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 pub client_id: ::std::option::Option<::std::string::String>,
8 /// <p>Specifies whether to remove the client's 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. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
9 pub clean_session: ::std::option::Option<bool>,
10 /// <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 allow publishing. By default, this is set to <code>FALSE</code> (allows publishing the LWT message).</p>
11 pub prevent_will_message: ::std::option::Option<bool>,
12}
13impl DeleteConnectionInput {
14 /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
15 pub fn client_id(&self) -> ::std::option::Option<&str> {
16 self.client_id.as_deref()
17 }
18 /// <p>Specifies whether to remove the client's 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. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
19 pub fn clean_session(&self) -> ::std::option::Option<bool> {
20 self.clean_session
21 }
22 /// <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 allow publishing. By default, this is set to <code>FALSE</code> (allows publishing the LWT message).</p>
23 pub fn prevent_will_message(&self) -> ::std::option::Option<bool> {
24 self.prevent_will_message
25 }
26}
27impl DeleteConnectionInput {
28 /// Creates a new builder-style object to manufacture [`DeleteConnectionInput`](crate::operation::delete_connection::DeleteConnectionInput).
29 pub fn builder() -> crate::operation::delete_connection::builders::DeleteConnectionInputBuilder {
30 crate::operation::delete_connection::builders::DeleteConnectionInputBuilder::default()
31 }
32}
33
34/// A builder for [`DeleteConnectionInput`](crate::operation::delete_connection::DeleteConnectionInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct DeleteConnectionInputBuilder {
38 pub(crate) client_id: ::std::option::Option<::std::string::String>,
39 pub(crate) clean_session: ::std::option::Option<bool>,
40 pub(crate) prevent_will_message: ::std::option::Option<bool>,
41}
42impl DeleteConnectionInputBuilder {
43 /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
44 /// This field is required.
45 pub fn client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.client_id = ::std::option::Option::Some(input.into());
47 self
48 }
49 /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
50 pub fn set_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.client_id = input;
52 self
53 }
54 /// <p>The unique identifier of the MQTT client to disconnect. The client ID can't start with a dollar sign ($).</p>
55 pub fn get_client_id(&self) -> &::std::option::Option<::std::string::String> {
56 &self.client_id
57 }
58 /// <p>Specifies whether to remove the client's 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. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
59 pub fn clean_session(mut self, input: bool) -> Self {
60 self.clean_session = ::std::option::Option::Some(input);
61 self
62 }
63 /// <p>Specifies whether to remove the client's 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. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
64 pub fn set_clean_session(mut self, input: ::std::option::Option<bool>) -> Self {
65 self.clean_session = input;
66 self
67 }
68 /// <p>Specifies whether to remove the client's 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. By default, this is set to <code>FALSE</code> (preserves the session state).</p>
69 pub fn get_clean_session(&self) -> &::std::option::Option<bool> {
70 &self.clean_session
71 }
72 /// <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 allow publishing. By default, this is set to <code>FALSE</code> (allows publishing the LWT message).</p>
73 pub fn prevent_will_message(mut self, input: bool) -> Self {
74 self.prevent_will_message = ::std::option::Option::Some(input);
75 self
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 allow publishing. By default, this is set to <code>FALSE</code> (allows publishing the LWT message).</p>
78 pub fn set_prevent_will_message(mut self, input: ::std::option::Option<bool>) -> Self {
79 self.prevent_will_message = 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 allow publishing. By default, this is set to <code>FALSE</code> (allows publishing the LWT message).</p>
83 pub fn get_prevent_will_message(&self) -> &::std::option::Option<bool> {
84 &self.prevent_will_message
85 }
86 /// Consumes the builder and constructs a [`DeleteConnectionInput`](crate::operation::delete_connection::DeleteConnectionInput).
87 pub fn build(
88 self,
89 ) -> ::std::result::Result<crate::operation::delete_connection::DeleteConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
90 ::std::result::Result::Ok(crate::operation::delete_connection::DeleteConnectionInput {
91 client_id: self.client_id,
92 clean_session: self.clean_session,
93 prevent_will_message: self.prevent_will_message,
94 })
95 }
96}