aws_sdk_wellarchitected/operation/create_profile/_create_profile_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 CreateProfileInput {
6 /// <p>Name of the profile.</p>
7 pub profile_name: ::std::option::Option<::std::string::String>,
8 /// <p>The profile description.</p>
9 pub profile_description: ::std::option::Option<::std::string::String>,
10 /// <p>The profile questions.</p>
11 pub profile_questions: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQuestionUpdate>>,
12 /// <p>A unique case-sensitive string used to ensure that this request is idempotent (executes only once).</p>
13 /// <p>You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p><important>
14 /// <p>This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.</p>
15 /// </important>
16 pub client_request_token: ::std::option::Option<::std::string::String>,
17 /// <p>The tags assigned to the profile.</p>
18 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
19}
20impl CreateProfileInput {
21 /// <p>Name of the profile.</p>
22 pub fn profile_name(&self) -> ::std::option::Option<&str> {
23 self.profile_name.as_deref()
24 }
25 /// <p>The profile description.</p>
26 pub fn profile_description(&self) -> ::std::option::Option<&str> {
27 self.profile_description.as_deref()
28 }
29 /// <p>The profile questions.</p>
30 ///
31 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.profile_questions.is_none()`.
32 pub fn profile_questions(&self) -> &[crate::types::ProfileQuestionUpdate] {
33 self.profile_questions.as_deref().unwrap_or_default()
34 }
35 /// <p>A unique case-sensitive string used to ensure that this request is idempotent (executes only once).</p>
36 /// <p>You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p><important>
37 /// <p>This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.</p>
38 /// </important>
39 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
40 self.client_request_token.as_deref()
41 }
42 /// <p>The tags assigned to the profile.</p>
43 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
44 self.tags.as_ref()
45 }
46}
47impl CreateProfileInput {
48 /// Creates a new builder-style object to manufacture [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
49 pub fn builder() -> crate::operation::create_profile::builders::CreateProfileInputBuilder {
50 crate::operation::create_profile::builders::CreateProfileInputBuilder::default()
51 }
52}
53
54/// A builder for [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateProfileInputBuilder {
58 pub(crate) profile_name: ::std::option::Option<::std::string::String>,
59 pub(crate) profile_description: ::std::option::Option<::std::string::String>,
60 pub(crate) profile_questions: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQuestionUpdate>>,
61 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
62 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
63}
64impl CreateProfileInputBuilder {
65 /// <p>Name of the profile.</p>
66 /// This field is required.
67 pub fn profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68 self.profile_name = ::std::option::Option::Some(input.into());
69 self
70 }
71 /// <p>Name of the profile.</p>
72 pub fn set_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.profile_name = input;
74 self
75 }
76 /// <p>Name of the profile.</p>
77 pub fn get_profile_name(&self) -> &::std::option::Option<::std::string::String> {
78 &self.profile_name
79 }
80 /// <p>The profile description.</p>
81 /// This field is required.
82 pub fn profile_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.profile_description = ::std::option::Option::Some(input.into());
84 self
85 }
86 /// <p>The profile description.</p>
87 pub fn set_profile_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.profile_description = input;
89 self
90 }
91 /// <p>The profile description.</p>
92 pub fn get_profile_description(&self) -> &::std::option::Option<::std::string::String> {
93 &self.profile_description
94 }
95 /// Appends an item to `profile_questions`.
96 ///
97 /// To override the contents of this collection use [`set_profile_questions`](Self::set_profile_questions).
98 ///
99 /// <p>The profile questions.</p>
100 pub fn profile_questions(mut self, input: crate::types::ProfileQuestionUpdate) -> Self {
101 let mut v = self.profile_questions.unwrap_or_default();
102 v.push(input);
103 self.profile_questions = ::std::option::Option::Some(v);
104 self
105 }
106 /// <p>The profile questions.</p>
107 pub fn set_profile_questions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQuestionUpdate>>) -> Self {
108 self.profile_questions = input;
109 self
110 }
111 /// <p>The profile questions.</p>
112 pub fn get_profile_questions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProfileQuestionUpdate>> {
113 &self.profile_questions
114 }
115 /// <p>A unique case-sensitive string used to ensure that this request is idempotent (executes only once).</p>
116 /// <p>You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p><important>
117 /// <p>This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.</p>
118 /// </important>
119 /// This field is required.
120 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.client_request_token = ::std::option::Option::Some(input.into());
122 self
123 }
124 /// <p>A unique case-sensitive string used to ensure that this request is idempotent (executes only once).</p>
125 /// <p>You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p><important>
126 /// <p>This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.</p>
127 /// </important>
128 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.client_request_token = input;
130 self
131 }
132 /// <p>A unique case-sensitive string used to ensure that this request is idempotent (executes only once).</p>
133 /// <p>You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p><important>
134 /// <p>This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.</p>
135 /// </important>
136 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
137 &self.client_request_token
138 }
139 /// Adds a key-value pair to `tags`.
140 ///
141 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
142 ///
143 /// <p>The tags assigned to the profile.</p>
144 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
145 let mut hash_map = self.tags.unwrap_or_default();
146 hash_map.insert(k.into(), v.into());
147 self.tags = ::std::option::Option::Some(hash_map);
148 self
149 }
150 /// <p>The tags assigned to the profile.</p>
151 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
152 self.tags = input;
153 self
154 }
155 /// <p>The tags assigned to the profile.</p>
156 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
157 &self.tags
158 }
159 /// Consumes the builder and constructs a [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
160 pub fn build(
161 self,
162 ) -> ::std::result::Result<crate::operation::create_profile::CreateProfileInput, ::aws_smithy_types::error::operation::BuildError> {
163 ::std::result::Result::Ok(crate::operation::create_profile::CreateProfileInput {
164 profile_name: self.profile_name,
165 profile_description: self.profile_description,
166 profile_questions: self.profile_questions,
167 client_request_token: self.client_request_token,
168 tags: self.tags,
169 })
170 }
171}