aws_sdk_opensearchserverless/operation/update_index/
_update_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 UpdateIndexInput {
6    /// <p>The unique identifier of the collection containing the index to update.</p>
7    pub id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the index to update.</p>
9    pub index_name: ::std::option::Option<::std::string::String>,
10    /// <p>The updated JSON schema definition for the index, including field mappings and settings.</p>
11    pub index_schema: ::std::option::Option<::aws_smithy_types::Document>,
12}
13impl UpdateIndexInput {
14    /// <p>The unique identifier of the collection containing the index to update.</p>
15    pub fn id(&self) -> ::std::option::Option<&str> {
16        self.id.as_deref()
17    }
18    /// <p>The name of the index to update.</p>
19    pub fn index_name(&self) -> ::std::option::Option<&str> {
20        self.index_name.as_deref()
21    }
22    /// <p>The updated JSON schema definition for the index, including field mappings and settings.</p>
23    pub fn index_schema(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
24        self.index_schema.as_ref()
25    }
26}
27impl UpdateIndexInput {
28    /// Creates a new builder-style object to manufacture [`UpdateIndexInput`](crate::operation::update_index::UpdateIndexInput).
29    pub fn builder() -> crate::operation::update_index::builders::UpdateIndexInputBuilder {
30        crate::operation::update_index::builders::UpdateIndexInputBuilder::default()
31    }
32}
33
34/// A builder for [`UpdateIndexInput`](crate::operation::update_index::UpdateIndexInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct UpdateIndexInputBuilder {
38    pub(crate) id: ::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 UpdateIndexInputBuilder {
43    /// <p>The unique identifier of the collection containing the index to update.</p>
44    /// This field is required.
45    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.id = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The unique identifier of the collection containing the index to update.</p>
50    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.id = input;
52        self
53    }
54    /// <p>The unique identifier of the collection containing the index to update.</p>
55    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
56        &self.id
57    }
58    /// <p>The name of the index to update.</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 update.</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 update.</p>
70    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
71        &self.index_name
72    }
73    /// <p>The updated JSON schema definition for the index, including field mappings and settings.</p>
74    pub fn index_schema(mut self, input: ::aws_smithy_types::Document) -> Self {
75        self.index_schema = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>The updated JSON schema definition for the index, including field mappings and settings.</p>
79    pub fn set_index_schema(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
80        self.index_schema = input;
81        self
82    }
83    /// <p>The updated JSON schema definition for the index, including field mappings and settings.</p>
84    pub fn get_index_schema(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
85        &self.index_schema
86    }
87    /// Consumes the builder and constructs a [`UpdateIndexInput`](crate::operation::update_index::UpdateIndexInput).
88    pub fn build(self) -> ::std::result::Result<crate::operation::update_index::UpdateIndexInput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::update_index::UpdateIndexInput {
90            id: self.id,
91            index_name: self.index_name,
92            index_schema: self.index_schema,
93        })
94    }
95}