aws-sdk-assurance 1.0.0

AWS SDK for AWS Assurance
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 BatchGetTaskInput {
    /// <p>The ARN of this governance environment.</p>
    pub environment_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the project.</p>
    pub project: ::std::option::Option<::std::string::String>,
    /// <p>The tasks to retrieve, 1 to 100 per request. Keys must be unique within a request.</p>
    pub keys: ::std::option::Option<::std::vec::Vec<crate::types::TaskKey>>,
}
impl BatchGetTaskInput {
    /// <p>The ARN of this governance environment.</p>
    pub fn environment_arn(&self) -> ::std::option::Option<&str> {
        self.environment_arn.as_deref()
    }
    /// <p>The name of the project.</p>
    pub fn project(&self) -> ::std::option::Option<&str> {
        self.project.as_deref()
    }
    /// <p>The tasks to retrieve, 1 to 100 per request. Keys must be unique within a 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 `.keys.is_none()`.
    pub fn keys(&self) -> &[crate::types::TaskKey] {
        self.keys.as_deref().unwrap_or_default()
    }
}
impl BatchGetTaskInput {
    /// Creates a new builder-style object to manufacture [`BatchGetTaskInput`](crate::operation::batch_get_task::BatchGetTaskInput).
    pub fn builder() -> crate::operation::batch_get_task::builders::BatchGetTaskInputBuilder {
        crate::operation::batch_get_task::builders::BatchGetTaskInputBuilder::default()
    }
}

/// A builder for [`BatchGetTaskInput`](crate::operation::batch_get_task::BatchGetTaskInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchGetTaskInputBuilder {
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) project: ::std::option::Option<::std::string::String>,
    pub(crate) keys: ::std::option::Option<::std::vec::Vec<crate::types::TaskKey>>,
}
impl BatchGetTaskInputBuilder {
    /// <p>The ARN of this governance environment.</p>
    /// This field is required.
    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn set_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_arn = input;
        self
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_arn
    }
    /// <p>The name of the project.</p>
    /// This field is required.
    pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.project = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the project.</p>
    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.project = input;
        self
    }
    /// <p>The name of the project.</p>
    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
        &self.project
    }
    /// Appends an item to `keys`.
    ///
    /// To override the contents of this collection use [`set_keys`](Self::set_keys).
    ///
    /// <p>The tasks to retrieve, 1 to 100 per request. Keys must be unique within a request.</p>
    pub fn keys(mut self, input: crate::types::TaskKey) -> Self {
        let mut v = self.keys.unwrap_or_default();
        v.push(input);
        self.keys = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tasks to retrieve, 1 to 100 per request. Keys must be unique within a request.</p>
    pub fn set_keys(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TaskKey>>) -> Self {
        self.keys = input;
        self
    }
    /// <p>The tasks to retrieve, 1 to 100 per request. Keys must be unique within a request.</p>
    pub fn get_keys(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TaskKey>> {
        &self.keys
    }
    /// Consumes the builder and constructs a [`BatchGetTaskInput`](crate::operation::batch_get_task::BatchGetTaskInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::batch_get_task::BatchGetTaskInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::batch_get_task::BatchGetTaskInput {
            environment_arn: self.environment_arn,
            project: self.project,
            keys: self.keys,
        })
    }
}