aws_sdk_opensearch/operation/get_index/
_get_index_output.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 GetIndexOutput {
6    /// <p>The JSON schema of the index including mappings, settings, and semantic enrichment configuration.</p>
7    pub index_schema: ::aws_smithy_types::Document,
8    _request_id: Option<String>,
9}
10impl GetIndexOutput {
11    /// <p>The JSON schema of the index including mappings, settings, and semantic enrichment configuration.</p>
12    pub fn index_schema(&self) -> &::aws_smithy_types::Document {
13        &self.index_schema
14    }
15}
16impl ::aws_types::request_id::RequestId for GetIndexOutput {
17    fn request_id(&self) -> Option<&str> {
18        self._request_id.as_deref()
19    }
20}
21impl GetIndexOutput {
22    /// Creates a new builder-style object to manufacture [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
23    pub fn builder() -> crate::operation::get_index::builders::GetIndexOutputBuilder {
24        crate::operation::get_index::builders::GetIndexOutputBuilder::default()
25    }
26}
27
28/// A builder for [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct GetIndexOutputBuilder {
32    pub(crate) index_schema: ::std::option::Option<::aws_smithy_types::Document>,
33    _request_id: Option<String>,
34}
35impl GetIndexOutputBuilder {
36    /// <p>The JSON schema of the index including mappings, settings, and semantic enrichment configuration.</p>
37    /// This field is required.
38    pub fn index_schema(mut self, input: ::aws_smithy_types::Document) -> Self {
39        self.index_schema = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The JSON schema of the index including mappings, settings, and semantic enrichment configuration.</p>
43    pub fn set_index_schema(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
44        self.index_schema = input;
45        self
46    }
47    /// <p>The JSON schema of the index including mappings, settings, and semantic enrichment configuration.</p>
48    pub fn get_index_schema(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
49        &self.index_schema
50    }
51    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
52        self._request_id = Some(request_id.into());
53        self
54    }
55
56    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
57        self._request_id = request_id;
58        self
59    }
60    /// Consumes the builder and constructs a [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
61    /// This method will fail if any of the following fields are not set:
62    /// - [`index_schema`](crate::operation::get_index::builders::GetIndexOutputBuilder::index_schema)
63    pub fn build(self) -> ::std::result::Result<crate::operation::get_index::GetIndexOutput, ::aws_smithy_types::error::operation::BuildError> {
64        ::std::result::Result::Ok(crate::operation::get_index::GetIndexOutput {
65            index_schema: self.index_schema.ok_or_else(|| {
66                ::aws_smithy_types::error::operation::BuildError::missing_field(
67                    "index_schema",
68                    "index_schema was not specified but it is required when building GetIndexOutput",
69                )
70            })?,
71            _request_id: self._request_id,
72        })
73    }
74}