aws-sdk-iotdataplane 1.103.0

AWS SDK for AWS IoT Data Plane
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`SendDirectMessage`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`client_id(impl Into<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::client_id) / [`set_client_id(Option<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::set_client_id):<br>required: **true**<br><p>The unique identifier of the MQTT client to send the message to.</p> <p>Client IDs must not exceed 128 characters and can't start with a dollar sign ($). MQTT client IDs must be URL encoded (percent-encoded) when they contain characters that are not valid in HTTP requests, such as spaces, forward slashes (/), and UTF-8 characters. For more information, 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>.</p><br>
    ///   - [`topic(impl Into<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::topic) / [`set_topic(Option<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::set_topic):<br>required: **true**<br><p>The topic of the outbound MQTT Publish message to the receiving client. For more information, 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>.</p><br>
    ///   - [`content_type(impl Into<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::content_type) / [`set_content_type(Option<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::set_content_type):<br>required: **false**<br><p>The MQTT5 content type property forwarded to the receiving client (for example, <code>application/json</code>).</p><br>
    ///   - [`response_topic(impl Into<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::response_topic) / [`set_response_topic(Option<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::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 describes the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters. For more information, 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>.</p><br>
    ///   - [`confirmation(bool)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::confirmation) / [`set_confirmation(Option<bool>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::set_confirmation):<br>required: **false**<br><p>A Boolean value that specifies whether to wait for delivery confirmation from the receiving client.</p> <p>When set to <code>true</code>, the API delivers the message at QoS 1 and waits for the client to send a delivery confirmation (PUBACK) before returning a successful response. If delivery confirmation is not received within the specified <code>timeout</code> period, the API returns HTTP 504.</p> <p>When set to <code>false</code>, the API delivers the message at QoS 0 and returns after Amazon Web Services IoT Core attempts to deliver the message.</p> <p>Valid values: <code>true</code> | <code>false</code></p> <p>Default value: <code>false</code></p><br>
    ///   - [`timeout(i32)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::timeout) / [`set_timeout(Option<i32>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::set_timeout):<br>required: **false**<br><p>An integer that represents the maximum time, in seconds, to wait for a delivery confirmation (PUBACK) from the receiving client after the message has been delivered. This parameter is only used when <code>confirmation</code> is set to <code>true</code>. If <code>confirmation</code> is <code>false</code>, this parameter is ignored.</p> <p>The total API response time may be higher than this value due to internal processing. Set your HTTP client timeout to a value greater than this parameter.</p> <p>Valid range: 1 to 15 seconds.</p> <p>Default value: <code>5</code> seconds.</p><br>
    ///   - [`payload(Blob)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::payload) / [`set_payload(Option<Blob>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::set_payload):<br>required: **false**<br><p>The message body. MQTT accepts text, binary, and empty (null) message payloads.</p><br>
    ///   - [`user_properties(impl Into<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::user_properties) / [`set_user_properties(Option<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::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>For MQTT 3.1.1 clients, user properties are silently dropped.</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::send_direct_message::builders::SendDirectMessageFluentBuilder::payload_format_indicator) / [`set_payload_format_indicator(Option<PayloadFormatIndicator>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::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>
    ///   - [`correlation_data(impl Into<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::correlation_data) / [`set_correlation_data(Option<String>)`](crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::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>
    /// - On success, responds with [`SendDirectMessageOutput`](crate::operation::send_direct_message::SendDirectMessageOutput) with field(s):
    ///   - [`message(Option<String>)`](crate::operation::send_direct_message::SendDirectMessageOutput::message): <p>The status message indicating the result of the operation.</p>
    ///   - [`trace_id(Option<String>)`](crate::operation::send_direct_message::SendDirectMessageOutput::trace_id): <p>A unique identifier for the request. Include this value when contacting Amazon Web Services Support for troubleshooting.</p>
    /// - On failure, responds with [`SdkError<SendDirectMessageError>`](crate::operation::send_direct_message::SendDirectMessageError)
    pub fn send_direct_message(&self) -> crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder {
        crate::operation::send_direct_message::builders::SendDirectMessageFluentBuilder::new(self.handle.clone())
    }
}