1686862fbSopenharmony_ci/*
2686862fbSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
3686862fbSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4686862fbSopenharmony_ci * you may not use this file except in compliance with the License.
5686862fbSopenharmony_ci * You may obtain a copy of the License at
6686862fbSopenharmony_ci *
7686862fbSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8686862fbSopenharmony_ci *
9686862fbSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10686862fbSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11686862fbSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12686862fbSopenharmony_ci * See the License for the specific language governing permissions and
13686862fbSopenharmony_ci * limitations under the License.
14686862fbSopenharmony_ci */
15686862fbSopenharmony_ci
16686862fbSopenharmony_ci#ifndef OHOS_DISTRIBUTEDWANT_OPERATION_BUILDER_H
17686862fbSopenharmony_ci#define OHOS_DISTRIBUTEDWANT_OPERATION_BUILDER_H
18686862fbSopenharmony_ci
19686862fbSopenharmony_ci#include <memory>
20686862fbSopenharmony_ci#include <string>
21686862fbSopenharmony_ci#include <vector>
22686862fbSopenharmony_ci#include "uri.h"
23686862fbSopenharmony_ci
24686862fbSopenharmony_cinamespace OHOS {
25686862fbSopenharmony_cinamespace DistributedSchedule {
26686862fbSopenharmony_ciclass DistributedOperation;
27686862fbSopenharmony_ciclass DistributedOperationBuilder {
28686862fbSopenharmony_cipublic:
29686862fbSopenharmony_ci    DistributedOperationBuilder();
30686862fbSopenharmony_ci    ~DistributedOperationBuilder();
31686862fbSopenharmony_ci
32686862fbSopenharmony_ci    /**
33686862fbSopenharmony_ci     * @description: Sets a AbilityName in an DistributedOperationBuilder.
34686862fbSopenharmony_ci     * @return Returns this DistributedOperationBuilder object containing the AbilityName.
35686862fbSopenharmony_ci     */
36686862fbSopenharmony_ci    DistributedOperationBuilder& WithAbilityName(const std::string& abilityName);
37686862fbSopenharmony_ci
38686862fbSopenharmony_ci    /**
39686862fbSopenharmony_ci     * @description: Sets a BundleName in an DistributedOperationBuilder.
40686862fbSopenharmony_ci     * @return Returns this DistributedOperationBuilder object containing the BundleName.
41686862fbSopenharmony_ci     */
42686862fbSopenharmony_ci    DistributedOperationBuilder& WithBundleName(const std::string& bundleName);
43686862fbSopenharmony_ci
44686862fbSopenharmony_ci    /**
45686862fbSopenharmony_ci     * @description: Sets a DeviceId in an DistributedOperationBuilder.
46686862fbSopenharmony_ci     * @return Returns this DistributedOperationBuilder object containing the DeviceId.
47686862fbSopenharmony_ci     */
48686862fbSopenharmony_ci    DistributedOperationBuilder& WithDeviceId(const std::string& deviceID);
49686862fbSopenharmony_ci
50686862fbSopenharmony_ci    /**
51686862fbSopenharmony_ci     * @description: Sets a Action in an DistributedOperationBuilder.
52686862fbSopenharmony_ci     * @return Returns this DistributedOperationBuilder object containing the Action.
53686862fbSopenharmony_ci     */
54686862fbSopenharmony_ci    DistributedOperationBuilder& WithAction(const std::string& action);
55686862fbSopenharmony_ci
56686862fbSopenharmony_ci    /**
57686862fbSopenharmony_ci     * @description: Sets a Entities in an DistributedOperationBuilder.
58686862fbSopenharmony_ci     * @return Returns this DistributedOperationBuilder object containing the Entities.
59686862fbSopenharmony_ci     */
60686862fbSopenharmony_ci    DistributedOperationBuilder& WithEntities(const std::vector<std::string>& entities);
61686862fbSopenharmony_ci
62686862fbSopenharmony_ci    /**
63686862fbSopenharmony_ci     * @description: Sets a Flags in an DistributedOperationBuilder.
64686862fbSopenharmony_ci     * @return Returns this DistributedOperationBuilder object containing the Flags.
65686862fbSopenharmony_ci     */
66686862fbSopenharmony_ci    DistributedOperationBuilder& WithFlags(unsigned int flags);
67686862fbSopenharmony_ci
68686862fbSopenharmony_ci    /**
69686862fbSopenharmony_ci     * @description: Sets a Uri in an DistributedOperationBuilder.
70686862fbSopenharmony_ci     * @return Returns this DistributedOperationBuilder object containing the Uri.
71686862fbSopenharmony_ci     */
72686862fbSopenharmony_ci    DistributedOperationBuilder& WithUri(const OHOS::Uri& uri);
73686862fbSopenharmony_ci    std::shared_ptr<DistributedOperation> build();
74686862fbSopenharmony_ci
75686862fbSopenharmony_ciprivate:
76686862fbSopenharmony_ci    std::string abilityName_ = "";
77686862fbSopenharmony_ci    std::string action_ = "";
78686862fbSopenharmony_ci    std::string bundleName_ = "";
79686862fbSopenharmony_ci    std::string deviceId_ = "";
80686862fbSopenharmony_ci    std::vector<std::string> entities_ = {};
81686862fbSopenharmony_ci    unsigned int flags_ = 0;
82686862fbSopenharmony_ci    OHOS::Uri uri_;
83686862fbSopenharmony_ci};
84686862fbSopenharmony_ci} // namespace DistributedSchedule
85686862fbSopenharmony_ci} // namespace OHOS
86686862fbSopenharmony_ci#endif // OHOS_DISTRIBUTEDWANT_OPERATION_BUILDER_H