aws-sdk-gamelift 0.26.0

AWS SDK for Amazon GameLift
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 UpdateFleetAttributesInput {
    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
    #[doc(hidden)]
    pub fleet_id: std::option::Option<std::string::String>,
    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
    #[doc(hidden)]
    pub name: std::option::Option<std::string::String>,
    /// <p>A human-readable description of a fleet.</p>
    #[doc(hidden)]
    pub description: std::option::Option<std::string::String>,
    /// <p>The game session protection policy to apply to all new instances created in this fleet. Instances that already exist are not affected. You can set protection for individual instances using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html">UpdateGameSession</a> .</p>
    /// <ul>
    /// <li> <p> <b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p> </li>
    /// <li> <p> <b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p> </li>
    /// </ul>
    #[doc(hidden)]
    pub new_game_session_protection_policy: std::option::Option<crate::types::ProtectionPolicy>,
    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time. </p>
    #[doc(hidden)]
    pub resource_creation_limit_policy:
        std::option::Option<crate::types::ResourceCreationLimitPolicy>,
    /// <p>The name of a metric group to add this fleet to. Use a metric group in Amazon CloudWatch to aggregate the metrics from multiple fleets. Provide an existing metric group name, or create a new metric group by providing a new name. A fleet can only be in one metric group at a time.</p>
    #[doc(hidden)]
    pub metric_groups: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>GameLift Anywhere configuration options.</p>
    #[doc(hidden)]
    pub anywhere_configuration: std::option::Option<crate::types::AnywhereConfiguration>,
}
impl UpdateFleetAttributesInput {
    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
    pub fn fleet_id(&self) -> std::option::Option<&str> {
        self.fleet_id.as_deref()
    }
    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
    pub fn name(&self) -> std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A human-readable description of a fleet.</p>
    pub fn description(&self) -> std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The game session protection policy to apply to all new instances created in this fleet. Instances that already exist are not affected. You can set protection for individual instances using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html">UpdateGameSession</a> .</p>
    /// <ul>
    /// <li> <p> <b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p> </li>
    /// <li> <p> <b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p> </li>
    /// </ul>
    pub fn new_game_session_protection_policy(
        &self,
    ) -> std::option::Option<&crate::types::ProtectionPolicy> {
        self.new_game_session_protection_policy.as_ref()
    }
    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time. </p>
    pub fn resource_creation_limit_policy(
        &self,
    ) -> std::option::Option<&crate::types::ResourceCreationLimitPolicy> {
        self.resource_creation_limit_policy.as_ref()
    }
    /// <p>The name of a metric group to add this fleet to. Use a metric group in Amazon CloudWatch to aggregate the metrics from multiple fleets. Provide an existing metric group name, or create a new metric group by providing a new name. A fleet can only be in one metric group at a time.</p>
    pub fn metric_groups(&self) -> std::option::Option<&[std::string::String]> {
        self.metric_groups.as_deref()
    }
    /// <p>GameLift Anywhere configuration options.</p>
    pub fn anywhere_configuration(
        &self,
    ) -> std::option::Option<&crate::types::AnywhereConfiguration> {
        self.anywhere_configuration.as_ref()
    }
}
impl UpdateFleetAttributesInput {
    /// Creates a new builder-style object to manufacture [`UpdateFleetAttributesInput`](crate::operation::update_fleet_attributes::UpdateFleetAttributesInput).
    pub fn builder(
    ) -> crate::operation::update_fleet_attributes::builders::UpdateFleetAttributesInputBuilder
    {
        crate::operation::update_fleet_attributes::builders::UpdateFleetAttributesInputBuilder::default()
    }
}

