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 GetAliasOutput {
    /// <p>The name of the alias.</p>
    pub alias_name: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the alias.</p>
    pub alias_arn: ::std::string::String,
    /// <p>The type of the alias.</p>
    pub r#type: crate::types::AliasType,
    /// <p>The URL of the alias.</p>
    pub url: ::std::option::Option<::std::string::String>,
    /// <p>The traffic routing configuration.</p>
    pub routing_config: ::std::option::Option<::std::vec::Vec<crate::types::RoutingConfigEntry>>,
    /// <p>The gradual rollout settings.</p>
    pub gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
    /// <p>The current state of the gradual rollout.</p>
    pub gradual_rollout_state: ::std::option::Option<crate::types::GradualRolloutState>,
    /// <p>The time at which the alias was created. The value is in ISO-8601 format.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The time at which the alias was last updated. The value is in ISO-8601 format.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetAliasOutput {
    /// <p>The name of the alias.</p>
    pub fn alias_name(&self) -> &str {
        use std::ops::Deref;
        self.alias_name.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the alias.</p>
    pub fn alias_arn(&self) -> &str {
        use std::ops::Deref;
        self.alias_arn.deref()
    }
    /// <p>The type of the alias.</p>
    pub fn r#type(&self) -> &crate::types::AliasType {
        &self.r#type
    }
    /// <p>The URL of the alias.</p>
    pub fn url(&self) -> ::std::option::Option<&str> {
        self.url.as_deref()
    }
    /// <p>The traffic routing configuration.</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.</p>
    pub fn gradual_rollout_config(&self) -> ::std::option::Option<&crate::types::GradualRolloutConfig> {
        self.gradual_rollout_config.as_ref()
    }
    /// <p>The current state of the gradual rollout.</p>
    pub fn gradual_rollout_state(&self) -> ::std::option::Option<&crate::types::GradualRolloutState> {
        self.gradual_rollout_state.as_ref()
    }
    /// <p>The time at which the alias was created. The value is in ISO-8601 format.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The time at which the alias was last updated. The value is in ISO-8601 format.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetAliasOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAliasOutput {
    /// Creates a new builder-style object to manufacture [`GetAliasOutput`](crate::operation::get_alias::GetAliasOutput).
    pub fn builder() -> crate::operation::get_alias::builders::GetAliasOutputBuilder {
        crate::operation::get_alias::builders::GetAliasOutputBuilder::default()
    }
}

/// A builder for [`GetAliasOutput`](crate::operation::get_alias::GetAliasOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAliasOutputBuilder {
    pub(crate) alias_name: ::std::option::Option<::std::string::String>,
    pub(crate) alias_arn: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::AliasType>,
    pub(crate) url: ::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>,
    pub(crate) gradual_rollout_state: ::std::option::Option<crate::types::GradualRolloutState>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetAliasOutputBuilder {
    /// <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
    }
    /// <p>The Amazon Resource Name (ARN) of the alias.</p>
    /// This field is required.
    pub fn alias_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.alias_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the alias.</p>
    pub fn set_alias_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.alias_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the alias.</p>
    pub fn get_alias_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.alias_arn
    }
    /// <p>The type of the alias.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::AliasType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the alias.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::AliasType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of the alias.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::AliasType> {
        &self.r#type
    }
    /// <p>The URL of the alias.</p>
    pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL of the alias.</p>
    pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.url = input;
        self
    }
    /// <p>The URL of the alias.</p>
    pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.url
    }
    /// 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.</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.</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.</p>
    pub fn get_routing_config(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RoutingConfigEntry>> {
        &self.routing_config
    }
    /// <p>The gradual rollout settings.</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.</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.</p>
    pub fn get_gradual_rollout_config(&self) -> &::std::option::Option<crate::types::GradualRolloutConfig> {
        &self.gradual_rollout_config
    }
    /// <p>The current state of the gradual rollout.</p>
    pub fn gradual_rollout_state(mut self, input: crate::types::GradualRolloutState) -> Self {
        self.gradual_rollout_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current state of the gradual rollout.</p>
    pub fn set_gradual_rollout_state(mut self, input: ::std::option::Option<crate::types::GradualRolloutState>) -> Self {
        self.gradual_rollout_state = input;
        self
    }
    /// <p>The current state of the gradual rollout.</p>
    pub fn get_gradual_rollout_state(&self) -> &::std::option::Option<crate::types::GradualRolloutState> {
        &self.gradual_rollout_state
    }
    /// <p>The time at which the alias was created. The value is in ISO-8601 format.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the alias was created. The value is in ISO-8601 format.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The time at which the alias was created. The value is in ISO-8601 format.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The time at which the alias was last updated. The value is in ISO-8601 format.</p>
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the alias was last updated. The value is in ISO-8601 format.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The time at which the alias was last updated. The value is in ISO-8601 format.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetAliasOutput`](crate::operation::get_alias::GetAliasOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`alias_name`](crate::operation::get_alias::builders::GetAliasOutputBuilder::alias_name)
    /// - [`alias_arn`](crate::operation::get_alias::builders::GetAliasOutputBuilder::alias_arn)
    /// - [`r#type`](crate::operation::get_alias::builders::GetAliasOutputBuilder::type)
    /// - [`created_at`](crate::operation::get_alias::builders::GetAliasOutputBuilder::created_at)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_alias::GetAliasOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_alias::GetAliasOutput {
            alias_name: self.alias_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "alias_name",
                    "alias_name was not specified but it is required when building GetAliasOutput",
                )
            })?,
            alias_arn: self.alias_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "alias_arn",
                    "alias_arn was not specified but it is required when building GetAliasOutput",
                )
            })?,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building GetAliasOutput",
                )
            })?,
            url: self.url,
            routing_config: self.routing_config,
            gradual_rollout_config: self.gradual_rollout_config,
            gradual_rollout_state: self.gradual_rollout_state,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building GetAliasOutput",
                )
            })?,
            updated_at: self.updated_at,
            _request_id: self._request_id,
        })
    }
}