aws-sdk-glue 1.147.0

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

/// <p>Specifies a route node that directs data to different output paths based on defined filtering conditions.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Route {
    /// <p>The name of the route node.</p>
    pub name: ::std::string::String,
    /// <p>The input connection for the route node.</p>
    pub inputs: ::std::vec::Vec<::std::string::String>,
    /// <p>A list of group filters that define the routing conditions and criteria for directing data to different output paths.</p>
    pub group_filters_list: ::std::vec::Vec<crate::types::GroupFilters>,
}
impl Route {
    /// <p>The name of the route node.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The input connection for the route node.</p>
    pub fn inputs(&self) -> &[::std::string::String] {
        use std::ops::Deref;
        self.inputs.deref()
    }
    /// <p>A list of group filters that define the routing conditions and criteria for directing data to different output paths.</p>
    pub fn group_filters_list(&self) -> &[crate::types::GroupFilters] {
        use std::ops::Deref;
        self.group_filters_list.deref()
    }
}
impl Route {
    /// Creates a new builder-style object to manufacture [`Route`](crate::types::Route).
    pub fn builder() -> crate::types::builders::RouteBuilder {
        crate::types::builders::RouteBuilder::default()
    }
}

/// A builder for [`Route`](crate::types::Route).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RouteBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) inputs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) group_filters_list: ::std::option::Option<::std::vec::Vec<crate::types::GroupFilters>>,
}
impl RouteBuilder {
    /// <p>The name of the route 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 route 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 route 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 input connection for the route node.</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 input connection for the route node.</p>
    pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inputs = input;
        self
    }
    /// <p>The input connection for the route node.</p>
    pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.inputs
    }
    /// Appends an item to `group_filters_list`.
    ///
    /// To override the contents of this collection use [`set_group_filters_list`](Self::set_group_filters_list).
    ///
    /// <p>A list of group filters that define the routing conditions and criteria for directing data to different output paths.</p>
    pub fn group_filters_list(mut self, input: crate::types::GroupFilters) -> Self {
        let mut v = self.group_filters_list.unwrap_or_default();
        v.push(input);
        self.group_filters_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of group filters that define the routing conditions and criteria for directing data to different output paths.</p>
    pub fn set_group_filters_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GroupFilters>>) -> Self {
        self.group_filters_list = input;
        self
    }
    /// <p>A list of group filters that define the routing conditions and criteria for directing data to different output paths.</p>
    pub fn get_group_filters_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GroupFilters>> {
        &self.group_filters_list
    }
    /// Consumes the builder and constructs a [`Route`](crate::types::Route).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::RouteBuilder::name)
    /// - [`inputs`](crate::types::builders::RouteBuilder::inputs)
    /// - [`group_filters_list`](crate::types::builders::RouteBuilder::group_filters_list)
    pub fn build(self) -> ::std::result::Result<crate::types::Route, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Route {
            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 Route",
                )
            })?,
            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 Route",
                )
            })?,
            group_filters_list: self.group_filters_list.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "group_filters_list",
                    "group_filters_list was not specified but it is required when building Route",
                )
            })?,
        })
    }
}