aws_sdk_appflow/types/
_google_analytics_connector_profile_credentials.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct GoogleAnalyticsConnectorProfileCredentials {
7 pub client_id: ::std::string::String,
9 pub client_secret: ::std::string::String,
11 pub access_token: ::std::option::Option<::std::string::String>,
13 pub refresh_token: ::std::option::Option<::std::string::String>,
15 pub o_auth_request: ::std::option::Option<crate::types::ConnectorOAuthRequest>,
17}
18impl GoogleAnalyticsConnectorProfileCredentials {
19 pub fn client_id(&self) -> &str {
21 use std::ops::Deref;
22 self.client_id.deref()
23 }
24 pub fn client_secret(&self) -> &str {
26 use std::ops::Deref;
27 self.client_secret.deref()
28 }
29 pub fn access_token(&self) -> ::std::option::Option<&str> {
31 self.access_token.as_deref()
32 }
33 pub fn refresh_token(&self) -> ::std::option::Option<&str> {
35 self.refresh_token.as_deref()
36 }
37 pub fn o_auth_request(&self) -> ::std::option::Option<&crate::types::ConnectorOAuthRequest> {
39 self.o_auth_request.as_ref()
40 }
41}
42impl ::std::fmt::Debug for GoogleAnalyticsConnectorProfileCredentials {
43 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
44 let mut formatter = f.debug_struct("GoogleAnalyticsConnectorProfileCredentials");
45 formatter.field("client_id", &self.client_id);
46 formatter.field("client_secret", &"*** Sensitive Data Redacted ***");
47 formatter.field("access_token", &"*** Sensitive Data Redacted ***");
48 formatter.field("refresh_token", &self.refresh_token);
49 formatter.field("o_auth_request", &self.o_auth_request);
50 formatter.finish()
51 }
52}
53impl GoogleAnalyticsConnectorProfileCredentials {
54 pub fn builder() -> crate::types::builders::GoogleAnalyticsConnectorProfileCredentialsBuilder {
56 crate::types::builders::GoogleAnalyticsConnectorProfileCredentialsBuilder::default()
57 }
58}
59
60#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
62#[non_exhaustive]
63pub struct GoogleAnalyticsConnectorProfileCredentialsBuilder {
64 pub(crate) client_id: ::std::option::Option<::std::string::String>,
65 pub(crate) client_secret: ::std::option::Option<::std::string::String>,
66 pub(crate) access_token: ::std::option::Option<::std::string::String>,
67 pub(crate) refresh_token: ::std::option::Option<::std::string::String>,
68 pub(crate) o_auth_request: ::std::option::Option<crate::types::ConnectorOAuthRequest>,
69}
70impl GoogleAnalyticsConnectorProfileCredentialsBuilder {
71 pub fn client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74 self.client_id = ::std::option::Option::Some(input.into());
75 self
76 }
77 pub fn set_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79 self.client_id = input;
80 self
81 }
82 pub fn get_client_id(&self) -> &::std::option::Option<::std::string::String> {
84 &self.client_id
85 }
86 pub fn client_secret(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.client_secret = ::std::option::Option::Some(input.into());
90 self
91 }
92 pub fn set_client_secret(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.client_secret = input;
95 self
96 }
97 pub fn get_client_secret(&self) -> &::std::option::Option<::std::string::String> {
99 &self.client_secret
100 }
101 pub fn access_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.access_token = ::std::option::Option::Some(input.into());
104 self
105 }
106 pub fn set_access_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.access_token = input;
109 self
110 }
111 pub fn get_access_token(&self) -> &::std::option::Option<::std::string::String> {
113 &self.access_token
114 }
115 pub fn refresh_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.refresh_token = ::std::option::Option::Some(input.into());
118 self
119 }
120 pub fn set_refresh_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.refresh_token = input;
123 self
124 }
125 pub fn get_refresh_token(&self) -> &::std::option::Option<::std::string::String> {
127 &self.refresh_token
128 }
129 pub fn o_auth_request(mut self, input: crate::types::ConnectorOAuthRequest) -> Self {
131 self.o_auth_request = ::std::option::Option::Some(input);
132 self
133 }
134 pub fn set_o_auth_request(mut self, input: ::std::option::Option<crate::types::ConnectorOAuthRequest>) -> Self {
136 self.o_auth_request = input;
137 self
138 }
139 pub fn get_o_auth_request(&self) -> &::std::option::Option<crate::types::ConnectorOAuthRequest> {
141 &self.o_auth_request
142 }
143 pub fn build(
148 self,
149 ) -> ::std::result::Result<crate::types::GoogleAnalyticsConnectorProfileCredentials, ::aws_smithy_types::error::operation::BuildError> {
150 ::std::result::Result::Ok(crate::types::GoogleAnalyticsConnectorProfileCredentials {
151 client_id: self.client_id.ok_or_else(|| {
152 ::aws_smithy_types::error::operation::BuildError::missing_field(
153 "client_id",
154 "client_id was not specified but it is required when building GoogleAnalyticsConnectorProfileCredentials",
155 )
156 })?,
157 client_secret: self.client_secret.ok_or_else(|| {
158 ::aws_smithy_types::error::operation::BuildError::missing_field(
159 "client_secret",
160 "client_secret was not specified but it is required when building GoogleAnalyticsConnectorProfileCredentials",
161 )
162 })?,
163 access_token: self.access_token,
164 refresh_token: self.refresh_token,
165 o_auth_request: self.o_auth_request,
166 })
167 }
168}
169impl ::std::fmt::Debug for GoogleAnalyticsConnectorProfileCredentialsBuilder {
170 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
171 let mut formatter = f.debug_struct("GoogleAnalyticsConnectorProfileCredentialsBuilder");
172 formatter.field("client_id", &self.client_id);
173 formatter.field("client_secret", &"*** Sensitive Data Redacted ***");
174 formatter.field("access_token", &"*** Sensitive Data Redacted ***");
175 formatter.field("refresh_token", &self.refresh_token);
176 formatter.field("o_auth_request", &self.o_auth_request);
177 formatter.finish()
178 }
179}