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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateOtaTaskInput {
    /// <p>The description of the over-the-air (OTA) task.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The URL to the Amazon S3 bucket where the over-the-air (OTA) task is stored.</p>
    pub s3_url: ::std::option::Option<::std::string::String>,
    /// <p>The connection protocol the over-the-air (OTA) task uses to update the device.</p>
    pub protocol: ::std::option::Option<crate::types::OtaProtocol>,
    /// <p>The device targeted for the over-the-air (OTA) task.</p>
    pub target: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The identifier for the over-the-air (OTA) task configuration.</p>
    pub task_configuration_id: ::std::option::Option<::std::string::String>,
    /// <p>The deployment mechanism for the over-the-air (OTA) task.</p>
    pub ota_mechanism: ::std::option::Option<crate::types::OtaMechanism>,
    /// <p>The frequency type for the over-the-air (OTA) task.</p>
    pub ota_type: ::std::option::Option<crate::types::OtaType>,
    /// <p>The query string to add things to the thing group.</p>
    pub ota_target_query_string: ::std::option::Option<::std::string::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 client_token: ::std::option::Option<::std::string::String>,
    /// <p>Over-the-air (OTA) task scheduling config.</p>
    pub ota_scheduling_config: ::std::option::Option<crate::types::OtaTaskSchedulingConfig>,
    /// <p>Over-the-air (OTA) task retry config.</p>
    pub ota_task_execution_retry_config: ::std::option::Option<crate::types::OtaTaskExecutionRetryConfig>,
    /// <p>A set of key/value pairs that are used to manage the over-the-air (OTA) task.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateOtaTaskInput {
    /// <p>The description of the over-the-air (OTA) task.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The URL to the Amazon S3 bucket where the over-the-air (OTA) task is stored.</p>
    pub fn s3_url(&self) -> ::std::option::Option<&str> {
        self.s3_url.as_deref()
    }
    /// <p>The connection protocol the over-the-air (OTA) task uses to update the device.</p>
    pub fn protocol(&self) -> ::std::option::Option<&crate::types::OtaProtocol> {
        self.protocol.as_ref()
    }
    /// <p>The device targeted for the over-the-air (OTA) task.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target.is_none()`.
    pub fn target(&self) -> &[::std::string::String] {
        self.target.as_deref().unwrap_or_default()
    }
    /// <p>The identifier for the over-the-air (OTA) task configuration.</p>
    pub fn task_configuration_id(&self) -> ::std::option::Option<&str> {
        self.task_configuration_id.as_deref()
    }
    /// <p>The deployment mechanism for the over-the-air (OTA) task.</p>
    pub fn ota_mechanism(&self) -> ::std::option::Option<&crate::types::OtaMechanism> {
        self.ota_mechanism.as_ref()
    }
    /// <p>The frequency type for the over-the-air (OTA) task.</p>
    pub fn ota_type(&self) -> ::std::option::Option<&crate::types::OtaType> {
        self.ota_type.as_ref()
    }
    /// <p>The query string to add things to the thing group.</p>
    pub fn ota_target_query_string(&self) -> ::std::option::Option<&str> {
        self.ota_target_query_string.as_deref()
    }
    /// <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(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>Over-the-air (OTA) task scheduling config.</p>
    pub fn ota_scheduling_config(&self) -> ::std::option::Option<&crate::types::OtaTaskSchedulingConfig> {
        self.ota_scheduling_config.as_ref()
    }
    /// <p>Over-the-air (OTA) task retry config.</p>
    pub fn ota_task_execution_retry_config(&self) -> ::std::option::Option<&crate::types::OtaTaskExecutionRetryConfig> {
        self.ota_task_execution_retry_config.as_ref()
    }
    /// <p>A set of key/value pairs that are used to manage the over-the-air (OTA) task.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::std::fmt::Debug for CreateOtaTaskInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateOtaTaskInput");
        formatter.field("description", &self.description);
        formatter.field("s3_url", &self.s3_url);
        formatter.field("protocol", &self.protocol);
        formatter.field("target", &self.target);
        formatter.field("task_configuration_id", &self.task_configuration_id);
        formatter.field("ota_mechanism", &self.ota_mechanism);
        formatter.field("ota_type", &self.ota_type);
        formatter.field("ota_target_query_string", &self.ota_target_query_string);
        formatter.field("client_token", &self.client_token);
        formatter.field("ota_scheduling_config", &self.ota_scheduling_config);
        formatter.field("ota_task_execution_retry_config", &self.ota_task_execution_retry_config);
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl CreateOtaTaskInput {
    /// Creates a new builder-style object to manufacture [`CreateOtaTaskInput`](crate::operation::create_ota_task::CreateOtaTaskInput).
    pub fn builder() -> crate::operation::create_ota_task::builders::CreateOtaTaskInputBuilder {
        crate::operation::create_ota_task::builders::CreateOtaTaskInputBuilder::default()
    }
}

/// A builder for [`CreateOtaTaskInput`](crate::operation::create_ota_task::CreateOtaTaskInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateOtaTaskInputBuilder {
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) s3_url: ::std::option::Option<::std::string::String>,
    pub(crate) protocol: ::std::option::Option<crate::types::OtaProtocol>,
    pub(crate) target: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) task_configuration_id: ::std::option::Option<::std::string::String>,
    pub(crate) ota_mechanism: ::std::option::Option<crate::types::OtaMechanism>,
    pub(crate) ota_type: ::std::option::Option<crate::types::OtaType>,
    pub(crate) ota_target_query_string: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) ota_scheduling_config: ::std::option::Option<crate::types::OtaTaskSchedulingConfig>,
    pub(crate) ota_task_execution_retry_config: ::std::option::Option<crate::types::OtaTaskExecutionRetryConfig>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateOtaTaskInputBuilder {
    /// <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.description = ::std::option::Option::Some(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.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.description
    }
    /// <p>The URL to the Amazon S3 bucket where the over-the-air (OTA) task is stored.</p>
    /// This field is required.
    pub fn s3_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.s3_url = ::std::option::Option::Some(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.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.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.protocol = ::std::option::Option::Some(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.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.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 {
        let mut v = self.target.unwrap_or_default();
        v.push(input.into());
        self.target = ::std::option::Option::Some(v);
        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.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.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.task_configuration_id = ::std::option::Option::Some(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.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.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.ota_mechanism = ::std::option::Option::Some(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.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.ota_mechanism
    }
    /// <p>The frequency type for the over-the-air (OTA) task.</p>
    /// This field is required.
    pub fn ota_type(mut self, input: crate::types::OtaType) -> Self {
        self.ota_type = ::std::option::Option::Some(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.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.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.ota_target_query_string = ::std::option::Option::Some(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.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.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.client_token = ::std::option::Option::Some(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.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.client_token
    }
    /// <p>Over-the-air (OTA) task scheduling config.</p>
    pub fn ota_scheduling_config(mut self, input: crate::types::OtaTaskSchedulingConfig) -> Self {
        self.ota_scheduling_config = ::std::option::Option::Some(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.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.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.ota_task_execution_retry_config = ::std::option::Option::Some(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.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.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 {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        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.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.tags
    }
    /// Consumes the builder and constructs a [`CreateOtaTaskInput`](crate::operation::create_ota_task::CreateOtaTaskInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_ota_task::CreateOtaTaskInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_ota_task::CreateOtaTaskInput {
            description: self.description,
            s3_url: self.s3_url,
            protocol: self.protocol,
            target: self.target,
            task_configuration_id: self.task_configuration_id,
            ota_mechanism: self.ota_mechanism,
            ota_type: self.ota_type,
            ota_target_query_string: self.ota_target_query_string,
            client_token: self.client_token,
            ota_scheduling_config: self.ota_scheduling_config,
            ota_task_execution_retry_config: self.ota_task_execution_retry_config,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for CreateOtaTaskInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateOtaTaskInputBuilder");
        formatter.field("description", &self.description);
        formatter.field("s3_url", &self.s3_url);
        formatter.field("protocol", &self.protocol);
        formatter.field("target", &self.target);
        formatter.field("task_configuration_id", &self.task_configuration_id);
        formatter.field("ota_mechanism", &self.ota_mechanism);
        formatter.field("ota_type", &self.ota_type);
        formatter.field("ota_target_query_string", &self.ota_target_query_string);
        formatter.field("client_token", &self.client_token);
        formatter.field("ota_scheduling_config", &self.ota_scheduling_config);
        formatter.field("ota_task_execution_retry_config", &self.ota_task_execution_retry_config);
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}