olp-cpp-sdk 1.24.0
Loading...
Searching...
No Matches
PublishDataRequest.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
30namespace olp {
31namespace dataservice {
32namespace write {
33namespace model {
35class DATASERVICE_WRITE_API PublishDataRequest {
36 public:
37 PublishDataRequest() = default;
38 PublishDataRequest(const PublishDataRequest&) = default;
40 PublishDataRequest& operator=(const PublishDataRequest&) = default;
41 PublishDataRequest& operator=(PublishDataRequest&&) = default;
42 virtual ~PublishDataRequest() = default;
43
49 inline std::shared_ptr<std::vector<unsigned char>> GetData() const {
50 return data_;
51 }
52
59 const std::shared_ptr<std::vector<unsigned char>>& data) {
60 data_ = data;
61 return *this;
62 }
63
70 std::shared_ptr<std::vector<unsigned char>>&& data) {
71 data_ = std::move(data);
72 return *this;
73 }
74
80 inline const std::string& GetLayerId() const { return layer_id_; }
81
89 inline PublishDataRequest& WithLayerId(const std::string& layer_id) {
90 layer_id_ = layer_id;
91 return *this;
92 }
93
101 inline PublishDataRequest& WithLayerId(std::string&& layer_id) {
102 layer_id_ = std::move(layer_id);
103 return *this;
104 }
105
115 inline const porting::optional<std::string>& GetTraceId() const {
116 return trace_id_;
117 }
118
128 inline PublishDataRequest& WithTraceId(const std::string& trace_id) {
129 trace_id_ = trace_id;
130 return *this;
131 }
132
142 inline PublishDataRequest& WithTraceId(std::string&& trace_id) {
143 trace_id_ = std::move(trace_id);
144 return *this;
145 }
146
157 inline const porting::optional<std::string>& GetBillingTag() const {
158 return billing_tag_;
159 }
160
168 inline PublishDataRequest& WithBillingTag(const std::string& billing_tag) {
169 billing_tag_ = billing_tag;
170 return *this;
171 }
172
181 inline PublishDataRequest& WithBillingTag(std::string&& billing_tag) {
182 billing_tag_ = std::move(billing_tag);
183 return *this;
184 }
185
197 inline const porting::optional<std::string>& GetChecksum() const {
198 return checksum_;
199 }
200
208 inline PublishDataRequest& WithChecksum(const std::string& checksum) {
209 checksum_ = checksum;
210 return *this;
211 }
212
220 inline PublishDataRequest& WithChecksum(std::string&& checksum) {
221 checksum_ = std::move(checksum);
222 return *this;
223 }
224
225 private:
226 std::shared_ptr<std::vector<unsigned char>> data_;
227
228 std::string layer_id_;
229
230 porting::optional<std::string> trace_id_;
231
232 porting::optional<std::string> billing_tag_;
233
234 porting::optional<std::string> checksum_;
235};
236
237} // namespace model
238} // namespace write
239} // namespace dataservice
240} // namespace olp
Publishes data to a stream layer.
Definition PublishDataRequest.h:35
const porting::optional< std::string > & GetTraceId() const
Gets the trace ID of the request.
Definition PublishDataRequest.h:115
PublishDataRequest & WithChecksum(std::string &&checksum)
Sets the request checksum.
Definition PublishDataRequest.h:220
const porting::optional< std::string > & GetChecksum() const
Gets the request checksum.
Definition PublishDataRequest.h:197
std::shared_ptr< std::vector< unsigned char > > GetData() const
Gets the data to be published to the HERE platform.
Definition PublishDataRequest.h:49
PublishDataRequest & WithTraceId(std::string &&trace_id)
Sets the trace ID of the request.
Definition PublishDataRequest.h:142
const porting::optional< std::string > & GetBillingTag() const
Gets the billing tag to group billing records together.
Definition PublishDataRequest.h:157
PublishDataRequest & WithChecksum(const std::string &checksum)
Sets the request checksum.
Definition PublishDataRequest.h:208
PublishDataRequest & WithData(const std::shared_ptr< std::vector< unsigned char > > &data)
Sets the data to be published to the HERE platform.
Definition PublishDataRequest.h:58
PublishDataRequest & WithData(std::shared_ptr< std::vector< unsigned char > > &&data)
Sets the data to be published to the HERE platform.
Definition PublishDataRequest.h:69
PublishDataRequest & WithBillingTag(const std::string &billing_tag)
Sets the billing tag for the request.
Definition PublishDataRequest.h:168
PublishDataRequest & WithLayerId(const std::string &layer_id)
Sets the layer ID of the catalog where you want to store the data.
Definition PublishDataRequest.h:89
PublishDataRequest & WithTraceId(const std::string &trace_id)
Sets the trace ID of the request.
Definition PublishDataRequest.h:128
PublishDataRequest & WithBillingTag(std::string &&billing_tag)
Sets the billing tag for the request.
Definition PublishDataRequest.h:181
const std::string & GetLayerId() const
Gets the layer ID of the catalog where you want to store the data.
Definition PublishDataRequest.h:80
PublishDataRequest & WithLayerId(std::string &&layer_id)
Sets the layer ID of the catalog where you want to store the data.
Definition PublishDataRequest.h:101
Rules all the other namespaces.
Definition AppleSignInProperties.h:24