aws-sdk-iot 1.112.0

AWS SDK for AWS IoT
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, ::std::fmt::Debug)]
pub struct CreateCommandInput {
    /// <p>A unique identifier for the command. We recommend using UUID. Alpha-numeric characters, hyphens, and underscores are valid for use here.</p>
    pub command_id: ::std::option::Option<::std::string::String>,
    /// <p>The namespace of the command. The MQTT reserved topics and validations will be used for command executions according to the namespace setting.</p>
    pub namespace: ::std::option::Option<crate::types::CommandNamespace>,
    /// <p>The user-friendly name in the console for the command. This name doesn't have to be unique. You can update the user-friendly name after you define it.</p>
    pub display_name: ::std::option::Option<::std::string::String>,
    /// <p>A short text decription of the command.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The payload object for the static command.</p>
    /// <p>You can upload a static payload file from your local storage that contains the instructions for the device to process. The payload file can use any format. To make sure that the device correctly interprets the payload, we recommend you to specify the payload content type.</p>
    pub payload: ::std::option::Option<crate::types::CommandPayload>,
    /// <p>The payload template for the dynamic command.</p><note>
    /// <p>This parameter is required for dynamic commands where the command execution placeholders are supplied either from <code>mandatoryParameters</code> or when <code>StartCommandExecution</code> is invoked.</p>
    /// </note>
    pub payload_template: ::std::option::Option<::std::string::String>,
    /// <p>Configuration that determines how <code>payloadTemplate</code> is processed to generate command execution payload.</p><note>
    /// <p>This parameter is required for dynamic commands, along with <code>payloadTemplate</code>, and <code>mandatoryParameters</code>.</p>
    /// </note>
    pub preprocessor: ::std::option::Option<crate::types::CommandPreprocessor>,
    /// <p>A list of parameters that are used by <code>StartCommandExecution</code> API for execution payload generation.</p>
    pub mandatory_parameters: ::std::option::Option<::std::vec::Vec<crate::types::CommandParameter>>,
    /// <p>The IAM role that you must provide when using the <code>AWS-IoT-FleetWise</code> namespace. The role grants IoT Device Management the permission to access IoT FleetWise resources for generating the payload for the command. This field is not supported when you use the <code>AWS-IoT</code> namespace.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>Name-value pairs that are used as metadata to manage a command.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateCommandInput {
    /// <p>A unique identifier for the command. We recommend using UUID. Alpha-numeric characters, hyphens, and underscores are valid for use here.</p>
    pub fn command_id(&self) -> ::std::option::Option<&str> {
        self.command_id.as_deref()
    }
    /// <p>The namespace of the command. The MQTT reserved topics and validations will be used for command executions according to the namespace setting.</p>
    pub fn namespace(&self) -> ::std::option::Option<&crate::types::CommandNamespace> {
        self.namespace.as_ref()
    }
    /// <p>The user-friendly name in the console for the command. This name doesn't have to be unique. You can update the user-friendly name after you define it.</p>
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// <p>A short text decription of the command.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The payload object for the static command.</p>
    /// <p>You can upload a static payload file from your local storage that contains the instructions for the device to process. The payload file can use any format. To make sure that the device correctly interprets the payload, we recommend you to specify the payload content type.</p>
    pub fn payload(&self) -> ::std::option::Option<&crate::types::CommandPayload> {
        self.payload.as_ref()
    }
    /// <p>The payload template for the dynamic command.</p><note>
    /// <p>This parameter is required for dynamic commands where the command execution placeholders are supplied either from <code>mandatoryParameters</code> or when <code>StartCommandExecution</code> is invoked.</p>
    /// </note>
    pub fn payload_template(&self) -> ::std::option::Option<&str> {
        self.payload_template.as_deref()
    }
    /// <p>Configuration that determines how <code>payloadTemplate</code> is processed to generate command execution payload.</p><note>
    /// <p>This parameter is required for dynamic commands, along with <code>payloadTemplate</code>, and <code>mandatoryParameters</code>.</p>
    /// </note>
    pub fn preprocessor(&self) -> ::std::option::Option<&crate::types::CommandPreprocessor> {
        self.preprocessor.as_ref()
    }
    /// <p>A list of parameters that are used by <code>StartCommandExecution</code> API for execution payload generation.</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 `.mandatory_parameters.is_none()`.
    pub fn mandatory_parameters(&self) -> &[crate::types::CommandParameter] {
        self.mandatory_parameters.as_deref().unwrap_or_default()
    }
    /// <p>The IAM role that you must provide when using the <code>AWS-IoT-FleetWise</code> namespace. The role grants IoT Device Management the permission to access IoT FleetWise resources for generating the payload for the command. This field is not supported when you use the <code>AWS-IoT</code> namespace.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>Name-value pairs that are used as metadata to manage a command.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl CreateCommandInput {
    /// Creates a new builder-style object to manufacture [`CreateCommandInput`](crate::operation::create_command::CreateCommandInput).
    pub fn builder() -> crate::operation::create_command::builders::CreateCommandInputBuilder {
        crate::operation::create_command::builders::CreateCommandInputBuilder::default()
    }
}

