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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetPlanInput {
    /// <p>The list of mappings from a source table to target tables.</p>
    pub mapping: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>,
    /// <p>The source table.</p>
    pub source: ::std::option::Option<crate::types::CatalogEntry>,
    /// <p>The target tables.</p>
    pub sinks: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>,
    /// <p>The parameters for the mapping.</p>
    pub location: ::std::option::Option<crate::types::Location>,
    /// <p>The programming language of the code to perform the mapping.</p>
    pub language: ::std::option::Option<crate::types::Language>,
    /// <p>A map to hold additional optional key-value parameters.</p>
    /// <p>Currently, these key-value pairs are supported:</p>
    /// <ul>
    /// <li>
    /// <p><code>inferSchema</code>&nbsp; — &nbsp;Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
    /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
    /// </ul>
    pub additional_plan_options_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GetPlanInput {
    /// <p>The list of mappings from a source table to target tables.</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 `.mapping.is_none()`.
    pub fn mapping(&self) -> &[crate::types::MappingEntry] {
        self.mapping.as_deref().unwrap_or_default()
    }
    /// <p>The source table.</p>
    pub fn source(&self) -> ::std::option::Option<&crate::types::CatalogEntry> {
        self.source.as_ref()
    }
    /// <p>The target tables.</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 `.sinks.is_none()`.
    pub fn sinks(&self) -> &[crate::types::CatalogEntry] {
        self.sinks.as_deref().unwrap_or_default()
    }
    /// <p>The parameters for the mapping.</p>
    pub fn location(&self) -> ::std::option::Option<&crate::types::Location> {
        self.location.as_ref()
    }
    /// <p>The programming language of the code to perform the mapping.</p>
    pub fn language(&self) -> ::std::option::Option<&crate::types::Language> {
        self.language.as_ref()
    }
    /// <p>A map to hold additional optional key-value parameters.</p>
    /// <p>Currently, these key-value pairs are supported:</p>
    /// <ul>
    /// <li>
    /// <p><code>inferSchema</code>&nbsp; — &nbsp;Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
    /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
    /// </ul>
    pub fn additional_plan_options_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.additional_plan_options_map.as_ref()
    }
}
impl GetPlanInput {
    /// Creates a new builder-style object to manufacture [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
    pub fn builder() -> crate::operation::get_plan::builders::GetPlanInputBuilder {
        crate::operation::get_plan::builders::GetPlanInputBuilder::default()
    }
}

/// A builder for [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetPlanInputBuilder {
    pub(crate) mapping: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>,
    pub(crate) source: ::std::option::Option<crate::types::CatalogEntry>,
    pub(crate) sinks: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>,
    pub(crate) location: ::std::option::Option<crate::types::Location>,
    pub(crate) language: ::std::option::Option<crate::types::Language>,
    pub(crate) additional_plan_options_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GetPlanInputBuilder {
    /// Appends an item to `mapping`.
    ///
    /// To override the contents of this collection use [`set_mapping`](Self::set_mapping).
    ///
    /// <p>The list of mappings from a source table to target tables.</p>
    pub fn mapping(mut self, input: crate::types::MappingEntry) -> Self {
        let mut v = self.mapping.unwrap_or_default();
        v.push(input);
        self.mapping = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of mappings from a source table to target tables.</p>
    pub fn set_mapping(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>) -> Self {
        self.mapping = input;
        self
    }
    /// <p>The list of mappings from a source table to target tables.</p>
    pub fn get_mapping(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>> {
        &self.mapping
    }
    /// <p>The source table.</p>
    /// This field is required.
    pub fn source(mut self, input: crate::types::CatalogEntry) -> Self {
        self.source = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source table.</p>
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::CatalogEntry>) -> Self {
        self.source = input;
        self
    }
    /// <p>The source table.</p>
    pub fn get_source(&self) -> &::std::option::Option<crate::types::CatalogEntry> {
        &self.source
    }
    /// Appends an item to `sinks`.
    ///
    /// To override the contents of this collection use [`set_sinks`](Self::set_sinks).
    ///
    /// <p>The target tables.</p>
    pub fn sinks(mut self, input: crate::types::CatalogEntry) -> Self {
        let mut v = self.sinks.unwrap_or_default();
        v.push(input);
        self.sinks = ::std::option::Option::Some(v);
        self
    }
    /// <p>The target tables.</p>
    pub fn set_sinks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>) -> Self {
        self.sinks = input;
        self
    }
    /// <p>The target tables.</p>
    pub fn get_sinks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>> {
        &self.sinks
    }
    /// <p>The parameters for the mapping.</p>
    pub fn location(mut self, input: crate::types::Location) -> Self {
        self.location = ::std::option::Option::Some(input);
        self
    }
    /// <p>The parameters for the mapping.</p>
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::Location>) -> Self {
        self.location = input;
        self
    }
    /// <p>The parameters for the mapping.</p>
    pub fn get_location(&self) -> &::std::option::Option<crate::types::Location> {
        &self.location
    }
    /// <p>The programming language of the code to perform the mapping.</p>
    pub fn language(mut self, input: crate::types::Language) -> Self {
        self.language = ::std::option::Option::Some(input);
        self
    }
    /// <p>The programming language of the code to perform the mapping.</p>
    pub fn set_language(mut self, input: ::std::option::Option<crate::types::Language>) -> Self {
        self.language = input;
        self
    }
    /// <p>The programming language of the code to perform the mapping.</p>
    pub fn get_language(&self) -> &::std::option::Option<crate::types::Language> {
        &self.language
    }
    /// Adds a key-value pair to `additional_plan_options_map`.
    ///
    /// To override the contents of this collection use [`set_additional_plan_options_map`](Self::set_additional_plan_options_map).
    ///
    /// <p>A map to hold additional optional key-value parameters.</p>
    /// <p>Currently, these key-value pairs are supported:</p>
    /// <ul>
    /// <li>
    /// <p><code>inferSchema</code>&nbsp; — &nbsp;Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
    /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
    /// </ul>
    pub fn additional_plan_options_map(
        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_plan_options_map.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.additional_plan_options_map = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A map to hold additional optional key-value parameters.</p>
    /// <p>Currently, these key-value pairs are supported:</p>
    /// <ul>
    /// <li>
    /// <p><code>inferSchema</code>&nbsp; — &nbsp;Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
    /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
    /// </ul>
    pub fn set_additional_plan_options_map(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.additional_plan_options_map = input;
        self
    }
    /// <p>A map to hold additional optional key-value parameters.</p>
    /// <p>Currently, these key-value pairs are supported:</p>
    /// <ul>
    /// <li>
    /// <p><code>inferSchema</code>&nbsp; — &nbsp;Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
    /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
    /// </ul>
    pub fn get_additional_plan_options_map(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.additional_plan_options_map
    }
    /// Consumes the builder and constructs a [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::get_plan::GetPlanInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_plan::GetPlanInput {
            mapping: self.mapping,
            source: self.source,
            sinks: self.sinks,
            location: self.location,
            language: self.language,
            additional_plan_options_map: self.additional_plan_options_map,
        })
    }
}