Skip to main content

aws_sdk_appflow/types/
_o_auth2_defaults.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the default values required for OAuth 2.0 authentication.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct OAuth2Defaults {
7    /// <p>OAuth 2.0 scopes that the connector supports.</p>
8    pub oauth_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9    /// <p>Token URLs that can be used for OAuth 2.0 authentication.</p>
10    pub token_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// <p>Auth code URLs that can be used for OAuth 2.0 authentication.</p>
12    pub auth_code_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <p>OAuth 2.0 grant types supported by the connector.</p>
14    pub oauth2_grant_types_supported: ::std::option::Option<::std::vec::Vec<crate::types::OAuth2GrantType>>,
15    /// <p>List of custom parameters required for OAuth 2.0 authentication.</p>
16    pub oauth2_custom_properties: ::std::option::Option<::std::vec::Vec<crate::types::OAuth2CustomParameter>>,
17}
18impl OAuth2Defaults {
19    /// <p>OAuth 2.0 scopes that the connector supports.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.oauth_scopes.is_none()`.
22    pub fn oauth_scopes(&self) -> &[::std::string::String] {
23        self.oauth_scopes.as_deref().unwrap_or_default()
24    }
25    /// <p>Token URLs that can be used for OAuth 2.0 authentication.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.token_urls.is_none()`.
28    pub fn token_urls(&self) -> &[::std::string::String] {
29        self.token_urls.as_deref().unwrap_or_default()
30    }
31    /// <p>Auth code URLs that can be used for OAuth 2.0 authentication.</p>
32    ///
33    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.auth_code_urls.is_none()`.
34    pub fn auth_code_urls(&self) -> &[::std::string::String] {
35        self.auth_code_urls.as_deref().unwrap_or_default()
36    }
37    /// <p>OAuth 2.0 grant types supported by the connector.</p>
38    ///
39    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.oauth2_grant_types_supported.is_none()`.
40    pub fn oauth2_grant_types_supported(&self) -> &[crate::types::OAuth2GrantType] {
41        self.oauth2_grant_types_supported.as_deref().unwrap_or_default()
42    }
43    /// <p>List of custom parameters required for OAuth 2.0 authentication.</p>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.oauth2_custom_properties.is_none()`.
46    pub fn oauth2_custom_properties(&self) -> &[crate::types::OAuth2CustomParameter] {
47        self.oauth2_custom_properties.as_deref().unwrap_or_default()
48    }
49}
50impl OAuth2Defaults {
51    /// Creates a new builder-style object to manufacture [`OAuth2Defaults`](crate::types::OAuth2Defaults).
52    pub fn builder() -> crate::types::builders::OAuth2DefaultsBuilder {
53        crate::types::builders::OAuth2DefaultsBuilder::default()
54    }
55}
56
57/// A builder for [`OAuth2Defaults`](crate::types::OAuth2Defaults).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
59#[non_exhaustive]
60pub struct OAuth2DefaultsBuilder {
61    pub(crate) oauth_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
62    pub(crate) token_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
63    pub(crate) auth_code_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
64    pub(crate) oauth2_grant_types_supported: ::std::option::Option<::std::vec::Vec<crate::types::OAuth2GrantType>>,
65    pub(crate) oauth2_custom_properties: ::std::option::Option<::std::vec::Vec<crate::types::OAuth2CustomParameter>>,
66}
67impl OAuth2DefaultsBuilder {
68    /// Appends an item to `oauth_scopes`.
69    ///
70    /// To override the contents of this collection use [`set_oauth_scopes`](Self::set_oauth_scopes).
71    ///
72    /// <p>OAuth 2.0 scopes that the connector supports.</p>
73    pub fn oauth_scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        let mut v = self.oauth_scopes.unwrap_or_default();
75        v.push(input.into());
76        self.oauth_scopes = ::std::option::Option::Some(v);
77        self
78    }
79    /// <p>OAuth 2.0 scopes that the connector supports.</p>
80    pub fn set_oauth_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
81        self.oauth_scopes = input;
82        self
83    }
84    /// <p>OAuth 2.0 scopes that the connector supports.</p>
85    pub fn get_oauth_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
86        &self.oauth_scopes
87    }
88    /// Appends an item to `token_urls`.
89    ///
90    /// To override the contents of this collection use [`set_token_urls`](Self::set_token_urls).
91    ///
92    /// <p>Token URLs that can be used for OAuth 2.0 authentication.</p>
93    pub fn token_urls(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        let mut v = self.token_urls.unwrap_or_default();
95        v.push(input.into());
96        self.token_urls = ::std::option::Option::Some(v);
97        self
98    }
99    /// <p>Token URLs that can be used for OAuth 2.0 authentication.</p>
100    pub fn set_token_urls(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
101        self.token_urls = input;
102        self
103    }
104    /// <p>Token URLs that can be used for OAuth 2.0 authentication.</p>
105    pub fn get_token_urls(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
106        &self.token_urls
107    }
108    /// Appends an item to `auth_code_urls`.
109    ///
110    /// To override the contents of this collection use [`set_auth_code_urls`](Self::set_auth_code_urls).
111    ///
112    /// <p>Auth code URLs that can be used for OAuth 2.0 authentication.</p>
113    pub fn auth_code_urls(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        let mut v = self.auth_code_urls.unwrap_or_default();
115        v.push(input.into());
116        self.auth_code_urls = ::std::option::Option::Some(v);
117        self
118    }
119    /// <p>Auth code URLs that can be used for OAuth 2.0 authentication.</p>
120    pub fn set_auth_code_urls(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
121        self.auth_code_urls = input;
122        self
123    }
124    /// <p>Auth code URLs that can be used for OAuth 2.0 authentication.</p>
125    pub fn get_auth_code_urls(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
126        &self.auth_code_urls
127    }
128    /// Appends an item to `oauth2_grant_types_supported`.
129    ///
130    /// To override the contents of this collection use [`set_oauth2_grant_types_supported`](Self::set_oauth2_grant_types_supported).
131    ///
132    /// <p>OAuth 2.0 grant types supported by the connector.</p>
133    pub fn oauth2_grant_types_supported(mut self, input: crate::types::OAuth2GrantType) -> Self {
134        let mut v = self.oauth2_grant_types_supported.unwrap_or_default();
135        v.push(input);
136        self.oauth2_grant_types_supported = ::std::option::Option::Some(v);
137        self
138    }
139    /// <p>OAuth 2.0 grant types supported by the connector.</p>
140    pub fn set_oauth2_grant_types_supported(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OAuth2GrantType>>) -> Self {
141        self.oauth2_grant_types_supported = input;
142        self
143    }
144    /// <p>OAuth 2.0 grant types supported by the connector.</p>
145    pub fn get_oauth2_grant_types_supported(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OAuth2GrantType>> {
146        &self.oauth2_grant_types_supported
147    }
148    /// Appends an item to `oauth2_custom_properties`.
149    ///
150    /// To override the contents of this collection use [`set_oauth2_custom_properties`](Self::set_oauth2_custom_properties).
151    ///
152    /// <p>List of custom parameters required for OAuth 2.0 authentication.</p>
153    pub fn oauth2_custom_properties(mut self, input: crate::types::OAuth2CustomParameter) -> Self {
154        let mut v = self.oauth2_custom_properties.unwrap_or_default();
155        v.push(input);
156        self.oauth2_custom_properties = ::std::option::Option::Some(v);
157        self
158    }
159    /// <p>List of custom parameters required for OAuth 2.0 authentication.</p>
160    pub fn set_oauth2_custom_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OAuth2CustomParameter>>) -> Self {
161        self.oauth2_custom_properties = input;
162        self
163    }
164    /// <p>List of custom parameters required for OAuth 2.0 authentication.</p>
165    pub fn get_oauth2_custom_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OAuth2CustomParameter>> {
166        &self.oauth2_custom_properties
167    }
168    /// Consumes the builder and constructs a [`OAuth2Defaults`](crate::types::OAuth2Defaults).
169    pub fn build(self) -> crate::types::OAuth2Defaults {
170        crate::types::OAuth2Defaults {
171            oauth_scopes: self.oauth_scopes,
172            token_urls: self.token_urls,
173            auth_code_urls: self.auth_code_urls,
174            oauth2_grant_types_supported: self.oauth2_grant_types_supported,
175            oauth2_custom_properties: self.oauth2_custom_properties,
176        }
177    }
178}