#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeAgentInput {
pub agent_arn: ::std::option::Option<::std::string::String>,
}
impl DescribeAgentInput {
pub fn agent_arn(&self) -> ::std::option::Option<&str> {
self.agent_arn.as_deref()
}
}
static DESCRIBEAGENTINPUT_MEMBER_AGENT_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.datasync.synthetic#DescribeAgentInput$AgentArn",
"com.amazonaws.datasync.synthetic",
"DescribeAgentInput",
),
::aws_smithy_schema::ShapeType::String,
"AgentArn",
0,
);
static DESCRIBEAGENTINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.datasync.synthetic#DescribeAgentInput",
"com.amazonaws.datasync.synthetic",
"DescribeAgentInput",
),
::aws_smithy_schema::ShapeType::Structure,
&[&DESCRIBEAGENTINPUT_MEMBER_AGENT_ARN],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DescribeAgentRequest");
impl DescribeAgentInput {
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEAGENTINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeAgentInput {
fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
Self::SCHEMA
}
#[allow(unused_variables, clippy::diverging_sub_expression)]
fn serialize_members(
&self,
ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
if let Some(ref val) = self.agent_arn {
ser.write_string(&DESCRIBEAGENTINPUT_MEMBER_AGENT_ARN, val)?;
}
Ok(())
}
}
impl crate::operation::describe_agent::builders::DescribeAgentInputBuilder {
#[allow(
unused_variables,
unreachable_code,
clippy::single_match,
clippy::match_single_binding,
clippy::diverging_sub_expression
)]
pub(crate) fn deserialize_members(
&mut self,
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
deserializer.read_struct(&DESCRIBEAGENTINPUT_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.agent_arn = Some(deser.read_string(member)?);
}
}
_ => {}
}
Ok(())
})
}
}
impl DescribeAgentInput {
pub fn deserialize(
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
let mut builder = Self::builder();
builder.deserialize_members(deserializer)?;
builder.agent_arn = builder.agent_arn.or(Some(String::new()));
builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
}
}
impl DescribeAgentInput {
pub fn builder() -> crate::operation::describe_agent::builders::DescribeAgentInputBuilder {
crate::operation::describe_agent::builders::DescribeAgentInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeAgentInputBuilder {
pub(crate) agent_arn: ::std::option::Option<::std::string::String>,
}
impl DescribeAgentInputBuilder {
pub fn agent_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_agent_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_arn = input;
self
}
pub fn get_agent_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_arn
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::describe_agent::DescribeAgentInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::describe_agent::DescribeAgentInput { agent_arn: self.agent_arn })
}
}