aws_sdk_iotwireless/operation/create_wireless_gateway_task_definition/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_wireless_gateway_task_definition::_create_wireless_gateway_task_definition_output::CreateWirelessGatewayTaskDefinitionOutputBuilder;
3
4pub use crate::operation::create_wireless_gateway_task_definition::_create_wireless_gateway_task_definition_input::CreateWirelessGatewayTaskDefinitionInputBuilder;
5
6impl crate::operation::create_wireless_gateway_task_definition::builders::CreateWirelessGatewayTaskDefinitionInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_wireless_gateway_task_definition();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateWirelessGatewayTaskDefinition`.
24///
25/// <p>Creates a gateway task definition.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateWirelessGatewayTaskDefinitionFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_wireless_gateway_task_definition::builders::CreateWirelessGatewayTaskDefinitionInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionOutput,
35        crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionError,
36    > for CreateWirelessGatewayTaskDefinitionFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionOutput,
44            crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateWirelessGatewayTaskDefinitionFluentBuilder {
51    /// Creates a new `CreateWirelessGatewayTaskDefinitionFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateWirelessGatewayTaskDefinition as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_wireless_gateway_task_definition::builders::CreateWirelessGatewayTaskDefinitionInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins =
85            crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinition::operation_runtime_plugins(
86                self.handle.runtime_plugins.clone(),
87                &self.handle.conf,
88                self.config_override,
89            );
90        crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinition::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionOutput,
98        crate::operation::create_wireless_gateway_task_definition::CreateWirelessGatewayTaskDefinitionError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <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>
113    pub fn auto_create_tasks(mut self, input: bool) -> Self {
114        self.inner = self.inner.auto_create_tasks(input);
115        self
116    }
117    /// <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>
118    pub fn set_auto_create_tasks(mut self, input: ::std::option::Option<bool>) -> Self {
119        self.inner = self.inner.set_auto_create_tasks(input);
120        self
121    }
122    /// <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>
123    pub fn get_auto_create_tasks(&self) -> &::std::option::Option<bool> {
124        self.inner.get_auto_create_tasks()
125    }
126    /// <p>The name of the new resource.</p>
127    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.name(input.into());
129        self
130    }
131    /// <p>The name of the new resource.</p>
132    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_name(input);
134        self
135    }
136    /// <p>The name of the new resource.</p>
137    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_name()
139    }
140    /// <p>Information about the gateways to update.</p>
141    pub fn update(mut self, input: crate::types::UpdateWirelessGatewayTaskCreate) -> Self {
142        self.inner = self.inner.update(input);
143        self
144    }
145    /// <p>Information about the gateways to update.</p>
146    pub fn set_update(mut self, input: ::std::option::Option<crate::types::UpdateWirelessGatewayTaskCreate>) -> Self {
147        self.inner = self.inner.set_update(input);
148        self
149    }
150    /// <p>Information about the gateways to update.</p>
151    pub fn get_update(&self) -> &::std::option::Option<crate::types::UpdateWirelessGatewayTaskCreate> {
152        self.inner.get_update()
153    }
154    /// <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>
155    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.inner = self.inner.client_request_token(input.into());
157        self
158    }
159    /// <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>
160    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.inner = self.inner.set_client_request_token(input);
162        self
163    }
164    /// <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>
165    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
166        self.inner.get_client_request_token()
167    }
168    ///
169    /// Appends an item to `Tags`.
170    ///
171    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
172    ///
173    /// <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>
174    pub fn tags(mut self, input: crate::types::Tag) -> Self {
175        self.inner = self.inner.tags(input);
176        self
177    }
178    /// <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>
179    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
180        self.inner = self.inner.set_tags(input);
181        self
182    }
183    /// <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>
184    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
185        self.inner.get_tags()
186    }
187}