aws-sdk-securityagent 1.1.0

AWS SDK for AWS Security Agent
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 GetApplicationOutput {
    /// Application ID
    pub application_id: ::std::string::String,
    /// Domain where the application is available
    pub domain: ::std::string::String,
    /// Name of the application, automatically assigned by the service
    pub application_name: ::std::option::Option<::std::string::String>,
    /// IAM Identity Center configuration for the application
    pub idc_configuration: ::std::option::Option<crate::types::IdCConfiguration>,
    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// Default KMS key identifier used to encrypt application data
    pub default_kms_key_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetApplicationOutput {
    /// Application ID
    pub fn application_id(&self) -> &str {
        use std::ops::Deref;
        self.application_id.deref()
    }
    /// Domain where the application is available
    pub fn domain(&self) -> &str {
        use std::ops::Deref;
        self.domain.deref()
    }
    /// Name of the application, automatically assigned by the service
    pub fn application_name(&self) -> ::std::option::Option<&str> {
        self.application_name.as_deref()
    }
    /// IAM Identity Center configuration for the application
    pub fn idc_configuration(&self) -> ::std::option::Option<&crate::types::IdCConfiguration> {
        self.idc_configuration.as_ref()
    }
    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// Default KMS key identifier used to encrypt application data
    pub fn default_kms_key_id(&self) -> ::std::option::Option<&str> {
        self.default_kms_key_id.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetApplicationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetApplicationOutput {
    /// Creates a new builder-style object to manufacture [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
    pub fn builder() -> crate::operation::get_application::builders::GetApplicationOutputBuilder {
        crate::operation::get_application::builders::GetApplicationOutputBuilder::default()
    }
}

/// A builder for [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetApplicationOutputBuilder {
    pub(crate) application_id: ::std::option::Option<::std::string::String>,
    pub(crate) domain: ::std::option::Option<::std::string::String>,
    pub(crate) application_name: ::std::option::Option<::std::string::String>,
    pub(crate) idc_configuration: ::std::option::Option<crate::types::IdCConfiguration>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) default_kms_key_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetApplicationOutputBuilder {
    /// Application ID
    /// This field is required.
    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Application ID
    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_id = input;
        self
    }
    /// Application ID
    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_id
    }
    /// Domain where the application is available
    /// This field is required.
    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain = ::std::option::Option::Some(input.into());
        self
    }
    /// Domain where the application is available
    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain = input;
        self
    }
    /// Domain where the application is available
    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain
    }
    /// Name of the application, automatically assigned by the service
    pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_name = ::std::option::Option::Some(input.into());
        self
    }
    /// Name of the application, automatically assigned by the service
    pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_name = input;
        self
    }
    /// Name of the application, automatically assigned by the service
    pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_name
    }
    /// IAM Identity Center configuration for the application
    pub fn idc_configuration(mut self, input: crate::types::IdCConfiguration) -> Self {
        self.idc_configuration = ::std::option::Option::Some(input);
        self
    }
    /// IAM Identity Center configuration for the application
    pub fn set_idc_configuration(mut self, input: ::std::option::Option<crate::types::IdCConfiguration>) -> Self {
        self.idc_configuration = input;
        self
    }
    /// IAM Identity Center configuration for the application
    pub fn get_idc_configuration(&self) -> &::std::option::Option<crate::types::IdCConfiguration> {
        &self.idc_configuration
    }
    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// Default KMS key identifier used to encrypt application data
    pub fn default_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.default_kms_key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Default KMS key identifier used to encrypt application data
    pub fn set_default_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.default_kms_key_id = input;
        self
    }
    /// Default KMS key identifier used to encrypt application data
    pub fn get_default_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.default_kms_key_id
    }
    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 [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`application_id`](crate::operation::get_application::builders::GetApplicationOutputBuilder::application_id)
    /// - [`domain`](crate::operation::get_application::builders::GetApplicationOutputBuilder::domain)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_application::GetApplicationOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_application::GetApplicationOutput {
            application_id: self.application_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "application_id",
                    "application_id was not specified but it is required when building GetApplicationOutput",
                )
            })?,
            domain: self.domain.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "domain",
                    "domain was not specified but it is required when building GetApplicationOutput",
                )
            })?,
            application_name: self.application_name,
            idc_configuration: self.idc_configuration,
            role_arn: self.role_arn,
            default_kms_key_id: self.default_kms_key_id,
            _request_id: self._request_id,
        })
    }
}