/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Http { class URI; } //namespace Http namespace IoTDataPlane { namespace Model { /** *

The input for the Publish operation.

See Also:

AWS * API Reference

*/ class PublishRequest : public StreamingIoTDataPlaneRequest { public: AWS_IOTDATAPLANE_API PublishRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "Publish"; } AWS_IOTDATAPLANE_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; AWS_IOTDATAPLANE_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

The name of the MQTT topic.

*/ inline const Aws::String& GetTopic() const{ return m_topic; } /** *

The name of the MQTT topic.

*/ inline bool TopicHasBeenSet() const { return m_topicHasBeenSet; } /** *

The name of the MQTT topic.

*/ inline void SetTopic(const Aws::String& value) { m_topicHasBeenSet = true; m_topic = value; } /** *

The name of the MQTT topic.

*/ inline void SetTopic(Aws::String&& value) { m_topicHasBeenSet = true; m_topic = std::move(value); } /** *

The name of the MQTT topic.

*/ inline void SetTopic(const char* value) { m_topicHasBeenSet = true; m_topic.assign(value); } /** *

The name of the MQTT topic.

*/ inline PublishRequest& WithTopic(const Aws::String& value) { SetTopic(value); return *this;} /** *

The name of the MQTT topic.

*/ inline PublishRequest& WithTopic(Aws::String&& value) { SetTopic(std::move(value)); return *this;} /** *

The name of the MQTT topic.

*/ inline PublishRequest& WithTopic(const char* value) { SetTopic(value); return *this;} /** *

The Quality of Service (QoS) level. The default QoS level is 0.

*/ inline int GetQos() const{ return m_qos; } /** *

The Quality of Service (QoS) level. The default QoS level is 0.

*/ inline bool QosHasBeenSet() const { return m_qosHasBeenSet; } /** *

The Quality of Service (QoS) level. The default QoS level is 0.

*/ inline void SetQos(int value) { m_qosHasBeenSet = true; m_qos = value; } /** *

The Quality of Service (QoS) level. The default QoS level is 0.

*/ inline PublishRequest& WithQos(int value) { SetQos(value); return *this;} /** *

A Boolean value that determines whether to set the RETAIN flag when the * message is published.

Setting the RETAIN flag causes the message to be * retained and sent to new subscribers to the topic.

Valid values: * true | false

Default value: false *

*/ inline bool GetRetain() const{ return m_retain; } /** *

A Boolean value that determines whether to set the RETAIN flag when the * message is published.

Setting the RETAIN flag causes the message to be * retained and sent to new subscribers to the topic.

Valid values: * true | false

Default value: false *

*/ inline bool RetainHasBeenSet() const { return m_retainHasBeenSet; } /** *

A Boolean value that determines whether to set the RETAIN flag when the * message is published.

Setting the RETAIN flag causes the message to be * retained and sent to new subscribers to the topic.

Valid values: * true | false

Default value: false *

*/ inline void SetRetain(bool value) { m_retainHasBeenSet = true; m_retain = value; } /** *

A Boolean value that determines whether to set the RETAIN flag when the * message is published.

Setting the RETAIN flag causes the message to be * retained and sent to new subscribers to the topic.

Valid values: * true | false

Default value: false *

*/ inline PublishRequest& WithRetain(bool value) { SetRetain(value); return *this;} /** *

A JSON string that contains an array of JSON objects. If you don’t use Amazon * Web Services SDK or CLI, you must encode the JSON string to base64 format before * adding it to the HTTP header. userProperties is an HTTP header * value in the API.

The following example userProperties * parameter is a JSON string which represents two User Properties. Note that it * needs to be base64-encoded:

[{"deviceName": "alpha"}, * {"deviceCnt": "45"}]

*/ inline const Aws::String& GetUserProperties() const{ return m_userProperties; } /** *

A JSON string that contains an array of JSON objects. If you don’t use Amazon * Web Services SDK or CLI, you must encode the JSON string to base64 format before * adding it to the HTTP header. userProperties is an HTTP header * value in the API.

The following example userProperties * parameter is a JSON string which represents two User Properties. Note that it * needs to be base64-encoded:

[{"deviceName": "alpha"}, * {"deviceCnt": "45"}]

*/ inline bool UserPropertiesHasBeenSet() const { return m_userPropertiesHasBeenSet; } /** *

A JSON string that contains an array of JSON objects. If you don’t use Amazon * Web Services SDK or CLI, you must encode the JSON string to base64 format before * adding it to the HTTP header. userProperties is an HTTP header * value in the API.

The following example userProperties * parameter is a JSON string which represents two User Properties. Note that it * needs to be base64-encoded:

[{"deviceName": "alpha"}, * {"deviceCnt": "45"}]

*/ inline void SetUserProperties(const Aws::String& value) { m_userPropertiesHasBeenSet = true; m_userProperties = value; } /** *

A JSON string that contains an array of JSON objects. If you don’t use Amazon * Web Services SDK or CLI, you must encode the JSON string to base64 format before * adding it to the HTTP header. userProperties is an HTTP header * value in the API.

The following example userProperties * parameter is a JSON string which represents two User Properties. Note that it * needs to be base64-encoded:

[{"deviceName": "alpha"}, * {"deviceCnt": "45"}]

*/ inline void SetUserProperties(Aws::String&& value) { m_userPropertiesHasBeenSet = true; m_userProperties = std::move(value); } /** *

A JSON string that contains an array of JSON objects. If you don’t use Amazon * Web Services SDK or CLI, you must encode the JSON string to base64 format before * adding it to the HTTP header. userProperties is an HTTP header * value in the API.

The following example userProperties * parameter is a JSON string which represents two User Properties. Note that it * needs to be base64-encoded:

[{"deviceName": "alpha"}, * {"deviceCnt": "45"}]

*/ inline void SetUserProperties(const char* value) { m_userPropertiesHasBeenSet = true; m_userProperties.assign(value); } /** *

A JSON string that contains an array of JSON objects. If you don’t use Amazon * Web Services SDK or CLI, you must encode the JSON string to base64 format before * adding it to the HTTP header. userProperties is an HTTP header * value in the API.

The following example userProperties * parameter is a JSON string which represents two User Properties. Note that it * needs to be base64-encoded:

[{"deviceName": "alpha"}, * {"deviceCnt": "45"}]

*/ inline PublishRequest& WithUserProperties(const Aws::String& value) { SetUserProperties(value); return *this;} /** *

A JSON string that contains an array of JSON objects. If you don’t use Amazon * Web Services SDK or CLI, you must encode the JSON string to base64 format before * adding it to the HTTP header. userProperties is an HTTP header * value in the API.

The following example userProperties * parameter is a JSON string which represents two User Properties. Note that it * needs to be base64-encoded:

[{"deviceName": "alpha"}, * {"deviceCnt": "45"}]

*/ inline PublishRequest& WithUserProperties(Aws::String&& value) { SetUserProperties(std::move(value)); return *this;} /** *

A JSON string that contains an array of JSON objects. If you don’t use Amazon * Web Services SDK or CLI, you must encode the JSON string to base64 format before * adding it to the HTTP header. userProperties is an HTTP header * value in the API.

The following example userProperties * parameter is a JSON string which represents two User Properties. Note that it * needs to be base64-encoded:

[{"deviceName": "alpha"}, * {"deviceCnt": "45"}]

*/ inline PublishRequest& WithUserProperties(const char* value) { SetUserProperties(value); return *this;} /** *

An Enum string value that indicates whether the payload is * formatted as UTF-8. payloadFormatIndicator is an HTTP header value * in the API.

*/ inline const PayloadFormatIndicator& GetPayloadFormatIndicator() const{ return m_payloadFormatIndicator; } /** *

An Enum string value that indicates whether the payload is * formatted as UTF-8. payloadFormatIndicator is an HTTP header value * in the API.

*/ inline bool PayloadFormatIndicatorHasBeenSet() const { return m_payloadFormatIndicatorHasBeenSet; } /** *

An Enum string value that indicates whether the payload is * formatted as UTF-8. payloadFormatIndicator is an HTTP header value * in the API.

*/ inline void SetPayloadFormatIndicator(const PayloadFormatIndicator& value) { m_payloadFormatIndicatorHasBeenSet = true; m_payloadFormatIndicator = value; } /** *

An Enum string value that indicates whether the payload is * formatted as UTF-8. payloadFormatIndicator is an HTTP header value * in the API.

*/ inline void SetPayloadFormatIndicator(PayloadFormatIndicator&& value) { m_payloadFormatIndicatorHasBeenSet = true; m_payloadFormatIndicator = std::move(value); } /** *

An Enum string value that indicates whether the payload is * formatted as UTF-8. payloadFormatIndicator is an HTTP header value * in the API.

*/ inline PublishRequest& WithPayloadFormatIndicator(const PayloadFormatIndicator& value) { SetPayloadFormatIndicator(value); return *this;} /** *

An Enum string value that indicates whether the payload is * formatted as UTF-8. payloadFormatIndicator is an HTTP header value * in the API.

*/ inline PublishRequest& WithPayloadFormatIndicator(PayloadFormatIndicator&& value) { SetPayloadFormatIndicator(std::move(value)); return *this;} /** *

A UTF-8 encoded string that's used as the topic name for a response message. * The response topic is used to describe the topic which the receiver should * publish to as part of the request-response flow. The topic must not contain * wildcard characters.

*/ inline const Aws::String& GetResponseTopic() const{ return m_responseTopic; } /** *

A UTF-8 encoded string that's used as the topic name for a response message. * The response topic is used to describe the topic which the receiver should * publish to as part of the request-response flow. The topic must not contain * wildcard characters.

*/ inline bool ResponseTopicHasBeenSet() const { return m_responseTopicHasBeenSet; } /** *

A UTF-8 encoded string that's used as the topic name for a response message. * The response topic is used to describe the topic which the receiver should * publish to as part of the request-response flow. The topic must not contain * wildcard characters.

*/ inline void SetResponseTopic(const Aws::String& value) { m_responseTopicHasBeenSet = true; m_responseTopic = value; } /** *

A UTF-8 encoded string that's used as the topic name for a response message. * The response topic is used to describe the topic which the receiver should * publish to as part of the request-response flow. The topic must not contain * wildcard characters.

*/ inline void SetResponseTopic(Aws::String&& value) { m_responseTopicHasBeenSet = true; m_responseTopic = std::move(value); } /** *

A UTF-8 encoded string that's used as the topic name for a response message. * The response topic is used to describe the topic which the receiver should * publish to as part of the request-response flow. The topic must not contain * wildcard characters.

*/ inline void SetResponseTopic(const char* value) { m_responseTopicHasBeenSet = true; m_responseTopic.assign(value); } /** *

A UTF-8 encoded string that's used as the topic name for a response message. * The response topic is used to describe the topic which the receiver should * publish to as part of the request-response flow. The topic must not contain * wildcard characters.

*/ inline PublishRequest& WithResponseTopic(const Aws::String& value) { SetResponseTopic(value); return *this;} /** *

A UTF-8 encoded string that's used as the topic name for a response message. * The response topic is used to describe the topic which the receiver should * publish to as part of the request-response flow. The topic must not contain * wildcard characters.

*/ inline PublishRequest& WithResponseTopic(Aws::String&& value) { SetResponseTopic(std::move(value)); return *this;} /** *

A UTF-8 encoded string that's used as the topic name for a response message. * The response topic is used to describe the topic which the receiver should * publish to as part of the request-response flow. The topic must not contain * wildcard characters.

*/ inline PublishRequest& WithResponseTopic(const char* value) { SetResponseTopic(value); return *this;} /** *

The base64-encoded binary data used by the sender of the request message to * identify which request the response message is for when it's received. * correlationData is an HTTP header value in the API.

*/ inline const Aws::String& GetCorrelationData() const{ return m_correlationData; } /** *

The base64-encoded binary data used by the sender of the request message to * identify which request the response message is for when it's received. * correlationData is an HTTP header value in the API.

*/ inline bool CorrelationDataHasBeenSet() const { return m_correlationDataHasBeenSet; } /** *

The base64-encoded binary data used by the sender of the request message to * identify which request the response message is for when it's received. * correlationData is an HTTP header value in the API.

*/ inline void SetCorrelationData(const Aws::String& value) { m_correlationDataHasBeenSet = true; m_correlationData = value; } /** *

The base64-encoded binary data used by the sender of the request message to * identify which request the response message is for when it's received. * correlationData is an HTTP header value in the API.

*/ inline void SetCorrelationData(Aws::String&& value) { m_correlationDataHasBeenSet = true; m_correlationData = std::move(value); } /** *

The base64-encoded binary data used by the sender of the request message to * identify which request the response message is for when it's received. * correlationData is an HTTP header value in the API.

*/ inline void SetCorrelationData(const char* value) { m_correlationDataHasBeenSet = true; m_correlationData.assign(value); } /** *

The base64-encoded binary data used by the sender of the request message to * identify which request the response message is for when it's received. * correlationData is an HTTP header value in the API.

*/ inline PublishRequest& WithCorrelationData(const Aws::String& value) { SetCorrelationData(value); return *this;} /** *

The base64-encoded binary data used by the sender of the request message to * identify which request the response message is for when it's received. * correlationData is an HTTP header value in the API.

*/ inline PublishRequest& WithCorrelationData(Aws::String&& value) { SetCorrelationData(std::move(value)); return *this;} /** *

The base64-encoded binary data used by the sender of the request message to * identify which request the response message is for when it's received. * correlationData is an HTTP header value in the API.

*/ inline PublishRequest& WithCorrelationData(const char* value) { SetCorrelationData(value); return *this;} /** *

A user-defined integer value that represents the message expiry interval in * seconds. If absent, the message doesn't expire. For more information about the * limits of messageExpiry, see Amazon * Web Services IoT Core message broker and protocol limits and quotas from * the Amazon Web Services Reference Guide.

*/ inline long long GetMessageExpiry() const{ return m_messageExpiry; } /** *

A user-defined integer value that represents the message expiry interval in * seconds. If absent, the message doesn't expire. For more information about the * limits of messageExpiry, see Amazon * Web Services IoT Core message broker and protocol limits and quotas from * the Amazon Web Services Reference Guide.

*/ inline bool MessageExpiryHasBeenSet() const { return m_messageExpiryHasBeenSet; } /** *

A user-defined integer value that represents the message expiry interval in * seconds. If absent, the message doesn't expire. For more information about the * limits of messageExpiry, see Amazon * Web Services IoT Core message broker and protocol limits and quotas from * the Amazon Web Services Reference Guide.

*/ inline void SetMessageExpiry(long long value) { m_messageExpiryHasBeenSet = true; m_messageExpiry = value; } /** *

A user-defined integer value that represents the message expiry interval in * seconds. If absent, the message doesn't expire. For more information about the * limits of messageExpiry, see Amazon * Web Services IoT Core message broker and protocol limits and quotas from * the Amazon Web Services Reference Guide.

*/ inline PublishRequest& WithMessageExpiry(long long value) { SetMessageExpiry(value); return *this;} private: Aws::String m_topic; bool m_topicHasBeenSet = false; int m_qos; bool m_qosHasBeenSet = false; bool m_retain; bool m_retainHasBeenSet = false; Aws::String m_userProperties; bool m_userPropertiesHasBeenSet = false; PayloadFormatIndicator m_payloadFormatIndicator; bool m_payloadFormatIndicatorHasBeenSet = false; Aws::String m_responseTopic; bool m_responseTopicHasBeenSet = false; Aws::String m_correlationData; bool m_correlationDataHasBeenSet = false; long long m_messageExpiry; bool m_messageExpiryHasBeenSet = false; }; } // namespace Model } // namespace IoTDataPlane } // namespace Aws