#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct RefreshTokenOutput {
pub access_token: ::std::string::String,
pub expires_in: i32,
_request_id: Option<String>,
}
impl RefreshTokenOutput {
pub fn access_token(&self) -> &str {
use std::ops::Deref;
self.access_token.deref()
}
pub fn expires_in(&self) -> i32 {
self.expires_in
}
}
impl ::std::fmt::Debug for RefreshTokenOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("RefreshTokenOutput");
formatter.field("access_token", &"*** Sensitive Data Redacted ***");
formatter.field("expires_in", &self.expires_in);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for RefreshTokenOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl RefreshTokenOutput {
pub fn builder() -> crate::operation::refresh_token::builders::RefreshTokenOutputBuilder {
crate::operation::refresh_token::builders::RefreshTokenOutputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct RefreshTokenOutputBuilder {
pub(crate) access_token: ::std::option::Option<::std::string::String>,
pub(crate) expires_in: ::std::option::Option<i32>,
_request_id: Option<String>,
}
impl RefreshTokenOutputBuilder {
pub fn access_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.access_token = ::std::option::Option::Some(input.into());
self
}
pub fn set_access_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.access_token = input;
self
}
pub fn get_access_token(&self) -> &::std::option::Option<::std::string::String> {
&self.access_token
}
pub fn expires_in(mut self, input: i32) -> Self {
self.expires_in = ::std::option::Option::Some(input);
self
}
pub fn set_expires_in(mut self, input: ::std::option::Option<i32>) -> Self {
self.expires_in = input;
self
}
pub fn get_expires_in(&self) -> &::std::option::Option<i32> {
&self.expires_in
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::refresh_token::RefreshTokenOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::refresh_token::RefreshTokenOutput {
access_token: self.access_token.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"access_token",
"access_token was not specified but it is required when building RefreshTokenOutput",
)
})?,
expires_in: self.expires_in.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"expires_in",
"expires_in was not specified but it is required when building RefreshTokenOutput",
)
})?,
_request_id: self._request_id,
})
}
}
impl ::std::fmt::Debug for RefreshTokenOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("RefreshTokenOutputBuilder");
formatter.field("access_token", &"*** Sensitive Data Redacted ***");
formatter.field("expires_in", &self.expires_in);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}