aws-sdk-comprehendmedical 1.92.0

AWS SDK for AWS Comprehend Medical
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 DetectPhiOutput {
    /// <p>The collection of PHI entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in its detection.</p>
    pub entities: ::std::vec::Vec<crate::types::Entity>,
    /// <p>If the result of the previous request to <code>DetectPHI</code> was truncated, include the <code>PaginationToken</code> to fetch the next page of PHI entities.</p>
    pub pagination_token: ::std::option::Option<::std::string::String>,
    /// <p>The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.</p>
    pub model_version: ::std::string::String,
    _request_id: Option<String>,
}
impl DetectPhiOutput {
    /// <p>The collection of PHI entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in its detection.</p>
    pub fn entities(&self) -> &[crate::types::Entity] {
        use std::ops::Deref;
        self.entities.deref()
    }
    /// <p>If the result of the previous request to <code>DetectPHI</code> was truncated, include the <code>PaginationToken</code> to fetch the next page of PHI entities.</p>
    pub fn pagination_token(&self) -> ::std::option::Option<&str> {
        self.pagination_token.as_deref()
    }
    /// <p>The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.</p>
    pub fn model_version(&self) -> &str {
        use std::ops::Deref;
        self.model_version.deref()
    }
}
impl ::aws_types::request_id::RequestId for DetectPhiOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DetectPhiOutput {
    /// Creates a new builder-style object to manufacture [`DetectPhiOutput`](crate::operation::detect_phi::DetectPhiOutput).
    pub fn builder() -> crate::operation::detect_phi::builders::DetectPhiOutputBuilder {
        crate::operation::detect_phi::builders::DetectPhiOutputBuilder::default()
    }
}

/// A builder for [`DetectPhiOutput`](crate::operation::detect_phi::DetectPhiOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DetectPhiOutputBuilder {
    pub(crate) entities: ::std::option::Option<::std::vec::Vec<crate::types::Entity>>,
    pub(crate) pagination_token: ::std::option::Option<::std::string::String>,
    pub(crate) model_version: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DetectPhiOutputBuilder {
    /// Appends an item to `entities`.
    ///
    /// To override the contents of this collection use [`set_entities`](Self::set_entities).
    ///
    /// <p>The collection of PHI entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in its detection.</p>
    pub fn entities(mut self, input: crate::types::Entity) -> Self {
        let mut v = self.entities.unwrap_or_default();
        v.push(input);
        self.entities = ::std::option::Option::Some(v);
        self
    }
    /// <p>The collection of PHI entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in its detection.</p>
    pub fn set_entities(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Entity>>) -> Self {
        self.entities = input;
        self
    }
    /// <p>The collection of PHI entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in its detection.</p>
    pub fn get_entities(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Entity>> {
        &self.entities
    }
    /// <p>If the result of the previous request to <code>DetectPHI</code> was truncated, include the <code>PaginationToken</code> to fetch the next page of PHI entities.</p>
    pub fn pagination_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.pagination_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>If the result of the previous request to <code>DetectPHI</code> was truncated, include the <code>PaginationToken</code> to fetch the next page of PHI entities.</p>
    pub fn set_pagination_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pagination_token = input;
        self
    }
    /// <p>If the result of the previous request to <code>DetectPHI</code> was truncated, include the <code>PaginationToken</code> to fetch the next page of PHI entities.</p>
    pub fn get_pagination_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.pagination_token
    }
    /// <p>The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.</p>
    /// This field is required.
    pub fn model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.model_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.</p>
    pub fn set_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.model_version = input;
        self
    }
    /// <p>The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.</p>
    pub fn get_model_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.model_version
    }
    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 [`DetectPhiOutput`](crate::operation::detect_phi::DetectPhiOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`entities`](crate::operation::detect_phi::builders::DetectPhiOutputBuilder::entities)
    /// - [`model_version`](crate::operation::detect_phi::builders::DetectPhiOutputBuilder::model_version)
    pub fn build(self) -> ::std::result::Result<crate::operation::detect_phi::DetectPhiOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::detect_phi::DetectPhiOutput {
            entities: self.entities.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "entities",
                    "entities was not specified but it is required when building DetectPhiOutput",
                )
            })?,
            pagination_token: self.pagination_token,
            model_version: self.model_version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "model_version",
                    "model_version was not specified but it is required when building DetectPhiOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}