aws-sdk-migrationhub 1.102.0

AWS SDK for AWS Migration Hub
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Task object encapsulating task information.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Task {
    /// <p>Status of the task - Not Started, In-Progress, Complete.</p>
    pub status: crate::types::Status,
    /// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
    pub status_detail: ::std::option::Option<::std::string::String>,
    /// <p>Indication of the percentage completion of the task.</p>
    pub progress_percent: ::std::option::Option<i32>,
}
impl Task {
    /// <p>Status of the task - Not Started, In-Progress, Complete.</p>
    pub fn status(&self) -> &crate::types::Status {
        &self.status
    }
    /// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
    pub fn status_detail(&self) -> ::std::option::Option<&str> {
        self.status_detail.as_deref()
    }
    /// <p>Indication of the percentage completion of the task.</p>
    pub fn progress_percent(&self) -> ::std::option::Option<i32> {
        self.progress_percent
    }
}
impl Task {
    /// Creates a new builder-style object to manufacture [`Task`](crate::types::Task).
    pub fn builder() -> crate::types::builders::TaskBuilder {
        crate::types::builders::TaskBuilder::default()
    }
}

/// A builder for [`Task`](crate::types::Task).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TaskBuilder {
    pub(crate) status: ::std::option::Option<crate::types::Status>,
    pub(crate) status_detail: ::std::option::Option<::std::string::String>,
    pub(crate) progress_percent: ::std::option::Option<i32>,
}
impl TaskBuilder {
    /// <p>Status of the task - Not Started, In-Progress, Complete.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::Status) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Status of the task - Not Started, In-Progress, Complete.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
        self.status = input;
        self
    }
    /// <p>Status of the task - Not Started, In-Progress, Complete.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
        &self.status
    }
    /// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
    pub fn status_detail(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_detail = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
    pub fn set_status_detail(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_detail = input;
        self
    }
    /// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
    pub fn get_status_detail(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_detail
    }
    /// <p>Indication of the percentage completion of the task.</p>
    pub fn progress_percent(mut self, input: i32) -> Self {
        self.progress_percent = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indication of the percentage completion of the task.</p>
    pub fn set_progress_percent(mut self, input: ::std::option::Option<i32>) -> Self {
        self.progress_percent = input;
        self
    }
    /// <p>Indication of the percentage completion of the task.</p>
    pub fn get_progress_percent(&self) -> &::std::option::Option<i32> {
        &self.progress_percent
    }
    /// Consumes the builder and constructs a [`Task`](crate::types::Task).
    /// This method will fail if any of the following fields are not set:
    /// - [`status`](crate::types::builders::TaskBuilder::status)
    pub fn build(self) -> ::std::result::Result<crate::types::Task, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Task {
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building Task",
                )
            })?,
            status_detail: self.status_detail,
            progress_percent: self.progress_percent,
        })
    }
}