aws-sdk-glue 1.149.0

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

/// <p>Specifies a transform that combines the rows from two or more datasets into a single result.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Union {
    /// <p>The name of the transform node.</p>
    pub name: ::std::string::String,
    /// <p>The node ID inputs to the transform.</p>
    pub inputs: ::std::vec::Vec<::std::string::String>,
    /// <p>Indicates the type of Union transform.</p>
    /// <p>Specify <code>ALL</code> to join all rows from data sources to the resulting DynamicFrame. The resulting union does not remove duplicate rows.</p>
    /// <p>Specify <code>DISTINCT</code> to remove duplicate rows in the resulting DynamicFrame.</p>
    pub union_type: crate::types::UnionType,
}
impl Union {
    /// <p>The name of the transform node.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The node ID inputs to the transform.</p>
    pub fn inputs(&self) -> &[::std::string::String] {
        use std::ops::Deref;
        self.inputs.deref()
    }
    /// <p>Indicates the type of Union transform.</p>
    /// <p>Specify <code>ALL</code> to join all rows from data sources to the resulting DynamicFrame. The resulting union does not remove duplicate rows.</p>
    /// <p>Specify <code>DISTINCT</code> to remove duplicate rows in the resulting DynamicFrame.</p>
    pub fn union_type(&self) -> &crate::types::UnionType {
        &self.union_type
    }
}
impl Union {
    /// Creates a new builder-style object to manufacture [`Union`](crate::types::Union).
    pub fn builder() -> crate::types::builders::UnionBuilder {
        crate::types::builders::UnionBuilder::default()
    }
}

/// A builder for [`Union`](crate::types::Union).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UnionBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) inputs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) union_type: ::std::option::Option<crate::types::UnionType>,
}
impl UnionBuilder {
    /// <p>The name of the transform node.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the transform node.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the transform node.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `inputs`.
    ///
    /// To override the contents of this collection use [`set_inputs`](Self::set_inputs).
    ///
    /// <p>The node ID inputs to the transform.</p>
    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
    }
    /// <p>The node ID inputs to the transform.</p>
    pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inputs = input;
        self
    }
    /// <p>The node ID inputs to the transform.</p>
    pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.inputs
    }
    /// <p>Indicates the type of Union transform.</p>
    /// <p>Specify <code>ALL</code> to join all rows from data sources to the resulting DynamicFrame. The resulting union does not remove duplicate rows.</p>
    /// <p>Specify <code>DISTINCT</code> to remove duplicate rows in the resulting DynamicFrame.</p>
    /// This field is required.
    pub fn union_type(mut self, input: crate::types::UnionType) -> Self {
        self.union_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates the type of Union transform.</p>
    /// <p>Specify <code>ALL</code> to join all rows from data sources to the resulting DynamicFrame. The resulting union does not remove duplicate rows.</p>
    /// <p>Specify <code>DISTINCT</code> to remove duplicate rows in the resulting DynamicFrame.</p>
    pub fn set_union_type(mut self, input: ::std::option::Option<crate::types::UnionType>) -> Self {
        self.union_type = input;
        self
    }
    /// <p>Indicates the type of Union transform.</p>
    /// <p>Specify <code>ALL</code> to join all rows from data sources to the resulting DynamicFrame. The resulting union does not remove duplicate rows.</p>
    /// <p>Specify <code>DISTINCT</code> to remove duplicate rows in the resulting DynamicFrame.</p>
    pub fn get_union_type(&self) -> &::std::option::Option<crate::types::UnionType> {
        &self.union_type
    }
    /// Consumes the builder and constructs a [`Union`](crate::types::Union).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::UnionBuilder::name)
    /// - [`inputs`](crate::types::builders::UnionBuilder::inputs)
    /// - [`union_type`](crate::types::builders::UnionBuilder::union_type)
    pub fn build(self) -> ::std::result::Result<crate::types::Union, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Union {
            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 Union",
                )
            })?,
            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 Union",
                )
            })?,
            union_type: self.union_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "union_type",
                    "union_type was not specified but it is required when building Union",
                )
            })?,
        })
    }
}