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