/// A builder for [`CreateCommandInput`](crate::operation::create_command::CreateCommandInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCommandInputBuilder {
    pub(crate) command_id: ::std::option::Option<::std::string::String>,
    pub(crate) namespace: ::std::option::Option<crate::types::CommandNamespace>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) payload: ::std::option::Option<crate::types::CommandPayload>,
    pub(crate) payload_template: ::std::option::Option<::std::string::String>,
    pub(crate) preprocessor: ::std::option::Option<crate::types::CommandPreprocessor>,
    pub(crate) mandatory_parameters: ::std::option::Option<::std::vec::Vec<crate::types::CommandParameter>>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateCommandInputBuilder {
    /// <p>A unique identifier for the command. We recommend using UUID. Alpha-numeric characters, hyphens, and underscores are valid for use here.</p>
    /// This field is required.
    pub fn command_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.command_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier for the command. We recommend using UUID. Alpha-numeric characters, hyphens, and underscores are valid for use here.</p>
    pub fn set_command_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.command_id = input;
        self
    }
    /// <p>A unique identifier for the command. We recommend using UUID. Alpha-numeric characters, hyphens, and underscores are valid for use here.</p>
    pub fn get_command_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.command_id
    }
    /// <p>The namespace of the command. The MQTT reserved topics and validations will be used for command executions according to the namespace setting.</p>
    pub fn namespace(mut self, input: crate::types::CommandNamespace) -> Self {
        self.namespace = ::std::option::Option::Some(input);
        self
    }
    /// <p>The namespace of the command. The MQTT reserved topics and validations will be used for command executions according to the namespace setting.</p>
    pub fn set_namespace(mut self, input: ::std::option::Option<crate::types::CommandNamespace>) -> Self {
        self.namespace = input;
        self
    }
    /// <p>The namespace of the command. The MQTT reserved topics and validations will be used for command executions according to the namespace setting.</p>
    pub fn get_namespace(&self) -> &::std::option::Option<crate::types::CommandNamespace> {
        &self.namespace
    }
    /// <p>The user-friendly name in the console for the command. This name doesn't have to be unique. You can update the user-friendly name after you define it.</p>
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.display_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user-friendly name in the console for the command. This name doesn't have to be unique. You can update the user-friendly name after you define it.</p>
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// <p>The user-friendly name in the console for the command. This name doesn't have to be unique. You can update the user-friendly name after you define it.</p>
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// <p>A short text decription of the command.</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>A short text decription of the command.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A short text decription of the command.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The payload object for the static command.</p>
    /// <p>You can upload a static payload file from your local storage that contains the instructions for the device to process. The payload file can use any format. To make sure that the device correctly interprets the payload, we recommend you to specify the payload content type.</p>
    pub fn payload(mut self, input: crate::types::CommandPayload) -> Self {
        self.payload = ::std::option::Option::Some(input);
        self
    }
    /// <p>The payload object for the static command.</p>
    /// <p>You can upload a static payload file from your local storage that contains the instructions for the device to process. The payload file can use any format. To make sure that the device correctly interprets the payload, we recommend you to specify the payload content type.</p>
    pub fn set_payload(mut self, input: ::std::option::Option<crate::types::CommandPayload>) -> Self {
        self.payload = input;
        self
    }
    /// <p>The payload object for the static command.</p>
    /// <p>You can upload a static payload file from your local storage that contains the instructions for the device to process. The payload file can use any format. To make sure that the device correctly interprets the payload, we recommend you to specify the payload content type.</p>
    pub fn get_payload(&self) -> &::std::option::Option<crate::types::CommandPayload> {
        &self.payload
    }
    /// <p>The payload template for the dynamic command.</p><note>
    /// <p>This parameter is required for dynamic commands where the command execution placeholders are supplied either from <code>mandatoryParameters</code> or when <code>StartCommandExecution</code> is invoked.</p>
    /// </note>
    pub fn payload_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.payload_template = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The payload template for the dynamic command.</p><note>
    /// <p>This parameter is required for dynamic commands where the command execution placeholders are supplied either from <code>mandatoryParameters</code> or when <code>StartCommandExecution</code> is invoked.</p>
    /// </note>
    pub fn set_payload_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.payload_template = input;
        self
    }
    /// <p>The payload template for the dynamic command.</p><note>
    /// <p>This parameter is required for dynamic commands where the command execution placeholders are supplied either from <code>mandatoryParameters</code> or when <code>StartCommandExecution</code> is invoked.</p>
    /// </note>
    pub fn get_payload_template(&self) -> &::std::option::Option<::std::string::String> {
        &self.payload_template
    }
    /// <p>Configuration that determines how <code>payloadTemplate</code> is processed to generate command execution payload.</p><note>
    /// <p>This parameter is required for dynamic commands, along with <code>payloadTemplate</code>, and <code>mandatoryParameters</code>.</p>
    /// </note>
    pub fn preprocessor(mut self, input: crate::types::CommandPreprocessor) -> Self {
        self.preprocessor = ::std::option::Option::Some(input);
        self
    }
    /// <p>Configuration that determines how <code>payloadTemplate</code> is processed to generate command execution payload.</p><note>
    /// <p>This parameter is required for dynamic commands, along with <code>payloadTemplate</code>, and <code>mandatoryParameters</code>.</p>
    /// </note>
    pub fn set_preprocessor(mut self, input: ::std::option::Option<crate::types::CommandPreprocessor>) -> Self {
        self.preprocessor = input;
        self
    }
    /// <p>Configuration that determines how <code>payloadTemplate</code> is processed to generate command execution payload.</p><note>
    /// <p>This parameter is required for dynamic commands, along with <code>payloadTemplate</code>, and <code>mandatoryParameters</code>.</p>
    /// </note>
    pub fn get_preprocessor(&self) -> &::std::option::Option<crate::types::CommandPreprocessor> {
        &self.preprocessor
    }
    /// Appends an item to `mandatory_parameters`.
    ///
    /// To override the contents of this collection use [`set_mandatory_parameters`](Self::set_mandatory_parameters).
    ///
    /// <p>A list of parameters that are used by <code>StartCommandExecution</code> API for execution payload generation.</p>
    pub fn mandatory_parameters(mut self, input: crate::types::CommandParameter) -> Self {
        let mut v = self.mandatory_parameters.unwrap_or_default();
        v.push(input);
        self.mandatory_parameters = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of parameters that are used by <code>StartCommandExecution</code> API for execution payload generation.</p>
    pub fn set_mandatory_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CommandParameter>>) -> Self {
        self.mandatory_parameters = input;
        self
    }
    /// <p>A list of parameters that are used by <code>StartCommandExecution</code> API for execution payload generation.</p>
    pub fn get_mandatory_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CommandParameter>> {
        &self.mandatory_parameters
    }
    /// <p>The IAM role that you must provide when using the <code>AWS-IoT-FleetWise</code> namespace. The role grants IoT Device Management the permission to access IoT FleetWise resources for generating the payload for the command. This field is not supported when you use the <code>AWS-IoT</code> namespace.</p>
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The IAM role that you must provide when using the <code>AWS-IoT-FleetWise</code> namespace. The role grants IoT Device Management the permission to access IoT FleetWise resources for generating the payload for the command. This field is not supported when you use the <code>AWS-IoT</code> namespace.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The IAM role that you must provide when using the <code>AWS-IoT-FleetWise</code> namespace. The role grants IoT Device Management the permission to access IoT FleetWise resources for generating the payload for the command. This field is not supported when you use the <code>AWS-IoT</code> namespace.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Name-value pairs that are used as metadata to manage a command.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Name-value pairs that are used as metadata to manage a command.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Name-value pairs that are used as metadata to manage a command.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateCommandInput`](crate::operation::create_command::CreateCommandInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_command::CreateCommandInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_command::CreateCommandInput {
            command_id: self.command_id,
            namespace: self.namespace,
            display_name: self.display_name,
            description: self.description,
            payload: self.payload,
            payload_template: self.payload_template,
            preprocessor: self.preprocessor,
            mandatory_parameters: self.mandatory_parameters,
            role_arn: self.role_arn,
            tags: self.tags,
        })
    }
}