#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetSessionOutput {
pub session_id: ::std::string::String,
pub session_arn: ::std::string::String,
pub session_status: crate::types::SessionStatus,
pub created_at: ::aws_smithy_types::DateTime,
pub last_updated_at: ::aws_smithy_types::DateTime,
pub session_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub encryption_key_arn: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetSessionOutput {
pub fn session_id(&self) -> &str {
use std::ops::Deref;
self.session_id.deref()
}
pub fn session_arn(&self) -> &str {
use std::ops::Deref;
self.session_arn.deref()
}
pub fn session_status(&self) -> &crate::types::SessionStatus {
&self.session_status
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
pub fn last_updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.last_updated_at
}
pub fn session_metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.session_metadata.as_ref()
}
pub fn encryption_key_arn(&self) -> ::std::option::Option<&str> {
self.encryption_key_arn.as_deref()
}
}
impl ::aws_types::request_id::RequestId for GetSessionOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetSessionOutput {
pub fn builder() -> crate::operation::get_session::builders::GetSessionOutputBuilder {
crate::operation::get_session::builders::GetSessionOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSessionOutputBuilder {
pub(crate) session_id: ::std::option::Option<::std::string::String>,
pub(crate) session_arn: ::std::option::Option<::std::string::String>,
pub(crate) session_status: ::std::option::Option<crate::types::SessionStatus>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) session_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) encryption_key_arn: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetSessionOutputBuilder {
pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_id = input;
self
}
pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
&self.session_id
}
pub fn session_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_session_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_arn = input;
self
}
pub fn get_session_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.session_arn
}
pub fn session_status(mut self, input: crate::types::SessionStatus) -> Self {
self.session_status = ::std::option::Option::Some(input);
self
}
pub fn set_session_status(mut self, input: ::std::option::Option<crate::types::SessionStatus>) -> Self {
self.session_status = input;
self
}
pub fn get_session_status(&self) -> &::std::option::Option<crate::types::SessionStatus> {
&self.session_status
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn last_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_last_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_updated_at = input;
self
}
pub fn get_last_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_updated_at
}
pub fn session_metadata(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.session_metadata.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.session_metadata = ::std::option::Option::Some(hash_map);
self
}
pub fn set_session_metadata(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.session_metadata = input;
self
}
pub fn get_session_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.session_metadata
}
pub fn encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.encryption_key_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.encryption_key_arn = input;
self
}
pub fn get_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.encryption_key_arn
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(self) -> ::std::result::Result<crate::operation::get_session::GetSessionOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_session::GetSessionOutput {
session_id: self.session_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"session_id",
"session_id was not specified but it is required when building GetSessionOutput",
)
})?,
session_arn: self.session_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"session_arn",
"session_arn was not specified but it is required when building GetSessionOutput",
)
})?,
session_status: self.session_status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"session_status",
"session_status was not specified but it is required when building GetSessionOutput",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building GetSessionOutput",
)
})?,
last_updated_at: self.last_updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"last_updated_at",
"last_updated_at was not specified but it is required when building GetSessionOutput",
)
})?,
session_metadata: self.session_metadata,
encryption_key_arn: self.encryption_key_arn,
_request_id: self._request_id,
})
}
}