aws-sdk-outposts 1.110.0

AWS SDK for AWS Outposts
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 StartCapacityTaskOutput {
    /// <p>ID of the capacity task that you want to start.</p>
    pub capacity_task_id: ::std::option::Option<::std::string::String>,
    /// <p>ID of the Outpost associated with the capacity task.</p>
    pub outpost_id: ::std::option::Option<::std::string::String>,
    /// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
    pub order_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
    pub asset_id: ::std::option::Option<::std::string::String>,
    /// <p>List of the instance pools requested in the specified capacity task.</p>
    pub requested_instance_pools: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>,
    /// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
    pub instances_to_exclude: ::std::option::Option<crate::types::InstancesToExclude>,
    /// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
    pub dry_run: bool,
    /// <p>Status of the specified capacity task.</p>
    pub capacity_task_status: ::std::option::Option<crate::types::CapacityTaskStatus>,
    /// <p>Reason that the specified capacity task failed.</p>
    pub failed: ::std::option::Option<crate::types::CapacityTaskFailure>,
    /// <p>Date that the specified capacity task was created.</p>
    pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Date that the specified capacity task ran successfully.</p>
    pub completion_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Date that the specified capacity task was last modified.</p>
    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
    /// <ul>
    /// <li>
    /// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
    /// <li>
    /// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
    /// </ul>
    pub task_action_on_blocking_instances: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>,
    _request_id: Option<String>,
}
impl StartCapacityTaskOutput {
    /// <p>ID of the capacity task that you want to start.</p>
    pub fn capacity_task_id(&self) -> ::std::option::Option<&str> {
        self.capacity_task_id.as_deref()
    }
    /// <p>ID of the Outpost associated with the capacity task.</p>
    pub fn outpost_id(&self) -> ::std::option::Option<&str> {
        self.outpost_id.as_deref()
    }
    /// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
    pub fn order_id(&self) -> ::std::option::Option<&str> {
        self.order_id.as_deref()
    }
    /// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
    pub fn asset_id(&self) -> ::std::option::Option<&str> {
        self.asset_id.as_deref()
    }
    /// <p>List of the instance pools requested in the specified capacity 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 `.requested_instance_pools.is_none()`.
    pub fn requested_instance_pools(&self) -> &[crate::types::InstanceTypeCapacity] {
        self.requested_instance_pools.as_deref().unwrap_or_default()
    }
    /// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
    pub fn instances_to_exclude(&self) -> ::std::option::Option<&crate::types::InstancesToExclude> {
        self.instances_to_exclude.as_ref()
    }
    /// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
    pub fn dry_run(&self) -> bool {
        self.dry_run
    }
    /// <p>Status of the specified capacity task.</p>
    pub fn capacity_task_status(&self) -> ::std::option::Option<&crate::types::CapacityTaskStatus> {
        self.capacity_task_status.as_ref()
    }
    /// <p>Reason that the specified capacity task failed.</p>
    pub fn failed(&self) -> ::std::option::Option<&crate::types::CapacityTaskFailure> {
        self.failed.as_ref()
    }
    /// <p>Date that the specified capacity task was created.</p>
    pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_date.as_ref()
    }
    /// <p>Date that the specified capacity task ran successfully.</p>
    pub fn completion_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.completion_date.as_ref()
    }
    /// <p>Date that the specified capacity task was last modified.</p>
    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_date.as_ref()
    }
    /// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
    /// <ul>
    /// <li>
    /// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
    /// <li>
    /// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
    /// </ul>
    pub fn task_action_on_blocking_instances(&self) -> ::std::option::Option<&crate::types::TaskActionOnBlockingInstances> {
        self.task_action_on_blocking_instances.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for StartCapacityTaskOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl StartCapacityTaskOutput {
    /// Creates a new builder-style object to manufacture [`StartCapacityTaskOutput`](crate::operation::start_capacity_task::StartCapacityTaskOutput).
    pub fn builder() -> crate::operation::start_capacity_task::builders::StartCapacityTaskOutputBuilder {
        crate::operation::start_capacity_task::builders::StartCapacityTaskOutputBuilder::default()
    }
}

/// A builder for [`StartCapacityTaskOutput`](crate::operation::start_capacity_task::StartCapacityTaskOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartCapacityTaskOutputBuilder {
    pub(crate) capacity_task_id: ::std::option::Option<::std::string::String>,
    pub(crate) outpost_id: ::std::option::Option<::std::string::String>,
    pub(crate) order_id: ::std::option::Option<::std::string::String>,
    pub(crate) asset_id: ::std::option::Option<::std::string::String>,
    pub(crate) requested_instance_pools: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>,
    pub(crate) instances_to_exclude: ::std::option::Option<crate::types::InstancesToExclude>,
    pub(crate) dry_run: ::std::option::Option<bool>,
    pub(crate) capacity_task_status: ::std::option::Option<crate::types::CapacityTaskStatus>,
    pub(crate) failed: ::std::option::Option<crate::types::CapacityTaskFailure>,
    pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) completion_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) task_action_on_blocking_instances: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>,
    _request_id: Option<String>,
}
impl StartCapacityTaskOutputBuilder {
    /// <p>ID of the capacity task that you want to start.</p>
    pub fn capacity_task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.capacity_task_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>ID of the capacity task that you want to start.</p>
    pub fn set_capacity_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.capacity_task_id = input;
        self
    }
    /// <p>ID of the capacity task that you want to start.</p>
    pub fn get_capacity_task_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.capacity_task_id
    }
    /// <p>ID of the Outpost associated with the capacity task.</p>
    pub fn outpost_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.outpost_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>ID of the Outpost associated with the capacity task.</p>
    pub fn set_outpost_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.outpost_id = input;
        self
    }
    /// <p>ID of the Outpost associated with the capacity task.</p>
    pub fn get_outpost_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.outpost_id
    }
    /// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
    pub fn order_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.order_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
    pub fn set_order_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.order_id = input;
        self
    }
    /// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
    pub fn get_order_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.order_id
    }
    /// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
    pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.asset_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
    pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.asset_id = input;
        self
    }
    /// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
    pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.asset_id
    }
    /// Appends an item to `requested_instance_pools`.
    ///
    /// To override the contents of this collection use [`set_requested_instance_pools`](Self::set_requested_instance_pools).
    ///
    /// <p>List of the instance pools requested in the specified capacity task.</p>
    pub fn requested_instance_pools(mut self, input: crate::types::InstanceTypeCapacity) -> Self {
        let mut v = self.requested_instance_pools.unwrap_or_default();
        v.push(input);
        self.requested_instance_pools = ::std::option::Option::Some(v);
        self
    }
    /// <p>List of the instance pools requested in the specified capacity task.</p>
    pub fn set_requested_instance_pools(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>) -> Self {
        self.requested_instance_pools = input;
        self
    }
    /// <p>List of the instance pools requested in the specified capacity task.</p>
    pub fn get_requested_instance_pools(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>> {
        &self.requested_instance_pools
    }
    /// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
    pub fn instances_to_exclude(mut self, input: crate::types::InstancesToExclude) -> Self {
        self.instances_to_exclude = ::std::option::Option::Some(input);
        self
    }
    /// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
    pub fn set_instances_to_exclude(mut self, input: ::std::option::Option<crate::types::InstancesToExclude>) -> Self {
        self.instances_to_exclude = input;
        self
    }
    /// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
    pub fn get_instances_to_exclude(&self) -> &::std::option::Option<crate::types::InstancesToExclude> {
        &self.instances_to_exclude
    }
    /// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
    pub fn dry_run(mut self, input: bool) -> Self {
        self.dry_run = ::std::option::Option::Some(input);
        self
    }
    /// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
        self.dry_run = input;
        self
    }
    /// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
        &self.dry_run
    }
    /// <p>Status of the specified capacity task.</p>
    pub fn capacity_task_status(mut self, input: crate::types::CapacityTaskStatus) -> Self {
        self.capacity_task_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Status of the specified capacity task.</p>
    pub fn set_capacity_task_status(mut self, input: ::std::option::Option<crate::types::CapacityTaskStatus>) -> Self {
        self.capacity_task_status = input;
        self
    }
    /// <p>Status of the specified capacity task.</p>
    pub fn get_capacity_task_status(&self) -> &::std::option::Option<crate::types::CapacityTaskStatus> {
        &self.capacity_task_status
    }
    /// <p>Reason that the specified capacity task failed.</p>
    pub fn failed(mut self, input: crate::types::CapacityTaskFailure) -> Self {
        self.failed = ::std::option::Option::Some(input);
        self
    }
    /// <p>Reason that the specified capacity task failed.</p>
    pub fn set_failed(mut self, input: ::std::option::Option<crate::types::CapacityTaskFailure>) -> Self {
        self.failed = input;
        self
    }
    /// <p>Reason that the specified capacity task failed.</p>
    pub fn get_failed(&self) -> &::std::option::Option<crate::types::CapacityTaskFailure> {
        &self.failed
    }
    /// <p>Date that the specified capacity task was created.</p>
    pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>Date that the specified capacity task was created.</p>
    pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_date = input;
        self
    }
    /// <p>Date that the specified capacity task was created.</p>
    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_date
    }
    /// <p>Date that the specified capacity task ran successfully.</p>
    pub fn completion_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.completion_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>Date that the specified capacity task ran successfully.</p>
    pub fn set_completion_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.completion_date = input;
        self
    }
    /// <p>Date that the specified capacity task ran successfully.</p>
    pub fn get_completion_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.completion_date
    }
    /// <p>Date that the specified capacity task was last modified.</p>
    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>Date that the specified capacity task was last modified.</p>
    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_date = input;
        self
    }
    /// <p>Date that the specified capacity task was last modified.</p>
    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_date
    }
    /// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
    /// <ul>
    /// <li>
    /// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
    /// <li>
    /// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
    /// </ul>
    pub fn task_action_on_blocking_instances(mut self, input: crate::types::TaskActionOnBlockingInstances) -> Self {
        self.task_action_on_blocking_instances = ::std::option::Option::Some(input);
        self
    }
    /// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
    /// <ul>
    /// <li>
    /// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
    /// <li>
    /// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
    /// </ul>
    pub fn set_task_action_on_blocking_instances(mut self, input: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>) -> Self {
        self.task_action_on_blocking_instances = input;
        self
    }
    /// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
    /// <ul>
    /// <li>
    /// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
    /// <li>
    /// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
    /// </ul>
    pub fn get_task_action_on_blocking_instances(&self) -> &::std::option::Option<crate::types::TaskActionOnBlockingInstances> {
        &self.task_action_on_blocking_instances
    }
    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 [`StartCapacityTaskOutput`](crate::operation::start_capacity_task::StartCapacityTaskOutput).
    pub fn build(self) -> crate::operation::start_capacity_task::StartCapacityTaskOutput {
        crate::operation::start_capacity_task::StartCapacityTaskOutput {
            capacity_task_id: self.capacity_task_id,
            outpost_id: self.outpost_id,
            order_id: self.order_id,
            asset_id: self.asset_id,
            requested_instance_pools: self.requested_instance_pools,
            instances_to_exclude: self.instances_to_exclude,
            dry_run: self.dry_run.unwrap_or_default(),
            capacity_task_status: self.capacity_task_status,
            failed: self.failed,
            creation_date: self.creation_date,
            completion_date: self.completion_date,
            last_modified_date: self.last_modified_date,
            task_action_on_blocking_instances: self.task_action_on_blocking_instances,
            _request_id: self._request_id,
        }
    }
}