aws-sdk-apptest 1.57.0

AWS SDK for AWS Mainframe Modernization Application Testing
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Defines a batch.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Batch {
    /// <p>The job name of the batch.</p>
    pub batch_job_name: ::std::string::String,
    /// <p>The batch job parameters of the batch.</p>
    pub batch_job_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The export data set names of the batch.</p>
    pub export_data_set_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Batch {
    /// <p>The job name of the batch.</p>
    pub fn batch_job_name(&self) -> &str {
        use std::ops::Deref;
        self.batch_job_name.deref()
    }
    /// <p>The batch job parameters of the batch.</p>
    pub fn batch_job_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.batch_job_parameters.as_ref()
    }
    /// <p>The export data set names of the batch.</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 `.export_data_set_names.is_none()`.
    pub fn export_data_set_names(&self) -> &[::std::string::String] {
        self.export_data_set_names.as_deref().unwrap_or_default()
    }
}
impl Batch {
    /// Creates a new builder-style object to manufacture [`Batch`](crate::types::Batch).
    pub fn builder() -> crate::types::builders::BatchBuilder {
        crate::types::builders::BatchBuilder::default()
    }
}

/// A builder for [`Batch`](crate::types::Batch).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchBuilder {
    pub(crate) batch_job_name: ::std::option::Option<::std::string::String>,
    pub(crate) batch_job_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) export_data_set_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl BatchBuilder {
    /// <p>The job name of the batch.</p>
    /// This field is required.
    pub fn batch_job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.batch_job_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The job name of the batch.</p>
    pub fn set_batch_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.batch_job_name = input;
        self
    }
    /// <p>The job name of the batch.</p>
    pub fn get_batch_job_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.batch_job_name
    }
    /// Adds a key-value pair to `batch_job_parameters`.
    ///
    /// To override the contents of this collection use [`set_batch_job_parameters`](Self::set_batch_job_parameters).
    ///
    /// <p>The batch job parameters of the batch.</p>
    pub fn batch_job_parameters(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.batch_job_parameters.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.batch_job_parameters = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The batch job parameters of the batch.</p>
    pub fn set_batch_job_parameters(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.batch_job_parameters = input;
        self
    }
    /// <p>The batch job parameters of the batch.</p>
    pub fn get_batch_job_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.batch_job_parameters
    }
    /// Appends an item to `export_data_set_names`.
    ///
    /// To override the contents of this collection use [`set_export_data_set_names`](Self::set_export_data_set_names).
    ///
    /// <p>The export data set names of the batch.</p>
    pub fn export_data_set_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.export_data_set_names.unwrap_or_default();
        v.push(input.into());
        self.export_data_set_names = ::std::option::Option::Some(v);
        self
    }
    /// <p>The export data set names of the batch.</p>
    pub fn set_export_data_set_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.export_data_set_names = input;
        self
    }
    /// <p>The export data set names of the batch.</p>
    pub fn get_export_data_set_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.export_data_set_names
    }
    /// Consumes the builder and constructs a [`Batch`](crate::types::Batch).
    /// This method will fail if any of the following fields are not set:
    /// - [`batch_job_name`](crate::types::builders::BatchBuilder::batch_job_name)
    pub fn build(self) -> ::std::result::Result<crate::types::Batch, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Batch {
            batch_job_name: self.batch_job_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "batch_job_name",
                    "batch_job_name was not specified but it is required when building Batch",
                )
            })?,
            batch_job_parameters: self.batch_job_parameters,
            export_data_set_names: self.export_data_set_names,
        })
    }
}