Skip to main content

aws_sdk_securityagent/operation/get_application/
_get_application_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetApplicationOutput {
6    /// Application ID
7    pub application_id: ::std::string::String,
8    /// Domain where the application is available
9    pub domain: ::std::string::String,
10    /// Name of the application, automatically assigned by the service
11    pub application_name: ::std::option::Option<::std::string::String>,
12    /// IAM Identity Center configuration for the application
13    pub idc_configuration: ::std::option::Option<crate::types::IdCConfiguration>,
14    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
15    pub role_arn: ::std::option::Option<::std::string::String>,
16    /// Default KMS key identifier used to encrypt application data
17    pub default_kms_key_id: ::std::option::Option<::std::string::String>,
18    _request_id: Option<String>,
19}
20impl GetApplicationOutput {
21    /// Application ID
22    pub fn application_id(&self) -> &str {
23        use std::ops::Deref;
24        self.application_id.deref()
25    }
26    /// Domain where the application is available
27    pub fn domain(&self) -> &str {
28        use std::ops::Deref;
29        self.domain.deref()
30    }
31    /// Name of the application, automatically assigned by the service
32    pub fn application_name(&self) -> ::std::option::Option<&str> {
33        self.application_name.as_deref()
34    }
35    /// IAM Identity Center configuration for the application
36    pub fn idc_configuration(&self) -> ::std::option::Option<&crate::types::IdCConfiguration> {
37        self.idc_configuration.as_ref()
38    }
39    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
40    pub fn role_arn(&self) -> ::std::option::Option<&str> {
41        self.role_arn.as_deref()
42    }
43    /// Default KMS key identifier used to encrypt application data
44    pub fn default_kms_key_id(&self) -> ::std::option::Option<&str> {
45        self.default_kms_key_id.as_deref()
46    }
47}
48impl ::aws_types::request_id::RequestId for GetApplicationOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl GetApplicationOutput {
54    /// Creates a new builder-style object to manufacture [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
55    pub fn builder() -> crate::operation::get_application::builders::GetApplicationOutputBuilder {
56        crate::operation::get_application::builders::GetApplicationOutputBuilder::default()
57    }
58}
59
60/// A builder for [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct GetApplicationOutputBuilder {
64    pub(crate) application_id: ::std::option::Option<::std::string::String>,
65    pub(crate) domain: ::std::option::Option<::std::string::String>,
66    pub(crate) application_name: ::std::option::Option<::std::string::String>,
67    pub(crate) idc_configuration: ::std::option::Option<crate::types::IdCConfiguration>,
68    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
69    pub(crate) default_kms_key_id: ::std::option::Option<::std::string::String>,
70    _request_id: Option<String>,
71}
72impl GetApplicationOutputBuilder {
73    /// Application ID
74    /// This field is required.
75    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.application_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// Application ID
80    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.application_id = input;
82        self
83    }
84    /// Application ID
85    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.application_id
87    }
88    /// Domain where the application is available
89    /// This field is required.
90    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.domain = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// Domain where the application is available
95    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.domain = input;
97        self
98    }
99    /// Domain where the application is available
100    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
101        &self.domain
102    }
103    /// Name of the application, automatically assigned by the service
104    pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.application_name = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// Name of the application, automatically assigned by the service
109    pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.application_name = input;
111        self
112    }
113    /// Name of the application, automatically assigned by the service
114    pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
115        &self.application_name
116    }
117    /// IAM Identity Center configuration for the application
118    pub fn idc_configuration(mut self, input: crate::types::IdCConfiguration) -> Self {
119        self.idc_configuration = ::std::option::Option::Some(input);
120        self
121    }
122    /// IAM Identity Center configuration for the application
123    pub fn set_idc_configuration(mut self, input: ::std::option::Option<crate::types::IdCConfiguration>) -> Self {
124        self.idc_configuration = input;
125        self
126    }
127    /// IAM Identity Center configuration for the application
128    pub fn get_idc_configuration(&self) -> &::std::option::Option<crate::types::IdCConfiguration> {
129        &self.idc_configuration
130    }
131    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
132    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.role_arn = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
137    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.role_arn = input;
139        self
140    }
141    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
142    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
143        &self.role_arn
144    }
145    /// Default KMS key identifier used to encrypt application data
146    pub fn default_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.default_kms_key_id = ::std::option::Option::Some(input.into());
148        self
149    }
150    /// Default KMS key identifier used to encrypt application data
151    pub fn set_default_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.default_kms_key_id = input;
153        self
154    }
155    /// Default KMS key identifier used to encrypt application data
156    pub fn get_default_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
157        &self.default_kms_key_id
158    }
159    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
160        self._request_id = Some(request_id.into());
161        self
162    }
163
164    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
165        self._request_id = request_id;
166        self
167    }
168    /// Consumes the builder and constructs a [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
169    /// This method will fail if any of the following fields are not set:
170    /// - [`application_id`](crate::operation::get_application::builders::GetApplicationOutputBuilder::application_id)
171    /// - [`domain`](crate::operation::get_application::builders::GetApplicationOutputBuilder::domain)
172    pub fn build(
173        self,
174    ) -> ::std::result::Result<crate::operation::get_application::GetApplicationOutput, ::aws_smithy_types::error::operation::BuildError> {
175        ::std::result::Result::Ok(crate::operation::get_application::GetApplicationOutput {
176            application_id: self.application_id.ok_or_else(|| {
177                ::aws_smithy_types::error::operation::BuildError::missing_field(
178                    "application_id",
179                    "application_id was not specified but it is required when building GetApplicationOutput",
180                )
181            })?,
182            domain: self.domain.ok_or_else(|| {
183                ::aws_smithy_types::error::operation::BuildError::missing_field(
184                    "domain",
185                    "domain was not specified but it is required when building GetApplicationOutput",
186                )
187            })?,
188            application_name: self.application_name,
189            idc_configuration: self.idc_configuration,
190            role_arn: self.role_arn,
191            default_kms_key_id: self.default_kms_key_id,
192            _request_id: self._request_id,
193        })
194    }
195}