aws-sdk-batch 1.124.0

AWS SDK for AWS Batch
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 CreateQuotaShareInput {
    /// <p>The name of the quota share. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
    pub quota_share_name: ::std::option::Option<::std::string::String>,
    /// <p>The Batch job queue associated with the quota share. This can be the job queue name or ARN. A job queue must be in the <code>VALID</code> state before you can associate it with a quota share.</p>
    pub job_queue: ::std::option::Option<::std::string::String>,
    /// <p>A list that specifies the quantity and type of compute capacity allocated to the quota share.</p>
    pub capacity_limits: ::std::option::Option<::std::vec::Vec<crate::types::QuotaShareCapacityLimit>>,
    /// <p>Specifies whether a quota share reserves, lends, or both lends and borrows idle compute capacity.</p>
    pub resource_sharing_configuration: ::std::option::Option<crate::types::QuotaShareResourceSharingConfiguration>,
    /// <p>Specifies the preemption behavior for jobs in a quota share.</p>
    pub preemption_configuration: ::std::option::Option<crate::types::QuotaSharePreemptionConfiguration>,
    /// <p>The state of the quota share. If the quota share is <code>ENABLED</code>, it is able to accept jobs. If the quota share is <code>DISABLED</code>, new jobs won't be accepted but jobs already submitted can finish. The default state is <code>ENABLED</code>.</p>
    pub state: ::std::option::Option<crate::types::QuotaShareState>,
    /// <p>The tags that you apply to the quota share to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateQuotaShareInput {
    /// <p>The name of the quota share. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
    pub fn quota_share_name(&self) -> ::std::option::Option<&str> {
        self.quota_share_name.as_deref()
    }
    /// <p>The Batch job queue associated with the quota share. This can be the job queue name or ARN. A job queue must be in the <code>VALID</code> state before you can associate it with a quota share.</p>
    pub fn job_queue(&self) -> ::std::option::Option<&str> {
        self.job_queue.as_deref()
    }
    /// <p>A list that specifies the quantity and type of compute capacity allocated to the quota share.</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 `.capacity_limits.is_none()`.
    pub fn capacity_limits(&self) -> &[crate::types::QuotaShareCapacityLimit] {
        self.capacity_limits.as_deref().unwrap_or_default()
    }
    /// <p>Specifies whether a quota share reserves, lends, or both lends and borrows idle compute capacity.</p>
    pub fn resource_sharing_configuration(&self) -> ::std::option::Option<&crate::types::QuotaShareResourceSharingConfiguration> {
        self.resource_sharing_configuration.as_ref()
    }
    /// <p>Specifies the preemption behavior for jobs in a quota share.</p>
    pub fn preemption_configuration(&self) -> ::std::option::Option<&crate::types::QuotaSharePreemptionConfiguration> {
        self.preemption_configuration.as_ref()
    }
    /// <p>The state of the quota share. If the quota share is <code>ENABLED</code>, it is able to accept jobs. If the quota share is <code>DISABLED</code>, new jobs won't be accepted but jobs already submitted can finish. The default state is <code>ENABLED</code>.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::QuotaShareState> {
        self.state.as_ref()
    }
    /// <p>The tags that you apply to the quota share to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateQuotaShareInput {
    /// Creates a new builder-style object to manufacture [`CreateQuotaShareInput`](crate::operation::create_quota_share::CreateQuotaShareInput).
    pub fn builder() -> crate::operation::create_quota_share::builders::CreateQuotaShareInputBuilder {
        crate::operation::create_quota_share::builders::CreateQuotaShareInputBuilder::default()
    }
}

