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 GetAppOutput {
    /// <p>The name of the app.</p>
    pub app_name: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the app.</p>
    pub app_arn: ::std::string::String,
    /// <p>The source configuration for the app.</p>
    pub source_config: ::std::option::Option<crate::types::AppSourceConfig>,
    /// <p>The web hosting settings for the app.</p>
    pub web: ::std::option::Option<crate::types::AppWebConfig>,
    /// <p>The backend settings for the app. Present only when the app has a backend.</p>
    pub backend: ::std::option::Option<crate::types::AppBackend>,
    /// <p>A list of the app's AWS WAF configurations. Omitted when the app has no web ACL association.</p>
    pub waf_configs: ::std::option::Option<::std::vec::Vec<crate::types::WafConfig>>,
    /// <p>The time at which the app was created. The value is in ISO-8601 format.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The time at which the app 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 GetAppOutput {
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> &str {
        use std::ops::Deref;
        self.app_name.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the app.</p>
    pub fn app_arn(&self) -> &str {
        use std::ops::Deref;
        self.app_arn.deref()
    }
    /// <p>The source configuration for the app.</p>
    pub fn source_config(&self) -> ::std::option::Option<&crate::types::AppSourceConfig> {
        self.source_config.as_ref()
    }
    /// <p>The web hosting settings for the app.</p>
    pub fn web(&self) -> ::std::option::Option<&crate::types::AppWebConfig> {
        self.web.as_ref()
    }
    /// <p>The backend settings for the app. Present only when the app has a backend.</p>
    pub fn backend(&self) -> ::std::option::Option<&crate::types::AppBackend> {
        self.backend.as_ref()
    }
    /// <p>A list of the app's AWS WAF configurations. Omitted when the app has no web ACL association.</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 `.waf_configs.is_none()`.
    pub fn waf_configs(&self) -> &[crate::types::WafConfig] {
        self.waf_configs.as_deref().unwrap_or_default()
    }
    /// <p>The time at which the app 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 app 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 GetAppOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAppOutput {
    /// Creates a new builder-style object to manufacture [`GetAppOutput`](crate::operation::get_app::GetAppOutput).
    pub fn builder() -> crate::operation::get_app::builders::GetAppOutputBuilder {
        crate::operation::get_app::builders::GetAppOutputBuilder::default()
    }
}

/// A builder for [`GetAppOutput`](crate::operation::get_app::GetAppOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAppOutputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) app_arn: ::std::option::Option<::std::string::String>,
    pub(crate) source_config: ::std::option::Option<crate::types::AppSourceConfig>,
    pub(crate) web: ::std::option::Option<crate::types::AppWebConfig>,
    pub(crate) backend: ::std::option::Option<crate::types::AppBackend>,
    pub(crate) waf_configs: ::std::option::Option<::std::vec::Vec<crate::types::WafConfig>>,
    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 GetAppOutputBuilder {
    /// <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 Amazon Resource Name (ARN) of the app.</p>
    /// This field is required.
    pub fn app_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the app.</p>
    pub fn set_app_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the app.</p>
    pub fn get_app_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_arn
    }
    /// <p>The source configuration for the app.</p>
    pub fn source_config(mut self, input: crate::types::AppSourceConfig) -> Self {
        self.source_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source configuration for the app.</p>
    pub fn set_source_config(mut self, input: ::std::option::Option<crate::types::AppSourceConfig>) -> Self {
        self.source_config = input;
        self
    }
    /// <p>The source configuration for the app.</p>
    pub fn get_source_config(&self) -> &::std::option::Option<crate::types::AppSourceConfig> {
        &self.source_config
    }
    /// <p>The web hosting settings for the app.</p>
    pub fn web(mut self, input: crate::types::AppWebConfig) -> Self {
        self.web = ::std::option::Option::Some(input);
        self
    }
    /// <p>The web hosting settings for the app.</p>
    pub fn set_web(mut self, input: ::std::option::Option<crate::types::AppWebConfig>) -> Self {
        self.web = input;
        self
    }
    /// <p>The web hosting settings for the app.</p>
    pub fn get_web(&self) -> &::std::option::Option<crate::types::AppWebConfig> {
        &self.web
    }
    /// <p>The backend settings for the app. Present only when the app has a backend.</p>
    pub fn backend(mut self, input: crate::types::AppBackend) -> Self {
        self.backend = ::std::option::Option::Some(input);
        self
    }
    /// <p>The backend settings for the app. Present only when the app has a backend.</p>
    pub fn set_backend(mut self, input: ::std::option::Option<crate::types::AppBackend>) -> Self {
        self.backend = input;
        self
    }
    /// <p>The backend settings for the app. Present only when the app has a backend.</p>
    pub fn get_backend(&self) -> &::std::option::Option<crate::types::AppBackend> {
        &self.backend
    }
    /// Appends an item to `waf_configs`.
    ///
    /// To override the contents of this collection use [`set_waf_configs`](Self::set_waf_configs).
    ///
    /// <p>A list of the app's AWS WAF configurations. Omitted when the app has no web ACL association.</p>
    pub fn waf_configs(mut self, input: crate::types::WafConfig) -> Self {
        let mut v = self.waf_configs.unwrap_or_default();
        v.push(input);
        self.waf_configs = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of the app's AWS WAF configurations. Omitted when the app has no web ACL association.</p>
    pub fn set_waf_configs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WafConfig>>) -> Self {
        self.waf_configs = input;
        self
    }
    /// <p>A list of the app's AWS WAF configurations. Omitted when the app has no web ACL association.</p>
    pub fn get_waf_configs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WafConfig>> {
        &self.waf_configs
    }
    /// <p>The time at which the app 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 app 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 app 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 app 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 app 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 app 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 [`GetAppOutput`](crate::operation::get_app::GetAppOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`app_name`](crate::operation::get_app::builders::GetAppOutputBuilder::app_name)
    /// - [`app_arn`](crate::operation::get_app::builders::GetAppOutputBuilder::app_arn)
    /// - [`created_at`](crate::operation::get_app::builders::GetAppOutputBuilder::created_at)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_app::GetAppOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_app::GetAppOutput {
            app_name: self.app_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "app_name",
                    "app_name was not specified but it is required when building GetAppOutput",
                )
            })?,
            app_arn: self.app_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "app_arn",
                    "app_arn was not specified but it is required when building GetAppOutput",
                )
            })?,
            source_config: self.source_config,
            web: self.web,
            backend: self.backend,
            waf_configs: self.waf_configs,
            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 GetAppOutput",
                )
            })?,
            updated_at: self.updated_at,
            _request_id: self._request_id,
        })
    }
}