aws-sdk-deadline 1.102.0

AWS SDK for AWSDeadlineCloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchUpdateTaskInput {
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The list of tasks to update. You can specify up to 100 tasks per request.</p>
    pub tasks: ::std::option::Option<::std::vec::Vec<crate::types::BatchUpdateTaskItem>>,
}
impl BatchUpdateTaskInput {
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The list of tasks to update. You can specify up to 100 tasks per request.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tasks.is_none()`.
    pub fn tasks(&self) -> &[crate::types::BatchUpdateTaskItem] {
        self.tasks.as_deref().unwrap_or_default()
    }
}
impl BatchUpdateTaskInput {
    /// Creates a new builder-style object to manufacture [`BatchUpdateTaskInput`](crate::operation::batch_update_task::BatchUpdateTaskInput).
    pub fn builder() -> crate::operation::batch_update_task::builders::BatchUpdateTaskInputBuilder {
        crate::operation::batch_update_task::builders::BatchUpdateTaskInputBuilder::default()
    }
}

/// A builder for [`BatchUpdateTaskInput`](crate::operation::batch_update_task::BatchUpdateTaskInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchUpdateTaskInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) tasks: ::std::option::Option<::std::vec::Vec<crate::types::BatchUpdateTaskItem>>,
}
impl BatchUpdateTaskInputBuilder {
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Appends an item to `tasks`.
    ///
    /// To override the contents of this collection use [`set_tasks`](Self::set_tasks).
    ///
    /// <p>The list of tasks to update. You can specify up to 100 tasks per request.</p>
    pub fn tasks(mut self, input: crate::types::BatchUpdateTaskItem) -> Self {
        let mut v = self.tasks.unwrap_or_default();
        v.push(input);
        self.tasks = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of tasks to update. You can specify up to 100 tasks per request.</p>
    pub fn set_tasks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchUpdateTaskItem>>) -> Self {
        self.tasks = input;
        self
    }
    /// <p>The list of tasks to update. You can specify up to 100 tasks per request.</p>
    pub fn get_tasks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchUpdateTaskItem>> {
        &self.tasks
    }
    /// Consumes the builder and constructs a [`BatchUpdateTaskInput`](crate::operation::batch_update_task::BatchUpdateTaskInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::batch_update_task::BatchUpdateTaskInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::batch_update_task::BatchUpdateTaskInput {
            client_token: self.client_token,
            tasks: self.tasks,
        })
    }
}