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>DeleteTask</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DeleteTaskInput {
    /// <p>Specifies the Amazon Resource Name (ARN) of the task that you want to delete.</p>
    pub task_arn: ::std::option::Option<::std::string::String>,
}
impl DeleteTaskInput {
    /// <p>Specifies the Amazon Resource Name (ARN) of the task that you want to delete.</p>
    pub fn task_arn(&self) -> ::std::option::Option<&str> {
        self.task_arn.as_deref()
    }
}
static DELETETASKINPUT_MEMBER_TASK_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#DeleteTaskInput$TaskArn",
        "com.amazonaws.datasync.synthetic",
        "DeleteTaskInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "TaskArn",
    0,
);
static DELETETASKINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#DeleteTaskInput",
        "com.amazonaws.datasync.synthetic",
        "DeleteTaskInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&DELETETASKINPUT_MEMBER_TASK_ARN],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DeleteTaskRequest");
impl DeleteTaskInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DELETETASKINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DeleteTaskInput {
    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(&DELETETASKINPUT_MEMBER_TASK_ARN, val)?;
        }
        Ok(())
    }
}
impl crate::operation::delete_task::builders::DeleteTaskInputBuilder {
    #[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(&DELETETASKINPUT_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 DeleteTaskInput {
    /// 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)?;
        builder.task_arn = builder.task_arn.or(Some(String::new()));
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl DeleteTaskInput {
    /// Creates a new builder-style object to manufacture [`DeleteTaskInput`](crate::operation::delete_task::DeleteTaskInput).
    pub fn builder() -> crate::operation::delete_task::builders::DeleteTaskInputBuilder {
        crate::operation::delete_task::builders::DeleteTaskInputBuilder::default()
    }
}

/// A builder for [`DeleteTaskInput`](crate::operation::delete_task::DeleteTaskInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DeleteTaskInputBuilder {
    pub(crate) task_arn: ::std::option::Option<::std::string::String>,
}
impl DeleteTaskInputBuilder {
    /// <p>Specifies the Amazon Resource Name (ARN) of the task that you want to delete.</p>
    /// This field is required.
    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>Specifies the Amazon Resource Name (ARN) of the task that you want to delete.</p>
    pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.task_arn = input;
        self
    }
    /// <p>Specifies the Amazon Resource Name (ARN) of the task that you want to delete.</p>
    pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.task_arn
    }
    /// Consumes the builder and constructs a [`DeleteTaskInput`](crate::operation::delete_task::DeleteTaskInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::delete_task::DeleteTaskInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::delete_task::DeleteTaskInput { task_arn: self.task_arn })
    }
}