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