olp-cpp-sdk  1.22.0
PublishSdiiRequest.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 <boost/optional.hpp>
28 
29 #include <olp/dataservice/write/DataServiceWriteApi.h>
30 
31 namespace olp {
32 namespace dataservice {
33 namespace write {
34 namespace model {
45 class DATASERVICE_WRITE_API PublishSdiiRequest {
46  public:
47  PublishSdiiRequest() = default;
48  PublishSdiiRequest(const PublishSdiiRequest&) = default;
50  PublishSdiiRequest& operator=(const PublishSdiiRequest&) = default;
51  PublishSdiiRequest& operator=(PublishSdiiRequest&&) = default;
52  virtual ~PublishSdiiRequest() = default;
53 
59  inline std::shared_ptr<std::vector<unsigned char>> GetSdiiMessageList()
60  const {
61  return sdii_message_list_;
62  }
63 
72  const std::shared_ptr<std::vector<unsigned char>>& sdii_message_list) {
73  sdii_message_list_ = sdii_message_list;
74  return *this;
75  }
76 
85  std::shared_ptr<std::vector<unsigned char>>&& sdii_message_list) {
86  sdii_message_list_ = std::move(sdii_message_list);
87  return *this;
88  }
89 
95  inline const std::string& GetLayerId() const { return layer_id_; }
96 
104  inline PublishSdiiRequest& WithLayerId(const std::string& layer_id) {
105  layer_id_ = layer_id;
106  return *this;
107  }
108 
116  inline PublishSdiiRequest& WithLayerId(std::string&& layer_id) {
117  layer_id_ = std::move(layer_id);
118  return *this;
119  }
120 
130  inline const boost::optional<std::string>& GetTraceId() const {
131  return trace_id_;
132  }
133 
143  inline PublishSdiiRequest& WithTraceId(const std::string& trace_id) {
144  trace_id_ = trace_id;
145  return *this;
146  }
147 
157  inline PublishSdiiRequest& WithTraceId(std::string&& trace_id) {
158  trace_id_ = std::move(trace_id);
159  return *this;
160  }
161 
172  inline const boost::optional<std::string>& GetBillingTag() const {
173  return billing_tag_;
174  }
175 
183  inline PublishSdiiRequest& WithBillingTag(const std::string& billing_tag) {
184  billing_tag_ = billing_tag;
185  return *this;
186  }
187 
196  inline PublishSdiiRequest& WithBillingTag(std::string&& billing_tag) {
197  billing_tag_ = std::move(billing_tag);
198  return *this;
199  }
200 
212  inline const boost::optional<std::string>& GetChecksum() const {
213  return checksum_;
214  }
215 
223  inline PublishSdiiRequest& WithChecksum(const std::string& checksum) {
224  checksum_ = checksum;
225  return *this;
226  }
227 
235  inline PublishSdiiRequest& WithChecksum(std::string&& checksum) {
236  checksum_ = std::move(checksum);
237  return *this;
238  }
239 
240  private:
241  std::shared_ptr<std::vector<unsigned char>> sdii_message_list_;
242 
243  std::string layer_id_;
244 
245  boost::optional<std::string> trace_id_;
246 
247  boost::optional<std::string> billing_tag_;
248 
249  boost::optional<std::string> checksum_;
250 };
251 
252 } // namespace model
253 } // namespace write
254 } // namespace dataservice
255 } // namespace olp
Sends a list of SDII messages to a stream layer.
Definition: PublishSdiiRequest.h:45
const boost::optional< std::string > & GetBillingTag() const
Gets the billing tag to group billing records together.
Definition: PublishSdiiRequest.h:172
PublishSdiiRequest & WithLayerId(const std::string &layer_id)
Sets the layer ID of the catalog where you want to store the data.
Definition: PublishSdiiRequest.h:104
const boost::optional< std::string > & GetChecksum() const
Gets the request checksum.
Definition: PublishSdiiRequest.h:212
const boost::optional< std::string > & GetTraceId() const
Gets the trace ID of the request.
Definition: PublishSdiiRequest.h:130
PublishSdiiRequest & WithChecksum(const std::string &checksum)
Sets the request checksum.
Definition: PublishSdiiRequest.h:223
PublishSdiiRequest & WithBillingTag(const std::string &billing_tag)
Sets the billing tag for the request.
Definition: PublishSdiiRequest.h:183
const std::string & GetLayerId() const
Gets the layer ID of the catalog where you want to store the data.
Definition: PublishSdiiRequest.h:95
PublishSdiiRequest & WithTraceId(const std::string &trace_id)
Sets the trace ID of the request.
Definition: PublishSdiiRequest.h:143
PublishSdiiRequest & WithChecksum(std::string &&checksum)
Sets the request checksum.
Definition: PublishSdiiRequest.h:235
PublishSdiiRequest & WithBillingTag(std::string &&billing_tag)
Sets the billing tag for the request.
Definition: PublishSdiiRequest.h:196
PublishSdiiRequest & WithSdiiMessageList(std::shared_ptr< std::vector< unsigned char >> &&sdii_message_list)
Sets the SDII Message List data.
Definition: PublishSdiiRequest.h:84
PublishSdiiRequest & WithLayerId(std::string &&layer_id)
Sets the layer ID of the catalog where you want to store the data.
Definition: PublishSdiiRequest.h:116
PublishSdiiRequest & WithTraceId(std::string &&trace_id)
Sets the trace ID of the request.
Definition: PublishSdiiRequest.h:157
std::shared_ptr< std::vector< unsigned char > > GetSdiiMessageList() const
Gets the SDII Message List data.
Definition: PublishSdiiRequest.h:59
PublishSdiiRequest & WithSdiiMessageList(const std::shared_ptr< std::vector< unsigned char >> &sdii_message_list)
Sets the SDII Message List data.
Definition: PublishSdiiRequest.h:71
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24