aws-sdk-cloudsearchdomain 1.93.0

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

/// <p>Container for the parameters to the <code>UploadDocuments</code> request.</p>
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub struct UploadDocumentsInput {
    /// <p>A batch of documents formatted in JSON or HTML.</p>
    pub documents: ::aws_smithy_types::byte_stream::ByteStream,
    /// <p>The format of the batch you are uploading. Amazon CloudSearch supports two document batch formats:</p>
    /// <ul>
    /// <li>application/json</li>
    /// <li>application/xml</li>
    /// </ul>
    pub content_type: ::std::option::Option<crate::types::ContentType>,
}
impl UploadDocumentsInput {
    /// <p>A batch of documents formatted in JSON or HTML.</p>
    pub fn documents(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
        &self.documents
    }
    /// <p>The format of the batch you are uploading. Amazon CloudSearch supports two document batch formats:</p>
    /// <ul>
    /// <li>application/json</li>
    /// <li>application/xml</li>
    /// </ul>
    pub fn content_type(&self) -> ::std::option::Option<&crate::types::ContentType> {
        self.content_type.as_ref()
    }
}
impl UploadDocumentsInput {
    /// Creates a new builder-style object to manufacture [`UploadDocumentsInput`](crate::operation::upload_documents::UploadDocumentsInput).
    pub fn builder() -> crate::operation::upload_documents::builders::UploadDocumentsInputBuilder {
        crate::operation::upload_documents::builders::UploadDocumentsInputBuilder::default()
    }
}

/// A builder for [`UploadDocumentsInput`](crate::operation::upload_documents::UploadDocumentsInput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UploadDocumentsInputBuilder {
    pub(crate) documents: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
    pub(crate) content_type: ::std::option::Option<crate::types::ContentType>,
}
impl UploadDocumentsInputBuilder {
    /// <p>A batch of documents formatted in JSON or HTML.</p>
    /// This field is required.
    pub fn documents(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
        self.documents = ::std::option::Option::Some(input);
        self
    }
    /// <p>A batch of documents formatted in JSON or HTML.</p>
    pub fn set_documents(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
        self.documents = input;
        self
    }
    /// <p>A batch of documents formatted in JSON or HTML.</p>
    pub fn get_documents(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
        &self.documents
    }
    /// <p>The format of the batch you are uploading. Amazon CloudSearch supports two document batch formats:</p>
    /// <ul>
    /// <li>application/json</li>
    /// <li>application/xml</li>
    /// </ul>
    /// This field is required.
    pub fn content_type(mut self, input: crate::types::ContentType) -> Self {
        self.content_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The format of the batch you are uploading. Amazon CloudSearch supports two document batch formats:</p>
    /// <ul>
    /// <li>application/json</li>
    /// <li>application/xml</li>
    /// </ul>
    pub fn set_content_type(mut self, input: ::std::option::Option<crate::types::ContentType>) -> Self {
        self.content_type = input;
        self
    }
    /// <p>The format of the batch you are uploading. Amazon CloudSearch supports two document batch formats:</p>
    /// <ul>
    /// <li>application/json</li>
    /// <li>application/xml</li>
    /// </ul>
    pub fn get_content_type(&self) -> &::std::option::Option<crate::types::ContentType> {
        &self.content_type
    }
    /// Consumes the builder and constructs a [`UploadDocumentsInput`](crate::operation::upload_documents::UploadDocumentsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::upload_documents::UploadDocumentsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::upload_documents::UploadDocumentsInput {
            documents: self.documents.unwrap_or_default(),
            content_type: self.content_type,
        })
    }
}