aws_sdk_amplifyuibuilder/operation/refresh_token/
_refresh_token_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct RefreshTokenOutput {
6 pub access_token: ::std::string::String,
8 pub expires_in: i32,
10 _request_id: Option<String>,
11}
12impl RefreshTokenOutput {
13 pub fn access_token(&self) -> &str {
15 use std::ops::Deref;
16 self.access_token.deref()
17 }
18 pub fn expires_in(&self) -> i32 {
20 self.expires_in
21 }
22}
23impl ::std::fmt::Debug for RefreshTokenOutput {
24 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
25 let mut formatter = f.debug_struct("RefreshTokenOutput");
26 formatter.field("access_token", &"*** Sensitive Data Redacted ***");
27 formatter.field("expires_in", &self.expires_in);
28 formatter.field("_request_id", &self._request_id);
29 formatter.finish()
30 }
31}
32impl ::aws_types::request_id::RequestId for RefreshTokenOutput {
33 fn request_id(&self) -> Option<&str> {
34 self._request_id.as_deref()
35 }
36}
37impl RefreshTokenOutput {
38 pub fn builder() -> crate::operation::refresh_token::builders::RefreshTokenOutputBuilder {
40 crate::operation::refresh_token::builders::RefreshTokenOutputBuilder::default()
41 }
42}
43
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
46#[non_exhaustive]
47pub struct RefreshTokenOutputBuilder {
48 pub(crate) access_token: ::std::option::Option<::std::string::String>,
49 pub(crate) expires_in: ::std::option::Option<i32>,
50 _request_id: Option<String>,
51}
52impl RefreshTokenOutputBuilder {
53 pub fn access_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56 self.access_token = ::std::option::Option::Some(input.into());
57 self
58 }
59 pub fn set_access_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61 self.access_token = input;
62 self
63 }
64 pub fn get_access_token(&self) -> &::std::option::Option<::std::string::String> {
66 &self.access_token
67 }
68 pub fn expires_in(mut self, input: i32) -> Self {
71 self.expires_in = ::std::option::Option::Some(input);
72 self
73 }
74 pub fn set_expires_in(mut self, input: ::std::option::Option<i32>) -> Self {
76 self.expires_in = input;
77 self
78 }
79 pub fn get_expires_in(&self) -> &::std::option::Option<i32> {
81 &self.expires_in
82 }
83 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
84 self._request_id = Some(request_id.into());
85 self
86 }
87
88 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
89 self._request_id = request_id;
90 self
91 }
92 pub fn build(
97 self,
98 ) -> ::std::result::Result<crate::operation::refresh_token::RefreshTokenOutput, ::aws_smithy_types::error::operation::BuildError> {
99 ::std::result::Result::Ok(crate::operation::refresh_token::RefreshTokenOutput {
100 access_token: self.access_token.ok_or_else(|| {
101 ::aws_smithy_types::error::operation::BuildError::missing_field(
102 "access_token",
103 "access_token was not specified but it is required when building RefreshTokenOutput",
104 )
105 })?,
106 expires_in: self.expires_in.ok_or_else(|| {
107 ::aws_smithy_types::error::operation::BuildError::missing_field(
108 "expires_in",
109 "expires_in was not specified but it is required when building RefreshTokenOutput",
110 )
111 })?,
112 _request_id: self._request_id,
113 })
114 }
115}
116impl ::std::fmt::Debug for RefreshTokenOutputBuilder {
117 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
118 let mut formatter = f.debug_struct("RefreshTokenOutputBuilder");
119 formatter.field("access_token", &"*** Sensitive Data Redacted ***");
120 formatter.field("expires_in", &self.expires_in);
121 formatter.field("_request_id", &self._request_id);
122 formatter.finish()
123 }
124}