aws_sdk_datasync/operation/describe_task/
_describe_task_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeTaskInput {
7 pub task_arn: ::std::option::Option<::std::string::String>,
9}
10impl DescribeTaskInput {
11 pub fn task_arn(&self) -> ::std::option::Option<&str> {
13 self.task_arn.as_deref()
14 }
15}
16static DESCRIBETASKINPUT_MEMBER_TASK_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
17 ::aws_smithy_schema::ShapeId::from_parts(
18 "com.amazonaws.datasync.synthetic#DescribeTaskInput$TaskArn",
19 "com.amazonaws.datasync.synthetic",
20 "DescribeTaskInput",
21 ),
22 ::aws_smithy_schema::ShapeType::String,
23 "TaskArn",
24 0,
25);
26static DESCRIBETASKINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
27 ::aws_smithy_schema::ShapeId::from_parts(
28 "com.amazonaws.datasync.synthetic#DescribeTaskInput",
29 "com.amazonaws.datasync.synthetic",
30 "DescribeTaskInput",
31 ),
32 ::aws_smithy_schema::ShapeType::Structure,
33 &[&DESCRIBETASKINPUT_MEMBER_TASK_ARN],
34)
35.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
36.with_original_name("DescribeTaskRequest");
37impl DescribeTaskInput {
38 pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBETASKINPUT_SCHEMA;
40}
41impl ::aws_smithy_schema::serde::SerializableStruct for DescribeTaskInput {
42 fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
43 Self::SCHEMA
44 }
45
46 #[allow(unused_variables, clippy::diverging_sub_expression)]
47 fn serialize_members(
48 &self,
49 ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
50 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
51 if let Some(ref val) = self.task_arn {
52 ser.write_string(&DESCRIBETASKINPUT_MEMBER_TASK_ARN, val)?;
53 }
54 Ok(())
55 }
56}
57impl crate::operation::describe_task::builders::DescribeTaskInputBuilder {
58 #[allow(
59 unused_variables,
60 unreachable_code,
61 clippy::single_match,
62 clippy::match_single_binding,
63 clippy::diverging_sub_expression
64 )]
65 pub(crate) fn deserialize_members(
66 &mut self,
67 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
68 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
69 deserializer.read_struct(&DESCRIBETASKINPUT_SCHEMA, &mut |member, deser| {
70 match member.member_index() {
71 Some(0) => {
72 if deser.is_null() {
73 deser.read_null()?;
74 } else {
75 self.task_arn = Some(deser.read_string(member)?);
76 }
77 }
78 _ => {}
79 }
80 Ok(())
81 })
82 }
83}
84
85impl DescribeTaskInput {
86 pub fn deserialize(
88 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
89 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
90 let mut builder = Self::builder();
91 builder.deserialize_members(deserializer)?;
92 builder.task_arn = builder.task_arn.or(Some(String::new()));
93 builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
94 }
95}
96impl DescribeTaskInput {
97 pub fn builder() -> crate::operation::describe_task::builders::DescribeTaskInputBuilder {
99 crate::operation::describe_task::builders::DescribeTaskInputBuilder::default()
100 }
101}
102
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
105#[non_exhaustive]
106pub struct DescribeTaskInputBuilder {
107 pub(crate) task_arn: ::std::option::Option<::std::string::String>,
108}
109impl DescribeTaskInputBuilder {
110 pub fn task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.task_arn = ::std::option::Option::Some(input.into());
114 self
115 }
116 pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.task_arn = input;
119 self
120 }
121 pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
123 &self.task_arn
124 }
125 pub fn build(
127 self,
128 ) -> ::std::result::Result<crate::operation::describe_task::DescribeTaskInput, ::aws_smithy_types::error::operation::BuildError> {
129 ::std::result::Result::Ok(crate::operation::describe_task::DescribeTaskInput { task_arn: self.task_arn })
130 }
131}