Skip to main content

aws_sdk_bedrockagentruntime/client/
get_document_content.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`GetDocumentContent`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`knowledge_base_id(impl Into<String>)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::knowledge_base_id) / [`set_knowledge_base_id(Option<String>)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::set_knowledge_base_id):<br>required: **true**<br><p>The unique identifier of the knowledge base that contains the document.</p><br>
7    ///   - [`data_source_id(impl Into<String>)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::data_source_id) / [`set_data_source_id(Option<String>)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::set_data_source_id):<br>required: **true**<br><p>The unique identifier of the data source that contains the document.</p><br>
8    ///   - [`document_id(impl Into<String>)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::document_id) / [`set_document_id(Option<String>)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::set_document_id):<br>required: **true**<br><p>The unique identifier of the document to retrieve content for.</p><br>
9    ///   - [`output_format(DocumentOutputFormat)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::output_format) / [`set_output_format(Option<DocumentOutputFormat>)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::set_output_format):<br>required: **false**<br><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><br>
10    ///   - [`user_context(UserContext)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::user_context) / [`set_user_context(Option<UserContext>)`](crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::set_user_context):<br>required: **false**<br><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><br>
11    /// - On success, responds with [`GetDocumentContentOutput`](crate::operation::get_document_content::GetDocumentContentOutput) with field(s):
12    ///   - [`mime_type(String)`](crate::operation::get_document_content::GetDocumentContentOutput::mime_type): <p>The MIME type of the document content. For <code>RAW</code> format, this is the original file type (for example, <code>application/pdf</code>). For <code>EXTRACTED</code> format, this is always <code>application/json</code>.</p>
13    ///   - [`presigned_url(String)`](crate::operation::get_document_content::GetDocumentContentOutput::presigned_url): <p>A pre-signed URL for downloading the document content. The URL expires after 5 minutes.</p>
14    ///   - [`document_content_length(Option<i64>)`](crate::operation::get_document_content::GetDocumentContentOutput::document_content_length): <p>The size of the document content in bytes available at the pre-signed URL.</p>
15    /// - On failure, responds with [`SdkError<GetDocumentContentError>`](crate::operation::get_document_content::GetDocumentContentError)
16    pub fn get_document_content(&self) -> crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder {
17        crate::operation::get_document_content::builders::GetDocumentContentFluentBuilder::new(self.handle.clone())
18    }
19}