olp-cpp-sdk 1.24.0
Loading...
Searching...
No Matches
PublishIndexRequest.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 PublishIndexRequest {
37 public:
38 PublishIndexRequest() = default;
41 PublishIndexRequest& operator=(const PublishIndexRequest&) = default;
42 PublishIndexRequest& operator=(PublishIndexRequest&&) = default;
43 virtual ~PublishIndexRequest() = default;
44
50 inline std::shared_ptr<std::vector<unsigned char>> GetData() const {
51 return data_;
52 }
53
60 const std::shared_ptr<std::vector<unsigned char>>& data) {
61 data_ = data;
62 return *this;
63 }
64
71 std::shared_ptr<std::vector<unsigned char>>&& data) {
72 data_ = std::move(data);
73 return *this;
74 }
75
81 inline const std::string& GetLayerId() const { return layer_id_; }
82
90 inline PublishIndexRequest& WithLayerId(const std::string& layer_id) {
91 layer_id_ = layer_id;
92 return *this;
93 }
94
102 inline PublishIndexRequest& WithLayerId(std::string&& layer_id) {
103 layer_id_ = std::move(layer_id);
104 return *this;
105 }
106
117 inline const porting::optional<std::string>& GetBillingTag() const {
118 return billing_tag_;
119 }
120
129 inline PublishIndexRequest& WithBillingTag(const std::string& billing_tag) {
130 billing_tag_ = billing_tag;
131 return *this;
132 }
133
142 inline PublishIndexRequest& WithBillingTag(std::string&& billing_tag) {
143 billing_tag_ = std::move(billing_tag);
144 return *this;
145 }
146
158 inline const porting::optional<std::string>& GetChecksum() const {
159 return checksum_;
160 }
161
169 inline PublishIndexRequest& WithChecksum(const std::string& checksum) {
170 checksum_ = checksum;
171 return *this;
172 }
173
181 inline PublishIndexRequest& WithChecksum(std::string&& checksum) {
182 checksum_ = std::move(checksum);
183 return *this;
184 }
185
197 inline const Index& GetIndex() const { return index_; }
198
206 inline PublishIndexRequest& WithIndex(const Index& index) {
207 index_ = index;
208 return *this;
209 }
210
219 index_ = std::move(index);
220 return *this;
221 }
222
223 private:
224 std::shared_ptr<std::vector<unsigned char>> data_;
225
226 std::string layer_id_;
227
228 porting::optional<std::string> billing_tag_;
229
230 porting::optional<std::string> checksum_;
231
232 Index index_;
233};
234
235} // namespace model
236} // namespace write
237} // namespace dataservice
238} // namespace olp
Represents the index layer.
Definition Index.h:310
Publishes data to an index layer.
Definition PublishIndexRequest.h:36
const std::string & GetLayerId() const
Gets the layer ID of the catalog where you want to store the data.
Definition PublishIndexRequest.h:81
PublishIndexRequest & WithIndex(Index &&index)
Sets the Index object.
Definition PublishIndexRequest.h:218
PublishIndexRequest & WithBillingTag(std::string &&billing_tag)
Sets the billing tag for the request.
Definition PublishIndexRequest.h:142
std::shared_ptr< std::vector< unsigned char > > GetData() const
Gets the data to be published to the HERE platform.
Definition PublishIndexRequest.h:50
const porting::optional< std::string > & GetChecksum() const
Gets the request checksum.
Definition PublishIndexRequest.h:158
PublishIndexRequest & WithLayerId(std::string &&layer_id)
Sets the layer ID of the catalog where you want to store the data.
Definition PublishIndexRequest.h:102
const Index & GetIndex() const
Gets the Index object that contains the index information to be published to the index layer.
Definition PublishIndexRequest.h:197
const porting::optional< std::string > & GetBillingTag() const
Gets the billing tag to group billing records together.
Definition PublishIndexRequest.h:117
PublishIndexRequest & WithIndex(const Index &index)
Sets the Index object.
Definition PublishIndexRequest.h:206
PublishIndexRequest & WithLayerId(const std::string &layer_id)
Sets the layer ID of the catalog where you want to store the data.
Definition PublishIndexRequest.h:90
PublishIndexRequest & WithData(std::shared_ptr< std::vector< unsigned char > > &&data)
Sets the data to be published to the HERE platform.
Definition PublishIndexRequest.h:70
PublishIndexRequest & WithData(const std::shared_ptr< std::vector< unsigned char > > &data)
Sets the data to be published to the HERE platform.
Definition PublishIndexRequest.h:59
PublishIndexRequest & WithChecksum(std::string &&checksum)
Sets the request checksum.
Definition PublishIndexRequest.h:181
PublishIndexRequest & WithChecksum(const std::string &checksum)
Sets the request checksum.
Definition PublishIndexRequest.h:169
PublishIndexRequest & WithBillingTag(const std::string &billing_tag)
Sets the billing tag for the request.
Definition PublishIndexRequest.h:129
Rules all the other namespaces.
Definition AppleSignInProperties.h:24