olp-cpp-sdk 1.24.0
Loading...
Searching...
No Matches
UpdateIndexRequest.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 <memory>
23#include <string>
24#include <utility>
25#include <vector>
26
27#include <olp/core/porting/optional.h>
28#include <olp/dataservice/write/DataServiceWriteApi.h>
29#include <olp/dataservice/write/generated/model/Index.h>
30
31namespace olp {
32namespace dataservice {
33namespace write {
34namespace model {
36class DATASERVICE_WRITE_API UpdateIndexRequest {
37 public:
38 UpdateIndexRequest() = default;
39 UpdateIndexRequest(const UpdateIndexRequest&) = default;
41 UpdateIndexRequest& operator=(const UpdateIndexRequest&) = default;
42 UpdateIndexRequest& operator=(UpdateIndexRequest&&) = default;
43 virtual ~UpdateIndexRequest() = default;
49 inline const std::string& GetLayerId() const { return layer_id_; }
50
58 inline UpdateIndexRequest& WithLayerId(const std::string& layer_id) {
59 layer_id_ = layer_id;
60 return *this;
61 }
62
70 inline UpdateIndexRequest& WithLayerId(std::string&& layer_id) {
71 layer_id_ = std::move(layer_id);
72 return *this;
73 }
74
85 inline const porting::optional<std::string>& GetBillingTag() const {
86 return billing_tag_;
87 }
88
96 inline UpdateIndexRequest& WithBillingTag(const std::string& billing_tag) {
97 billing_tag_ = billing_tag;
98 return *this;
99 }
100
109 inline UpdateIndexRequest& WithBillingTag(std::string&& billing_tag) {
110 billing_tag_ = std::move(billing_tag);
111 return *this;
112 }
113
125 inline const porting::optional<std::string>& GetChecksum() const {
126 return checksum_;
127 }
128
136 inline UpdateIndexRequest& WithChecksum(const std::string& checksum) {
137 checksum_ = checksum;
138 return *this;
139 }
140
148 inline UpdateIndexRequest& WithChecksum(std::string&& checksum) {
149 checksum_ = std::move(checksum);
150 return *this;
151 }
152
158 inline const std::vector<Index>& GetIndexAdditions() const {
159 return indexAdditions_;
160 }
161
168 const std::vector<Index>& indexAdditions) {
169 indexAdditions_ = indexAdditions;
170 return *this;
171 }
172
180 std::vector<Index>&& indexAdditions) {
181 indexAdditions_ = std::move(indexAdditions);
182 return *this;
183 }
184
191 inline const std::vector<std::string>& GetIndexRemovals() const {
192 return indexRemovals_;
193 }
194
203 const std::vector<std::string>& indexRemovals) {
204 indexRemovals_ = indexRemovals;
205 return *this;
206 }
207
216 std::vector<std::string>&& indexRemovals) {
217 indexRemovals_ = std::move(indexRemovals);
218 return *this;
219 }
220
221 private:
222 std::string layer_id_;
223
224 porting::optional<std::string> billing_tag_;
225
226 porting::optional<std::string> checksum_;
227
228 std::vector<Index> indexAdditions_;
229
230 std::vector<std::string> indexRemovals_;
231};
232
233} // namespace model
234} // namespace write
235} // namespace dataservice
236} // namespace olp
Updates an index in an index layer.
Definition UpdateIndexRequest.h:36
UpdateIndexRequest & WithIndexAdditions(std::vector< Index > &&indexAdditions)
Sets the indexes to be added anew to the index layer.
Definition UpdateIndexRequest.h:179
UpdateIndexRequest & WithLayerId(std::string &&layer_id)
Sets the layer ID of the catalog where you want to store the data.
Definition UpdateIndexRequest.h:70
const std::string & GetLayerId() const
Gets the layer ID of the catalog where you want to store the data.
Definition UpdateIndexRequest.h:49
UpdateIndexRequest & WithIndexRemovals(const std::vector< std::string > &indexRemovals)
Sets the data handles of the indexes that you want to remove from the index layer.
Definition UpdateIndexRequest.h:202
UpdateIndexRequest & WithLayerId(const std::string &layer_id)
Sets the layer ID of the catalog where you want to store the data.
Definition UpdateIndexRequest.h:58
UpdateIndexRequest & WithIndexAdditions(const std::vector< Index > &indexAdditions)
Sets the indexes to be added anew to the index layer.
Definition UpdateIndexRequest.h:167
UpdateIndexRequest & WithChecksum(std::string &&checksum)
Sets the request checksum.
Definition UpdateIndexRequest.h:148
const std::vector< std::string > & GetIndexRemovals() const
Gets the data handles of the indexes that you want to remove from the index layer.
Definition UpdateIndexRequest.h:191
const std::vector< Index > & GetIndexAdditions() const
Gets the indexes to be added anew to the index layer.
Definition UpdateIndexRequest.h:158
UpdateIndexRequest & WithBillingTag(const std::string &billing_tag)
Sets the billing tag for the request.
Definition UpdateIndexRequest.h:96
UpdateIndexRequest & WithBillingTag(std::string &&billing_tag)
Sets the billing tag for the request.
Definition UpdateIndexRequest.h:109
UpdateIndexRequest & WithIndexRemovals(std::vector< std::string > &&indexRemovals)
Sets the data handles of the indexes that you want to remove from the index layer.
Definition UpdateIndexRequest.h:215
const porting::optional< std::string > & GetChecksum() const
Gets the request checksum.
Definition UpdateIndexRequest.h:125
const porting::optional< std::string > & GetBillingTag() const
Gets the billing tag to group billing records together.
Definition UpdateIndexRequest.h:85
UpdateIndexRequest & WithChecksum(const std::string &checksum)
Sets the request checksum.
Definition UpdateIndexRequest.h:136
Rules all the other namespaces.
Definition AppleSignInProperties.h:24