Skip to main content

aws_sdk_athena/operation/get_session_endpoint/
_get_session_endpoint_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 GetSessionEndpointOutput {
6    /// <p>The endpoint for connecting to the session.</p>
7    pub endpoint_url: ::std::string::String,
8    /// <p>Authentication token for the connection</p>
9    pub auth_token: ::std::string::String,
10    /// <p>Expiration time of the auth token.</p>
11    pub auth_token_expiration_time: ::aws_smithy_types::DateTime,
12    _request_id: Option<String>,
13}
14impl GetSessionEndpointOutput {
15    /// <p>The endpoint for connecting to the session.</p>
16    pub fn endpoint_url(&self) -> &str {
17        use std::ops::Deref;
18        self.endpoint_url.deref()
19    }
20    /// <p>Authentication token for the connection</p>
21    pub fn auth_token(&self) -> &str {
22        use std::ops::Deref;
23        self.auth_token.deref()
24    }
25    /// <p>Expiration time of the auth token.</p>
26    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    /// Creates a new builder-style object to manufacture [`GetSessionEndpointOutput`](crate::operation::get_session_endpoint::GetSessionEndpointOutput).
37    pub fn builder() -> crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder {
38        crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::default()
39    }
40}
41
42/// A builder for [`GetSessionEndpointOutput`](crate::operation::get_session_endpoint::GetSessionEndpointOutput).
43#[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    /// <p>The endpoint for connecting to the session.</p>
53    /// This field is required.
54    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    /// <p>The endpoint for connecting to the session.</p>
59    pub fn set_endpoint_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.endpoint_url = input;
61        self
62    }
63    /// <p>The endpoint for connecting to the session.</p>
64    pub fn get_endpoint_url(&self) -> &::std::option::Option<::std::string::String> {
65        &self.endpoint_url
66    }
67    /// <p>Authentication token for the connection</p>
68    /// This field is required.
69    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    /// <p>Authentication token for the connection</p>
74    pub fn set_auth_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.auth_token = input;
76        self
77    }
78    /// <p>Authentication token for the connection</p>
79    pub fn get_auth_token(&self) -> &::std::option::Option<::std::string::String> {
80        &self.auth_token
81    }
82    /// <p>Expiration time of the auth token.</p>
83    /// This field is required.
84    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    /// <p>Expiration time of the auth token.</p>
89    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    /// <p>Expiration time of the auth token.</p>
94    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    /// Consumes the builder and constructs a [`GetSessionEndpointOutput`](crate::operation::get_session_endpoint::GetSessionEndpointOutput).
107    /// This method will fail if any of the following fields are not set:
108    /// - [`endpoint_url`](crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::endpoint_url)
109    /// - [`auth_token`](crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::auth_token)
110    /// - [`auth_token_expiration_time`](crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::auth_token_expiration_time)
111    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}