#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Batch {
pub batch_job_name: ::std::string::String,
pub batch_job_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub export_data_set_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Batch {
pub fn batch_job_name(&self) -> &str {
use std::ops::Deref;
self.batch_job_name.deref()
}
pub fn batch_job_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.batch_job_parameters.as_ref()
}
pub fn export_data_set_names(&self) -> &[::std::string::String] {
self.export_data_set_names.as_deref().unwrap_or_default()
}
}
impl Batch {
pub fn builder() -> crate::types::builders::BatchBuilder {
crate::types::builders::BatchBuilder::default()
}
}
#[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 {
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
}
pub fn set_batch_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.batch_job_name = input;
self
}
pub fn get_batch_job_name(&self) -> &::std::option::Option<::std::string::String> {
&self.batch_job_name
}
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
}
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
}
pub fn get_batch_job_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.batch_job_parameters
}
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
}
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
}
pub fn get_export_data_set_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.export_data_set_names
}
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,
})
}
}