#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct S3DeltaDirectTarget {
pub name: ::std::string::String,
pub inputs: ::std::vec::Vec<::std::string::String>,
pub partition_keys: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
pub path: ::std::string::String,
pub compression: crate::types::DeltaTargetCompressionType,
pub format: crate::types::TargetFormat,
pub additional_options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub schema_change_policy: ::std::option::Option<crate::types::DirectSchemaChangePolicy>,
}
impl S3DeltaDirectTarget {
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn inputs(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.inputs.deref()
}
pub fn partition_keys(&self) -> &[::std::vec::Vec<::std::string::String>] {
self.partition_keys.as_deref().unwrap_or_default()
}
pub fn path(&self) -> &str {
use std::ops::Deref;
self.path.deref()
}
pub fn compression(&self) -> &crate::types::DeltaTargetCompressionType {
&self.compression
}
pub fn format(&self) -> &crate::types::TargetFormat {
&self.format
}
pub fn additional_options(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.additional_options.as_ref()
}
pub fn schema_change_policy(&self) -> ::std::option::Option<&crate::types::DirectSchemaChangePolicy> {
self.schema_change_policy.as_ref()
}
}
impl S3DeltaDirectTarget {
pub fn builder() -> crate::types::builders::S3DeltaDirectTargetBuilder {
crate::types::builders::S3DeltaDirectTargetBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct S3DeltaDirectTargetBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) inputs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) partition_keys: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
pub(crate) path: ::std::option::Option<::std::string::String>,
pub(crate) compression: ::std::option::Option<crate::types::DeltaTargetCompressionType>,
pub(crate) format: ::std::option::Option<crate::types::TargetFormat>,
pub(crate) additional_options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) schema_change_policy: ::std::option::Option<crate::types::DirectSchemaChangePolicy>,
}
impl S3DeltaDirectTargetBuilder {
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn inputs(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.inputs.unwrap_or_default();
v.push(input.into());
self.inputs = ::std::option::Option::Some(v);
self
}
pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inputs = input;
self
}
pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.inputs
}
pub fn partition_keys(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
let mut v = self.partition_keys.unwrap_or_default();
v.push(input);
self.partition_keys = ::std::option::Option::Some(v);
self
}
pub fn set_partition_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>) -> Self {
self.partition_keys = input;
self
}
pub fn get_partition_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>> {
&self.partition_keys
}
pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.path = ::std::option::Option::Some(input.into());
self
}
pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.path = input;
self
}
pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
&self.path
}
pub fn compression(mut self, input: crate::types::DeltaTargetCompressionType) -> Self {
self.compression = ::std::option::Option::Some(input);
self
}
pub fn set_compression(mut self, input: ::std::option::Option<crate::types::DeltaTargetCompressionType>) -> Self {
self.compression = input;
self
}
pub fn get_compression(&self) -> &::std::option::Option<crate::types::DeltaTargetCompressionType> {
&self.compression
}
pub fn format(mut self, input: crate::types::TargetFormat) -> Self {
self.format = ::std::option::Option::Some(input);
self
}
pub fn set_format(mut self, input: ::std::option::Option<crate::types::TargetFormat>) -> Self {
self.format = input;
self
}
pub fn get_format(&self) -> &::std::option::Option<crate::types::TargetFormat> {
&self.format
}
pub fn additional_options(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.additional_options.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.additional_options = ::std::option::Option::Some(hash_map);
self
}
pub fn set_additional_options(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.additional_options = input;
self
}
pub fn get_additional_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.additional_options
}
pub fn schema_change_policy(mut self, input: crate::types::DirectSchemaChangePolicy) -> Self {
self.schema_change_policy = ::std::option::Option::Some(input);
self
}
pub fn set_schema_change_policy(mut self, input: ::std::option::Option<crate::types::DirectSchemaChangePolicy>) -> Self {
self.schema_change_policy = input;
self
}
pub fn get_schema_change_policy(&self) -> &::std::option::Option<crate::types::DirectSchemaChangePolicy> {
&self.schema_change_policy
}
pub fn build(self) -> ::std::result::Result<crate::types::S3DeltaDirectTarget, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::S3DeltaDirectTarget {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building S3DeltaDirectTarget",
)
})?,
inputs: self.inputs.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"inputs",
"inputs was not specified but it is required when building S3DeltaDirectTarget",
)
})?,
partition_keys: self.partition_keys,
path: self.path.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"path",
"path was not specified but it is required when building S3DeltaDirectTarget",
)
})?,
compression: self.compression.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"compression",
"compression was not specified but it is required when building S3DeltaDirectTarget",
)
})?,
format: self.format.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"format",
"format was not specified but it is required when building S3DeltaDirectTarget",
)
})?,
additional_options: self.additional_options,
schema_change_policy: self.schema_change_policy,
})
}
}