aws_sdk_opensearch/operation/create_index/
_create_index_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateIndexInput {
6    /// <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>
7    pub domain_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
9    pub index_name: ::std::option::Option<::std::string::String>,
10    /// <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>
11    pub index_schema: ::std::option::Option<::aws_smithy_types::Document>,
12}
13impl CreateIndexInput {
14    /// <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>
15    pub fn domain_name(&self) -> ::std::option::Option<&str> {
16        self.domain_name.as_deref()
17    }
18    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
19    pub fn index_name(&self) -> ::std::option::Option<&str> {
20        self.index_name.as_deref()
21    }
22    /// <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>
23    pub fn index_schema(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
24        self.index_schema.as_ref()
25    }
26}
27impl CreateIndexInput {
28    /// Creates a new builder-style object to manufacture [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
29    pub fn builder() -> crate::operation::create_index::builders::CreateIndexInputBuilder {
30        crate::operation::create_index::builders::CreateIndexInputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateIndexInputBuilder {
38    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
39    pub(crate) index_name: ::std::option::Option<::std::string::String>,
40    pub(crate) index_schema: ::std::option::Option<::aws_smithy_types::Document>,
41}
42impl CreateIndexInputBuilder {
43    /// <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>
44    /// This field is required.
45    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.domain_name = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <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>
50    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.domain_name = input;
52        self
53    }
54    /// <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>
55    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
56        &self.domain_name
57    }
58    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
59    /// This field is required.
60    pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.index_name = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
65    pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.index_name = input;
67        self
68    }
69    /// <p>The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.</p>
70    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
71        &self.index_name
72    }
73    /// <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>
74    /// This field is required.
75    pub fn index_schema(mut self, input: ::aws_smithy_types::Document) -> Self {
76        self.index_schema = ::std::option::Option::Some(input);
77        self
78    }
79    /// <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>
80    pub fn set_index_schema(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
81        self.index_schema = input;
82        self
83    }
84    /// <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>
85    pub fn get_index_schema(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
86        &self.index_schema
87    }
88    /// Consumes the builder and constructs a [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
89    pub fn build(self) -> ::std::result::Result<crate::operation::create_index::CreateIndexInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::create_index::CreateIndexInput {
91            domain_name: self.domain_name,
92            index_name: self.index_name,
93            index_schema: self.index_schema,
94        })
95    }
96}