Skip to main content

aws_sdk_iotdataplane/operation/delete_connection/
_delete_connection_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteConnectionInput {
6    /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
7    /// <p>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.</p>
8    pub client_id: ::std::option::Option<::std::string::String>,
9    /// <p>Specifies whether to remove the client's persistent session state when disconnecting. Set to <code>TRUE</code> to delete all session information, including subscriptions and queued messages. Set to <code>FALSE</code> to preserve the session state for <a href="https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html#mqtt-persistent-sessions">persistent sessions</a>. For clean sessions this parameter will be ignored. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
10    pub clean_session: ::std::option::Option<bool>,
11    /// <p>Controls if Amazon Web Services IoT Core publishes the client's Last Will and Testament (LWT) message upon disconnection. Set to <code>TRUE</code> to prevent publishing the LWT message. Set to <code>FALSE</code> to ensure that LWT is published. By default, this is set to <code>FALSE</code> (LWT message is published).</p>
12    pub prevent_will_message: ::std::option::Option<bool>,
13}
14impl DeleteConnectionInput {
15    /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
16    /// <p>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.</p>
17    pub fn client_id(&self) -> ::std::option::Option<&str> {
18        self.client_id.as_deref()
19    }
20    /// <p>Specifies whether to remove the client's persistent session state when disconnecting. Set to <code>TRUE</code> to delete all session information, including subscriptions and queued messages. Set to <code>FALSE</code> to preserve the session state for <a href="https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html#mqtt-persistent-sessions">persistent sessions</a>. For clean sessions this parameter will be ignored. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
21    pub fn clean_session(&self) -> ::std::option::Option<bool> {
22        self.clean_session
23    }
24    /// <p>Controls if Amazon Web Services IoT Core publishes the client's Last Will and Testament (LWT) message upon disconnection. Set to <code>TRUE</code> to prevent publishing the LWT message. Set to <code>FALSE</code> to ensure that LWT is published. By default, this is set to <code>FALSE</code> (LWT message is published).</p>
25    pub fn prevent_will_message(&self) -> ::std::option::Option<bool> {
26        self.prevent_will_message
27    }
28}
29impl DeleteConnectionInput {
30    /// Creates a new builder-style object to manufacture [`DeleteConnectionInput`](crate::operation::delete_connection::DeleteConnectionInput).
31    pub fn builder() -> crate::operation::delete_connection::builders::DeleteConnectionInputBuilder {
32        crate::operation::delete_connection::builders::DeleteConnectionInputBuilder::default()
33    }
34}
35
36/// A builder for [`DeleteConnectionInput`](crate::operation::delete_connection::DeleteConnectionInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct DeleteConnectionInputBuilder {
40    pub(crate) client_id: ::std::option::Option<::std::string::String>,
41    pub(crate) clean_session: ::std::option::Option<bool>,
42    pub(crate) prevent_will_message: ::std::option::Option<bool>,
43}
44impl DeleteConnectionInputBuilder {
45    /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
46    /// <p>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.</p>
47    /// This field is required.
48    pub fn client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.client_id = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
53    /// <p>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.</p>
54    pub fn set_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.client_id = input;
56        self
57    }
58    /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
59    /// <p>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.</p>
60    pub fn get_client_id(&self) -> &::std::option::Option<::std::string::String> {
61        &self.client_id
62    }
63    /// <p>Specifies whether to remove the client's persistent session state when disconnecting. Set to <code>TRUE</code> to delete all session information, including subscriptions and queued messages. Set to <code>FALSE</code> to preserve the session state for <a href="https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html#mqtt-persistent-sessions">persistent sessions</a>. For clean sessions this parameter will be ignored. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
64    pub fn clean_session(mut self, input: bool) -> Self {
65        self.clean_session = ::std::option::Option::Some(input);
66        self
67    }
68    /// <p>Specifies whether to remove the client's persistent session state when disconnecting. Set to <code>TRUE</code> to delete all session information, including subscriptions and queued messages. Set to <code>FALSE</code> to preserve the session state for <a href="https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html#mqtt-persistent-sessions">persistent sessions</a>. For clean sessions this parameter will be ignored. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
69    pub fn set_clean_session(mut self, input: ::std::option::Option<bool>) -> Self {
70        self.clean_session = input;
71        self
72    }
73    /// <p>Specifies whether to remove the client's persistent session state when disconnecting. Set to <code>TRUE</code> to delete all session information, including subscriptions and queued messages. Set to <code>FALSE</code> to preserve the session state for <a href="https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html#mqtt-persistent-sessions">persistent sessions</a>. For clean sessions this parameter will be ignored. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
74    pub fn get_clean_session(&self) -> &::std::option::Option<bool> {
75        &self.clean_session
76    }
77    /// <p>Controls if Amazon Web Services IoT Core publishes the client's Last Will and Testament (LWT) message upon disconnection. Set to <code>TRUE</code> to prevent publishing the LWT message. Set to <code>FALSE</code> to ensure that LWT is published. By default, this is set to <code>FALSE</code> (LWT message is published).</p>
78    pub fn prevent_will_message(mut self, input: bool) -> Self {
79        self.prevent_will_message = ::std::option::Option::Some(input);
80        self
81    }
82    /// <p>Controls if Amazon Web Services IoT Core publishes the client's Last Will and Testament (LWT) message upon disconnection. Set to <code>TRUE</code> to prevent publishing the LWT message. Set to <code>FALSE</code> to ensure that LWT is published. By default, this is set to <code>FALSE</code> (LWT message is published).</p>
83    pub fn set_prevent_will_message(mut self, input: ::std::option::Option<bool>) -> Self {
84        self.prevent_will_message = input;
85        self
86    }
87    /// <p>Controls if Amazon Web Services IoT Core publishes the client's Last Will and Testament (LWT) message upon disconnection. Set to <code>TRUE</code> to prevent publishing the LWT message. Set to <code>FALSE</code> to ensure that LWT is published. By default, this is set to <code>FALSE</code> (LWT message is published).</p>
88    pub fn get_prevent_will_message(&self) -> &::std::option::Option<bool> {
89        &self.prevent_will_message
90    }
91    /// Consumes the builder and constructs a [`DeleteConnectionInput`](crate::operation::delete_connection::DeleteConnectionInput).
92    pub fn build(
93        self,
94    ) -> ::std::result::Result<crate::operation::delete_connection::DeleteConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
95        ::std::result::Result::Ok(crate::operation::delete_connection::DeleteConnectionInput {
96            client_id: self.client_id,
97            clean_session: self.clean_session,
98            prevent_will_message: self.prevent_will_message,
99        })
100    }
101}