AWS SDK for C++

AWS SDK for C++ Version 1.11.716

Loading...
Searching...
No Matches
PublishRequest.h
1
6#pragma once
7#include <aws/core/utils/Array.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/iot-data/IoTDataPlaneRequest.h>
10#include <aws/iot-data/IoTDataPlane_EXPORTS.h>
11#include <aws/iot-data/model/PayloadFormatIndicator.h>
12
13#include <utility>
14
15namespace Aws {
16namespace Http {
17class URI;
18} // namespace Http
19namespace IoTDataPlane {
20namespace Model {
21
28 public:
29 AWS_IOTDATAPLANE_API PublishRequest() = default;
30
31 // Service request name is the Operation name which will send this request out,
32 // each operation should has unique request name, so that we can get operation's name from this request.
33 // Note: this is not true for response, multiple operations may have the same response name,
34 // so we can not get operation's name from response.
35 inline virtual const char* GetServiceRequestName() const override { return "Publish"; }
36
37 AWS_IOTDATAPLANE_API void AddQueryStringParameters(Aws::Http::URI& uri) const override;
38
39 AWS_IOTDATAPLANE_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
40
42
45 inline const Aws::String& GetTopic() const { return m_topic; }
46 inline bool TopicHasBeenSet() const { return m_topicHasBeenSet; }
47 template <typename TopicT = Aws::String>
48 void SetTopic(TopicT&& value) {
49 m_topicHasBeenSet = true;
50 m_topic = std::forward<TopicT>(value);
51 }
52 template <typename TopicT = Aws::String>
53 PublishRequest& WithTopic(TopicT&& value) {
54 SetTopic(std::forward<TopicT>(value));
55 return *this;
56 }
58
60
63 inline int GetQos() const { return m_qos; }
64 inline bool QosHasBeenSet() const { return m_qosHasBeenSet; }
65 inline void SetQos(int value) {
66 m_qosHasBeenSet = true;
67 m_qos = value;
68 }
69 inline PublishRequest& WithQos(int value) {
70 SetQos(value);
71 return *this;
72 }
74
76
83 inline bool GetRetain() const { return m_retain; }
84 inline bool RetainHasBeenSet() const { return m_retainHasBeenSet; }
85 inline void SetRetain(bool value) {
86 m_retainHasBeenSet = true;
87 m_retain = value;
88 }
89 inline PublishRequest& WithRetain(bool value) {
90 SetRetain(value);
91 return *this;
92 }
94
96
105 inline const Aws::String& GetUserProperties() const { return m_userProperties; }
106 inline bool UserPropertiesHasBeenSet() const { return m_userPropertiesHasBeenSet; }
107 template <typename UserPropertiesT = Aws::String>
108 void SetUserProperties(UserPropertiesT&& value) {
109 m_userPropertiesHasBeenSet = true;
110 m_userProperties = std::forward<UserPropertiesT>(value);
111 }
112 template <typename UserPropertiesT = Aws::String>
113 PublishRequest& WithUserProperties(UserPropertiesT&& value) {
114 SetUserProperties(std::forward<UserPropertiesT>(value));
115 return *this;
116 }
118
120
125 inline PayloadFormatIndicator GetPayloadFormatIndicator() const { return m_payloadFormatIndicator; }
126 inline bool PayloadFormatIndicatorHasBeenSet() const { return m_payloadFormatIndicatorHasBeenSet; }
128 m_payloadFormatIndicatorHasBeenSet = true;
129 m_payloadFormatIndicator = value;
130 }
133 return *this;
134 }
136
138
144 inline const Aws::String& GetResponseTopic() const { return m_responseTopic; }
145 inline bool ResponseTopicHasBeenSet() const { return m_responseTopicHasBeenSet; }
146 template <typename ResponseTopicT = Aws::String>
147 void SetResponseTopic(ResponseTopicT&& value) {
148 m_responseTopicHasBeenSet = true;
149 m_responseTopic = std::forward<ResponseTopicT>(value);
150 }
151 template <typename ResponseTopicT = Aws::String>
152 PublishRequest& WithResponseTopic(ResponseTopicT&& value) {
153 SetResponseTopic(std::forward<ResponseTopicT>(value));
154 return *this;
155 }
157
159
164 inline const Aws::String& GetCorrelationData() const { return m_correlationData; }
165 inline bool CorrelationDataHasBeenSet() const { return m_correlationDataHasBeenSet; }
166 template <typename CorrelationDataT = Aws::String>
167 void SetCorrelationData(CorrelationDataT&& value) {
168 m_correlationDataHasBeenSet = true;
169 m_correlationData = std::forward<CorrelationDataT>(value);
170 }
171 template <typename CorrelationDataT = Aws::String>
172 PublishRequest& WithCorrelationData(CorrelationDataT&& value) {
173 SetCorrelationData(std::forward<CorrelationDataT>(value));
174 return *this;
175 }
177
179
187 inline long long GetMessageExpiry() const { return m_messageExpiry; }
188 inline bool MessageExpiryHasBeenSet() const { return m_messageExpiryHasBeenSet; }
189 inline void SetMessageExpiry(long long value) {
190 m_messageExpiryHasBeenSet = true;
191 m_messageExpiry = value;
192 }
193 inline PublishRequest& WithMessageExpiry(long long value) {
194 SetMessageExpiry(value);
195 return *this;
196 }
198 private:
199 Aws::String m_topic;
200
201 int m_qos{0};
202
203 bool m_retain{false};
204
205 Aws::String m_userProperties;
206
208
209 Aws::String m_responseTopic;
210
211 Aws::String m_correlationData;
212
213 long long m_messageExpiry{0};
214 bool m_topicHasBeenSet = false;
215 bool m_qosHasBeenSet = false;
216 bool m_retainHasBeenSet = false;
217 bool m_userPropertiesHasBeenSet = false;
218 bool m_payloadFormatIndicatorHasBeenSet = false;
219 bool m_responseTopicHasBeenSet = false;
220 bool m_correlationDataHasBeenSet = false;
221 bool m_messageExpiryHasBeenSet = false;
222};
223
224} // namespace Model
225} // namespace IoTDataPlane
226} // namespace Aws
PublishRequest & WithCorrelationData(CorrelationDataT &&value)
PayloadFormatIndicator GetPayloadFormatIndicator() const
PublishRequest & WithMessageExpiry(long long value)
PublishRequest & WithRetain(bool value)
AWS_IOTDATAPLANE_API PublishRequest()=default
const Aws::String & GetTopic() const
void SetCorrelationData(CorrelationDataT &&value)
PublishRequest & WithQos(int value)
const Aws::String & GetUserProperties() const
PublishRequest & WithTopic(TopicT &&value)
void SetResponseTopic(ResponseTopicT &&value)
AWS_IOTDATAPLANE_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
PublishRequest & WithUserProperties(UserPropertiesT &&value)
PublishRequest & WithPayloadFormatIndicator(PayloadFormatIndicator value)
virtual const char * GetServiceRequestName() const override
const Aws::String & GetResponseTopic() const
AWS_IOTDATAPLANE_API void AddQueryStringParameters(Aws::Http::URI &uri) const override
void SetPayloadFormatIndicator(PayloadFormatIndicator value)
void SetUserProperties(UserPropertiesT &&value)
const Aws::String & GetCorrelationData() const
PublishRequest & WithResponseTopic(ResponseTopicT &&value)
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String