aws-sdk-batch 1.119.0

AWS SDK for AWS Batch
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains the parameters for <code>UpdateSchedulingPolicy</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateSchedulingPolicyInput {
    /// <p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The quota share scheduling policy details. Once set during creation, a quotaSharePolicy cannot be removed or changed to a fairsharePolicy.</p>
    pub quota_share_policy: ::std::option::Option<crate::types::QuotaSharePolicy>,
    /// <p>The fair-share policy scheduling details. Once set during creation, a fairsharePolicy cannot be removed or changed to a quotaSharePolicy.</p>
    pub fairshare_policy: ::std::option::Option<crate::types::FairsharePolicy>,
}
impl UpdateSchedulingPolicyInput {
    /// <p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The quota share scheduling policy details. Once set during creation, a quotaSharePolicy cannot be removed or changed to a fairsharePolicy.</p>
    pub fn quota_share_policy(&self) -> ::std::option::Option<&crate::types::QuotaSharePolicy> {
        self.quota_share_policy.as_ref()
    }
    /// <p>The fair-share policy scheduling details. Once set during creation, a fairsharePolicy cannot be removed or changed to a quotaSharePolicy.</p>
    pub fn fairshare_policy(&self) -> ::std::option::Option<&crate::types::FairsharePolicy> {
        self.fairshare_policy.as_ref()
    }
}
impl UpdateSchedulingPolicyInput {
    /// Creates a new builder-style object to manufacture [`UpdateSchedulingPolicyInput`](crate::operation::update_scheduling_policy::UpdateSchedulingPolicyInput).
    pub fn builder() -> crate::operation::update_scheduling_policy::builders::UpdateSchedulingPolicyInputBuilder {
        crate::operation::update_scheduling_policy::builders::UpdateSchedulingPolicyInputBuilder::default()
    }
}

/// A builder for [`UpdateSchedulingPolicyInput`](crate::operation::update_scheduling_policy::UpdateSchedulingPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSchedulingPolicyInputBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) quota_share_policy: ::std::option::Option<crate::types::QuotaSharePolicy>,
    pub(crate) fairshare_policy: ::std::option::Option<crate::types::FairsharePolicy>,
}
impl UpdateSchedulingPolicyInputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The quota share scheduling policy details. Once set during creation, a quotaSharePolicy cannot be removed or changed to a fairsharePolicy.</p>
    pub fn quota_share_policy(mut self, input: crate::types::QuotaSharePolicy) -> Self {
        self.quota_share_policy = ::std::option::Option::Some(input);
        self
    }
    /// <p>The quota share scheduling policy details. Once set during creation, a quotaSharePolicy cannot be removed or changed to a fairsharePolicy.</p>
    pub fn set_quota_share_policy(mut self, input: ::std::option::Option<crate::types::QuotaSharePolicy>) -> Self {
        self.quota_share_policy = input;
        self
    }
    /// <p>The quota share scheduling policy details. Once set during creation, a quotaSharePolicy cannot be removed or changed to a fairsharePolicy.</p>
    pub fn get_quota_share_policy(&self) -> &::std::option::Option<crate::types::QuotaSharePolicy> {
        &self.quota_share_policy
    }
    /// <p>The fair-share policy scheduling details. Once set during creation, a fairsharePolicy cannot be removed or changed to a quotaSharePolicy.</p>
    pub fn fairshare_policy(mut self, input: crate::types::FairsharePolicy) -> Self {
        self.fairshare_policy = ::std::option::Option::Some(input);
        self
    }
    /// <p>The fair-share policy scheduling details. Once set during creation, a fairsharePolicy cannot be removed or changed to a quotaSharePolicy.</p>
    pub fn set_fairshare_policy(mut self, input: ::std::option::Option<crate::types::FairsharePolicy>) -> Self {
        self.fairshare_policy = input;
        self
    }
    /// <p>The fair-share policy scheduling details. Once set during creation, a fairsharePolicy cannot be removed or changed to a quotaSharePolicy.</p>
    pub fn get_fairshare_policy(&self) -> &::std::option::Option<crate::types::FairsharePolicy> {
        &self.fairshare_policy
    }
    /// Consumes the builder and constructs a [`UpdateSchedulingPolicyInput`](crate::operation::update_scheduling_policy::UpdateSchedulingPolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_scheduling_policy::UpdateSchedulingPolicyInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_scheduling_policy::UpdateSchedulingPolicyInput {
            arn: self.arn,
            quota_share_policy: self.quota_share_policy,
            fairshare_policy: self.fairshare_policy,
        })
    }
}