#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateAgentOutput {
pub arn: ::std::string::String,
pub agent_id: ::std::string::String,
pub agent_status: crate::types::AgentStatus,
pub agent_name: ::std::string::String,
pub request_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl CreateAgentOutput {
pub fn arn(&self) -> &str {
use std::ops::Deref;
self.arn.deref()
}
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_name(&self) -> &str {
use std::ops::Deref;
self.agent_name.deref()
}
pub fn request_id(&self) -> ::std::option::Option<&str> {
self.request_id.as_deref()
}
}
impl ::aws_types::request_id::RequestId for CreateAgentOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateAgentOutput {
pub fn builder() -> crate::operation::create_agent::builders::CreateAgentOutputBuilder {
crate::operation::create_agent::builders::CreateAgentOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateAgentOutputBuilder {
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) agent_id: ::std::option::Option<::std::string::String>,
pub(crate) agent_status: ::std::option::Option<crate::types::AgentStatus>,
pub(crate) agent_name: ::std::option::Option<::std::string::String>,
pub(crate) request_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl CreateAgentOutputBuilder {
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
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_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_agent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_name = input;
self
}
pub fn get_agent_name(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_name
}
pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.request_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.request_id = input;
self
}
pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
&self.request_id
}
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::create_agent::CreateAgentOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_agent::CreateAgentOutput {
arn: self.arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"arn",
"arn was not specified but it is required when building CreateAgentOutput",
)
})?,
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 CreateAgentOutput",
)
})?,
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 CreateAgentOutput",
)
})?,
agent_name: self.agent_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"agent_name",
"agent_name was not specified but it is required when building CreateAgentOutput",
)
})?,
request_id: self.request_id,
_request_id: self._request_id,
})
}
}