aws_sdk_iot/operation/test_invoke_authorizer/
_test_invoke_authorizer_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 TestInvokeAuthorizerOutput {
6    /// <p>True if the token is authenticated, otherwise false.</p>
7    pub is_authenticated: ::std::option::Option<bool>,
8    /// <p>The principal ID.</p>
9    pub principal_id: ::std::option::Option<::std::string::String>,
10    /// <p>IAM policy documents.</p>
11    pub policy_documents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The number of seconds after which the temporary credentials are refreshed.</p>
13    pub refresh_after_in_seconds: ::std::option::Option<i32>,
14    /// <p>The number of seconds after which the connection is terminated.</p>
15    pub disconnect_after_in_seconds: ::std::option::Option<i32>,
16    _request_id: Option<String>,
17}
18impl TestInvokeAuthorizerOutput {
19    /// <p>True if the token is authenticated, otherwise false.</p>
20    pub fn is_authenticated(&self) -> ::std::option::Option<bool> {
21        self.is_authenticated
22    }
23    /// <p>The principal ID.</p>
24    pub fn principal_id(&self) -> ::std::option::Option<&str> {
25        self.principal_id.as_deref()
26    }
27    /// <p>IAM policy documents.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.policy_documents.is_none()`.
30    pub fn policy_documents(&self) -> &[::std::string::String] {
31        self.policy_documents.as_deref().unwrap_or_default()
32    }
33    /// <p>The number of seconds after which the temporary credentials are refreshed.</p>
34    pub fn refresh_after_in_seconds(&self) -> ::std::option::Option<i32> {
35        self.refresh_after_in_seconds
36    }
37    /// <p>The number of seconds after which the connection is terminated.</p>
38    pub fn disconnect_after_in_seconds(&self) -> ::std::option::Option<i32> {
39        self.disconnect_after_in_seconds
40    }
41}
42impl ::aws_types::request_id::RequestId for TestInvokeAuthorizerOutput {
43    fn request_id(&self) -> Option<&str> {
44        self._request_id.as_deref()
45    }
46}
47impl TestInvokeAuthorizerOutput {
48    /// Creates a new builder-style object to manufacture [`TestInvokeAuthorizerOutput`](crate::operation::test_invoke_authorizer::TestInvokeAuthorizerOutput).
49    pub fn builder() -> crate::operation::test_invoke_authorizer::builders::TestInvokeAuthorizerOutputBuilder {
50        crate::operation::test_invoke_authorizer::builders::TestInvokeAuthorizerOutputBuilder::default()
51    }
52}
53
54/// A builder for [`TestInvokeAuthorizerOutput`](crate::operation::test_invoke_authorizer::TestInvokeAuthorizerOutput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct TestInvokeAuthorizerOutputBuilder {
58    pub(crate) is_authenticated: ::std::option::Option<bool>,
59    pub(crate) principal_id: ::std::option::Option<::std::string::String>,
60    pub(crate) policy_documents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
61    pub(crate) refresh_after_in_seconds: ::std::option::Option<i32>,
62    pub(crate) disconnect_after_in_seconds: ::std::option::Option<i32>,
63    _request_id: Option<String>,
64}
65impl TestInvokeAuthorizerOutputBuilder {
66    /// <p>True if the token is authenticated, otherwise false.</p>
67    pub fn is_authenticated(mut self, input: bool) -> Self {
68        self.is_authenticated = ::std::option::Option::Some(input);
69        self
70    }
71    /// <p>True if the token is authenticated, otherwise false.</p>
72    pub fn set_is_authenticated(mut self, input: ::std::option::Option<bool>) -> Self {
73        self.is_authenticated = input;
74        self
75    }
76    /// <p>True if the token is authenticated, otherwise false.</p>
77    pub fn get_is_authenticated(&self) -> &::std::option::Option<bool> {
78        &self.is_authenticated
79    }
80    /// <p>The principal ID.</p>
81    pub fn principal_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.principal_id = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The principal ID.</p>
86    pub fn set_principal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.principal_id = input;
88        self
89    }
90    /// <p>The principal ID.</p>
91    pub fn get_principal_id(&self) -> &::std::option::Option<::std::string::String> {
92        &self.principal_id
93    }
94    /// Appends an item to `policy_documents`.
95    ///
96    /// To override the contents of this collection use [`set_policy_documents`](Self::set_policy_documents).
97    ///
98    /// <p>IAM policy documents.</p>
99    pub fn policy_documents(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        let mut v = self.policy_documents.unwrap_or_default();
101        v.push(input.into());
102        self.policy_documents = ::std::option::Option::Some(v);
103        self
104    }
105    /// <p>IAM policy documents.</p>
106    pub fn set_policy_documents(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
107        self.policy_documents = input;
108        self
109    }
110    /// <p>IAM policy documents.</p>
111    pub fn get_policy_documents(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
112        &self.policy_documents
113    }
114    /// <p>The number of seconds after which the temporary credentials are refreshed.</p>
115    pub fn refresh_after_in_seconds(mut self, input: i32) -> Self {
116        self.refresh_after_in_seconds = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>The number of seconds after which the temporary credentials are refreshed.</p>
120    pub fn set_refresh_after_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
121        self.refresh_after_in_seconds = input;
122        self
123    }
124    /// <p>The number of seconds after which the temporary credentials are refreshed.</p>
125    pub fn get_refresh_after_in_seconds(&self) -> &::std::option::Option<i32> {
126        &self.refresh_after_in_seconds
127    }
128    /// <p>The number of seconds after which the connection is terminated.</p>
129    pub fn disconnect_after_in_seconds(mut self, input: i32) -> Self {
130        self.disconnect_after_in_seconds = ::std::option::Option::Some(input);
131        self
132    }
133    /// <p>The number of seconds after which the connection is terminated.</p>
134    pub fn set_disconnect_after_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
135        self.disconnect_after_in_seconds = input;
136        self
137    }
138    /// <p>The number of seconds after which the connection is terminated.</p>
139    pub fn get_disconnect_after_in_seconds(&self) -> &::std::option::Option<i32> {
140        &self.disconnect_after_in_seconds
141    }
142    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
143        self._request_id = Some(request_id.into());
144        self
145    }
146
147    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
148        self._request_id = request_id;
149        self
150    }
151    /// Consumes the builder and constructs a [`TestInvokeAuthorizerOutput`](crate::operation::test_invoke_authorizer::TestInvokeAuthorizerOutput).
152    pub fn build(self) -> crate::operation::test_invoke_authorizer::TestInvokeAuthorizerOutput {
153        crate::operation::test_invoke_authorizer::TestInvokeAuthorizerOutput {
154            is_authenticated: self.is_authenticated,
155            principal_id: self.principal_id,
156            policy_documents: self.policy_documents,
157            refresh_after_in_seconds: self.refresh_after_in_seconds,
158            disconnect_after_in_seconds: self.disconnect_after_in_seconds,
159            _request_id: self._request_id,
160        }
161    }
162}