aws-sdk-bedrockagentruntime 1.137.0

AWS SDK for Agents for Amazon Bedrock Runtime
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)]
pub struct GetDocumentContentInput {
    /// <p>The unique identifier of the knowledge base that contains the document.</p>
    pub knowledge_base_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the data source that contains the document.</p>
    pub data_source_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the document to retrieve content for.</p>
    pub document_id: ::std::option::Option<::std::string::String>,
    /// <p>The output format for the document content. <code>RAW</code> returns the original file. <code>EXTRACTED</code> returns parsed text as JSON. Defaults to <code>RAW</code>.</p>
    pub output_format: ::std::option::Option<crate::types::DocumentOutputFormat>,
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that results only include documents the user is authorized to access.</p>
    pub user_context: ::std::option::Option<crate::types::UserContext>,
}
impl GetDocumentContentInput {
    /// <p>The unique identifier of the knowledge base that contains the document.</p>
    pub fn knowledge_base_id(&self) -> ::std::option::Option<&str> {
        self.knowledge_base_id.as_deref()
    }
    /// <p>The unique identifier of the data source that contains the document.</p>
    pub fn data_source_id(&self) -> ::std::option::Option<&str> {
        self.data_source_id.as_deref()
    }
    /// <p>The unique identifier of the document to retrieve content for.</p>
    pub fn document_id(&self) -> ::std::option::Option<&str> {
        self.document_id.as_deref()
    }
    /// <p>The output format for the document content. <code>RAW</code> returns the original file. <code>EXTRACTED</code> returns parsed text as JSON. Defaults to <code>RAW</code>.</p>
    pub fn output_format(&self) -> ::std::option::Option<&crate::types::DocumentOutputFormat> {
        self.output_format.as_ref()
    }
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that results only include documents the user is authorized to access.</p>
    pub fn user_context(&self) -> ::std::option::Option<&crate::types::UserContext> {
        self.user_context.as_ref()
    }
}
impl ::std::fmt::Debug for GetDocumentContentInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetDocumentContentInput");
        formatter.field("knowledge_base_id", &self.knowledge_base_id);
        formatter.field("data_source_id", &self.data_source_id);
        formatter.field("document_id", &self.document_id);
        formatter.field("output_format", &self.output_format);
        formatter.field("user_context", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl GetDocumentContentInput {
    /// Creates a new builder-style object to manufacture [`GetDocumentContentInput`](crate::operation::get_document_content::GetDocumentContentInput).
    pub fn builder() -> crate::operation::get_document_content::builders::GetDocumentContentInputBuilder {
        crate::operation::get_document_content::builders::GetDocumentContentInputBuilder::default()
    }
}

/// A builder for [`GetDocumentContentInput`](crate::operation::get_document_content::GetDocumentContentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetDocumentContentInputBuilder {
    pub(crate) knowledge_base_id: ::std::option::Option<::std::string::String>,
    pub(crate) data_source_id: ::std::option::Option<::std::string::String>,
    pub(crate) document_id: ::std::option::Option<::std::string::String>,
    pub(crate) output_format: ::std::option::Option<crate::types::DocumentOutputFormat>,
    pub(crate) user_context: ::std::option::Option<crate::types::UserContext>,
}
impl GetDocumentContentInputBuilder {
    /// <p>The unique identifier of the knowledge base that contains the document.</p>
    /// This field is required.
    pub fn knowledge_base_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.knowledge_base_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the knowledge base that contains the document.</p>
    pub fn set_knowledge_base_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.knowledge_base_id = input;
        self
    }
    /// <p>The unique identifier of the knowledge base that contains the document.</p>
    pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.knowledge_base_id
    }
    /// <p>The unique identifier of the data source that contains the document.</p>
    /// This field is required.
    pub fn data_source_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.data_source_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the data source that contains the document.</p>
    pub fn set_data_source_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.data_source_id = input;
        self
    }
    /// <p>The unique identifier of the data source that contains the document.</p>
    pub fn get_data_source_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.data_source_id
    }
    /// <p>The unique identifier of the document to retrieve content for.</p>
    /// This field is required.
    pub fn document_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.document_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the document to retrieve content for.</p>
    pub fn set_document_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.document_id = input;
        self
    }
    /// <p>The unique identifier of the document to retrieve content for.</p>
    pub fn get_document_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.document_id
    }
    /// <p>The output format for the document content. <code>RAW</code> returns the original file. <code>EXTRACTED</code> returns parsed text as JSON. Defaults to <code>RAW</code>.</p>
    pub fn output_format(mut self, input: crate::types::DocumentOutputFormat) -> Self {
        self.output_format = ::std::option::Option::Some(input);
        self
    }
    /// <p>The output format for the document content. <code>RAW</code> returns the original file. <code>EXTRACTED</code> returns parsed text as JSON. Defaults to <code>RAW</code>.</p>
    pub fn set_output_format(mut self, input: ::std::option::Option<crate::types::DocumentOutputFormat>) -> Self {
        self.output_format = input;
        self
    }
    /// <p>The output format for the document content. <code>RAW</code> returns the original file. <code>EXTRACTED</code> returns parsed text as JSON. Defaults to <code>RAW</code>.</p>
    pub fn get_output_format(&self) -> &::std::option::Option<crate::types::DocumentOutputFormat> {
        &self.output_format
    }
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that results only include documents the user is authorized to access.</p>
    pub fn user_context(mut self, input: crate::types::UserContext) -> Self {
        self.user_context = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that results only include documents the user is authorized to access.</p>
    pub fn set_user_context(mut self, input: ::std::option::Option<crate::types::UserContext>) -> Self {
        self.user_context = input;
        self
    }
    /// <p>Contains information about the user making the request. This is used for access control filtering to ensure that results only include documents the user is authorized to access.</p>
    pub fn get_user_context(&self) -> &::std::option::Option<crate::types::UserContext> {
        &self.user_context
    }
    /// Consumes the builder and constructs a [`GetDocumentContentInput`](crate::operation::get_document_content::GetDocumentContentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_document_content::GetDocumentContentInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_document_content::GetDocumentContentInput {
            knowledge_base_id: self.knowledge_base_id,
            data_source_id: self.data_source_id,
            document_id: self.document_id,
            output_format: self.output_format,
            user_context: self.user_context,
        })
    }
}
impl ::std::fmt::Debug for GetDocumentContentInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetDocumentContentInputBuilder");
        formatter.field("knowledge_base_id", &self.knowledge_base_id);
        formatter.field("data_source_id", &self.data_source_id);
        formatter.field("document_id", &self.document_id);
        formatter.field("output_format", &self.output_format);
        formatter.field("user_context", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}