aws_sdk_ssooidc/operation/register_client/
_register_client_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 RegisterClientInput  {
6    /// <p>The friendly name of the client.</p>
7    pub client_name: ::std::option::Option<::std::string::String>,
8    /// <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
9    pub client_type: ::std::option::Option<::std::string::String>,
10    /// <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
11    pub scopes: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
12    /// <p>The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.</p>
13    pub redirect_uris: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
14    /// <p>The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.</p>
15    /// <p>* Authorization Code - <code>authorization_code</code></p>
16    /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
17    /// <p>* Refresh Token - <code>refresh_token</code></p>
18    pub grant_types: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
19    /// <p>The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.</p>
20    pub issuer_url: ::std::option::Option<::std::string::String>,
21    /// <p>This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.</p>
22    pub entitled_application_arn: ::std::option::Option<::std::string::String>,
23}
24impl  RegisterClientInput  {
25    /// <p>The friendly name of the client.</p>
26    pub fn client_name(&self) -> ::std::option::Option<&str> {
27        self.client_name.as_deref()
28    }
29    /// <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
30    pub fn client_type(&self) -> ::std::option::Option<&str> {
31        self.client_type.as_deref()
32    }
33    /// <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
34    /// 
35    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.scopes.is_none()`.
36    pub fn scopes(&self) -> &[::std::string::String] {
37        self.scopes.as_deref()
38        .unwrap_or_default()
39    }
40    /// <p>The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.</p>
41    /// 
42    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.redirect_uris.is_none()`.
43    pub fn redirect_uris(&self) -> &[::std::string::String] {
44        self.redirect_uris.as_deref()
45        .unwrap_or_default()
46    }
47    /// <p>The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.</p>
48    /// <p>* Authorization Code - <code>authorization_code</code></p>
49    /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
50    /// <p>* Refresh Token - <code>refresh_token</code></p>
51    /// 
52    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.grant_types.is_none()`.
53    pub fn grant_types(&self) -> &[::std::string::String] {
54        self.grant_types.as_deref()
55        .unwrap_or_default()
56    }
57    /// <p>The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.</p>
58    pub fn issuer_url(&self) -> ::std::option::Option<&str> {
59        self.issuer_url.as_deref()
60    }
61    /// <p>This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.</p>
62    pub fn entitled_application_arn(&self) -> ::std::option::Option<&str> {
63        self.entitled_application_arn.as_deref()
64    }
65}
66static REGISTERCLIENTINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ssooidc.synthetic#RegisterClientInput", "com.amazonaws.ssooidc.synthetic", "RegisterClientInput");
67static REGISTERCLIENTINPUT_MEMBER_CLIENT_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
68                            ::aws_smithy_schema::ShapeId::from_static(
69                                "com.amazonaws.ssooidc.synthetic#RegisterClientInput$clientName",
70                                "com.amazonaws.ssooidc.synthetic",
71                                "RegisterClientInput",
72                            ),
73                            ::aws_smithy_schema::ShapeType::String,
74                            "clientName",
75                            0,
76                        );
77static REGISTERCLIENTINPUT_MEMBER_CLIENT_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
78                            ::aws_smithy_schema::ShapeId::from_static(
79                                "com.amazonaws.ssooidc.synthetic#RegisterClientInput$clientType",
80                                "com.amazonaws.ssooidc.synthetic",
81                                "RegisterClientInput",
82                            ),
83                            ::aws_smithy_schema::ShapeType::String,
84                            "clientType",
85                            1,
86                        );
87static REGISTERCLIENTINPUT_MEMBER_SCOPES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
88                            ::aws_smithy_schema::ShapeId::from_static(
89                                "com.amazonaws.ssooidc.synthetic#RegisterClientInput$scopes",
90                                "com.amazonaws.ssooidc.synthetic",
91                                "RegisterClientInput",
92                            ),
93                            ::aws_smithy_schema::ShapeType::List,
94                            "scopes",
95                            2,
96                        );
97static REGISTERCLIENTINPUT_MEMBER_REDIRECT_URIS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
98                            ::aws_smithy_schema::ShapeId::from_static(
99                                "com.amazonaws.ssooidc.synthetic#RegisterClientInput$redirectUris",
100                                "com.amazonaws.ssooidc.synthetic",
101                                "RegisterClientInput",
102                            ),
103                            ::aws_smithy_schema::ShapeType::List,
104                            "redirectUris",
105                            3,
106                        );
107static REGISTERCLIENTINPUT_MEMBER_GRANT_TYPES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
108                            ::aws_smithy_schema::ShapeId::from_static(
109                                "com.amazonaws.ssooidc.synthetic#RegisterClientInput$grantTypes",
110                                "com.amazonaws.ssooidc.synthetic",
111                                "RegisterClientInput",
112                            ),
113                            ::aws_smithy_schema::ShapeType::List,
114                            "grantTypes",
115                            4,
116                        );
117static REGISTERCLIENTINPUT_MEMBER_ISSUER_URL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
118                            ::aws_smithy_schema::ShapeId::from_static(
119                                "com.amazonaws.ssooidc.synthetic#RegisterClientInput$issuerUrl",
120                                "com.amazonaws.ssooidc.synthetic",
121                                "RegisterClientInput",
122                            ),
123                            ::aws_smithy_schema::ShapeType::String,
124                            "issuerUrl",
125                            5,
126                        );
127static REGISTERCLIENTINPUT_MEMBER_ENTITLED_APPLICATION_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
128                            ::aws_smithy_schema::ShapeId::from_static(
129                                "com.amazonaws.ssooidc.synthetic#RegisterClientInput$entitledApplicationArn",
130                                "com.amazonaws.ssooidc.synthetic",
131                                "RegisterClientInput",
132                            ),
133                            ::aws_smithy_schema::ShapeType::String,
134                            "entitledApplicationArn",
135                            6,
136                        );
137static REGISTERCLIENTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
138                            REGISTERCLIENTINPUT_SCHEMA_ID,
139                            ::aws_smithy_schema::ShapeType::Structure,
140                            &[&REGISTERCLIENTINPUT_MEMBER_CLIENT_NAME, &REGISTERCLIENTINPUT_MEMBER_CLIENT_TYPE, &REGISTERCLIENTINPUT_MEMBER_SCOPES, &REGISTERCLIENTINPUT_MEMBER_REDIRECT_URIS, &REGISTERCLIENTINPUT_MEMBER_GRANT_TYPES, &REGISTERCLIENTINPUT_MEMBER_ISSUER_URL, &REGISTERCLIENTINPUT_MEMBER_ENTITLED_APPLICATION_ARN],
141                        )
142    .with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/client/register", None));
143impl RegisterClientInput {
144                /// The schema for this shape.
145                pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REGISTERCLIENTINPUT_SCHEMA;
146            }
147impl ::aws_smithy_schema::serde::SerializableStruct for RegisterClientInput {
148                #[allow(unused_variables, clippy::diverging_sub_expression)]
149                fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
150                    if let Some(ref val) = self.client_name {
151                                ser.write_string(&REGISTERCLIENTINPUT_MEMBER_CLIENT_NAME, val)?;
152                            }
153if let Some(ref val) = self.client_type {
154                                ser.write_string(&REGISTERCLIENTINPUT_MEMBER_CLIENT_TYPE, val)?;
155                            }
156if let Some(ref val) = self.scopes {
157                                
158                    ser.write_list(&REGISTERCLIENTINPUT_MEMBER_SCOPES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
159                        for item in val {
160                            ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
161                        }
162                        Ok(())
163                    })?;
164                    
165                            }
166if let Some(ref val) = self.redirect_uris {
167                                
168                    ser.write_list(&REGISTERCLIENTINPUT_MEMBER_REDIRECT_URIS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
169                        for item in val {
170                            ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
171                        }
172                        Ok(())
173                    })?;
174                    
175                            }
176if let Some(ref val) = self.grant_types {
177                                
178                    ser.write_list(&REGISTERCLIENTINPUT_MEMBER_GRANT_TYPES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
179                        for item in val {
180                            ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
181                        }
182                        Ok(())
183                    })?;
184                    
185                            }
186if let Some(ref val) = self.issuer_url {
187                                ser.write_string(&REGISTERCLIENTINPUT_MEMBER_ISSUER_URL, val)?;
188                            }
189if let Some(ref val) = self.entitled_application_arn {
190                                ser.write_string(&REGISTERCLIENTINPUT_MEMBER_ENTITLED_APPLICATION_ARN, val)?;
191                            }
192                    Ok(())
193                }
194            }
195impl RegisterClientInput {
196                /// Deserializes this structure from a [`ShapeDeserializer`].
197                pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
198                    #[allow(unused_variables, unused_mut)]
199                    let mut builder = Self::builder();
200                    #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
201                    deserializer.read_struct(&REGISTERCLIENTINPUT_SCHEMA, &mut |member, deser| {
202                        match member.member_index() {
203                            Some(0) => {
204                                    builder.client_name = Some(deser.read_string(member)?);
205                                }
206Some(1) => {
207                                    builder.client_type = Some(deser.read_string(member)?);
208                                }
209Some(2) => {
210                                    builder.scopes = Some(deser.read_string_list(member)?);
211                                }
212Some(3) => {
213                                    builder.redirect_uris = Some(deser.read_string_list(member)?);
214                                }
215Some(4) => {
216                                    builder.grant_types = Some(deser.read_string_list(member)?);
217                                }
218Some(5) => {
219                                    builder.issuer_url = Some(deser.read_string(member)?);
220                                }
221Some(6) => {
222                                    builder.entitled_application_arn = Some(deser.read_string(member)?);
223                                }
224                            _ => {}
225                        }
226                        Ok(())
227                    })?;
228                    builder.client_name = builder.client_name.or(Some(String::new()));
229builder.client_type = builder.client_type.or(Some(String::new()));
230builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
231                }
232            }
233impl RegisterClientInput {
234                        /// Deserializes this structure from a body deserializer and HTTP response.
235                        pub fn deserialize_with_response(
236                            deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
237                            _headers: &::aws_smithy_runtime_api::http::Headers,
238                            _status: u16,
239                            _body: &[u8],
240                        ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
241                            Self::deserialize(deserializer)
242                        }
243                    }
244impl RegisterClientInput {
245    /// Creates a new builder-style object to manufacture [`RegisterClientInput`](crate::operation::register_client::RegisterClientInput).
246    pub fn builder() -> crate::operation::register_client::builders::RegisterClientInputBuilder {
247        crate::operation::register_client::builders::RegisterClientInputBuilder::default()
248    }
249}
250
251/// A builder for [`RegisterClientInput`](crate::operation::register_client::RegisterClientInput).
252#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
253#[non_exhaustive]
254pub struct RegisterClientInputBuilder {
255    pub(crate) client_name: ::std::option::Option<::std::string::String>,
256    pub(crate) client_type: ::std::option::Option<::std::string::String>,
257    pub(crate) scopes: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
258    pub(crate) redirect_uris: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
259    pub(crate) grant_types: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
260    pub(crate) issuer_url: ::std::option::Option<::std::string::String>,
261    pub(crate) entitled_application_arn: ::std::option::Option<::std::string::String>,
262}
263impl RegisterClientInputBuilder {
264    /// <p>The friendly name of the client.</p>
265    /// This field is required.
266    pub fn client_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267        self.client_name = ::std::option::Option::Some(input.into());
268        self
269    }
270    /// <p>The friendly name of the client.</p>
271    pub fn set_client_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272        self.client_name = input; self
273    }
274    /// <p>The friendly name of the client.</p>
275    pub fn get_client_name(&self) -> &::std::option::Option<::std::string::String> {
276        &self.client_name
277    }
278    /// <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
279    /// This field is required.
280    pub fn client_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281        self.client_type = ::std::option::Option::Some(input.into());
282        self
283    }
284    /// <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
285    pub fn set_client_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
286        self.client_type = input; self
287    }
288    /// <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
289    pub fn get_client_type(&self) -> &::std::option::Option<::std::string::String> {
290        &self.client_type
291    }
292    /// Appends an item to `scopes`.
293    ///
294    /// To override the contents of this collection use [`set_scopes`](Self::set_scopes).
295    ///
296    /// <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
297    pub fn scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
298        let mut v = self.scopes.unwrap_or_default();
299                        v.push(input.into());
300                        self.scopes = ::std::option::Option::Some(v);
301                        self
302    }
303    /// <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
304    pub fn set_scopes(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
305        self.scopes = input; self
306    }
307    /// <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
308    pub fn get_scopes(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
309        &self.scopes
310    }
311    /// Appends an item to `redirect_uris`.
312    ///
313    /// To override the contents of this collection use [`set_redirect_uris`](Self::set_redirect_uris).
314    ///
315    /// <p>The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.</p>
316    pub fn redirect_uris(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
317        let mut v = self.redirect_uris.unwrap_or_default();
318                        v.push(input.into());
319                        self.redirect_uris = ::std::option::Option::Some(v);
320                        self
321    }
322    /// <p>The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.</p>
323    pub fn set_redirect_uris(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
324        self.redirect_uris = input; self
325    }
326    /// <p>The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.</p>
327    pub fn get_redirect_uris(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
328        &self.redirect_uris
329    }
330    /// Appends an item to `grant_types`.
331    ///
332    /// To override the contents of this collection use [`set_grant_types`](Self::set_grant_types).
333    ///
334    /// <p>The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.</p>
335    /// <p>* Authorization Code - <code>authorization_code</code></p>
336    /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
337    /// <p>* Refresh Token - <code>refresh_token</code></p>
338    pub fn grant_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
339        let mut v = self.grant_types.unwrap_or_default();
340                        v.push(input.into());
341                        self.grant_types = ::std::option::Option::Some(v);
342                        self
343    }
344    /// <p>The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.</p>
345    /// <p>* Authorization Code - <code>authorization_code</code></p>
346    /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
347    /// <p>* Refresh Token - <code>refresh_token</code></p>
348    pub fn set_grant_types(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
349        self.grant_types = input; self
350    }
351    /// <p>The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.</p>
352    /// <p>* Authorization Code - <code>authorization_code</code></p>
353    /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
354    /// <p>* Refresh Token - <code>refresh_token</code></p>
355    pub fn get_grant_types(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
356        &self.grant_types
357    }
358    /// <p>The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.</p>
359    pub fn issuer_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
360        self.issuer_url = ::std::option::Option::Some(input.into());
361        self
362    }
363    /// <p>The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.</p>
364    pub fn set_issuer_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
365        self.issuer_url = input; self
366    }
367    /// <p>The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.</p>
368    pub fn get_issuer_url(&self) -> &::std::option::Option<::std::string::String> {
369        &self.issuer_url
370    }
371    /// <p>This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.</p>
372    pub fn entitled_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
373        self.entitled_application_arn = ::std::option::Option::Some(input.into());
374        self
375    }
376    /// <p>This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.</p>
377    pub fn set_entitled_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
378        self.entitled_application_arn = input; self
379    }
380    /// <p>This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.</p>
381    pub fn get_entitled_application_arn(&self) -> &::std::option::Option<::std::string::String> {
382        &self.entitled_application_arn
383    }
384    /// Consumes the builder and constructs a [`RegisterClientInput`](crate::operation::register_client::RegisterClientInput).
385    pub fn build(self) -> ::std::result::Result<crate::operation::register_client::RegisterClientInput, ::aws_smithy_types::error::operation::BuildError> {
386        ::std::result::Result::Ok(
387            crate::operation::register_client::RegisterClientInput {
388                client_name: self.client_name
389                ,
390                client_type: self.client_type
391                ,
392                scopes: self.scopes
393                ,
394                redirect_uris: self.redirect_uris
395                ,
396                grant_types: self.grant_types
397                ,
398                issuer_url: self.issuer_url
399                ,
400                entitled_application_arn: self.entitled_application_arn
401                ,
402            }
403        )
404    }
405}
406