aws_sdk_iotwireless/operation/create_destination/_create_destination_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 CreateDestinationInput {
6 /// <p>The name of the new resource.</p>
7 pub name: ::std::option::Option<::std::string::String>,
8 /// <p>The type of value in <code>Expression</code>.</p>
9 pub expression_type: ::std::option::Option<crate::types::ExpressionType>,
10 /// <p>The rule name or topic rule to send messages to.</p>
11 pub expression: ::std::option::Option<::std::string::String>,
12 /// <p>The description of the new resource.</p>
13 pub description: ::std::option::Option<::std::string::String>,
14 /// <p>The ARN of the IAM Role that authorizes the destination.</p>
15 pub role_arn: ::std::option::Option<::std::string::String>,
16 /// <p>The tags to attach to the new destination. Tags are metadata that you can use to manage a resource.</p>
17 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18 /// <p>Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
19 pub client_request_token: ::std::option::Option<::std::string::String>,
20}
21impl CreateDestinationInput {
22 /// <p>The name of the new resource.</p>
23 pub fn name(&self) -> ::std::option::Option<&str> {
24 self.name.as_deref()
25 }
26 /// <p>The type of value in <code>Expression</code>.</p>
27 pub fn expression_type(&self) -> ::std::option::Option<&crate::types::ExpressionType> {
28 self.expression_type.as_ref()
29 }
30 /// <p>The rule name or topic rule to send messages to.</p>
31 pub fn expression(&self) -> ::std::option::Option<&str> {
32 self.expression.as_deref()
33 }
34 /// <p>The description of the new resource.</p>
35 pub fn description(&self) -> ::std::option::Option<&str> {
36 self.description.as_deref()
37 }
38 /// <p>The ARN of the IAM Role that authorizes the destination.</p>
39 pub fn role_arn(&self) -> ::std::option::Option<&str> {
40 self.role_arn.as_deref()
41 }
42 /// <p>The tags to attach to the new destination. Tags are metadata that you can use to manage a resource.</p>
43 ///
44 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
45 pub fn tags(&self) -> &[crate::types::Tag] {
46 self.tags.as_deref().unwrap_or_default()
47 }
48 /// <p>Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
49 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
50 self.client_request_token.as_deref()
51 }
52}
53impl CreateDestinationInput {
54 /// Creates a new builder-style object to manufacture [`CreateDestinationInput`](crate::operation::create_destination::CreateDestinationInput).
55 pub fn builder() -> crate::operation::create_destination::builders::CreateDestinationInputBuilder {
56 crate::operation::create_destination::builders::CreateDestinationInputBuilder::default()
57 }
58}
59
60/// A builder for [`CreateDestinationInput`](crate::operation::create_destination::CreateDestinationInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateDestinationInputBuilder {
64 pub(crate) name: ::std::option::Option<::std::string::String>,
65 pub(crate) expression_type: ::std::option::Option<crate::types::ExpressionType>,
66 pub(crate) expression: ::std::option::Option<::std::string::String>,
67 pub(crate) description: ::std::option::Option<::std::string::String>,
68 pub(crate) role_arn: ::std::option::Option<::std::string::String>,
69 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
70 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
71}
72impl CreateDestinationInputBuilder {
73 /// <p>The name of the new resource.</p>
74 /// This field is required.
75 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.name = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The name of the new resource.</p>
80 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.name = input;
82 self
83 }
84 /// <p>The name of the new resource.</p>
85 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
86 &self.name
87 }
88 /// <p>The type of value in <code>Expression</code>.</p>
89 /// This field is required.
90 pub fn expression_type(mut self, input: crate::types::ExpressionType) -> Self {
91 self.expression_type = ::std::option::Option::Some(input);
92 self
93 }
94 /// <p>The type of value in <code>Expression</code>.</p>
95 pub fn set_expression_type(mut self, input: ::std::option::Option<crate::types::ExpressionType>) -> Self {
96 self.expression_type = input;
97 self
98 }
99 /// <p>The type of value in <code>Expression</code>.</p>
100 pub fn get_expression_type(&self) -> &::std::option::Option<crate::types::ExpressionType> {
101 &self.expression_type
102 }
103 /// <p>The rule name or topic rule to send messages to.</p>
104 /// This field is required.
105 pub fn expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106 self.expression = ::std::option::Option::Some(input.into());
107 self
108 }
109 /// <p>The rule name or topic rule to send messages to.</p>
110 pub fn set_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.expression = input;
112 self
113 }
114 /// <p>The rule name or topic rule to send messages to.</p>
115 pub fn get_expression(&self) -> &::std::option::Option<::std::string::String> {
116 &self.expression
117 }
118 /// <p>The description of the new resource.</p>
119 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.description = ::std::option::Option::Some(input.into());
121 self
122 }
123 /// <p>The description of the new resource.</p>
124 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.description = input;
126 self
127 }
128 /// <p>The description of the new resource.</p>
129 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
130 &self.description
131 }
132 /// <p>The ARN of the IAM Role that authorizes the destination.</p>
133 /// This field is required.
134 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.role_arn = ::std::option::Option::Some(input.into());
136 self
137 }
138 /// <p>The ARN of the IAM Role that authorizes the destination.</p>
139 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.role_arn = input;
141 self
142 }
143 /// <p>The ARN of the IAM Role that authorizes the destination.</p>
144 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
145 &self.role_arn
146 }
147 /// Appends an item to `tags`.
148 ///
149 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
150 ///
151 /// <p>The tags to attach to the new destination. Tags are metadata that you can use to manage a resource.</p>
152 pub fn tags(mut self, input: crate::types::Tag) -> Self {
153 let mut v = self.tags.unwrap_or_default();
154 v.push(input);
155 self.tags = ::std::option::Option::Some(v);
156 self
157 }
158 /// <p>The tags to attach to the new destination. Tags are metadata that you can use to manage a resource.</p>
159 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
160 self.tags = input;
161 self
162 }
163 /// <p>The tags to attach to the new destination. Tags are metadata that you can use to manage a resource.</p>
164 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
165 &self.tags
166 }
167 /// <p>Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
168 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.client_request_token = ::std::option::Option::Some(input.into());
170 self
171 }
172 /// <p>Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
173 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.client_request_token = input;
175 self
176 }
177 /// <p>Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
178 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
179 &self.client_request_token
180 }
181 /// Consumes the builder and constructs a [`CreateDestinationInput`](crate::operation::create_destination::CreateDestinationInput).
182 pub fn build(
183 self,
184 ) -> ::std::result::Result<crate::operation::create_destination::CreateDestinationInput, ::aws_smithy_types::error::operation::BuildError> {
185 ::std::result::Result::Ok(crate::operation::create_destination::CreateDestinationInput {
186 name: self.name,
187 expression_type: self.expression_type,
188 expression: self.expression,
189 description: self.description,
190 role_arn: self.role_arn,
191 tags: self.tags,
192 client_request_token: self.client_request_token,
193 })
194 }
195}