aws-sdk-sagemaker 1.189.0

AWS SDK for Amazon SageMaker Service
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 CreateComputeQuotaInput {
    /// <p>Name to the compute allocation definition.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>Description of the compute allocation definition.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>ARN of the cluster.</p>
    pub cluster_arn: ::std::option::Option<::std::string::String>,
    /// <p>Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.</p>
    pub compute_quota_config: ::std::option::Option<crate::types::ComputeQuotaConfig>,
    /// <p>The target entity to allocate compute resources to.</p>
    pub compute_quota_target: ::std::option::Option<crate::types::ComputeQuotaTarget>,
    /// <p>The state of the compute allocation being described. Use to enable or disable compute allocation.</p>
    /// <p>Default is <code>Enabled</code>.</p>
    pub activation_state: ::std::option::Option<crate::types::ActivationState>,
    /// <p>Tags of the compute allocation definition.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateComputeQuotaInput {
    /// <p>Name to the compute allocation definition.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>Description of the compute allocation definition.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>ARN of the cluster.</p>
    pub fn cluster_arn(&self) -> ::std::option::Option<&str> {
        self.cluster_arn.as_deref()
    }
    /// <p>Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.</p>
    pub fn compute_quota_config(&self) -> ::std::option::Option<&crate::types::ComputeQuotaConfig> {
        self.compute_quota_config.as_ref()
    }
    /// <p>The target entity to allocate compute resources to.</p>
    pub fn compute_quota_target(&self) -> ::std::option::Option<&crate::types::ComputeQuotaTarget> {
        self.compute_quota_target.as_ref()
    }
    /// <p>The state of the compute allocation being described. Use to enable or disable compute allocation.</p>
    /// <p>Default is <code>Enabled</code>.</p>
    pub fn activation_state(&self) -> ::std::option::Option<&crate::types::ActivationState> {
        self.activation_state.as_ref()
    }
    /// <p>Tags of the compute allocation definition.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl CreateComputeQuotaInput {
    /// Creates a new builder-style object to manufacture [`CreateComputeQuotaInput`](crate::operation::create_compute_quota::CreateComputeQuotaInput).
    pub fn builder() -> crate::operation::create_compute_quota::builders::CreateComputeQuotaInputBuilder {
        crate::operation::create_compute_quota::builders::CreateComputeQuotaInputBuilder::default()
    }
}

/// A builder for [`CreateComputeQuotaInput`](crate::operation::create_compute_quota::CreateComputeQuotaInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateComputeQuotaInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
    pub(crate) compute_quota_config: ::std::option::Option<crate::types::ComputeQuotaConfig>,
    pub(crate) compute_quota_target: ::std::option::Option<crate::types::ComputeQuotaTarget>,
    pub(crate) activation_state: ::std::option::Option<crate::types::ActivationState>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateComputeQuotaInputBuilder {
    /// <p>Name to the compute allocation definition.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Name to the compute allocation definition.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>Name to the compute allocation definition.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>Description of the compute allocation definition.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Description of the compute allocation definition.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>Description of the compute allocation definition.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>ARN of the cluster.</p>
    /// This field is required.
    pub fn cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>ARN of the cluster.</p>
    pub fn set_cluster_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_arn = input;
        self
    }
    /// <p>ARN of the cluster.</p>
    pub fn get_cluster_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_arn
    }
    /// <p>Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.</p>
    /// This field is required.
    pub fn compute_quota_config(mut self, input: crate::types::ComputeQuotaConfig) -> Self {
        self.compute_quota_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.</p>
    pub fn set_compute_quota_config(mut self, input: ::std::option::Option<crate::types::ComputeQuotaConfig>) -> Self {
        self.compute_quota_config = input;
        self
    }
    /// <p>Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.</p>
    pub fn get_compute_quota_config(&self) -> &::std::option::Option<crate::types::ComputeQuotaConfig> {
        &self.compute_quota_config
    }
    /// <p>The target entity to allocate compute resources to.</p>
    /// This field is required.
    pub fn compute_quota_target(mut self, input: crate::types::ComputeQuotaTarget) -> Self {
        self.compute_quota_target = ::std::option::Option::Some(input);
        self
    }
    /// <p>The target entity to allocate compute resources to.</p>
    pub fn set_compute_quota_target(mut self, input: ::std::option::Option<crate::types::ComputeQuotaTarget>) -> Self {
        self.compute_quota_target = input;
        self
    }
    /// <p>The target entity to allocate compute resources to.</p>
    pub fn get_compute_quota_target(&self) -> &::std::option::Option<crate::types::ComputeQuotaTarget> {
        &self.compute_quota_target
    }
    /// <p>The state of the compute allocation being described. Use to enable or disable compute allocation.</p>
    /// <p>Default is <code>Enabled</code>.</p>
    pub fn activation_state(mut self, input: crate::types::ActivationState) -> Self {
        self.activation_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the compute allocation being described. Use to enable or disable compute allocation.</p>
    /// <p>Default is <code>Enabled</code>.</p>
    pub fn set_activation_state(mut self, input: ::std::option::Option<crate::types::ActivationState>) -> Self {
        self.activation_state = input;
        self
    }
    /// <p>The state of the compute allocation being described. Use to enable or disable compute allocation.</p>
    /// <p>Default is <code>Enabled</code>.</p>
    pub fn get_activation_state(&self) -> &::std::option::Option<crate::types::ActivationState> {
        &self.activation_state
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Tags of the compute allocation definition.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Tags of the compute allocation definition.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Tags of the compute allocation definition.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateComputeQuotaInput`](crate::operation::create_compute_quota::CreateComputeQuotaInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_compute_quota::CreateComputeQuotaInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_compute_quota::CreateComputeQuotaInput {
            name: self.name,
            description: self.description,
            cluster_arn: self.cluster_arn,
            compute_quota_config: self.compute_quota_config,
            compute_quota_target: self.compute_quota_target,
            activation_state: self.activation_state,
            tags: self.tags,
        })
    }
}