aws_sdk_licensemanager/operation/create_token/
_create_token_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateTokenOutput {
6 pub token_id: ::std::option::Option<::std::string::String>,
8 pub token_type: ::std::option::Option<crate::types::TokenType>,
10 pub token: ::std::option::Option<::std::string::String>,
12 _request_id: Option<String>,
13}
14impl CreateTokenOutput {
15 pub fn token_id(&self) -> ::std::option::Option<&str> {
17 self.token_id.as_deref()
18 }
19 pub fn token_type(&self) -> ::std::option::Option<&crate::types::TokenType> {
21 self.token_type.as_ref()
22 }
23 pub fn token(&self) -> ::std::option::Option<&str> {
25 self.token.as_deref()
26 }
27}
28impl ::aws_types::request_id::RequestId for CreateTokenOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl CreateTokenOutput {
34 pub fn builder() -> crate::operation::create_token::builders::CreateTokenOutputBuilder {
36 crate::operation::create_token::builders::CreateTokenOutputBuilder::default()
37 }
38}
39
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateTokenOutputBuilder {
44 pub(crate) token_id: ::std::option::Option<::std::string::String>,
45 pub(crate) token_type: ::std::option::Option<crate::types::TokenType>,
46 pub(crate) token: ::std::option::Option<::std::string::String>,
47 _request_id: Option<String>,
48}
49impl CreateTokenOutputBuilder {
50 pub fn token_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52 self.token_id = ::std::option::Option::Some(input.into());
53 self
54 }
55 pub fn set_token_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57 self.token_id = input;
58 self
59 }
60 pub fn get_token_id(&self) -> &::std::option::Option<::std::string::String> {
62 &self.token_id
63 }
64 pub fn token_type(mut self, input: crate::types::TokenType) -> Self {
66 self.token_type = ::std::option::Option::Some(input);
67 self
68 }
69 pub fn set_token_type(mut self, input: ::std::option::Option<crate::types::TokenType>) -> Self {
71 self.token_type = input;
72 self
73 }
74 pub fn get_token_type(&self) -> &::std::option::Option<crate::types::TokenType> {
76 &self.token_type
77 }
78 pub fn token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80 self.token = ::std::option::Option::Some(input.into());
81 self
82 }
83 pub fn set_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85 self.token = input;
86 self
87 }
88 pub fn get_token(&self) -> &::std::option::Option<::std::string::String> {
90 &self.token
91 }
92 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93 self._request_id = Some(request_id.into());
94 self
95 }
96
97 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98 self._request_id = request_id;
99 self
100 }
101 pub fn build(self) -> crate::operation::create_token::CreateTokenOutput {
103 crate::operation::create_token::CreateTokenOutput {
104 token_id: self.token_id,
105 token_type: self.token_type,
106 token: self.token,
107 _request_id: self._request_id,
108 }
109 }
110}