aws_sdk_amplifybackend/operation/create_token/
_create_token_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateTokenOutput {
6    /// <p>The app ID.</p>
7    pub app_id: ::std::option::Option<::std::string::String>,
8    /// <p>One-time challenge code for authenticating into the Amplify Admin UI.</p>
9    pub challenge_code: ::std::option::Option<::std::string::String>,
10    /// <p>A unique ID provided when creating a new challenge token.</p>
11    pub session_id: ::std::option::Option<::std::string::String>,
12    /// <p>The expiry time for the one-time generated token code.</p>
13    pub ttl: ::std::option::Option<::std::string::String>,
14    _request_id: Option<String>,
15}
16impl CreateTokenOutput {
17    /// <p>The app ID.</p>
18    pub fn app_id(&self) -> ::std::option::Option<&str> {
19        self.app_id.as_deref()
20    }
21    /// <p>One-time challenge code for authenticating into the Amplify Admin UI.</p>
22    pub fn challenge_code(&self) -> ::std::option::Option<&str> {
23        self.challenge_code.as_deref()
24    }
25    /// <p>A unique ID provided when creating a new challenge token.</p>
26    pub fn session_id(&self) -> ::std::option::Option<&str> {
27        self.session_id.as_deref()
28    }
29    /// <p>The expiry time for the one-time generated token code.</p>
30    pub fn ttl(&self) -> ::std::option::Option<&str> {
31        self.ttl.as_deref()
32    }
33}
34impl ::aws_types::request_id::RequestId for CreateTokenOutput {
35    fn request_id(&self) -> Option<&str> {
36        self._request_id.as_deref()
37    }
38}
39impl CreateTokenOutput {
40    /// Creates a new builder-style object to manufacture [`CreateTokenOutput`](crate::operation::create_token::CreateTokenOutput).
41    pub fn builder() -> crate::operation::create_token::builders::CreateTokenOutputBuilder {
42        crate::operation::create_token::builders::CreateTokenOutputBuilder::default()
43    }
44}
45
46/// A builder for [`CreateTokenOutput`](crate::operation::create_token::CreateTokenOutput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateTokenOutputBuilder {
50    pub(crate) app_id: ::std::option::Option<::std::string::String>,
51    pub(crate) challenge_code: ::std::option::Option<::std::string::String>,
52    pub(crate) session_id: ::std::option::Option<::std::string::String>,
53    pub(crate) ttl: ::std::option::Option<::std::string::String>,
54    _request_id: Option<String>,
55}
56impl CreateTokenOutputBuilder {
57    /// <p>The app ID.</p>
58    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.app_id = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The app ID.</p>
63    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.app_id = input;
65        self
66    }
67    /// <p>The app ID.</p>
68    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
69        &self.app_id
70    }
71    /// <p>One-time challenge code for authenticating into the Amplify Admin UI.</p>
72    pub fn challenge_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.challenge_code = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>One-time challenge code for authenticating into the Amplify Admin UI.</p>
77    pub fn set_challenge_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.challenge_code = input;
79        self
80    }
81    /// <p>One-time challenge code for authenticating into the Amplify Admin UI.</p>
82    pub fn get_challenge_code(&self) -> &::std::option::Option<::std::string::String> {
83        &self.challenge_code
84    }
85    /// <p>A unique ID provided when creating a new challenge token.</p>
86    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.session_id = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>A unique ID provided when creating a new challenge token.</p>
91    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.session_id = input;
93        self
94    }
95    /// <p>A unique ID provided when creating a new challenge token.</p>
96    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
97        &self.session_id
98    }
99    /// <p>The expiry time for the one-time generated token code.</p>
100    pub fn ttl(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.ttl = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The expiry time for the one-time generated token code.</p>
105    pub fn set_ttl(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.ttl = input;
107        self
108    }
109    /// <p>The expiry time for the one-time generated token code.</p>
110    pub fn get_ttl(&self) -> &::std::option::Option<::std::string::String> {
111        &self.ttl
112    }
113    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
114        self._request_id = Some(request_id.into());
115        self
116    }
117
118    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
119        self._request_id = request_id;
120        self
121    }
122    /// Consumes the builder and constructs a [`CreateTokenOutput`](crate::operation::create_token::CreateTokenOutput).
123    pub fn build(self) -> crate::operation::create_token::CreateTokenOutput {
124        crate::operation::create_token::CreateTokenOutput {
125            app_id: self.app_id,
126            challenge_code: self.challenge_code,
127            session_id: self.session_id,
128            ttl: self.ttl,
129            _request_id: self._request_id,
130        }
131    }
132}