aws-sdk-entityresolution 1.108.0

AWS SDK for AWS EntityResolution
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 GenerateMatchIdOutput {
    /// <p>The match groups from the generated match ID.</p>
    pub match_groups: ::std::vec::Vec<crate::types::MatchGroup>,
    /// <p>The records that didn't receive a generated Match ID.</p>
    pub failed_records: ::std::vec::Vec<crate::types::FailedRecord>,
    _request_id: Option<String>,
}
impl GenerateMatchIdOutput {
    /// <p>The match groups from the generated match ID.</p>
    pub fn match_groups(&self) -> &[crate::types::MatchGroup] {
        use std::ops::Deref;
        self.match_groups.deref()
    }
    /// <p>The records that didn't receive a generated Match ID.</p>
    pub fn failed_records(&self) -> &[crate::types::FailedRecord] {
        use std::ops::Deref;
        self.failed_records.deref()
    }
}
impl ::aws_types::request_id::RequestId for GenerateMatchIdOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GenerateMatchIdOutput {
    /// Creates a new builder-style object to manufacture [`GenerateMatchIdOutput`](crate::operation::generate_match_id::GenerateMatchIdOutput).
    pub fn builder() -> crate::operation::generate_match_id::builders::GenerateMatchIdOutputBuilder {
        crate::operation::generate_match_id::builders::GenerateMatchIdOutputBuilder::default()
    }
}

/// A builder for [`GenerateMatchIdOutput`](crate::operation::generate_match_id::GenerateMatchIdOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GenerateMatchIdOutputBuilder {
    pub(crate) match_groups: ::std::option::Option<::std::vec::Vec<crate::types::MatchGroup>>,
    pub(crate) failed_records: ::std::option::Option<::std::vec::Vec<crate::types::FailedRecord>>,
    _request_id: Option<String>,
}
impl GenerateMatchIdOutputBuilder {
    /// Appends an item to `match_groups`.
    ///
    /// To override the contents of this collection use [`set_match_groups`](Self::set_match_groups).
    ///
    /// <p>The match groups from the generated match ID.</p>
    pub fn match_groups(mut self, input: crate::types::MatchGroup) -> Self {
        let mut v = self.match_groups.unwrap_or_default();
        v.push(input);
        self.match_groups = ::std::option::Option::Some(v);
        self
    }
    /// <p>The match groups from the generated match ID.</p>
    pub fn set_match_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MatchGroup>>) -> Self {
        self.match_groups = input;
        self
    }
    /// <p>The match groups from the generated match ID.</p>
    pub fn get_match_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MatchGroup>> {
        &self.match_groups
    }
    /// Appends an item to `failed_records`.
    ///
    /// To override the contents of this collection use [`set_failed_records`](Self::set_failed_records).
    ///
    /// <p>The records that didn't receive a generated Match ID.</p>
    pub fn failed_records(mut self, input: crate::types::FailedRecord) -> Self {
        let mut v = self.failed_records.unwrap_or_default();
        v.push(input);
        self.failed_records = ::std::option::Option::Some(v);
        self
    }
    /// <p>The records that didn't receive a generated Match ID.</p>
    pub fn set_failed_records(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FailedRecord>>) -> Self {
        self.failed_records = input;
        self
    }
    /// <p>The records that didn't receive a generated Match ID.</p>
    pub fn get_failed_records(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FailedRecord>> {
        &self.failed_records
    }
    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 [`GenerateMatchIdOutput`](crate::operation::generate_match_id::GenerateMatchIdOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`match_groups`](crate::operation::generate_match_id::builders::GenerateMatchIdOutputBuilder::match_groups)
    /// - [`failed_records`](crate::operation::generate_match_id::builders::GenerateMatchIdOutputBuilder::failed_records)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::generate_match_id::GenerateMatchIdOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::generate_match_id::GenerateMatchIdOutput {
            match_groups: self.match_groups.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "match_groups",
                    "match_groups was not specified but it is required when building GenerateMatchIdOutput",
                )
            })?,
            failed_records: self.failed_records.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "failed_records",
                    "failed_records was not specified but it is required when building GenerateMatchIdOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}