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}
66impl RegisterClientInput {
67    /// Creates a new builder-style object to manufacture [`RegisterClientInput`](crate::operation::register_client::RegisterClientInput).
68    pub fn builder() -> crate::operation::register_client::builders::RegisterClientInputBuilder {
69        crate::operation::register_client::builders::RegisterClientInputBuilder::default()
70    }
71}
72
73/// A builder for [`RegisterClientInput`](crate::operation::register_client::RegisterClientInput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct RegisterClientInputBuilder {
77    pub(crate) client_name: ::std::option::Option<::std::string::String>,
78    pub(crate) client_type: ::std::option::Option<::std::string::String>,
79    pub(crate) scopes: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
80    pub(crate) redirect_uris: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
81    pub(crate) grant_types: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
82    pub(crate) issuer_url: ::std::option::Option<::std::string::String>,
83    pub(crate) entitled_application_arn: ::std::option::Option<::std::string::String>,
84}
85impl RegisterClientInputBuilder {
86    /// <p>The friendly name of the client.</p>
87    /// This field is required.
88    pub fn client_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.client_name = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The friendly name of the client.</p>
93    pub fn set_client_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.client_name = input; self
95    }
96    /// <p>The friendly name of the client.</p>
97    pub fn get_client_name(&self) -> &::std::option::Option<::std::string::String> {
98        &self.client_name
99    }
100    /// <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>
101    /// This field is required.
102    pub fn client_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.client_type = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <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>
107    pub fn set_client_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.client_type = input; self
109    }
110    /// <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>
111    pub fn get_client_type(&self) -> &::std::option::Option<::std::string::String> {
112        &self.client_type
113    }
114    /// Appends an item to `scopes`.
115    ///
116    /// To override the contents of this collection use [`set_scopes`](Self::set_scopes).
117    ///
118    /// <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>
119    pub fn scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        let mut v = self.scopes.unwrap_or_default();
121                        v.push(input.into());
122                        self.scopes = ::std::option::Option::Some(v);
123                        self
124    }
125    /// <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>
126    pub fn set_scopes(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
127        self.scopes = input; self
128    }
129    /// <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>
130    pub fn get_scopes(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
131        &self.scopes
132    }
133    /// Appends an item to `redirect_uris`.
134    ///
135    /// To override the contents of this collection use [`set_redirect_uris`](Self::set_redirect_uris).
136    ///
137    /// <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>
138    pub fn redirect_uris(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        let mut v = self.redirect_uris.unwrap_or_default();
140                        v.push(input.into());
141                        self.redirect_uris = ::std::option::Option::Some(v);
142                        self
143    }
144    /// <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>
145    pub fn set_redirect_uris(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
146        self.redirect_uris = input; self
147    }
148    /// <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>
149    pub fn get_redirect_uris(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
150        &self.redirect_uris
151    }
152    /// Appends an item to `grant_types`.
153    ///
154    /// To override the contents of this collection use [`set_grant_types`](Self::set_grant_types).
155    ///
156    /// <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>
157    /// <p>* Authorization Code - <code>authorization_code</code></p>
158    /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
159    /// <p>* Refresh Token - <code>refresh_token</code></p>
160    pub fn grant_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        let mut v = self.grant_types.unwrap_or_default();
162                        v.push(input.into());
163                        self.grant_types = ::std::option::Option::Some(v);
164                        self
165    }
166    /// <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>
167    /// <p>* Authorization Code - <code>authorization_code</code></p>
168    /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
169    /// <p>* Refresh Token - <code>refresh_token</code></p>
170    pub fn set_grant_types(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
171        self.grant_types = input; self
172    }
173    /// <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>
174    /// <p>* Authorization Code - <code>authorization_code</code></p>
175    /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
176    /// <p>* Refresh Token - <code>refresh_token</code></p>
177    pub fn get_grant_types(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
178        &self.grant_types
179    }
180    /// <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>
181    pub fn issuer_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.issuer_url = ::std::option::Option::Some(input.into());
183        self
184    }
185    /// <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>
186    pub fn set_issuer_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.issuer_url = input; self
188    }
189    /// <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>
190    pub fn get_issuer_url(&self) -> &::std::option::Option<::std::string::String> {
191        &self.issuer_url
192    }
193    /// <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>
194    pub fn entitled_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.entitled_application_arn = ::std::option::Option::Some(input.into());
196        self
197    }
198    /// <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>
199    pub fn set_entitled_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.entitled_application_arn = input; self
201    }
202    /// <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>
203    pub fn get_entitled_application_arn(&self) -> &::std::option::Option<::std::string::String> {
204        &self.entitled_application_arn
205    }
206    /// Consumes the builder and constructs a [`RegisterClientInput`](crate::operation::register_client::RegisterClientInput).
207    pub fn build(self) -> ::std::result::Result<crate::operation::register_client::RegisterClientInput, ::aws_smithy_types::error::operation::BuildError> {
208        ::std::result::Result::Ok(
209            crate::operation::register_client::RegisterClientInput {
210                client_name: self.client_name
211                ,
212                client_type: self.client_type
213                ,
214                scopes: self.scopes
215                ,
216                redirect_uris: self.redirect_uris
217                ,
218                grant_types: self.grant_types
219                ,
220                issuer_url: self.issuer_url
221                ,
222                entitled_application_arn: self.entitled_application_arn
223                ,
224            }
225        )
226    }
227}
228