aws-sdk-databrew 1.98.0

AWS SDK for AWS Glue DataBrew
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents options that specify how and where in Amazon S3 DataBrew writes the output generated by recipe jobs or profile jobs.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Output {
    /// <p>The compression algorithm used to compress the output text of the job.</p>
    pub compression_format: ::std::option::Option<crate::types::CompressionFormat>,
    /// <p>The data format of the output of the job.</p>
    pub format: ::std::option::Option<crate::types::OutputFormat>,
    /// <p>The names of one or more partition columns for the output of the job.</p>
    pub partition_columns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The location in Amazon S3 where the job writes its output.</p>
    pub location: ::std::option::Option<crate::types::S3Location>,
    /// <p>A value that, if true, means that any data in the location specified for output is overwritten with new output.</p>
    pub overwrite: bool,
    /// <p>Represents options that define how DataBrew formats job output files.</p>
    pub format_options: ::std::option::Option<crate::types::OutputFormatOptions>,
    /// <p>Maximum number of files to be generated by the job and written to the output folder. For output partitioned by column(s), the MaxOutputFiles value is the maximum number of files per partition.</p>
    pub max_output_files: ::std::option::Option<i32>,
}
impl Output {
    /// <p>The compression algorithm used to compress the output text of the job.</p>
    pub fn compression_format(&self) -> ::std::option::Option<&crate::types::CompressionFormat> {
        self.compression_format.as_ref()
    }
    /// <p>The data format of the output of the job.</p>
    pub fn format(&self) -> ::std::option::Option<&crate::types::OutputFormat> {
        self.format.as_ref()
    }
    /// <p>The names of one or more partition columns for the output of the job.</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 `.partition_columns.is_none()`.
    pub fn partition_columns(&self) -> &[::std::string::String] {
        self.partition_columns.as_deref().unwrap_or_default()
    }
    /// <p>The location in Amazon S3 where the job writes its output.</p>
    pub fn location(&self) -> ::std::option::Option<&crate::types::S3Location> {
        self.location.as_ref()
    }
    /// <p>A value that, if true, means that any data in the location specified for output is overwritten with new output.</p>
    pub fn overwrite(&self) -> bool {
        self.overwrite
    }
    /// <p>Represents options that define how DataBrew formats job output files.</p>
    pub fn format_options(&self) -> ::std::option::Option<&crate::types::OutputFormatOptions> {
        self.format_options.as_ref()
    }
    /// <p>Maximum number of files to be generated by the job and written to the output folder. For output partitioned by column(s), the MaxOutputFiles value is the maximum number of files per partition.</p>
    pub fn max_output_files(&self) -> ::std::option::Option<i32> {
        self.max_output_files
    }
}
impl Output {
    /// Creates a new builder-style object to manufacture [`Output`](crate::types::Output).
    pub fn builder() -> crate::types::builders::OutputBuilder {
        crate::types::builders::OutputBuilder::default()
    }
}

