aws-sdk-connect 1.172.0

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

/// <p>A structure that defines search criteria and matching logic to search for contacts by matching text with transcripts analyzed by Amazon Connect Contact Lens.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Transcript {
    /// <p>The list of search criteria based on Contact Lens conversational analytics transcript.</p>
    pub criteria: ::std::vec::Vec<crate::types::TranscriptCriteria>,
    /// <p>The match type combining search criteria using multiple transcript criteria.</p>
    pub match_type: ::std::option::Option<crate::types::SearchContactsMatchType>,
}
impl Transcript {
    /// <p>The list of search criteria based on Contact Lens conversational analytics transcript.</p>
    pub fn criteria(&self) -> &[crate::types::TranscriptCriteria] {
        use std::ops::Deref;
        self.criteria.deref()
    }
    /// <p>The match type combining search criteria using multiple transcript criteria.</p>
    pub fn match_type(&self) -> ::std::option::Option<&crate::types::SearchContactsMatchType> {
        self.match_type.as_ref()
    }
}
impl Transcript {
    /// Creates a new builder-style object to manufacture [`Transcript`](crate::types::Transcript).
    pub fn builder() -> crate::types::builders::TranscriptBuilder {
        crate::types::builders::TranscriptBuilder::default()
    }
}

/// A builder for [`Transcript`](crate::types::Transcript).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TranscriptBuilder {
    pub(crate) criteria: ::std::option::Option<::std::vec::Vec<crate::types::TranscriptCriteria>>,
    pub(crate) match_type: ::std::option::Option<crate::types::SearchContactsMatchType>,
}
impl TranscriptBuilder {
    /// Appends an item to `criteria`.
    ///
    /// To override the contents of this collection use [`set_criteria`](Self::set_criteria).
    ///
    /// <p>The list of search criteria based on Contact Lens conversational analytics transcript.</p>
    pub fn criteria(mut self, input: crate::types::TranscriptCriteria) -> Self {
        let mut v = self.criteria.unwrap_or_default();
        v.push(input);
        self.criteria = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of search criteria based on Contact Lens conversational analytics transcript.</p>
    pub fn set_criteria(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TranscriptCriteria>>) -> Self {
        self.criteria = input;
        self
    }
    /// <p>The list of search criteria based on Contact Lens conversational analytics transcript.</p>
    pub fn get_criteria(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TranscriptCriteria>> {
        &self.criteria
    }
    /// <p>The match type combining search criteria using multiple transcript criteria.</p>
    pub fn match_type(mut self, input: crate::types::SearchContactsMatchType) -> Self {
        self.match_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The match type combining search criteria using multiple transcript criteria.</p>
    pub fn set_match_type(mut self, input: ::std::option::Option<crate::types::SearchContactsMatchType>) -> Self {
        self.match_type = input;
        self
    }
    /// <p>The match type combining search criteria using multiple transcript criteria.</p>
    pub fn get_match_type(&self) -> &::std::option::Option<crate::types::SearchContactsMatchType> {
        &self.match_type
    }
    /// Consumes the builder and constructs a [`Transcript`](crate::types::Transcript).
    /// This method will fail if any of the following fields are not set:
    /// - [`criteria`](crate::types::builders::TranscriptBuilder::criteria)
    pub fn build(self) -> ::std::result::Result<crate::types::Transcript, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Transcript {
            criteria: self.criteria.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "criteria",
                    "criteria was not specified but it is required when building Transcript",
                )
            })?,
            match_type: self.match_type,
        })
    }
}