1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`Publish`](crate::operation::publish::builders::PublishFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`topic(impl Into<String>)`](crate::operation::publish::builders::PublishFluentBuilder::topic) / [`set_topic(Option<String>)`](crate::operation::publish::builders::PublishFluentBuilder::set_topic):<br>required: **true**<br><p>The name of the MQTT topic.</p><br>
    ///   - [`qos(i32)`](crate::operation::publish::builders::PublishFluentBuilder::qos) / [`set_qos(Option<i32>)`](crate::operation::publish::builders::PublishFluentBuilder::set_qos):<br>required: **false**<br><p>The Quality of Service (QoS) level. The default QoS level is 0.</p><br>
    ///   - [`retain(bool)`](crate::operation::publish::builders::PublishFluentBuilder::retain) / [`set_retain(Option<bool>)`](crate::operation::publish::builders::PublishFluentBuilder::set_retain):<br>required: **false**<br><p>A Boolean value that determines whether to set the RETAIN flag when the message is published.</p> <p>Setting the RETAIN flag causes the message to be retained and sent to new subscribers to the topic.</p> <p>Valid values: <code>true</code> | <code>false</code></p> <p>Default value: <code>false</code></p><br>
    ///   - [`payload(Blob)`](crate::operation::publish::builders::PublishFluentBuilder::payload) / [`set_payload(Option<Blob>)`](crate::operation::publish::builders::PublishFluentBuilder::set_payload):<br>required: **false**<br><p>The message body. MQTT accepts text, binary, and empty (null) message payloads.</p> <p>Publishing an empty (null) payload with <b>retain</b> = <code>true</code> deletes the retained message identified by <b>topic</b> from Amazon Web Services IoT Core.</p><br>
    ///   - [`user_properties(impl Into<String>)`](crate::operation::publish::builders::PublishFluentBuilder::user_properties) / [`set_user_properties(Option<String>)`](crate::operation::publish::builders::PublishFluentBuilder::set_user_properties):<br>required: **false**<br><p>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. <code>userProperties</code> is an HTTP header value in the API.</p> <p>The following example <code>userProperties</code> parameter is a JSON string which represents two User Properties. Note that it needs to be base64-encoded:</p> <p><code>[{"deviceName": "alpha"}, {"deviceCnt": "45"}]</code></p><br>
    ///   - [`payload_format_indicator(PayloadFormatIndicator)`](crate::operation::publish::builders::PublishFluentBuilder::payload_format_indicator) / [`set_payload_format_indicator(Option<PayloadFormatIndicator>)`](crate::operation::publish::builders::PublishFluentBuilder::set_payload_format_indicator):<br>required: **false**<br><p>An <code>Enum</code> string value that indicates whether the payload is formatted as UTF-8. <code>payloadFormatIndicator</code> is an HTTP header value in the API.</p><br>
    ///   - [`content_type(impl Into<String>)`](crate::operation::publish::builders::PublishFluentBuilder::content_type) / [`set_content_type(Option<String>)`](crate::operation::publish::builders::PublishFluentBuilder::set_content_type):<br>required: **false**<br><p>A UTF-8 encoded string that describes the content of the publishing message.</p><br>
    ///   - [`response_topic(impl Into<String>)`](crate::operation::publish::builders::PublishFluentBuilder::response_topic) / [`set_response_topic(Option<String>)`](crate::operation::publish::builders::PublishFluentBuilder::set_response_topic):<br>required: **false**<br><p>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.</p><br>
    ///   - [`correlation_data(impl Into<String>)`](crate::operation::publish::builders::PublishFluentBuilder::correlation_data) / [`set_correlation_data(Option<String>)`](crate::operation::publish::builders::PublishFluentBuilder::set_correlation_data):<br>required: **false**<br><p>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. <code>correlationData</code> is an HTTP header value in the API.</p><br>
    ///   - [`message_expiry(i64)`](crate::operation::publish::builders::PublishFluentBuilder::message_expiry) / [`set_message_expiry(Option<i64>)`](crate::operation::publish::builders::PublishFluentBuilder::set_message_expiry):<br>required: **false**<br><p>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 <code>messageExpiry</code>, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot-core.html#message-broker-limits">Amazon Web Services IoT Core message broker and protocol limits and quotas </a> from the Amazon Web Services Reference Guide.</p><br>
    /// - On success, responds with [`PublishOutput`](crate::operation::publish::PublishOutput)
    /// - On failure, responds with [`SdkError<PublishError>`](crate::operation::publish::PublishError)
    pub fn publish(&self) -> crate::operation::publish::builders::PublishFluentBuilder {
        crate::operation::publish::builders::PublishFluentBuilder::new(self.handle.clone())
    }
}