aws_sdk_deadline/operation/get_session/
_get_session_output.rs#[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 fleet_id: ::std::string::String,
pub worker_id: ::std::string::String,
pub started_at: ::aws_smithy_types::DateTime,
pub log: ::std::option::Option<crate::types::LogConfiguration>,
pub lifecycle_status: crate::types::SessionLifecycleStatus,
pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub updated_by: ::std::option::Option<::std::string::String>,
pub target_lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>,
pub host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
pub worker_log: ::std::option::Option<crate::types::LogConfiguration>,
_request_id: Option<String>,
}
impl GetSessionOutput {
pub fn session_id(&self) -> &str {
use std::ops::Deref;
self.session_id.deref()
}
pub fn fleet_id(&self) -> &str {
use std::ops::Deref;
self.fleet_id.deref()
}
pub fn worker_id(&self) -> &str {
use std::ops::Deref;
self.worker_id.deref()
}
pub fn started_at(&self) -> &::aws_smithy_types::DateTime {
&self.started_at
}
pub fn log(&self) -> ::std::option::Option<&crate::types::LogConfiguration> {
self.log.as_ref()
}
pub fn lifecycle_status(&self) -> &crate::types::SessionLifecycleStatus {
&self.lifecycle_status
}
pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.ended_at.as_ref()
}
pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
pub fn updated_by(&self) -> ::std::option::Option<&str> {
self.updated_by.as_deref()
}
pub fn target_lifecycle_status(&self) -> ::std::option::Option<&crate::types::SessionLifecycleTargetStatus> {
self.target_lifecycle_status.as_ref()
}
pub fn host_properties(&self) -> ::std::option::Option<&crate::types::HostPropertiesResponse> {
self.host_properties.as_ref()
}
pub fn worker_log(&self) -> ::std::option::Option<&crate::types::LogConfiguration> {
self.worker_log.as_ref()
}
}
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) fleet_id: ::std::option::Option<::std::string::String>,
pub(crate) worker_id: ::std::option::Option<::std::string::String>,
pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) log: ::std::option::Option<crate::types::LogConfiguration>,
pub(crate) lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleStatus>,
pub(crate) ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_by: ::std::option::Option<::std::string::String>,
pub(crate) target_lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>,
pub(crate) host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
pub(crate) worker_log: ::std::option::Option<crate::types::LogConfiguration>,
_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 fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.fleet_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.fleet_id = input;
self
}
pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
&self.fleet_id
}
pub fn worker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.worker_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_worker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.worker_id = input;
self
}
pub fn get_worker_id(&self) -> &::std::option::Option<::std::string::String> {
&self.worker_id
}
pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.started_at = ::std::option::Option::Some(input);
self
}
pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.started_at = input;
self
}
pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.started_at
}
pub fn log(mut self, input: crate::types::LogConfiguration) -> Self {
self.log = ::std::option::Option::Some(input);
self
}
pub fn set_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
self.log = input;
self
}
pub fn get_log(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
&self.log
}
pub fn lifecycle_status(mut self, input: crate::types::SessionLifecycleStatus) -> Self {
self.lifecycle_status = ::std::option::Option::Some(input);
self
}
pub fn set_lifecycle_status(mut self, input: ::std::option::Option<crate::types::SessionLifecycleStatus>) -> Self {
self.lifecycle_status = input;
self
}
pub fn get_lifecycle_status(&self) -> &::std::option::Option<crate::types::SessionLifecycleStatus> {
&self.lifecycle_status
}
pub fn ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.ended_at = ::std::option::Option::Some(input);
self
}
pub fn set_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.ended_at = input;
self
}
pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.ended_at
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.updated_by = ::std::option::Option::Some(input.into());
self
}
pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.updated_by = input;
self
}
pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
&self.updated_by
}
pub fn target_lifecycle_status(mut self, input: crate::types::SessionLifecycleTargetStatus) -> Self {
self.target_lifecycle_status = ::std::option::Option::Some(input);
self
}
pub fn set_target_lifecycle_status(mut self, input: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>) -> Self {
self.target_lifecycle_status = input;
self
}
pub fn get_target_lifecycle_status(&self) -> &::std::option::Option<crate::types::SessionLifecycleTargetStatus> {
&self.target_lifecycle_status
}
pub fn host_properties(mut self, input: crate::types::HostPropertiesResponse) -> Self {
self.host_properties = ::std::option::Option::Some(input);
self
}
pub fn set_host_properties(mut self, input: ::std::option::Option<crate::types::HostPropertiesResponse>) -> Self {
self.host_properties = input;
self
}
pub fn get_host_properties(&self) -> &::std::option::Option<crate::types::HostPropertiesResponse> {
&self.host_properties
}
pub fn worker_log(mut self, input: crate::types::LogConfiguration) -> Self {
self.worker_log = ::std::option::Option::Some(input);
self
}
pub fn set_worker_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
self.worker_log = input;
self
}
pub fn get_worker_log(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
&self.worker_log
}
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",
)
})?,
fleet_id: self.fleet_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"fleet_id",
"fleet_id was not specified but it is required when building GetSessionOutput",
)
})?,
worker_id: self.worker_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"worker_id",
"worker_id was not specified but it is required when building GetSessionOutput",
)
})?,
started_at: self.started_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"started_at",
"started_at was not specified but it is required when building GetSessionOutput",
)
})?,
log: self.log,
lifecycle_status: self.lifecycle_status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"lifecycle_status",
"lifecycle_status was not specified but it is required when building GetSessionOutput",
)
})?,
ended_at: self.ended_at,
updated_at: self.updated_at,
updated_by: self.updated_by,
target_lifecycle_status: self.target_lifecycle_status,
host_properties: self.host_properties,
worker_log: self.worker_log,
_request_id: self._request_id,
})
}
}