aws-sdk-snowdevicemanagement 0.26.0

AWS SDK for AWS Snow 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, std::fmt::Debug)]
pub struct DescribeTaskOutput {
    /// <p>The ID of the task.</p>
    #[doc(hidden)]
    pub task_id: std::option::Option<std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    #[doc(hidden)]
    pub task_arn: std::option::Option<std::string::String>,
    /// <p>The managed devices that the task was sent to.</p>
    #[doc(hidden)]
    pub targets: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>The current state of the task.</p>
    #[doc(hidden)]
    pub state: std::option::Option<crate::types::TaskState>,
    /// <p>When the <code>CreateTask</code> operation was called.</p>
    #[doc(hidden)]
    pub created_at: std::option::Option<aws_smithy_types::DateTime>,
    /// <p>When the state of the task was last updated.</p>
    #[doc(hidden)]
    pub last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
    /// <p>When the task was completed.</p>
    #[doc(hidden)]
    pub completed_at: std::option::Option<aws_smithy_types::DateTime>,
    /// <p>The description provided of the task and managed devices.</p>
    #[doc(hidden)]
    pub description: std::option::Option<std::string::String>,
    /// <p>Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.</p>
    #[doc(hidden)]
    pub tags:
        std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
    _request_id: Option<String>,
}
impl DescribeTaskOutput {
    /// <p>The ID of the task.</p>
    pub fn task_id(&self) -> std::option::Option<&str> {
        self.task_id.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    pub fn task_arn(&self) -> std::option::Option<&str> {
        self.task_arn.as_deref()
    }
    /// <p>The managed devices that the task was sent to.</p>
    pub fn targets(&self) -> std::option::Option<&[std::string::String]> {
        self.targets.as_deref()
    }
    /// <p>The current state of the task.</p>
    pub fn state(&self) -> std::option::Option<&crate::types::TaskState> {
        self.state.as_ref()
    }
    /// <p>When the <code>CreateTask</code> operation was called.</p>
    pub fn created_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>When the state of the task was last updated.</p>
    pub fn last_updated_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.last_updated_at.as_ref()
    }
    /// <p>When the task was completed.</p>
    pub fn completed_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.completed_at.as_ref()
    }
    /// <p>The description provided of the task and managed devices.</p>
    pub fn description(&self) -> std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.</p>
    pub fn tags(
        &self,
    ) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
    {
        self.tags.as_ref()
    }
}
impl aws_http::request_id::RequestId for DescribeTaskOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeTaskOutput {
    /// Creates a new builder-style object to manufacture [`DescribeTaskOutput`](crate::operation::describe_task::DescribeTaskOutput).
    pub fn builder() -> crate::operation::describe_task::builders::DescribeTaskOutputBuilder {
        crate::operation::describe_task::builders::DescribeTaskOutputBuilder::default()
    }
}

/// A builder for [`DescribeTaskOutput`](crate::operation::describe_task::DescribeTaskOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct DescribeTaskOutputBuilder {
    pub(crate) task_id: std::option::Option<std::string::String>,
    pub(crate) task_arn: std::option::Option<std::string::String>,
    pub(crate) targets: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) state: std::option::Option<crate::types::TaskState>,
    pub(crate) created_at: std::option::Option<aws_smithy_types::DateTime>,
    pub(crate) last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
    pub(crate) completed_at: std::option::Option<aws_smithy_types::DateTime>,
    pub(crate) description: std::option::Option<std::string::String>,
    pub(crate) tags:
        std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
    _request_id: Option<String>,
}
impl DescribeTaskOutputBuilder {
    /// <p>The ID of the task.</p>
    pub fn task_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.task_id = Some(input.into());
        self
    }
    /// <p>The ID of the task.</p>
    pub fn set_task_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.task_id = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    pub fn task_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.task_arn = Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    pub fn set_task_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.task_arn = input;
        self
    }
    /// Appends an item to `targets`.
    ///
    /// To override the contents of this collection use [`set_targets`](Self::set_targets).
    ///
    /// <p>The managed devices that the task was sent to.</p>
    pub fn targets(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.targets.unwrap_or_default();
        v.push(input.into());
        self.targets = Some(v);
        self
    }
    /// <p>The managed devices that the task was sent to.</p>
    pub fn set_targets(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.targets = input;
        self
    }
    /// <p>The current state of the task.</p>
    pub fn state(mut self, input: crate::types::TaskState) -> Self {
        self.state = Some(input);
        self
    }
    /// <p>The current state of the task.</p>
    pub fn set_state(mut self, input: std::option::Option<crate::types::TaskState>) -> Self {
        self.state = input;
        self
    }
    /// <p>When the <code>CreateTask</code> operation was called.</p>
    pub fn created_at(mut self, input: aws_smithy_types::DateTime) -> Self {
        self.created_at = Some(input);
        self
    }
    /// <p>When the <code>CreateTask</code> operation was called.</p>
    pub fn set_created_at(
        mut self,
        input: std::option::Option<aws_smithy_types::DateTime>,
    ) -> Self {
        self.created_at = input;
        self
    }
    /// <p>When the state of the task was last updated.</p>
    pub fn last_updated_at(mut self, input: aws_smithy_types::DateTime) -> Self {
        self.last_updated_at = Some(input);
        self
    }
    /// <p>When the state of the task was last updated.</p>
    pub fn set_last_updated_at(
        mut self,
        input: std::option::Option<aws_smithy_types::DateTime>,
    ) -> Self {
        self.last_updated_at = input;
        self
    }
    /// <p>When the task was completed.</p>
    pub fn completed_at(mut self, input: aws_smithy_types::DateTime) -> Self {
        self.completed_at = Some(input);
        self
    }
    /// <p>When the task was completed.</p>
    pub fn set_completed_at(
        mut self,
        input: std::option::Option<aws_smithy_types::DateTime>,
    ) -> Self {
        self.completed_at = input;
        self
    }
    /// <p>The description provided of the task and managed devices.</p>
    pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
        self.description = Some(input.into());
        self
    }
    /// <p>The description provided of the task and managed devices.</p>
    pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.</p>
    pub fn tags(
        mut self,
        k: impl Into<std::string::String>,
        v: impl Into<std::string::String>,
    ) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = Some(hash_map);
        self
    }
    /// <p>Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.</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
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeTaskOutput`](crate::operation::describe_task::DescribeTaskOutput).
    pub fn build(self) -> crate::operation::describe_task::DescribeTaskOutput {
        crate::operation::describe_task::DescribeTaskOutput {
            task_id: self.task_id,
            task_arn: self.task_arn,
            targets: self.targets,
            state: self.state,
            created_at: self.created_at,
            last_updated_at: self.last_updated_at,
            completed_at: self.completed_at,
            description: self.description,
            tags: self.tags,
            _request_id: self._request_id,
        }
    }
}