1 /* 2 * Copyright (c) 2023 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 UDMF_CLIENT_H 17 #define UDMF_CLIENT_H 18 19 #include <string> 20 #include <vector> 21 22 #include "unified_data.h" 23 #include "error_code.h" 24 #include "unified_meta.h" 25 #include "unified_types.h" 26 27 namespace OHOS { 28 namespace UDMF { 29 class UdmfClient { 30 public: 31 static UdmfClient &GetInstance(); 32 33 Status SetData(CustomOption &option, UnifiedData &unifiedData, std::string &key); 34 Status GetData(const QueryOption &query, UnifiedData &unifiedData); 35 Status GetBatchData(const QueryOption &query, std::vector<UnifiedData> &unifiedDataSet); 36 Status UpdateData(const QueryOption &query, UnifiedData &unifiedData); 37 Status DeleteData(const QueryOption &query, std::vector<UnifiedData> &unifiedDataSet); 38 Status GetSummary(const QueryOption &query, Summary& summary); 39 Status AddPrivilege(const QueryOption &query, Privilege &privilege); 40 Status Sync(const QueryOption &query, const std::vector<std::string> &devices); 41 }; 42 } // namespace UDMF 43 } // namespace OHOS 44 #endif // UDMF_CLIENT_H