aws_sdk_iot/operation/test_invoke_authorizer/
_test_invoke_authorizer_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct TestInvokeAuthorizerOutput {
6 pub is_authenticated: ::std::option::Option<bool>,
8 pub principal_id: ::std::option::Option<::std::string::String>,
10 pub policy_documents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12 pub refresh_after_in_seconds: ::std::option::Option<i32>,
14 pub disconnect_after_in_seconds: ::std::option::Option<i32>,
16 _request_id: Option<String>,
17}
18impl TestInvokeAuthorizerOutput {
19 pub fn is_authenticated(&self) -> ::std::option::Option<bool> {
21 self.is_authenticated
22 }
23 pub fn principal_id(&self) -> ::std::option::Option<&str> {
25 self.principal_id.as_deref()
26 }
27 pub fn policy_documents(&self) -> &[::std::string::String] {
31 self.policy_documents.as_deref().unwrap_or_default()
32 }
33 pub fn refresh_after_in_seconds(&self) -> ::std::option::Option<i32> {
35 self.refresh_after_in_seconds
36 }
37 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 pub fn builder() -> crate::operation::test_invoke_authorizer::builders::TestInvokeAuthorizerOutputBuilder {
50 crate::operation::test_invoke_authorizer::builders::TestInvokeAuthorizerOutputBuilder::default()
51 }
52}
53
54#[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 pub fn is_authenticated(mut self, input: bool) -> Self {
68 self.is_authenticated = ::std::option::Option::Some(input);
69 self
70 }
71 pub fn set_is_authenticated(mut self, input: ::std::option::Option<bool>) -> Self {
73 self.is_authenticated = input;
74 self
75 }
76 pub fn get_is_authenticated(&self) -> &::std::option::Option<bool> {
78 &self.is_authenticated
79 }
80 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 pub fn set_principal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.principal_id = input;
88 self
89 }
90 pub fn get_principal_id(&self) -> &::std::option::Option<::std::string::String> {
92 &self.principal_id
93 }
94 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 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 pub fn get_policy_documents(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
112 &self.policy_documents
113 }
114 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 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 pub fn get_refresh_after_in_seconds(&self) -> &::std::option::Option<i32> {
126 &self.refresh_after_in_seconds
127 }
128 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 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 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 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}