Skip to main content

aws_sdk_securityagent/operation/create_application/
_create_application_input.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 CreateApplicationInput {
6    /// ARN of the IAM Identity Center instance used for user authentication. Optional for non-IdC applications
7    pub idc_instance_arn: ::std::option::Option<::std::string::String>,
8    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
9    pub role_arn: ::std::option::Option<::std::string::String>,
10    /// Default KMS key identifier used to encrypt application data
11    pub default_kms_key_id: ::std::option::Option<::std::string::String>,
12    /// Tags to associate with the application
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateApplicationInput {
16    /// ARN of the IAM Identity Center instance used for user authentication. Optional for non-IdC applications
17    pub fn idc_instance_arn(&self) -> ::std::option::Option<&str> {
18        self.idc_instance_arn.as_deref()
19    }
20    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
21    pub fn role_arn(&self) -> ::std::option::Option<&str> {
22        self.role_arn.as_deref()
23    }
24    /// Default KMS key identifier used to encrypt application data
25    pub fn default_kms_key_id(&self) -> ::std::option::Option<&str> {
26        self.default_kms_key_id.as_deref()
27    }
28    /// Tags to associate with the application
29    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
30        self.tags.as_ref()
31    }
32}
33impl CreateApplicationInput {
34    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
35    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
36        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateApplicationInputBuilder {
44    pub(crate) idc_instance_arn: ::std::option::Option<::std::string::String>,
45    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
46    pub(crate) default_kms_key_id: ::std::option::Option<::std::string::String>,
47    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl CreateApplicationInputBuilder {
50    /// ARN of the IAM Identity Center instance used for user authentication. Optional for non-IdC applications
51    pub fn idc_instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.idc_instance_arn = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// ARN of the IAM Identity Center instance used for user authentication. Optional for non-IdC applications
56    pub fn set_idc_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.idc_instance_arn = input;
58        self
59    }
60    /// ARN of the IAM Identity Center instance used for user authentication. Optional for non-IdC applications
61    pub fn get_idc_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
62        &self.idc_instance_arn
63    }
64    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
65    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.role_arn = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
70    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.role_arn = input;
72        self
73    }
74    /// ARN of the IAM role that the application uses to access AWS resources on your behalf
75    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
76        &self.role_arn
77    }
78    /// Default KMS key identifier used to encrypt application data
79    pub fn default_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.default_kms_key_id = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// Default KMS key identifier used to encrypt application data
84    pub fn set_default_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.default_kms_key_id = input;
86        self
87    }
88    /// Default KMS key identifier used to encrypt application data
89    pub fn get_default_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
90        &self.default_kms_key_id
91    }
92    /// Adds a key-value pair to `tags`.
93    ///
94    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
95    ///
96    /// Tags to associate with the application
97    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
98        let mut hash_map = self.tags.unwrap_or_default();
99        hash_map.insert(k.into(), v.into());
100        self.tags = ::std::option::Option::Some(hash_map);
101        self
102    }
103    /// Tags to associate with the application
104    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
105        self.tags = input;
106        self
107    }
108    /// Tags to associate with the application
109    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
110        &self.tags
111    }
112    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
113    pub fn build(
114        self,
115    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
116        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
117            idc_instance_arn: self.idc_instance_arn,
118            role_arn: self.role_arn,
119            default_kms_key_id: self.default_kms_key_id,
120            tags: self.tags,
121        })
122    }
123}