aws_sdk_appflow/types/
_o_auth2_defaults.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct OAuth2Defaults {
7 pub oauth_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9 pub token_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11 pub auth_code_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13 pub oauth2_grant_types_supported: ::std::option::Option<::std::vec::Vec<crate::types::OAuth2GrantType>>,
15 pub oauth2_custom_properties: ::std::option::Option<::std::vec::Vec<crate::types::OAuth2CustomParameter>>,
17}
18impl OAuth2Defaults {
19 pub fn oauth_scopes(&self) -> &[::std::string::String] {
23 self.oauth_scopes.as_deref().unwrap_or_default()
24 }
25 pub fn token_urls(&self) -> &[::std::string::String] {
29 self.token_urls.as_deref().unwrap_or_default()
30 }
31 pub fn auth_code_urls(&self) -> &[::std::string::String] {
35 self.auth_code_urls.as_deref().unwrap_or_default()
36 }
37 pub fn oauth2_grant_types_supported(&self) -> &[crate::types::OAuth2GrantType] {
41 self.oauth2_grant_types_supported.as_deref().unwrap_or_default()
42 }
43 pub fn oauth2_custom_properties(&self) -> &[crate::types::OAuth2CustomParameter] {
47 self.oauth2_custom_properties.as_deref().unwrap_or_default()
48 }
49}
50impl OAuth2Defaults {
51 pub fn builder() -> crate::types::builders::OAuth2DefaultsBuilder {
53 crate::types::builders::OAuth2DefaultsBuilder::default()
54 }
55}
56
57#[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 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 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 pub fn get_oauth_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
86 &self.oauth_scopes
87 }
88 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 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 pub fn get_token_urls(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
106 &self.token_urls
107 }
108 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 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 pub fn get_auth_code_urls(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
126 &self.auth_code_urls
127 }
128 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 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 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 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 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 pub fn get_oauth2_custom_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OAuth2CustomParameter>> {
166 &self.oauth2_custom_properties
167 }
168 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}