aws-sdk-amplifygen3 1.0.0

AWS SDK for AWS Amplify Gen 3
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 UpdateAliasRoutingInput {
    /// <p>The name of the app.</p>
    pub app_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the environment.</p>
    pub environment_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the alias.</p>
    pub alias_name: ::std::option::Option<::std::string::String>,
    /// <p>The traffic routing configuration to apply to the alias.</p>
    pub routing_config: ::std::option::Option<::std::vec::Vec<crate::types::RoutingConfigEntry>>,
    /// <p>The gradual rollout settings to apply to the alias.</p>
    pub gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
}
impl UpdateAliasRoutingInput {
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> ::std::option::Option<&str> {
        self.app_name.as_deref()
    }
    /// <p>The name of the environment.</p>
    pub fn environment_name(&self) -> ::std::option::Option<&str> {
        self.environment_name.as_deref()
    }
    /// <p>The name of the alias.</p>
    pub fn alias_name(&self) -> ::std::option::Option<&str> {
        self.alias_name.as_deref()
    }
    /// <p>The traffic routing configuration to apply to the alias.</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 `.routing_config.is_none()`.
    pub fn routing_config(&self) -> &[crate::types::RoutingConfigEntry] {
        self.routing_config.as_deref().unwrap_or_default()
    }
    /// <p>The gradual rollout settings to apply to the alias.</p>
    pub fn gradual_rollout_config(&self) -> ::std::option::Option<&crate::types::GradualRolloutConfig> {
        self.gradual_rollout_config.as_ref()
    }
}
impl UpdateAliasRoutingInput {
    /// Creates a new builder-style object to manufacture [`UpdateAliasRoutingInput`](crate::operation::update_alias_routing::UpdateAliasRoutingInput).
    pub fn builder() -> crate::operation::update_alias_routing::builders::UpdateAliasRoutingInputBuilder {
        crate::operation::update_alias_routing::builders::UpdateAliasRoutingInputBuilder::default()
    }
}

/// A builder for [`UpdateAliasRoutingInput`](crate::operation::update_alias_routing::UpdateAliasRoutingInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateAliasRoutingInputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) alias_name: ::std::option::Option<::std::string::String>,
    pub(crate) routing_config: ::std::option::Option<::std::vec::Vec<crate::types::RoutingConfigEntry>>,
    pub(crate) gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
}
impl UpdateAliasRoutingInputBuilder {
    /// <p>The name of the app.</p>
    /// This field is required.
    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the app.</p>
    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_name = input;
        self
    }
    /// <p>The name of the app.</p>
    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_name
    }
    /// <p>The name of the environment.</p>
    /// This field is required.
    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the environment.</p>
    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_name = input;
        self
    }
    /// <p>The name of the environment.</p>
    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_name
    }
    /// <p>The name of the alias.</p>
    /// This field is required.
    pub fn alias_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.alias_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the alias.</p>
    pub fn set_alias_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.alias_name = input;
        self
    }
    /// <p>The name of the alias.</p>
    pub fn get_alias_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.alias_name
    }
    /// Appends an item to `routing_config`.
    ///
    /// To override the contents of this collection use [`set_routing_config`](Self::set_routing_config).
    ///
    /// <p>The traffic routing configuration to apply to the alias.</p>
    pub fn routing_config(mut self, input: crate::types::RoutingConfigEntry) -> Self {
        let mut v = self.routing_config.unwrap_or_default();
        v.push(input);
        self.routing_config = ::std::option::Option::Some(v);
        self
    }
    /// <p>The traffic routing configuration to apply to the alias.</p>
    pub fn set_routing_config(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RoutingConfigEntry>>) -> Self {
        self.routing_config = input;
        self
    }
    /// <p>The traffic routing configuration to apply to the alias.</p>
    pub fn get_routing_config(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RoutingConfigEntry>> {
        &self.routing_config
    }
    /// <p>The gradual rollout settings to apply to the alias.</p>
    pub fn gradual_rollout_config(mut self, input: crate::types::GradualRolloutConfig) -> Self {
        self.gradual_rollout_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The gradual rollout settings to apply to the alias.</p>
    pub fn set_gradual_rollout_config(mut self, input: ::std::option::Option<crate::types::GradualRolloutConfig>) -> Self {
        self.gradual_rollout_config = input;
        self
    }
    /// <p>The gradual rollout settings to apply to the alias.</p>
    pub fn get_gradual_rollout_config(&self) -> &::std::option::Option<crate::types::GradualRolloutConfig> {
        &self.gradual_rollout_config
    }
    /// Consumes the builder and constructs a [`UpdateAliasRoutingInput`](crate::operation::update_alias_routing::UpdateAliasRoutingInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_alias_routing::UpdateAliasRoutingInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_alias_routing::UpdateAliasRoutingInput {
            app_name: self.app_name,
            environment_name: self.environment_name,
            alias_name: self.alias_name,
            routing_config: self.routing_config,
            gradual_rollout_config: self.gradual_rollout_config,
        })
    }
}