/// A builder for [`Output`](crate::types::Output).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct OutputBuilder {
    pub(crate) compression_format: ::std::option::Option<crate::types::CompressionFormat>,
    pub(crate) format: ::std::option::Option<crate::types::OutputFormat>,
    pub(crate) partition_columns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) location: ::std::option::Option<crate::types::S3Location>,
    pub(crate) overwrite: ::std::option::Option<bool>,
    pub(crate) format_options: ::std::option::Option<crate::types::OutputFormatOptions>,
    pub(crate) max_output_files: ::std::option::Option<i32>,
}
impl OutputBuilder {
    /// <p>The compression algorithm used to compress the output text of the job.</p>
    pub fn compression_format(mut self, input: crate::types::CompressionFormat) -> Self {
        self.compression_format = ::std::option::Option::Some(input);
        self
    }
    /// <p>The compression algorithm used to compress the output text of the job.</p>
    pub fn set_compression_format(mut self, input: ::std::option::Option<crate::types::CompressionFormat>) -> Self {
        self.compression_format = input;
        self
    }
    /// <p>The compression algorithm used to compress the output text of the job.</p>
    pub fn get_compression_format(&self) -> &::std::option::Option<crate::types::CompressionFormat> {
        &self.compression_format
    }
    /// <p>The data format of the output of the job.</p>
    pub fn format(mut self, input: crate::types::OutputFormat) -> Self {
        self.format = ::std::option::Option::Some(input);
        self
    }
    /// <p>The data format of the output of the job.</p>
    pub fn set_format(mut self, input: ::std::option::Option<crate::types::OutputFormat>) -> Self {
        self.format = input;
        self
    }
    /// <p>The data format of the output of the job.</p>
    pub fn get_format(&self) -> &::std::option::Option<crate::types::OutputFormat> {
        &self.format
    }
    /// Appends an item to `partition_columns`.
    ///
    /// To override the contents of this collection use [`set_partition_columns`](Self::set_partition_columns).
    ///
    /// <p>The names of one or more partition columns for the output of the job.</p>
    pub fn partition_columns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.partition_columns.unwrap_or_default();
        v.push(input.into());
        self.partition_columns = ::std::option::Option::Some(v);
        self
    }
    /// <p>The names of one or more partition columns for the output of the job.</p>
    pub fn set_partition_columns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.partition_columns = input;
        self
    }
    /// <p>The names of one or more partition columns for the output of the job.</p>
    pub fn get_partition_columns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.partition_columns
    }
    /// <p>The location in Amazon S3 where the job writes its output.</p>
    /// This field is required.
    pub fn location(mut self, input: crate::types::S3Location) -> Self {
        self.location = ::std::option::Option::Some(input);
        self
    }
    /// <p>The location in Amazon S3 where the job writes its output.</p>
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::S3Location>) -> Self {
        self.location = input;
        self
    }
    /// <p>The location in Amazon S3 where the job writes its output.</p>
    pub fn get_location(&self) -> &::std::option::Option<crate::types::S3Location> {
        &self.location
    }
    /// <p>A value that, if true, means that any data in the location specified for output is overwritten with new output.</p>
    pub fn overwrite(mut self, input: bool) -> Self {
        self.overwrite = ::std::option::Option::Some(input);
        self
    }
    /// <p>A value that, if true, means that any data in the location specified for output is overwritten with new output.</p>
    pub fn set_overwrite(mut self, input: ::std::option::Option<bool>) -> Self {
        self.overwrite = input;
        self
    }
    /// <p>A value that, if true, means that any data in the location specified for output is overwritten with new output.</p>
    pub fn get_overwrite(&self) -> &::std::option::Option<bool> {
        &self.overwrite
    }
    /// <p>Represents options that define how DataBrew formats job output files.</p>
    pub fn format_options(mut self, input: crate::types::OutputFormatOptions) -> Self {
        self.format_options = ::std::option::Option::Some(input);
        self
    }
    /// <p>Represents options that define how DataBrew formats job output files.</p>
    pub fn set_format_options(mut self, input: ::std::option::Option<crate::types::OutputFormatOptions>) -> Self {
        self.format_options = input;
        self
    }
    /// <p>Represents options that define how DataBrew formats job output files.</p>
    pub fn get_format_options(&self) -> &::std::option::Option<crate::types::OutputFormatOptions> {
        &self.format_options
    }
    /// <p>Maximum number of files to be generated by the job and written to the output folder. For output partitioned by column(s), the MaxOutputFiles value is the maximum number of files per partition.</p>
    pub fn max_output_files(mut self, input: i32) -> Self {
        self.max_output_files = ::std::option::Option::Some(input);
        self
    }
    /// <p>Maximum number of files to be generated by the job and written to the output folder. For output partitioned by column(s), the MaxOutputFiles value is the maximum number of files per partition.</p>
    pub fn set_max_output_files(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_output_files = input;
        self
    }
    /// <p>Maximum number of files to be generated by the job and written to the output folder. For output partitioned by column(s), the MaxOutputFiles value is the maximum number of files per partition.</p>
    pub fn get_max_output_files(&self) -> &::std::option::Option<i32> {
        &self.max_output_files
    }
    /// Consumes the builder and constructs a [`Output`](crate::types::Output).
    pub fn build(self) -> crate::types::Output {
        crate::types::Output {
            compression_format: self.compression_format,
            format: self.format,
            partition_columns: self.partition_columns,
            location: self.location,
            overwrite: self.overwrite.unwrap_or_default(),
            format_options: self.format_options,
            max_output_files: self.max_output_files,
        }
    }
}