• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 
16 #ifndef OHOS_DISTRIBUTED_DATA_SERVICES_CLONE_BACKUP_INFO_H
17 #define OHOS_DISTRIBUTED_DATA_SERVICES_CLONE_BACKUP_INFO_H
18 #include "serializable/serializable.h"
19 namespace OHOS {
20 namespace DistributedData {
21 struct CloneEncryptionInfo final : public Serializable {
22     std::string symkey;
23     std::string algName;
24     std::string iv;
25     API_EXPORT bool Marshal(json &node) const override;
26     API_EXPORT bool Unmarshal(const json &node) override;
27     ~CloneEncryptionInfo();
28 };
29 
30 struct CloneBundleInfo final : public Serializable {
31     std::string bundleName;
32     uint32_t accessTokenId;
33     API_EXPORT bool Marshal(json &node) const override;
34     API_EXPORT bool Unmarshal(const json &node) override;
35 };
36 
37 struct CloneBackupInfo final : public Serializable {
38     CloneEncryptionInfo encryptionInfo;
39     std::vector<CloneBundleInfo> bundleInfos;
40     std::string userId;
41     API_EXPORT bool Marshal(json &node) const override;
42     API_EXPORT bool Unmarshal(const json &node) override;
43 };
44 
45 struct CloneReplyResult final : public Serializable {
46     std::string type = "ErrorInfo";
47     std::string errorCode;
48     std::string errorInfo;
49     API_EXPORT bool Marshal(json &node) const override;
50     API_EXPORT bool Unmarshal(const json &node) override;
51 };
52 
53 struct CloneReplyCode final : public Serializable {
54     std::vector<CloneReplyResult> resultInfo;
55     API_EXPORT bool Marshal(json &node) const override;
56     API_EXPORT bool Unmarshal(const json &node) override;
57 };
58 } // namespace DistributedData
59 } // namespace OHOS
60 #endif // OHOS_DISTRIBUTED_DATA_SERVICES_CLONE_BACKUP_INFO_H
61