aws-sdk-datasync 1.130.0

AWS SDK for AWS DataSync
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>CreateTaskResponse</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTaskOutput {
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    pub task_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateTaskOutput {
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    pub fn task_arn(&self) -> ::std::option::Option<&str> {
        self.task_arn.as_deref()
    }
}
static CREATETASKOUTPUT_MEMBER_TASK_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#CreateTaskOutput$TaskArn",
        "com.amazonaws.datasync.synthetic",
        "CreateTaskOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "TaskArn",
    0,
);
static CREATETASKOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#CreateTaskOutput",
        "com.amazonaws.datasync.synthetic",
        "CreateTaskOutput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&CREATETASKOUTPUT_MEMBER_TASK_ARN],
)
.with_original_name("CreateTaskResponse");
impl CreateTaskOutput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CREATETASKOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for CreateTaskOutput {
    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.task_arn {
            ser.write_string(&CREATETASKOUTPUT_MEMBER_TASK_ARN, val)?;
        }
        Ok(())
    }
}
impl crate::operation::create_task::builders::CreateTaskOutputBuilder {
    #[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(&CREATETASKOUTPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.task_arn = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl CreateTaskOutput {
    /// Deserializes this structure from a [`ShapeDeserializer`].
    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)?;
        Ok(builder.build())
    }
}
impl ::aws_types::request_id::RequestId for CreateTaskOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateTaskOutput {
    /// Creates a new builder-style object to manufacture [`CreateTaskOutput`](crate::operation::create_task::CreateTaskOutput).
    pub fn builder() -> crate::operation::create_task::builders::CreateTaskOutputBuilder {
        crate::operation::create_task::builders::CreateTaskOutputBuilder::default()
    }
}

/// A builder for [`CreateTaskOutput`](crate::operation::create_task::CreateTaskOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTaskOutputBuilder {
    pub(crate) task_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateTaskOutputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    pub fn task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.task_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.task_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the task.</p>
    pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.task_arn
    }
    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
    }
    /// Consumes the builder and constructs a [`CreateTaskOutput`](crate::operation::create_task::CreateTaskOutput).
    pub fn build(self) -> crate::operation::create_task::CreateTaskOutput {
        crate::operation::create_task::CreateTaskOutput {
            task_arn: self.task_arn,
            _request_id: self._request_id,
        }
    }
}