#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PrepareAgentOutput {
pub agent_id: ::std::string::String,
pub agent_status: crate::types::AgentStatus,
pub agent_version: ::std::string::String,
pub prepared_at: ::aws_smithy_types::DateTime,
_request_id: Option<String>,
}
impl PrepareAgentOutput {
pub fn agent_id(&self) -> &str {
use std::ops::Deref;
self.agent_id.deref()
}
pub fn agent_status(&self) -> &crate::types::AgentStatus {
&self.agent_status
}
pub fn agent_version(&self) -> &str {
use std::ops::Deref;
self.agent_version.deref()
}
pub fn prepared_at(&self) -> &::aws_smithy_types::DateTime {
&self.prepared_at
}
}
impl ::aws_types::request_id::RequestId for PrepareAgentOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl PrepareAgentOutput {
pub fn builder() -> crate::operation::prepare_agent::builders::PrepareAgentOutputBuilder {
crate::operation::prepare_agent::builders::PrepareAgentOutputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PrepareAgentOutputBuilder {
pub(crate) agent_id: ::std::option::Option<::std::string::String>,
pub(crate) agent_status: ::std::option::Option<crate::types::AgentStatus>,
pub(crate) agent_version: ::std::option::Option<::std::string::String>,
pub(crate) prepared_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl PrepareAgentOutputBuilder {
pub fn agent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_agent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_id = input;
self
}
pub fn get_agent_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_id
}
pub fn agent_status(mut self, input: crate::types::AgentStatus) -> Self {
self.agent_status = ::std::option::Option::Some(input);
self
}
pub fn set_agent_status(mut self, input: ::std::option::Option<crate::types::AgentStatus>) -> Self {
self.agent_status = input;
self
}
pub fn get_agent_status(&self) -> &::std::option::Option<crate::types::AgentStatus> {
&self.agent_status
}
pub fn agent_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_version = ::std::option::Option::Some(input.into());
self
}
pub fn set_agent_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_version = input;
self
}
pub fn get_agent_version(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_version
}
pub fn prepared_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.prepared_at = ::std::option::Option::Some(input);
self
}
pub fn set_prepared_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.prepared_at = input;
self
}
pub fn get_prepared_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.prepared_at
}
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::prepare_agent::PrepareAgentOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::prepare_agent::PrepareAgentOutput {
agent_id: self.agent_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"agent_id",
"agent_id was not specified but it is required when building PrepareAgentOutput",
)
})?,
agent_status: self.agent_status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"agent_status",
"agent_status was not specified but it is required when building PrepareAgentOutput",
)
})?,
agent_version: self.agent_version.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"agent_version",
"agent_version was not specified but it is required when building PrepareAgentOutput",
)
})?,
prepared_at: self.prepared_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"prepared_at",
"prepared_at was not specified but it is required when building PrepareAgentOutput",
)
})?,
_request_id: self._request_id,
})
}
}