/// A builder for [`CreateQuotaShareInput`](crate::operation::create_quota_share::CreateQuotaShareInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateQuotaShareInputBuilder {
    pub(crate) quota_share_name: ::std::option::Option<::std::string::String>,
    pub(crate) job_queue: ::std::option::Option<::std::string::String>,
    pub(crate) capacity_limits: ::std::option::Option<::std::vec::Vec<crate::types::QuotaShareCapacityLimit>>,
    pub(crate) resource_sharing_configuration: ::std::option::Option<crate::types::QuotaShareResourceSharingConfiguration>,
    pub(crate) preemption_configuration: ::std::option::Option<crate::types::QuotaSharePreemptionConfiguration>,
    pub(crate) state: ::std::option::Option<crate::types::QuotaShareState>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateQuotaShareInputBuilder {
    /// <p>The name of the quota share. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
    /// This field is required.
    pub fn quota_share_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.quota_share_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the quota share. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
    pub fn set_quota_share_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.quota_share_name = input;
        self
    }
    /// <p>The name of the quota share. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
    pub fn get_quota_share_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.quota_share_name
    }
    /// <p>The Batch job queue associated with the quota share. This can be the job queue name or ARN. A job queue must be in the <code>VALID</code> state before you can associate it with a quota share.</p>
    /// This field is required.
    pub fn job_queue(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_queue = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Batch job queue associated with the quota share. This can be the job queue name or ARN. A job queue must be in the <code>VALID</code> state before you can associate it with a quota share.</p>
    pub fn set_job_queue(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_queue = input;
        self
    }
    /// <p>The Batch job queue associated with the quota share. This can be the job queue name or ARN. A job queue must be in the <code>VALID</code> state before you can associate it with a quota share.</p>
    pub fn get_job_queue(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_queue
    }
    /// Appends an item to `capacity_limits`.
    ///
    /// To override the contents of this collection use [`set_capacity_limits`](Self::set_capacity_limits).
    ///
    /// <p>A list that specifies the quantity and type of compute capacity allocated to the quota share.</p>
    pub fn capacity_limits(mut self, input: crate::types::QuotaShareCapacityLimit) -> Self {
        let mut v = self.capacity_limits.unwrap_or_default();
        v.push(input);
        self.capacity_limits = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list that specifies the quantity and type of compute capacity allocated to the quota share.</p>
    pub fn set_capacity_limits(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::QuotaShareCapacityLimit>>) -> Self {
        self.capacity_limits = input;
        self
    }
    /// <p>A list that specifies the quantity and type of compute capacity allocated to the quota share.</p>
    pub fn get_capacity_limits(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::QuotaShareCapacityLimit>> {
        &self.capacity_limits
    }
    /// <p>Specifies whether a quota share reserves, lends, or both lends and borrows idle compute capacity.</p>
    /// This field is required.
    pub fn resource_sharing_configuration(mut self, input: crate::types::QuotaShareResourceSharingConfiguration) -> Self {
        self.resource_sharing_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether a quota share reserves, lends, or both lends and borrows idle compute capacity.</p>
    pub fn set_resource_sharing_configuration(mut self, input: ::std::option::Option<crate::types::QuotaShareResourceSharingConfiguration>) -> Self {
        self.resource_sharing_configuration = input;
        self
    }
    /// <p>Specifies whether a quota share reserves, lends, or both lends and borrows idle compute capacity.</p>
    pub fn get_resource_sharing_configuration(&self) -> &::std::option::Option<crate::types::QuotaShareResourceSharingConfiguration> {
        &self.resource_sharing_configuration
    }
    /// <p>Specifies the preemption behavior for jobs in a quota share.</p>
    /// This field is required.
    pub fn preemption_configuration(mut self, input: crate::types::QuotaSharePreemptionConfiguration) -> Self {
        self.preemption_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the preemption behavior for jobs in a quota share.</p>
    pub fn set_preemption_configuration(mut self, input: ::std::option::Option<crate::types::QuotaSharePreemptionConfiguration>) -> Self {
        self.preemption_configuration = input;
        self
    }
    /// <p>Specifies the preemption behavior for jobs in a quota share.</p>
    pub fn get_preemption_configuration(&self) -> &::std::option::Option<crate::types::QuotaSharePreemptionConfiguration> {
        &self.preemption_configuration
    }
    /// <p>The state of the quota share. If the quota share is <code>ENABLED</code>, it is able to accept jobs. If the quota share is <code>DISABLED</code>, new jobs won't be accepted but jobs already submitted can finish. The default state is <code>ENABLED</code>.</p>
    pub fn state(mut self, input: crate::types::QuotaShareState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the quota share. If the quota share is <code>ENABLED</code>, it is able to accept jobs. If the quota share is <code>DISABLED</code>, new jobs won't be accepted but jobs already submitted can finish. The default state is <code>ENABLED</code>.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::QuotaShareState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the quota share. If the quota share is <code>ENABLED</code>, it is able to accept jobs. If the quota share is <code>DISABLED</code>, new jobs won't be accepted but jobs already submitted can finish. The default state is <code>ENABLED</code>.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::QuotaShareState> {
        &self.state
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags that you apply to the quota share to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags that you apply to the quota share to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</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
    }
    /// <p>The tags that you apply to the quota share to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateQuotaShareInput`](crate::operation::create_quota_share::CreateQuotaShareInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_quota_share::CreateQuotaShareInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_quota_share::CreateQuotaShareInput {
            quota_share_name: self.quota_share_name,
            job_queue: self.job_queue,
            capacity_limits: self.capacity_limits,
            resource_sharing_configuration: self.resource_sharing_configuration,
            preemption_configuration: self.preemption_configuration,
            state: self.state,
            tags: self.tags,
        })
    }
}