aws_sdk_iotwireless/operation/create_wireless_gateway_task_definition/
_create_wireless_gateway_task_definition_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 CreateWirelessGatewayTaskDefinitionInput {
6    /// <p>Whether to automatically create tasks using this task definition for all gateways with the specified current version. If <code>false</code>, the task must me created by calling <code>CreateWirelessGatewayTask</code>.</p>
7    pub auto_create_tasks: ::std::option::Option<bool>,
8    /// <p>The name of the new resource.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>Information about the gateways to update.</p>
11    pub update: ::std::option::Option<crate::types::UpdateWirelessGatewayTaskCreate>,
12    /// <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>
13    pub client_request_token: ::std::option::Option<::std::string::String>,
14    /// <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>
15    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateWirelessGatewayTaskDefinitionInput {
18    /// <p>Whether to automatically create tasks using this task definition for all gateways with the specified current version. If <code>false</code>, the task must me created by calling <code>CreateWirelessGatewayTask</code>.</p>
19    pub fn auto_create_tasks(&self) -> ::std::option::Option<bool> {
20        self.auto_create_tasks
21    }
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>Information about the gateways to update.</p>
27    pub fn update(&self) -> ::std::option::Option<&crate::types::UpdateWirelessGatewayTaskCreate> {
28        self.update.as_ref()
29    }
30    /// <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>
31    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
32        self.client_request_token.as_deref()
33    }
34    /// <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>
35    ///
36    /// 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()`.
37    pub fn tags(&self) -> &[crate::types::Tag] {
38        self.tags.as_deref().unwrap_or_default()
39    }
40}
41impl CreateWirelessGatewayTaskDefinitionInput {
42    /// Creates a new builder-style object to manufacture [`CreateWirelessGatewayTaskDefinitionInput`](crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionInput).
43    pub fn builder() -> crate::operation::create_wireless_gateway_task_definition::builders::CreateWirelessGatewayTaskDefinitionInputBuilder {
44        crate::operation::create_wireless_gateway_task_definition::builders::CreateWirelessGatewayTaskDefinitionInputBuilder::default()
45    }
46}
47
48/// A builder for [`CreateWirelessGatewayTaskDefinitionInput`](crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateWirelessGatewayTaskDefinitionInputBuilder {
52    pub(crate) auto_create_tasks: ::std::option::Option<bool>,
53    pub(crate) name: ::std::option::Option<::std::string::String>,
54    pub(crate) update: ::std::option::Option<crate::types::UpdateWirelessGatewayTaskCreate>,
55    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
56    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
57}
58impl CreateWirelessGatewayTaskDefinitionInputBuilder {
59    /// <p>Whether to automatically create tasks using this task definition for all gateways with the specified current version. If <code>false</code>, the task must me created by calling <code>CreateWirelessGatewayTask</code>.</p>
60    /// This field is required.
61    pub fn auto_create_tasks(mut self, input: bool) -> Self {
62        self.auto_create_tasks = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>Whether to automatically create tasks using this task definition for all gateways with the specified current version. If <code>false</code>, the task must me created by calling <code>CreateWirelessGatewayTask</code>.</p>
66    pub fn set_auto_create_tasks(mut self, input: ::std::option::Option<bool>) -> Self {
67        self.auto_create_tasks = input;
68        self
69    }
70    /// <p>Whether to automatically create tasks using this task definition for all gateways with the specified current version. If <code>false</code>, the task must me created by calling <code>CreateWirelessGatewayTask</code>.</p>
71    pub fn get_auto_create_tasks(&self) -> &::std::option::Option<bool> {
72        &self.auto_create_tasks
73    }
74    /// <p>The name of the new resource.</p>
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>Information about the gateways to update.</p>
89    pub fn update(mut self, input: crate::types::UpdateWirelessGatewayTaskCreate) -> Self {
90        self.update = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>Information about the gateways to update.</p>
94    pub fn set_update(mut self, input: ::std::option::Option<crate::types::UpdateWirelessGatewayTaskCreate>) -> Self {
95        self.update = input;
96        self
97    }
98    /// <p>Information about the gateways to update.</p>
99    pub fn get_update(&self) -> &::std::option::Option<crate::types::UpdateWirelessGatewayTaskCreate> {
100        &self.update
101    }
102    /// <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>
103    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.client_request_token = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <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>
108    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.client_request_token = input;
110        self
111    }
112    /// <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>
113    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
114        &self.client_request_token
115    }
116    /// Appends an item to `tags`.
117    ///
118    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
119    ///
120    /// <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>
121    pub fn tags(mut self, input: crate::types::Tag) -> Self {
122        let mut v = self.tags.unwrap_or_default();
123        v.push(input);
124        self.tags = ::std::option::Option::Some(v);
125        self
126    }
127    /// <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>
128    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
129        self.tags = input;
130        self
131    }
132    /// <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>
133    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
134        &self.tags
135    }
136    /// Consumes the builder and constructs a [`CreateWirelessGatewayTaskDefinitionInput`](crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionInput).
137    pub fn build(
138        self,
139    ) -> ::std::result::Result<
140        crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionInput,
141        ::aws_smithy_types::error::operation::BuildError,
142    > {
143        ::std::result::Result::Ok(
144            crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionInput {
145                auto_create_tasks: self.auto_create_tasks,
146                name: self.name,
147                update: self.update,
148                client_request_token: self.client_request_token,
149                tags: self.tags,
150            },
151        )
152    }
153}