aws-sdk-iot 1.112.0

AWS SDK for AWS IoT
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 GetBucketsAggregationInput {
    /// <p>The name of the index to search.</p>
    pub index_name: ::std::option::Option<::std::string::String>,
    /// <p>The search query string.</p>
    pub query_string: ::std::option::Option<::std::string::String>,
    /// <p>The aggregation field.</p>
    pub aggregation_field: ::std::option::Option<::std::string::String>,
    /// <p>The version of the query.</p>
    pub query_version: ::std::option::Option<::std::string::String>,
    /// <p>The basic control of the response shape and the bucket aggregation type to perform.</p>
    pub buckets_aggregation_type: ::std::option::Option<crate::types::BucketsAggregationType>,
}
impl GetBucketsAggregationInput {
    /// <p>The name of the index to search.</p>
    pub fn index_name(&self) -> ::std::option::Option<&str> {
        self.index_name.as_deref()
    }
    /// <p>The search query string.</p>
    pub fn query_string(&self) -> ::std::option::Option<&str> {
        self.query_string.as_deref()
    }
    /// <p>The aggregation field.</p>
    pub fn aggregation_field(&self) -> ::std::option::Option<&str> {
        self.aggregation_field.as_deref()
    }
    /// <p>The version of the query.</p>
    pub fn query_version(&self) -> ::std::option::Option<&str> {
        self.query_version.as_deref()
    }
    /// <p>The basic control of the response shape and the bucket aggregation type to perform.</p>
    pub fn buckets_aggregation_type(&self) -> ::std::option::Option<&crate::types::BucketsAggregationType> {
        self.buckets_aggregation_type.as_ref()
    }
}
impl GetBucketsAggregationInput {
    /// Creates a new builder-style object to manufacture [`GetBucketsAggregationInput`](crate::operation::get_buckets_aggregation::GetBucketsAggregationInput).
    pub fn builder() -> crate::operation::get_buckets_aggregation::builders::GetBucketsAggregationInputBuilder {
        crate::operation::get_buckets_aggregation::builders::GetBucketsAggregationInputBuilder::default()
    }
}

/// A builder for [`GetBucketsAggregationInput`](crate::operation::get_buckets_aggregation::GetBucketsAggregationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetBucketsAggregationInputBuilder {
    pub(crate) index_name: ::std::option::Option<::std::string::String>,
    pub(crate) query_string: ::std::option::Option<::std::string::String>,
    pub(crate) aggregation_field: ::std::option::Option<::std::string::String>,
    pub(crate) query_version: ::std::option::Option<::std::string::String>,
    pub(crate) buckets_aggregation_type: ::std::option::Option<crate::types::BucketsAggregationType>,
}
impl GetBucketsAggregationInputBuilder {
    /// <p>The name of the index to search.</p>
    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 search.</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 search.</p>
    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.index_name
    }
    /// <p>The search query string.</p>
    /// This field is required.
    pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_string = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The search query string.</p>
    pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_string = input;
        self
    }
    /// <p>The search query string.</p>
    pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_string
    }
    /// <p>The aggregation field.</p>
    /// This field is required.
    pub fn aggregation_field(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.aggregation_field = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The aggregation field.</p>
    pub fn set_aggregation_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.aggregation_field = input;
        self
    }
    /// <p>The aggregation field.</p>
    pub fn get_aggregation_field(&self) -> &::std::option::Option<::std::string::String> {
        &self.aggregation_field
    }
    /// <p>The version of the query.</p>
    pub fn query_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the query.</p>
    pub fn set_query_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_version = input;
        self
    }
    /// <p>The version of the query.</p>
    pub fn get_query_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_version
    }
    /// <p>The basic control of the response shape and the bucket aggregation type to perform.</p>
    /// This field is required.
    pub fn buckets_aggregation_type(mut self, input: crate::types::BucketsAggregationType) -> Self {
        self.buckets_aggregation_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The basic control of the response shape and the bucket aggregation type to perform.</p>
    pub fn set_buckets_aggregation_type(mut self, input: ::std::option::Option<crate::types::BucketsAggregationType>) -> Self {
        self.buckets_aggregation_type = input;
        self
    }
    /// <p>The basic control of the response shape and the bucket aggregation type to perform.</p>
    pub fn get_buckets_aggregation_type(&self) -> &::std::option::Option<crate::types::BucketsAggregationType> {
        &self.buckets_aggregation_type
    }
    /// Consumes the builder and constructs a [`GetBucketsAggregationInput`](crate::operation::get_buckets_aggregation::GetBucketsAggregationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_buckets_aggregation::GetBucketsAggregationInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_buckets_aggregation::GetBucketsAggregationInput {
            index_name: self.index_name,
            query_string: self.query_string,
            aggregation_field: self.aggregation_field,
            query_version: self.query_version,
            buckets_aggregation_type: self.buckets_aggregation_type,
        })
    }
}