/// A builder for [`UpdateFleetAttributesInput`](crate::operation::update_fleet_attributes::UpdateFleetAttributesInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct UpdateFleetAttributesInputBuilder {
    pub(crate) fleet_id: std::option::Option<std::string::String>,
    pub(crate) name: std::option::Option<std::string::String>,
    pub(crate) description: std::option::Option<std::string::String>,
    pub(crate) new_game_session_protection_policy:
        std::option::Option<crate::types::ProtectionPolicy>,
    pub(crate) resource_creation_limit_policy:
        std::option::Option<crate::types::ResourceCreationLimitPolicy>,
    pub(crate) metric_groups: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) anywhere_configuration: std::option::Option<crate::types::AnywhereConfiguration>,
}
impl UpdateFleetAttributesInputBuilder {
    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
    pub fn fleet_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.fleet_id = Some(input.into());
        self
    }
    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
    pub fn set_fleet_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.fleet_id = input;
        self
    }
    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
    pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
        self.name = Some(input.into());
        self
    }
    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
    pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>A human-readable description of a fleet.</p>
    pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
        self.description = Some(input.into());
        self
    }
    /// <p>A human-readable description of a fleet.</p>
    pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The game session protection policy to apply to all new instances created in this fleet. Instances that already exist are not affected. You can set protection for individual instances using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html">UpdateGameSession</a> .</p>
    /// <ul>
    /// <li> <p> <b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p> </li>
    /// <li> <p> <b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p> </li>
    /// </ul>
    pub fn new_game_session_protection_policy(
        mut self,
        input: crate::types::ProtectionPolicy,
    ) -> Self {
        self.new_game_session_protection_policy = Some(input);
        self
    }
    /// <p>The game session protection policy to apply to all new instances created in this fleet. Instances that already exist are not affected. You can set protection for individual instances using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html">UpdateGameSession</a> .</p>
    /// <ul>
    /// <li> <p> <b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p> </li>
    /// <li> <p> <b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p> </li>
    /// </ul>
    pub fn set_new_game_session_protection_policy(
        mut self,
        input: std::option::Option<crate::types::ProtectionPolicy>,
    ) -> Self {
        self.new_game_session_protection_policy = input;
        self
    }
    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time. </p>
    pub fn resource_creation_limit_policy(
        mut self,
        input: crate::types::ResourceCreationLimitPolicy,
    ) -> Self {
        self.resource_creation_limit_policy = Some(input);
        self
    }
    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time. </p>
    pub fn set_resource_creation_limit_policy(
        mut self,
        input: std::option::Option<crate::types::ResourceCreationLimitPolicy>,
    ) -> Self {
        self.resource_creation_limit_policy = input;
        self
    }
    /// Appends an item to `metric_groups`.
    ///
    /// To override the contents of this collection use [`set_metric_groups`](Self::set_metric_groups).
    ///
    /// <p>The name of a metric group to add this fleet to. Use a metric group in Amazon CloudWatch to aggregate the metrics from multiple fleets. Provide an existing metric group name, or create a new metric group by providing a new name. A fleet can only be in one metric group at a time.</p>
    pub fn metric_groups(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.metric_groups.unwrap_or_default();
        v.push(input.into());
        self.metric_groups = Some(v);
        self
    }
    /// <p>The name of a metric group to add this fleet to. Use a metric group in Amazon CloudWatch to aggregate the metrics from multiple fleets. Provide an existing metric group name, or create a new metric group by providing a new name. A fleet can only be in one metric group at a time.</p>
    pub fn set_metric_groups(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.metric_groups = input;
        self
    }
    /// <p>GameLift Anywhere configuration options.</p>
    pub fn anywhere_configuration(mut self, input: crate::types::AnywhereConfiguration) -> Self {
        self.anywhere_configuration = Some(input);
        self
    }
    /// <p>GameLift Anywhere configuration options.</p>
    pub fn set_anywhere_configuration(
        mut self,
        input: std::option::Option<crate::types::AnywhereConfiguration>,
    ) -> Self {
        self.anywhere_configuration = input;
        self
    }
    /// Consumes the builder and constructs a [`UpdateFleetAttributesInput`](crate::operation::update_fleet_attributes::UpdateFleetAttributesInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::update_fleet_attributes::UpdateFleetAttributesInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::update_fleet_attributes::UpdateFleetAttributesInput {
                fleet_id: self.fleet_id,
                name: self.name,
                description: self.description,
                new_game_session_protection_policy: self.new_game_session_protection_policy,
                resource_creation_limit_policy: self.resource_creation_limit_policy,
                metric_groups: self.metric_groups,
                anywhere_configuration: self.anywhere_configuration,
            },
        )
    }
}