aws-sdk-bedrockagentruntime 1.131.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 GetDocumentContentOutput {
    /// <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>
    pub mime_type: ::std::string::String,
    /// <p>A pre-signed URL for downloading the document content. The URL expires after 5 minutes.</p>
    pub presigned_url: ::std::string::String,
    /// <p>The size of the document content in bytes available at the pre-signed URL.</p>
    pub document_content_length: ::std::option::Option<i64>,
    _request_id: Option<String>,
}
impl GetDocumentContentOutput {
    /// <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>
    pub fn mime_type(&self) -> &str {
        use std::ops::Deref;
        self.mime_type.deref()
    }
    /// <p>A pre-signed URL for downloading the document content. The URL expires after 5 minutes.</p>
    pub fn presigned_url(&self) -> &str {
        use std::ops::Deref;
        self.presigned_url.deref()
    }
    /// <p>The size of the document content in bytes available at the pre-signed URL.</p>
    pub fn document_content_length(&self) -> ::std::option::Option<i64> {
        self.document_content_length
    }
}
impl ::std::fmt::Debug for GetDocumentContentOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetDocumentContentOutput");
        formatter.field("mime_type", &self.mime_type);
        formatter.field("presigned_url", &"*** Sensitive Data Redacted ***");
        formatter.field("document_content_length", &self.document_content_length);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetDocumentContentOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetDocumentContentOutput {
    /// Creates a new builder-style object to manufacture [`GetDocumentContentOutput`](crate::operation::get_document_content::GetDocumentContentOutput).
    pub fn builder() -> crate::operation::get_document_content::builders::GetDocumentContentOutputBuilder {
        crate::operation::get_document_content::builders::GetDocumentContentOutputBuilder::default()
    }
}

/// A builder for [`GetDocumentContentOutput`](crate::operation::get_document_content::GetDocumentContentOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetDocumentContentOutputBuilder {
    pub(crate) mime_type: ::std::option::Option<::std::string::String>,
    pub(crate) presigned_url: ::std::option::Option<::std::string::String>,
    pub(crate) document_content_length: ::std::option::Option<i64>,
    _request_id: Option<String>,
}
impl GetDocumentContentOutputBuilder {
    /// <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>
    /// This field is required.
    pub fn mime_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.mime_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_mime_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.mime_type = input;
        self
    }
    /// <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>
    pub fn get_mime_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.mime_type
    }
    /// <p>A pre-signed URL for downloading the document content. The URL expires after 5 minutes.</p>
    /// This field is required.
    pub fn presigned_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.presigned_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A pre-signed URL for downloading the document content. The URL expires after 5 minutes.</p>
    pub fn set_presigned_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.presigned_url = input;
        self
    }
    /// <p>A pre-signed URL for downloading the document content. The URL expires after 5 minutes.</p>
    pub fn get_presigned_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.presigned_url
    }
    /// <p>The size of the document content in bytes available at the pre-signed URL.</p>
    pub fn document_content_length(mut self, input: i64) -> Self {
        self.document_content_length = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size of the document content in bytes available at the pre-signed URL.</p>
    pub fn set_document_content_length(mut self, input: ::std::option::Option<i64>) -> Self {
        self.document_content_length = input;
        self
    }
    /// <p>The size of the document content in bytes available at the pre-signed URL.</p>
    pub fn get_document_content_length(&self) -> &::std::option::Option<i64> {
        &self.document_content_length
    }
    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 [`GetDocumentContentOutput`](crate::operation::get_document_content::GetDocumentContentOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`mime_type`](crate::operation::get_document_content::builders::GetDocumentContentOutputBuilder::mime_type)
    /// - [`presigned_url`](crate::operation::get_document_content::builders::GetDocumentContentOutputBuilder::presigned_url)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_document_content::GetDocumentContentOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_document_content::GetDocumentContentOutput {
            mime_type: self.mime_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "mime_type",
                    "mime_type was not specified but it is required when building GetDocumentContentOutput",
                )
            })?,
            presigned_url: self.presigned_url.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "presigned_url",
                    "presigned_url was not specified but it is required when building GetDocumentContentOutput",
                )
            })?,
            document_content_length: self.document_content_length,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetDocumentContentOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetDocumentContentOutputBuilder");
        formatter.field("mime_type", &self.mime_type);
        formatter.field("presigned_url", &"*** Sensitive Data Redacted ***");
        formatter.field("document_content_length", &self.document_content_length);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}