aws-sdk-opensearch 1.112.0

AWS SDK for Amazon OpenSearch Service
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 CreateIndexInput {
    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
    pub domain_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
    pub index_name: ::std::option::Option<::std::string::String>,
    /// <p>The JSON schema defining index mappings, settings, and semantic enrichment configuration. The schema specifies which text fields should be automatically enriched for semantic search capabilities and includes OpenSearch index configuration parameters.</p>
    pub index_schema: ::std::option::Option<::aws_smithy_types::Document>,
}
impl CreateIndexInput {
    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
    pub fn domain_name(&self) -> ::std::option::Option<&str> {
        self.domain_name.as_deref()
    }
    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
    pub fn index_name(&self) -> ::std::option::Option<&str> {
        self.index_name.as_deref()
    }
    /// <p>The JSON schema defining index mappings, settings, and semantic enrichment configuration. The schema specifies which text fields should be automatically enriched for semantic search capabilities and includes OpenSearch index configuration parameters.</p>
    pub fn index_schema(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
        self.index_schema.as_ref()
    }
}
impl CreateIndexInput {
    /// Creates a new builder-style object to manufacture [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
    pub fn builder() -> crate::operation::create_index::builders::CreateIndexInputBuilder {
        crate::operation::create_index::builders::CreateIndexInputBuilder::default()
    }
}

/// A builder for [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateIndexInputBuilder {
    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
    pub(crate) index_name: ::std::option::Option<::std::string::String>,
    pub(crate) index_schema: ::std::option::Option<::aws_smithy_types::Document>,
}
impl CreateIndexInputBuilder {
    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
    /// This field is required.
    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_name = input;
        self
    }
    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_name
    }
    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
    /// This field is required.
    pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.index_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
    pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.index_name = input;
        self
    }
    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.index_name
    }
    /// <p>The JSON schema defining index mappings, settings, and semantic enrichment configuration. The schema specifies which text fields should be automatically enriched for semantic search capabilities and includes OpenSearch index configuration parameters.</p>
    /// This field is required.
    pub fn index_schema(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.index_schema = ::std::option::Option::Some(input);
        self
    }
    /// <p>The JSON schema defining index mappings, settings, and semantic enrichment configuration. The schema specifies which text fields should be automatically enriched for semantic search capabilities and includes OpenSearch index configuration parameters.</p>
    pub fn set_index_schema(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.index_schema = input;
        self
    }
    /// <p>The JSON schema defining index mappings, settings, and semantic enrichment configuration. The schema specifies which text fields should be automatically enriched for semantic search capabilities and includes OpenSearch index configuration parameters.</p>
    pub fn get_index_schema(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.index_schema
    }
    /// Consumes the builder and constructs a [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_index::CreateIndexInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_index::CreateIndexInput {
            domain_name: self.domain_name,
            index_name: self.index_name,
            index_schema: self.index_schema,
        })
    }
}