aws-sdk-iotmanagedintegrations 1.43.0

AWS SDK for Managed integrations for AWS IoT Device Management
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_ota_task::_create_ota_task_input::CreateOtaTaskInputBuilder;

pub use crate::operation::create_ota_task::_create_ota_task_output::CreateOtaTaskOutputBuilder;

impl crate::operation::create_ota_task::builders::CreateOtaTaskInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_ota_task::CreateOtaTaskOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_ota_task::CreateOtaTaskError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_ota_task();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateOtaTask`.
///
/// <p>Create an over-the-air (OTA) task to target a device.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateOtaTaskFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_ota_task::builders::CreateOtaTaskInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_ota_task::CreateOtaTaskOutput,
        crate::operation::create_ota_task::CreateOtaTaskError,
    > for CreateOtaTaskFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_ota_task::CreateOtaTaskOutput,
            crate::operation::create_ota_task::CreateOtaTaskError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateOtaTaskFluentBuilder {
    /// Creates a new `CreateOtaTaskFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateOtaTask as a reference.
    pub fn as_input(&self) -> &crate::operation::create_ota_task::builders::CreateOtaTaskInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_ota_task::CreateOtaTaskOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_ota_task::CreateOtaTaskError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_ota_task::CreateOtaTask::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_ota_task::CreateOtaTask::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_ota_task::CreateOtaTaskOutput,
        crate::operation::create_ota_task::CreateOtaTaskError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The description of the over-the-air (OTA) task.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>The description of the over-the-air (OTA) task.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>The description of the over-the-air (OTA) task.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The URL to the Amazon S3 bucket where the over-the-air (OTA) task is stored.</p>
    pub fn s3_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.s3_url(input.into());
        self
    }
    /// <p>The URL to the Amazon S3 bucket where the over-the-air (OTA) task is stored.</p>
    pub fn set_s3_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_s3_url(input);
        self
    }
    /// <p>The URL to the Amazon S3 bucket where the over-the-air (OTA) task is stored.</p>
    pub fn get_s3_url(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_s3_url()
    }
    /// <p>The connection protocol the over-the-air (OTA) task uses to update the device.</p>
    pub fn protocol(mut self, input: crate::types::OtaProtocol) -> Self {
        self.inner = self.inner.protocol(input);
        self
    }
    /// <p>The connection protocol the over-the-air (OTA) task uses to update the device.</p>
    pub fn set_protocol(mut self, input: ::std::option::Option<crate::types::OtaProtocol>) -> Self {
        self.inner = self.inner.set_protocol(input);
        self
    }
    /// <p>The connection protocol the over-the-air (OTA) task uses to update the device.</p>
    pub fn get_protocol(&self) -> &::std::option::Option<crate::types::OtaProtocol> {
        self.inner.get_protocol()
    }
    ///
    /// Appends an item to `Target`.
    ///
    /// To override the contents of this collection use [`set_target`](Self::set_target).
    ///
    /// <p>The device targeted for the over-the-air (OTA) task.</p>
    pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.target(input.into());
        self
    }
    /// <p>The device targeted for the over-the-air (OTA) task.</p>
    pub fn set_target(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_target(input);
        self
    }
    /// <p>The device targeted for the over-the-air (OTA) task.</p>
    pub fn get_target(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_target()
    }
    /// <p>The identifier for the over-the-air (OTA) task configuration.</p>
    pub fn task_configuration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.task_configuration_id(input.into());
        self
    }
    /// <p>The identifier for the over-the-air (OTA) task configuration.</p>
    pub fn set_task_configuration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_task_configuration_id(input);
        self
    }
    /// <p>The identifier for the over-the-air (OTA) task configuration.</p>
    pub fn get_task_configuration_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_task_configuration_id()
    }
    /// <p>The deployment mechanism for the over-the-air (OTA) task.</p>
    pub fn ota_mechanism(mut self, input: crate::types::OtaMechanism) -> Self {
        self.inner = self.inner.ota_mechanism(input);
        self
    }
    /// <p>The deployment mechanism for the over-the-air (OTA) task.</p>
    pub fn set_ota_mechanism(mut self, input: ::std::option::Option<crate::types::OtaMechanism>) -> Self {
        self.inner = self.inner.set_ota_mechanism(input);
        self
    }
    /// <p>The deployment mechanism for the over-the-air (OTA) task.</p>
    pub fn get_ota_mechanism(&self) -> &::std::option::Option<crate::types::OtaMechanism> {
        self.inner.get_ota_mechanism()
    }
    /// <p>The frequency type for the over-the-air (OTA) task.</p>
    pub fn ota_type(mut self, input: crate::types::OtaType) -> Self {
        self.inner = self.inner.ota_type(input);
        self
    }
    /// <p>The frequency type for the over-the-air (OTA) task.</p>
    pub fn set_ota_type(mut self, input: ::std::option::Option<crate::types::OtaType>) -> Self {
        self.inner = self.inner.set_ota_type(input);
        self
    }
    /// <p>The frequency type for the over-the-air (OTA) task.</p>
    pub fn get_ota_type(&self) -> &::std::option::Option<crate::types::OtaType> {
        self.inner.get_ota_type()
    }
    /// <p>The query string to add things to the thing group.</p>
    pub fn ota_target_query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.ota_target_query_string(input.into());
        self
    }
    /// <p>The query string to add things to the thing group.</p>
    pub fn set_ota_target_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_ota_target_query_string(input);
        self
    }
    /// <p>The query string to add things to the thing group.</p>
    pub fn get_ota_target_query_string(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_ota_target_query_string()
    }
    /// <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>Over-the-air (OTA) task scheduling config.</p>
    pub fn ota_scheduling_config(mut self, input: crate::types::OtaTaskSchedulingConfig) -> Self {
        self.inner = self.inner.ota_scheduling_config(input);
        self
    }
    /// <p>Over-the-air (OTA) task scheduling config.</p>
    pub fn set_ota_scheduling_config(mut self, input: ::std::option::Option<crate::types::OtaTaskSchedulingConfig>) -> Self {
        self.inner = self.inner.set_ota_scheduling_config(input);
        self
    }
    /// <p>Over-the-air (OTA) task scheduling config.</p>
    pub fn get_ota_scheduling_config(&self) -> &::std::option::Option<crate::types::OtaTaskSchedulingConfig> {
        self.inner.get_ota_scheduling_config()
    }
    /// <p>Over-the-air (OTA) task retry config.</p>
    pub fn ota_task_execution_retry_config(mut self, input: crate::types::OtaTaskExecutionRetryConfig) -> Self {
        self.inner = self.inner.ota_task_execution_retry_config(input);
        self
    }
    /// <p>Over-the-air (OTA) task retry config.</p>
    pub fn set_ota_task_execution_retry_config(mut self, input: ::std::option::Option<crate::types::OtaTaskExecutionRetryConfig>) -> Self {
        self.inner = self.inner.set_ota_task_execution_retry_config(input);
        self
    }
    /// <p>Over-the-air (OTA) task retry config.</p>
    pub fn get_ota_task_execution_retry_config(&self) -> &::std::option::Option<crate::types::OtaTaskExecutionRetryConfig> {
        self.inner.get_ota_task_execution_retry_config()
    }
    ///
    /// Adds a key-value pair to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A set of key/value pairs that are used to manage the over-the-air (OTA) task.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <p>A set of key/value pairs that are used to manage the over-the-air (OTA) task.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>A set of key/value pairs that are used to manage the over-the-air (OTA) task.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
}