olp-cpp-sdk  1.22.0
StartBatchRequest.h
1 /*
2  * Copyright (C) 2019-2023 HERE Europe B.V.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  * License-Filename: LICENSE
18  */
19 
20 #pragma once
21 
22 #include <string>
23 #include <utility>
24 #include <vector>
25 
26 #include <boost/optional.hpp>
27 
28 #include <olp/dataservice/write/DataServiceWriteApi.h>
29 #include <olp/dataservice/write/generated/model/VersionDependency.h>
30 
31 namespace olp {
32 namespace dataservice {
33 namespace write {
34 namespace model {
35 
37 class DATASERVICE_WRITE_API StartBatchRequest {
38  public:
39  StartBatchRequest() = default;
40  StartBatchRequest(const StartBatchRequest&) = default;
42  StartBatchRequest& operator=(const StartBatchRequest&) = default;
43  StartBatchRequest& operator=(StartBatchRequest&&) = default;
44  virtual ~StartBatchRequest() = default;
45 
51  inline StartBatchRequest& WithLayers(std::vector<std::string> layers) {
52  layers_ = std::move(layers);
53  return *this;
54  }
55 
61  inline const boost::optional<std::vector<std::string>>& GetLayers() const {
62  return layers_;
63  }
64 
71  std::vector<VersionDependency> versionDependencies) {
72  versionDependencies_ = std::move(versionDependencies);
73  return *this;
74  }
75 
81  inline const boost::optional<std::vector<VersionDependency>>&
83  return versionDependencies_;
84  }
85 
96  inline const boost::optional<std::string>& GetBillingTag() const {
97  return billing_tag_;
98  }
99 
107  inline StartBatchRequest& WithBillingTag(std::string billing_tag) {
108  billing_tag_ = std::move(billing_tag);
109  return *this;
110  }
111 
112  private:
113  boost::optional<std::vector<std::string>> layers_;
114  boost::optional<std::vector<VersionDependency>> versionDependencies_;
115  boost::optional<std::string> billing_tag_;
116 };
117 
118 } // namespace model
119 } // namespace write
120 } // namespace dataservice
121 } // namespace olp
Starts a versioned batch operation.
Definition: StartBatchRequest.h:37
StartBatchRequest & WithBillingTag(std::string billing_tag)
Sets the billing tag for the request.
Definition: StartBatchRequest.h:107
const boost::optional< std::vector< VersionDependency > > & GetVersionDependencies() const
Gets the version dependencies used in the batch operation.
Definition: StartBatchRequest.h:82
const boost::optional< std::vector< std::string > > & GetLayers() const
Gets the layers used in the batch operation.
Definition: StartBatchRequest.h:61
const boost::optional< std::string > & GetBillingTag() const
Gets the billing tag to group billing records together.
Definition: StartBatchRequest.h:96
StartBatchRequest & WithVersionDependencies(std::vector< VersionDependency > versionDependencies)
Sets the version dependencies used in the batch operation.
Definition: StartBatchRequest.h:70
StartBatchRequest & WithLayers(std::vector< std::string > layers)
Sets the layers used in the batch operation.
Definition: StartBatchRequest.h:51
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24