#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Task {
pub connector_operator: ::std::option::Option<crate::types::ConnectorOperator>,
pub destination_field: ::std::option::Option<::std::string::String>,
pub source_fields: ::std::vec::Vec<::std::string::String>,
pub task_properties: ::std::option::Option<::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>>,
pub task_type: crate::types::TaskType,
}
impl Task {
pub fn connector_operator(&self) -> ::std::option::Option<&crate::types::ConnectorOperator> {
self.connector_operator.as_ref()
}
pub fn destination_field(&self) -> ::std::option::Option<&str> {
self.destination_field.as_deref()
}
pub fn source_fields(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.source_fields.deref()
}
pub fn task_properties(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>> {
self.task_properties.as_ref()
}
pub fn task_type(&self) -> &crate::types::TaskType {
&self.task_type
}
}
impl Task {
pub fn builder() -> crate::types::builders::TaskBuilder {
crate::types::builders::TaskBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TaskBuilder {
pub(crate) connector_operator: ::std::option::Option<crate::types::ConnectorOperator>,
pub(crate) destination_field: ::std::option::Option<::std::string::String>,
pub(crate) source_fields: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) task_properties: ::std::option::Option<::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>>,
pub(crate) task_type: ::std::option::Option<crate::types::TaskType>,
}
impl TaskBuilder {
pub fn connector_operator(mut self, input: crate::types::ConnectorOperator) -> Self {
self.connector_operator = ::std::option::Option::Some(input);
self
}
pub fn set_connector_operator(mut self, input: ::std::option::Option<crate::types::ConnectorOperator>) -> Self {
self.connector_operator = input;
self
}
pub fn get_connector_operator(&self) -> &::std::option::Option<crate::types::ConnectorOperator> {
&self.connector_operator
}
pub fn destination_field(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.destination_field = ::std::option::Option::Some(input.into());
self
}
pub fn set_destination_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.destination_field = input;
self
}
pub fn get_destination_field(&self) -> &::std::option::Option<::std::string::String> {
&self.destination_field
}
pub fn source_fields(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.source_fields.unwrap_or_default();
v.push(input.into());
self.source_fields = ::std::option::Option::Some(v);
self
}
pub fn set_source_fields(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.source_fields = input;
self
}
pub fn get_source_fields(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.source_fields
}
pub fn task_properties(mut self, k: crate::types::OperatorPropertiesKeys, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.task_properties.unwrap_or_default();
hash_map.insert(k, v.into());
self.task_properties = ::std::option::Option::Some(hash_map);
self
}
pub fn set_task_properties(
mut self,
input: ::std::option::Option<::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>>,
) -> Self {
self.task_properties = input;
self
}
pub fn get_task_properties(
&self,
) -> &::std::option::Option<::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>> {
&self.task_properties
}
pub fn task_type(mut self, input: crate::types::TaskType) -> Self {
self.task_type = ::std::option::Option::Some(input);
self
}
pub fn set_task_type(mut self, input: ::std::option::Option<crate::types::TaskType>) -> Self {
self.task_type = input;
self
}
pub fn get_task_type(&self) -> &::std::option::Option<crate::types::TaskType> {
&self.task_type
}
pub fn build(self) -> ::std::result::Result<crate::types::Task, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Task {
connector_operator: self.connector_operator,
destination_field: self.destination_field,
source_fields: self.source_fields.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source_fields",
"source_fields was not specified but it is required when building Task",
)
})?,
task_properties: self.task_properties,
task_type: self.task_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"task_type",
"task_type was not specified but it is required when building Task",
)
})?,
})
}
}