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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetSegmentMembershipOutput {
    /// <p>The unique name of the segment definition.</p>
    pub segment_definition_name: ::std::option::Option<::std::string::String>,
    /// <p>An array of maps where each contains a response per profile requested.</p>
    pub profiles: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQueryResult>>,
    /// <p>An array of maps where each contains a response per profile failed for the request.</p>
    pub failures: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQueryFailures>>,
    /// <p>The timestamp indicating when the segment membership was last computed or updated.</p>
    pub last_computed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetSegmentMembershipOutput {
    /// <p>The unique name of the segment definition.</p>
    pub fn segment_definition_name(&self) -> ::std::option::Option<&str> {
        self.segment_definition_name.as_deref()
    }
    /// <p>An array of maps where each contains a response per profile requested.</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 `.profiles.is_none()`.
    pub fn profiles(&self) -> &[crate::types::ProfileQueryResult] {
        self.profiles.as_deref().unwrap_or_default()
    }
    /// <p>An array of maps where each contains a response per profile failed for the request.</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 `.failures.is_none()`.
    pub fn failures(&self) -> &[crate::types::ProfileQueryFailures] {
        self.failures.as_deref().unwrap_or_default()
    }
    /// <p>The timestamp indicating when the segment membership was last computed or updated.</p>
    pub fn last_computed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_computed_at.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetSegmentMembershipOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSegmentMembershipOutput {
    /// Creates a new builder-style object to manufacture [`GetSegmentMembershipOutput`](crate::operation::get_segment_membership::GetSegmentMembershipOutput).
    pub fn builder() -> crate::operation::get_segment_membership::builders::GetSegmentMembershipOutputBuilder {
        crate::operation::get_segment_membership::builders::GetSegmentMembershipOutputBuilder::default()
    }
}

/// A builder for [`GetSegmentMembershipOutput`](crate::operation::get_segment_membership::GetSegmentMembershipOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSegmentMembershipOutputBuilder {
    pub(crate) segment_definition_name: ::std::option::Option<::std::string::String>,
    pub(crate) profiles: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQueryResult>>,
    pub(crate) failures: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQueryFailures>>,
    pub(crate) last_computed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetSegmentMembershipOutputBuilder {
    /// <p>The unique name of the segment definition.</p>
    pub fn segment_definition_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.segment_definition_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique name of the segment definition.</p>
    pub fn set_segment_definition_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.segment_definition_name = input;
        self
    }
    /// <p>The unique name of the segment definition.</p>
    pub fn get_segment_definition_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.segment_definition_name
    }
    /// Appends an item to `profiles`.
    ///
    /// To override the contents of this collection use [`set_profiles`](Self::set_profiles).
    ///
    /// <p>An array of maps where each contains a response per profile requested.</p>
    pub fn profiles(mut self, input: crate::types::ProfileQueryResult) -> Self {
        let mut v = self.profiles.unwrap_or_default();
        v.push(input);
        self.profiles = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of maps where each contains a response per profile requested.</p>
    pub fn set_profiles(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQueryResult>>) -> Self {
        self.profiles = input;
        self
    }
    /// <p>An array of maps where each contains a response per profile requested.</p>
    pub fn get_profiles(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProfileQueryResult>> {
        &self.profiles
    }
    /// Appends an item to `failures`.
    ///
    /// To override the contents of this collection use [`set_failures`](Self::set_failures).
    ///
    /// <p>An array of maps where each contains a response per profile failed for the request.</p>
    pub fn failures(mut self, input: crate::types::ProfileQueryFailures) -> Self {
        let mut v = self.failures.unwrap_or_default();
        v.push(input);
        self.failures = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of maps where each contains a response per profile failed for the request.</p>
    pub fn set_failures(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQueryFailures>>) -> Self {
        self.failures = input;
        self
    }
    /// <p>An array of maps where each contains a response per profile failed for the request.</p>
    pub fn get_failures(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProfileQueryFailures>> {
        &self.failures
    }
    /// <p>The timestamp indicating when the segment membership was last computed or updated.</p>
    pub fn last_computed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_computed_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp indicating when the segment membership was last computed or updated.</p>
    pub fn set_last_computed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_computed_at = input;
        self
    }
    /// <p>The timestamp indicating when the segment membership was last computed or updated.</p>
    pub fn get_last_computed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_computed_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetSegmentMembershipOutput`](crate::operation::get_segment_membership::GetSegmentMembershipOutput).
    pub fn build(self) -> crate::operation::get_segment_membership::GetSegmentMembershipOutput {
        crate::operation::get_segment_membership::GetSegmentMembershipOutput {
            segment_definition_name: self.segment_definition_name,
            profiles: self.profiles,
            failures: self.failures,
            last_computed_at: self.last_computed_at,
            _request_id: self._request_id,
        }
    }
}