aws-sdk-customerprofiles 1.119.0

AWS SDK for Amazon Connect Customer Profiles
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains dimensions that determine what to segment on.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Group {
    /// <p>Defines the attributes to segment on.</p>
    pub dimensions: ::std::option::Option<::std::vec::Vec<crate::types::Dimension>>,
    /// <p>Defines the starting source of data.</p>
    pub source_segments: ::std::option::Option<::std::vec::Vec<crate::types::SourceSegment>>,
    /// <p>Defines how to interact with the source data.</p>
    pub source_type: crate::types::IncludeOptions,
    /// <p>Defines how to interact with the profiles found in the current filtering.</p>
    pub r#type: crate::types::IncludeOptions,
}
impl Group {
    /// <p>Defines the attributes to segment on.</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 `.dimensions.is_none()`.
    pub fn dimensions(&self) -> &[crate::types::Dimension] {
        self.dimensions.as_deref().unwrap_or_default()
    }
    /// <p>Defines the starting source of data.</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 `.source_segments.is_none()`.
    pub fn source_segments(&self) -> &[crate::types::SourceSegment] {
        self.source_segments.as_deref().unwrap_or_default()
    }
    /// <p>Defines how to interact with the source data.</p>
    pub fn source_type(&self) -> &crate::types::IncludeOptions {
        &self.source_type
    }
    /// <p>Defines how to interact with the profiles found in the current filtering.</p>
    pub fn r#type(&self) -> &crate::types::IncludeOptions {
        &self.r#type
    }
}
impl Group {
    /// Creates a new builder-style object to manufacture [`Group`](crate::types::Group).
    pub fn builder() -> crate::types::builders::GroupBuilder {
        crate::types::builders::GroupBuilder::default()
    }
}

/// A builder for [`Group`](crate::types::Group).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GroupBuilder {
    pub(crate) dimensions: ::std::option::Option<::std::vec::Vec<crate::types::Dimension>>,
    pub(crate) source_segments: ::std::option::Option<::std::vec::Vec<crate::types::SourceSegment>>,
    pub(crate) source_type: ::std::option::Option<crate::types::IncludeOptions>,
    pub(crate) r#type: ::std::option::Option<crate::types::IncludeOptions>,
}
impl GroupBuilder {
    /// Appends an item to `dimensions`.
    ///
    /// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
    ///
    /// <p>Defines the attributes to segment on.</p>
    pub fn dimensions(mut self, input: crate::types::Dimension) -> Self {
        let mut v = self.dimensions.unwrap_or_default();
        v.push(input);
        self.dimensions = ::std::option::Option::Some(v);
        self
    }
    /// <p>Defines the attributes to segment on.</p>
    pub fn set_dimensions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Dimension>>) -> Self {
        self.dimensions = input;
        self
    }
    /// <p>Defines the attributes to segment on.</p>
    pub fn get_dimensions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Dimension>> {
        &self.dimensions
    }
    /// Appends an item to `source_segments`.
    ///
    /// To override the contents of this collection use [`set_source_segments`](Self::set_source_segments).
    ///
    /// <p>Defines the starting source of data.</p>
    pub fn source_segments(mut self, input: crate::types::SourceSegment) -> Self {
        let mut v = self.source_segments.unwrap_or_default();
        v.push(input);
        self.source_segments = ::std::option::Option::Some(v);
        self
    }
    /// <p>Defines the starting source of data.</p>
    pub fn set_source_segments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SourceSegment>>) -> Self {
        self.source_segments = input;
        self
    }
    /// <p>Defines the starting source of data.</p>
    pub fn get_source_segments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SourceSegment>> {
        &self.source_segments
    }
    /// <p>Defines how to interact with the source data.</p>
    pub fn source_type(mut self, input: crate::types::IncludeOptions) -> Self {
        self.source_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Defines how to interact with the source data.</p>
    pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::IncludeOptions>) -> Self {
        self.source_type = input;
        self
    }
    /// <p>Defines how to interact with the source data.</p>
    pub fn get_source_type(&self) -> &::std::option::Option<crate::types::IncludeOptions> {
        &self.source_type
    }
    /// <p>Defines how to interact with the profiles found in the current filtering.</p>
    pub fn r#type(mut self, input: crate::types::IncludeOptions) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Defines how to interact with the profiles found in the current filtering.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::IncludeOptions>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>Defines how to interact with the profiles found in the current filtering.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::IncludeOptions> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`Group`](crate::types::Group).
    pub fn build(self) -> crate::types::Group {
        crate::types::Group {
            dimensions: self.dimensions,
            source_segments: self.source_segments,
            source_type: self
                .source_type
                .unwrap_or("ALL".parse::<crate::types::IncludeOptions>().expect("static value validated to member")),
            r#type: self
                .r#type
                .unwrap_or("ALL".parse::<crate::types::IncludeOptions>().expect("static value validated to member")),
        }
    }
}