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>A Glue Studio node that uses a Glue DataBrew recipe in Glue jobs.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Recipe {
    /// <p>The name of the Glue Studio node.</p>
    pub name: ::std::string::String,
    /// <p>The nodes that are inputs to the recipe node, identified by id.</p>
    pub inputs: ::std::vec::Vec<::std::string::String>,
    /// <p>A reference to the DataBrew recipe used by the node.</p>
    pub recipe_reference: ::std::option::Option<crate::types::RecipeReference>,
    /// <p>Transform steps used in the recipe node.</p>
    pub recipe_steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
}
impl Recipe {
    /// <p>The name of the Glue Studio node.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The nodes that are inputs to the recipe node, identified by id.</p>
    pub fn inputs(&self) -> &[::std::string::String] {
        use std::ops::Deref;
        self.inputs.deref()
    }
    /// <p>A reference to the DataBrew recipe used by the node.</p>
    pub fn recipe_reference(&self) -> ::std::option::Option<&crate::types::RecipeReference> {
        self.recipe_reference.as_ref()
    }
    /// <p>Transform steps used in the recipe node.</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 `.recipe_steps.is_none()`.
    pub fn recipe_steps(&self) -> &[crate::types::RecipeStep] {
        self.recipe_steps.as_deref().unwrap_or_default()
    }
}
impl Recipe {
    /// Creates a new builder-style object to manufacture [`Recipe`](crate::types::Recipe).
    pub fn builder() -> crate::types::builders::RecipeBuilder {
        crate::types::builders::RecipeBuilder::default()
    }
}

/// A builder for [`Recipe`](crate::types::Recipe).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RecipeBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) inputs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) recipe_reference: ::std::option::Option<crate::types::RecipeReference>,
    pub(crate) recipe_steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
}
impl RecipeBuilder {
    /// <p>The name of the Glue Studio 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 Glue Studio 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 Glue Studio 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 nodes that are inputs to the recipe node, identified by id.</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 nodes that are inputs to the recipe node, identified by id.</p>
    pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inputs = input;
        self
    }
    /// <p>The nodes that are inputs to the recipe node, identified by id.</p>
    pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.inputs
    }
    /// <p>A reference to the DataBrew recipe used by the node.</p>
    pub fn recipe_reference(mut self, input: crate::types::RecipeReference) -> Self {
        self.recipe_reference = ::std::option::Option::Some(input);
        self
    }
    /// <p>A reference to the DataBrew recipe used by the node.</p>
    pub fn set_recipe_reference(mut self, input: ::std::option::Option<crate::types::RecipeReference>) -> Self {
        self.recipe_reference = input;
        self
    }
    /// <p>A reference to the DataBrew recipe used by the node.</p>
    pub fn get_recipe_reference(&self) -> &::std::option::Option<crate::types::RecipeReference> {
        &self.recipe_reference
    }
    /// Appends an item to `recipe_steps`.
    ///
    /// To override the contents of this collection use [`set_recipe_steps`](Self::set_recipe_steps).
    ///
    /// <p>Transform steps used in the recipe node.</p>
    pub fn recipe_steps(mut self, input: crate::types::RecipeStep) -> Self {
        let mut v = self.recipe_steps.unwrap_or_default();
        v.push(input);
        self.recipe_steps = ::std::option::Option::Some(v);
        self
    }
    /// <p>Transform steps used in the recipe node.</p>
    pub fn set_recipe_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>) -> Self {
        self.recipe_steps = input;
        self
    }
    /// <p>Transform steps used in the recipe node.</p>
    pub fn get_recipe_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>> {
        &self.recipe_steps
    }
    /// Consumes the builder and constructs a [`Recipe`](crate::types::Recipe).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::RecipeBuilder::name)
    /// - [`inputs`](crate::types::builders::RecipeBuilder::inputs)
    pub fn build(self) -> ::std::result::Result<crate::types::Recipe, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Recipe {
            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 Recipe",
                )
            })?,
            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 Recipe",
                )
            })?,
            recipe_reference: self.recipe_reference,
            recipe_steps: self.recipe_steps,
        })
    }
}