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 one or more actions to be performed on a DataBrew dataset.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Recipe {
    /// <p>The Amazon Resource Name (ARN) of the user who created the recipe.</p>
    pub created_by: ::std::option::Option<::std::string::String>,
    /// <p>The date and time that the recipe was created.</p>
    pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Amazon Resource Name (ARN) of the user who last modified the recipe.</p>
    pub last_modified_by: ::std::option::Option<::std::string::String>,
    /// <p>The last modification date and time of the recipe.</p>
    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The name of the project that the recipe is associated with.</p>
    pub project_name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the user who published the recipe.</p>
    pub published_by: ::std::option::Option<::std::string::String>,
    /// <p>The date and time when the recipe was published.</p>
    pub published_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The description of the recipe.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The unique name for the recipe.</p>
    pub name: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) for the recipe.</p>
    pub resource_arn: ::std::option::Option<::std::string::String>,
    /// <p>A list of steps that are defined by the recipe.</p>
    pub steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
    /// <p>Metadata tags that have been applied to the recipe.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The identifier for the version for the recipe. Must be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p>Numeric version (<code>X.Y</code>) - <code>X</code> and <code>Y</code> stand for major and minor version numbers. The maximum length of each is 6 digits, and neither can be negative values. Both <code>X</code> and <code>Y</code> are required, and "0.0" isn't a valid version.</p></li>
    /// <li>
    /// <p><code>LATEST_WORKING</code> - the most recent valid version being developed in a DataBrew project.</p></li>
    /// <li>
    /// <p><code>LATEST_PUBLISHED</code> - the most recent published version.</p></li>
    /// </ul>
    pub recipe_version: ::std::option::Option<::std::string::String>,
}
impl Recipe {
    /// <p>The Amazon Resource Name (ARN) of the user who created the recipe.</p>
    pub fn created_by(&self) -> ::std::option::Option<&str> {
        self.created_by.as_deref()
    }
    /// <p>The date and time that the recipe was created.</p>
    pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.create_date.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the user who last modified the recipe.</p>
    pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
        self.last_modified_by.as_deref()
    }
    /// <p>The last modification date and time of the recipe.</p>
    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_date.as_ref()
    }
    /// <p>The name of the project that the recipe is associated with.</p>
    pub fn project_name(&self) -> ::std::option::Option<&str> {
        self.project_name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the user who published the recipe.</p>
    pub fn published_by(&self) -> ::std::option::Option<&str> {
        self.published_by.as_deref()
    }
    /// <p>The date and time when the recipe was published.</p>
    pub fn published_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.published_date.as_ref()
    }
    /// <p>The description of the recipe.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The unique name for the recipe.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The Amazon Resource Name (ARN) for the recipe.</p>
    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
        self.resource_arn.as_deref()
    }
    /// <p>A list of steps that are defined by the recipe.</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 `.steps.is_none()`.
    pub fn steps(&self) -> &[crate::types::RecipeStep] {
        self.steps.as_deref().unwrap_or_default()
    }
    /// <p>Metadata tags that have been applied to the recipe.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>The identifier for the version for the recipe. Must be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p>Numeric version (<code>X.Y</code>) - <code>X</code> and <code>Y</code> stand for major and minor version numbers. The maximum length of each is 6 digits, and neither can be negative values. Both <code>X</code> and <code>Y</code> are required, and "0.0" isn't a valid version.</p></li>
    /// <li>
    /// <p><code>LATEST_WORKING</code> - the most recent valid version being developed in a DataBrew project.</p></li>
    /// <li>
    /// <p><code>LATEST_PUBLISHED</code> - the most recent published version.</p></li>
    /// </ul>
    pub fn recipe_version(&self) -> ::std::option::Option<&str> {
        self.recipe_version.as_deref()
    }
}
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) created_by: ::std::option::Option<::std::string::String>,
    pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) project_name: ::std::option::Option<::std::string::String>,
    pub(crate) published_by: ::std::option::Option<::std::string::String>,
    pub(crate) published_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
    pub(crate) steps: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) recipe_version: ::std::option::Option<::std::string::String>,
}
impl RecipeBuilder {
    /// <p>The Amazon Resource Name (ARN) of the user who created the recipe.</p>
    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.created_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the user who created the recipe.</p>
    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.created_by = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the user who created the recipe.</p>
    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.created_by
    }
    /// <p>The date and time that the recipe was created.</p>
    pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.create_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time that the recipe was created.</p>
    pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.create_date = input;
        self
    }
    /// <p>The date and time that the recipe was created.</p>
    pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.create_date
    }
    /// <p>The Amazon Resource Name (ARN) of the user who last modified the recipe.</p>
    pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_modified_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the user who last modified the recipe.</p>
    pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_modified_by = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the user who last modified the recipe.</p>
    pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_modified_by
    }
    /// <p>The last modification date and time of the recipe.</p>
    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The last modification date and time of the recipe.</p>
    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_date = input;
        self
    }
    /// <p>The last modification date and time of the recipe.</p>
    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_date
    }
    /// <p>The name of the project that the recipe is associated with.</p>
    pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.project_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the project that the recipe is associated with.</p>
    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.project_name = input;
        self
    }
    /// <p>The name of the project that the recipe is associated with.</p>
    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.project_name
    }
    /// <p>The Amazon Resource Name (ARN) of the user who published the recipe.</p>
    pub fn published_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.published_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the user who published the recipe.</p>
    pub fn set_published_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.published_by = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the user who published the recipe.</p>
    pub fn get_published_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.published_by
    }
    /// <p>The date and time when the recipe was published.</p>
    pub fn published_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.published_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the recipe was published.</p>
    pub fn set_published_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.published_date = input;
        self
    }
    /// <p>The date and time when the recipe was published.</p>
    pub fn get_published_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.published_date
    }
    /// <p>The description of the recipe.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the recipe.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the recipe.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The unique name for the recipe.</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 unique name for the recipe.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The unique name for the recipe.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The Amazon Resource Name (ARN) for the recipe.</p>
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the recipe.</p>
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the recipe.</p>
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_arn
    }
    /// Appends an item to `steps`.
    ///
    /// To override the contents of this collection use [`set_steps`](Self::set_steps).
    ///
    /// <p>A list of steps that are defined by the recipe.</p>
    pub fn steps(mut self, input: crate::types::RecipeStep) -> Self {
        let mut v = self.steps.unwrap_or_default();
        v.push(input);
        self.steps = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of steps that are defined by the recipe.</p>
    pub fn set_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>>) -> Self {
        self.steps = input;
        self
    }
    /// <p>A list of steps that are defined by the recipe.</p>
    pub fn get_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecipeStep>> {
        &self.steps
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Metadata tags that have been applied to the recipe.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Metadata tags that have been applied to the recipe.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Metadata tags that have been applied to the recipe.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>The identifier for the version for the recipe. Must be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p>Numeric version (<code>X.Y</code>) - <code>X</code> and <code>Y</code> stand for major and minor version numbers. The maximum length of each is 6 digits, and neither can be negative values. Both <code>X</code> and <code>Y</code> are required, and "0.0" isn't a valid version.</p></li>
    /// <li>
    /// <p><code>LATEST_WORKING</code> - the most recent valid version being developed in a DataBrew project.</p></li>
    /// <li>
    /// <p><code>LATEST_PUBLISHED</code> - the most recent published version.</p></li>
    /// </ul>
    pub fn recipe_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.recipe_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for the version for the recipe. Must be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p>Numeric version (<code>X.Y</code>) - <code>X</code> and <code>Y</code> stand for major and minor version numbers. The maximum length of each is 6 digits, and neither can be negative values. Both <code>X</code> and <code>Y</code> are required, and "0.0" isn't a valid version.</p></li>
    /// <li>
    /// <p><code>LATEST_WORKING</code> - the most recent valid version being developed in a DataBrew project.</p></li>
    /// <li>
    /// <p><code>LATEST_PUBLISHED</code> - the most recent published version.</p></li>
    /// </ul>
    pub fn set_recipe_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.recipe_version = input;
        self
    }
    /// <p>The identifier for the version for the recipe. Must be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p>Numeric version (<code>X.Y</code>) - <code>X</code> and <code>Y</code> stand for major and minor version numbers. The maximum length of each is 6 digits, and neither can be negative values. Both <code>X</code> and <code>Y</code> are required, and "0.0" isn't a valid version.</p></li>
    /// <li>
    /// <p><code>LATEST_WORKING</code> - the most recent valid version being developed in a DataBrew project.</p></li>
    /// <li>
    /// <p><code>LATEST_PUBLISHED</code> - the most recent published version.</p></li>
    /// </ul>
    pub fn get_recipe_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.recipe_version
    }
    /// 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)
    pub fn build(self) -> ::std::result::Result<crate::types::Recipe, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Recipe {
            created_by: self.created_by,
            create_date: self.create_date,
            last_modified_by: self.last_modified_by,
            last_modified_date: self.last_modified_date,
            project_name: self.project_name,
            published_by: self.published_by,
            published_date: self.published_date,
            description: self.description,
            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",
                )
            })?,
            resource_arn: self.resource_arn,
            steps: self.steps,
            tags: self.tags,
            recipe_version: self.recipe_version,
        })
    }
}