aws_sdk_athena/operation/get_session_endpoint/
_get_session_endpoint_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetSessionEndpointOutput {
6 pub endpoint_url: ::std::string::String,
8 pub auth_token: ::std::string::String,
10 pub auth_token_expiration_time: ::aws_smithy_types::DateTime,
12 _request_id: Option<String>,
13}
14impl GetSessionEndpointOutput {
15 pub fn endpoint_url(&self) -> &str {
17 use std::ops::Deref;
18 self.endpoint_url.deref()
19 }
20 pub fn auth_token(&self) -> &str {
22 use std::ops::Deref;
23 self.auth_token.deref()
24 }
25 pub fn auth_token_expiration_time(&self) -> &::aws_smithy_types::DateTime {
27 &self.auth_token_expiration_time
28 }
29}
30impl ::aws_types::request_id::RequestId for GetSessionEndpointOutput {
31 fn request_id(&self) -> Option<&str> {
32 self._request_id.as_deref()
33 }
34}
35impl GetSessionEndpointOutput {
36 pub fn builder() -> crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder {
38 crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::default()
39 }
40}
41
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct GetSessionEndpointOutputBuilder {
46 pub(crate) endpoint_url: ::std::option::Option<::std::string::String>,
47 pub(crate) auth_token: ::std::option::Option<::std::string::String>,
48 pub(crate) auth_token_expiration_time: ::std::option::Option<::aws_smithy_types::DateTime>,
49 _request_id: Option<String>,
50}
51impl GetSessionEndpointOutputBuilder {
52 pub fn endpoint_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55 self.endpoint_url = ::std::option::Option::Some(input.into());
56 self
57 }
58 pub fn set_endpoint_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60 self.endpoint_url = input;
61 self
62 }
63 pub fn get_endpoint_url(&self) -> &::std::option::Option<::std::string::String> {
65 &self.endpoint_url
66 }
67 pub fn auth_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.auth_token = ::std::option::Option::Some(input.into());
71 self
72 }
73 pub fn set_auth_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.auth_token = input;
76 self
77 }
78 pub fn get_auth_token(&self) -> &::std::option::Option<::std::string::String> {
80 &self.auth_token
81 }
82 pub fn auth_token_expiration_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
85 self.auth_token_expiration_time = ::std::option::Option::Some(input);
86 self
87 }
88 pub fn set_auth_token_expiration_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
90 self.auth_token_expiration_time = input;
91 self
92 }
93 pub fn get_auth_token_expiration_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
95 &self.auth_token_expiration_time
96 }
97 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
98 self._request_id = Some(request_id.into());
99 self
100 }
101
102 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
103 self._request_id = request_id;
104 self
105 }
106 pub fn build(
112 self,
113 ) -> ::std::result::Result<crate::operation::get_session_endpoint::GetSessionEndpointOutput, ::aws_smithy_types::error::operation::BuildError>
114 {
115 ::std::result::Result::Ok(crate::operation::get_session_endpoint::GetSessionEndpointOutput {
116 endpoint_url: self.endpoint_url.ok_or_else(|| {
117 ::aws_smithy_types::error::operation::BuildError::missing_field(
118 "endpoint_url",
119 "endpoint_url was not specified but it is required when building GetSessionEndpointOutput",
120 )
121 })?,
122 auth_token: self.auth_token.ok_or_else(|| {
123 ::aws_smithy_types::error::operation::BuildError::missing_field(
124 "auth_token",
125 "auth_token was not specified but it is required when building GetSessionEndpointOutput",
126 )
127 })?,
128 auth_token_expiration_time: self.auth_token_expiration_time.ok_or_else(|| {
129 ::aws_smithy_types::error::operation::BuildError::missing_field(
130 "auth_token_expiration_time",
131 "auth_token_expiration_time was not specified but it is required when building GetSessionEndpointOutput",
132 )
133 })?,
134 _request_id: self._request_id,
135 })
136 }
137}