aws-sdk-batch 1.114.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 UpdateServiceEnvironmentInput {
    /// <p>The name or ARN of the service environment to update.</p>
    pub service_environment: ::std::option::Option<::std::string::String>,
    /// <p>The state of the service environment.</p>
    pub state: ::std::option::Option<crate::types::ServiceEnvironmentState>,
    /// <p>The capacity limits for the service environment. This defines the maximum resources that can be used by service jobs in this environment.</p>
    pub capacity_limits: ::std::option::Option<::std::vec::Vec<crate::types::CapacityLimit>>,
}
impl UpdateServiceEnvironmentInput {
    /// <p>The name or ARN of the service environment to update.</p>
    pub fn service_environment(&self) -> ::std::option::Option<&str> {
        self.service_environment.as_deref()
    }
    /// <p>The state of the service environment.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::ServiceEnvironmentState> {
        self.state.as_ref()
    }
    /// <p>The capacity limits for the service environment. This defines the maximum resources that can be used by service jobs in this environment.</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::CapacityLimit] {
        self.capacity_limits.as_deref().unwrap_or_default()
    }
}
impl UpdateServiceEnvironmentInput {
    /// Creates a new builder-style object to manufacture [`UpdateServiceEnvironmentInput`](crate::operation::update_service_environment::UpdateServiceEnvironmentInput).
    pub fn builder() -> crate::operation::update_service_environment::builders::UpdateServiceEnvironmentInputBuilder {
        crate::operation::update_service_environment::builders::UpdateServiceEnvironmentInputBuilder::default()
    }
}

/// A builder for [`UpdateServiceEnvironmentInput`](crate::operation::update_service_environment::UpdateServiceEnvironmentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateServiceEnvironmentInputBuilder {
    pub(crate) service_environment: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::ServiceEnvironmentState>,
    pub(crate) capacity_limits: ::std::option::Option<::std::vec::Vec<crate::types::CapacityLimit>>,
}
impl UpdateServiceEnvironmentInputBuilder {
    /// <p>The name or ARN of the service environment to update.</p>
    /// This field is required.
    pub fn service_environment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_environment = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name or ARN of the service environment to update.</p>
    pub fn set_service_environment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_environment = input;
        self
    }
    /// <p>The name or ARN of the service environment to update.</p>
    pub fn get_service_environment(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_environment
    }
    /// <p>The state of the service environment.</p>
    pub fn state(mut self, input: crate::types::ServiceEnvironmentState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the service environment.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ServiceEnvironmentState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the service environment.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::ServiceEnvironmentState> {
        &self.state
    }
    /// Appends an item to `capacity_limits`.
    ///
    /// To override the contents of this collection use [`set_capacity_limits`](Self::set_capacity_limits).
    ///
    /// <p>The capacity limits for the service environment. This defines the maximum resources that can be used by service jobs in this environment.</p>
    pub fn capacity_limits(mut self, input: crate::types::CapacityLimit) -> Self {
        let mut v = self.capacity_limits.unwrap_or_default();
        v.push(input);
        self.capacity_limits = ::std::option::Option::Some(v);
        self
    }
    /// <p>The capacity limits for the service environment. This defines the maximum resources that can be used by service jobs in this environment.</p>
    pub fn set_capacity_limits(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CapacityLimit>>) -> Self {
        self.capacity_limits = input;
        self
    }
    /// <p>The capacity limits for the service environment. This defines the maximum resources that can be used by service jobs in this environment.</p>
    pub fn get_capacity_limits(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CapacityLimit>> {
        &self.capacity_limits
    }
    /// Consumes the builder and constructs a [`UpdateServiceEnvironmentInput`](crate::operation::update_service_environment::UpdateServiceEnvironmentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_service_environment::UpdateServiceEnvironmentInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_service_environment::UpdateServiceEnvironmentInput {
            service_environment: self.service_environment,
            state: self.state,
            capacity_limits: self.capacity_limits,
        })
    }
}