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 StartCapacityTaskInput {
    /// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
    pub outpost_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
    pub order_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the Outpost 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>The instance pools specified in the capacity task.</p>
    pub instance_pools: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>,
    /// <p>List of user-specified running 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>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
    pub dry_run: ::std::option::Option<bool>,
    /// <p>Specify one of the following options 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>,
}
impl StartCapacityTaskInput {
    /// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
    pub fn outpost_identifier(&self) -> ::std::option::Option<&str> {
        self.outpost_identifier.as_deref()
    }
    /// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
    pub fn order_id(&self) -> ::std::option::Option<&str> {
        self.order_id.as_deref()
    }
    /// <p>The ID of the Outpost 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>The instance pools specified in the 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 `.instance_pools.is_none()`.
    pub fn instance_pools(&self) -> &[crate::types::InstanceTypeCapacity] {
        self.instance_pools.as_deref().unwrap_or_default()
    }
    /// <p>List of user-specified running 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>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
    pub fn dry_run(&self) -> ::std::option::Option<bool> {
        self.dry_run
    }
    /// <p>Specify one of the following options 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 StartCapacityTaskInput {
    /// Creates a new builder-style object to manufacture [`StartCapacityTaskInput`](crate::operation::start_capacity_task::StartCapacityTaskInput).
    pub fn builder() -> crate::operation::start_capacity_task::builders::StartCapacityTaskInputBuilder {
        crate::operation::start_capacity_task::builders::StartCapacityTaskInputBuilder::default()
    }
}

/// A builder for [`StartCapacityTaskInput`](crate::operation::start_capacity_task::StartCapacityTaskInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartCapacityTaskInputBuilder {
    pub(crate) outpost_identifier: ::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) 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) task_action_on_blocking_instances: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>,
}
impl StartCapacityTaskInputBuilder {
    /// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
    /// This field is required.
    pub fn outpost_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.outpost_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
    pub fn set_outpost_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.outpost_identifier = input;
        self
    }
    /// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
    pub fn get_outpost_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.outpost_identifier
    }
    /// <p>The ID of the Amazon Web Services Outposts order associated with the specified 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>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
    pub fn set_order_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.order_id = input;
        self
    }
    /// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
    pub fn get_order_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.order_id
    }
    /// <p>The ID of the Outpost 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 Outpost 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 Outpost 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 `instance_pools`.
    ///
    /// To override the contents of this collection use [`set_instance_pools`](Self::set_instance_pools).
    ///
    /// <p>The instance pools specified in the capacity task.</p>
    pub fn instance_pools(mut self, input: crate::types::InstanceTypeCapacity) -> Self {
        let mut v = self.instance_pools.unwrap_or_default();
        v.push(input);
        self.instance_pools = ::std::option::Option::Some(v);
        self
    }
    /// <p>The instance pools specified in the capacity task.</p>
    pub fn set_instance_pools(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>) -> Self {
        self.instance_pools = input;
        self
    }
    /// <p>The instance pools specified in the capacity task.</p>
    pub fn get_instance_pools(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>> {
        &self.instance_pools
    }
    /// <p>List of user-specified running 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>List of user-specified running 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>List of user-specified running 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>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
    pub fn dry_run(mut self, input: bool) -> Self {
        self.dry_run = ::std::option::Option::Some(input);
        self
    }
    /// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
        self.dry_run = input;
        self
    }
    /// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
        &self.dry_run
    }
    /// <p>Specify one of the following options 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>Specify one of the following options 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>Specify one of the following options 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
    }
    /// Consumes the builder and constructs a [`StartCapacityTaskInput`](crate::operation::start_capacity_task::StartCapacityTaskInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_capacity_task::StartCapacityTaskInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::start_capacity_task::StartCapacityTaskInput {
            outpost_identifier: self.outpost_identifier,
            order_id: self.order_id,
            asset_id: self.asset_id,
            instance_pools: self.instance_pools,
            instances_to_exclude: self.instances_to_exclude,
            dry_run: self.dry_run,
            task_action_on_blocking_instances: self.task_action_on_blocking_instances,
        })
    }
}