aws-sdk-opensearch 1.111.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 GetIndexOutput {
    /// <p>The JSON schema of the index including mappings, settings, and semantic enrichment configuration.</p>
    pub index_schema: ::aws_smithy_types::Document,
    _request_id: Option<String>,
}
impl GetIndexOutput {
    /// <p>The JSON schema of the index including mappings, settings, and semantic enrichment configuration.</p>
    pub fn index_schema(&self) -> &::aws_smithy_types::Document {
        &self.index_schema
    }
}
impl ::aws_types::request_id::RequestId for GetIndexOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetIndexOutput {
    /// Creates a new builder-style object to manufacture [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
    pub fn builder() -> crate::operation::get_index::builders::GetIndexOutputBuilder {
        crate::operation::get_index::builders::GetIndexOutputBuilder::default()
    }
}

/// A builder for [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetIndexOutputBuilder {
    pub(crate) index_schema: ::std::option::Option<::aws_smithy_types::Document>,
    _request_id: Option<String>,
}
impl GetIndexOutputBuilder {
    /// <p>The JSON schema of the index including mappings, settings, and semantic enrichment configuration.</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 of the index including mappings, settings, and semantic enrichment configuration.</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 of the index including mappings, settings, and semantic enrichment configuration.</p>
    pub fn get_index_schema(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.index_schema
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`index_schema`](crate::operation::get_index::builders::GetIndexOutputBuilder::index_schema)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_index::GetIndexOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_index::GetIndexOutput {
            index_schema: self.index_schema.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "index_schema",
                    "index_schema was not specified but it is required when building GetIndexOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}