aws-sdk-opensearch 1.121.0

AWS SDK for Amazon OpenSearch Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Container for the parameters to the <code>ListInsights</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ListInsightsInput {
    /// <p>The entity for which to list insights. Specifies the type and value of the entity, such as a domain name or Amazon Web Services account ID.</p>
    pub entity: ::std::option::Option<crate::types::InsightEntity>,
    /// <p>The time range for filtering insights, specified as epoch millisecond timestamps.</p>
    pub time_range: ::std::option::Option<crate::types::InsightTimeRange>,
    /// <p>The sort order for the results. Possible values are <code>ASC</code> (ascending) and <code>DESC</code> (descending).</p>
    pub sort_order: ::std::option::Option<crate::types::InsightSortOrder>,
    /// <p>An optional parameter that specifies the maximum number of results to return. You can use <code>NextToken</code> to get the next page of results. Valid values are 1 to 500.</p>
    pub max_results: ::std::option::Option<i32>,
    /// <p>If your initial <code>ListInsights</code> operation returns a <code>NextToken</code>, include the returned <code>NextToken</code> in subsequent <code>ListInsights</code> operations to retrieve the next page of results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
}
impl ListInsightsInput {
    /// <p>The entity for which to list insights. Specifies the type and value of the entity, such as a domain name or Amazon Web Services account ID.</p>
    pub fn entity(&self) -> ::std::option::Option<&crate::types::InsightEntity> {
        self.entity.as_ref()
    }
    /// <p>The time range for filtering insights, specified as epoch millisecond timestamps.</p>
    pub fn time_range(&self) -> ::std::option::Option<&crate::types::InsightTimeRange> {
        self.time_range.as_ref()
    }
    /// <p>The sort order for the results. Possible values are <code>ASC</code> (ascending) and <code>DESC</code> (descending).</p>
    pub fn sort_order(&self) -> ::std::option::Option<&crate::types::InsightSortOrder> {
        self.sort_order.as_ref()
    }
    /// <p>An optional parameter that specifies the maximum number of results to return. You can use <code>NextToken</code> to get the next page of results. Valid values are 1 to 500.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
    /// <p>If your initial <code>ListInsights</code> operation returns a <code>NextToken</code>, include the returned <code>NextToken</code> in subsequent <code>ListInsights</code> operations to retrieve the next page of results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ListInsightsInput {
    /// Creates a new builder-style object to manufacture [`ListInsightsInput`](crate::operation::list_insights::ListInsightsInput).
    pub fn builder() -> crate::operation::list_insights::builders::ListInsightsInputBuilder {
        crate::operation::list_insights::builders::ListInsightsInputBuilder::default()
    }
}

/// A builder for [`ListInsightsInput`](crate::operation::list_insights::ListInsightsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListInsightsInputBuilder {
    pub(crate) entity: ::std::option::Option<crate::types::InsightEntity>,
    pub(crate) time_range: ::std::option::Option<crate::types::InsightTimeRange>,
    pub(crate) sort_order: ::std::option::Option<crate::types::InsightSortOrder>,
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
}
impl ListInsightsInputBuilder {
    /// <p>The entity for which to list insights. Specifies the type and value of the entity, such as a domain name or Amazon Web Services account ID.</p>
    /// This field is required.
    pub fn entity(mut self, input: crate::types::InsightEntity) -> Self {
        self.entity = ::std::option::Option::Some(input);
        self
    }
    /// <p>The entity for which to list insights. Specifies the type and value of the entity, such as a domain name or Amazon Web Services account ID.</p>
    pub fn set_entity(mut self, input: ::std::option::Option<crate::types::InsightEntity>) -> Self {
        self.entity = input;
        self
    }
    /// <p>The entity for which to list insights. Specifies the type and value of the entity, such as a domain name or Amazon Web Services account ID.</p>
    pub fn get_entity(&self) -> &::std::option::Option<crate::types::InsightEntity> {
        &self.entity
    }
    /// <p>The time range for filtering insights, specified as epoch millisecond timestamps.</p>
    pub fn time_range(mut self, input: crate::types::InsightTimeRange) -> Self {
        self.time_range = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time range for filtering insights, specified as epoch millisecond timestamps.</p>
    pub fn set_time_range(mut self, input: ::std::option::Option<crate::types::InsightTimeRange>) -> Self {
        self.time_range = input;
        self
    }
    /// <p>The time range for filtering insights, specified as epoch millisecond timestamps.</p>
    pub fn get_time_range(&self) -> &::std::option::Option<crate::types::InsightTimeRange> {
        &self.time_range
    }
    /// <p>The sort order for the results. Possible values are <code>ASC</code> (ascending) and <code>DESC</code> (descending).</p>
    pub fn sort_order(mut self, input: crate::types::InsightSortOrder) -> Self {
        self.sort_order = ::std::option::Option::Some(input);
        self
    }
    /// <p>The sort order for the results. Possible values are <code>ASC</code> (ascending) and <code>DESC</code> (descending).</p>
    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::InsightSortOrder>) -> Self {
        self.sort_order = input;
        self
    }
    /// <p>The sort order for the results. Possible values are <code>ASC</code> (ascending) and <code>DESC</code> (descending).</p>
    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::InsightSortOrder> {
        &self.sort_order
    }
    /// <p>An optional parameter that specifies the maximum number of results to return. You can use <code>NextToken</code> to get the next page of results. Valid values are 1 to 500.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>An optional parameter that specifies the maximum number of results to return. You can use <code>NextToken</code> to get the next page of results. Valid values are 1 to 500.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>An optional parameter that specifies the maximum number of results to return. You can use <code>NextToken</code> to get the next page of results. Valid values are 1 to 500.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// <p>If your initial <code>ListInsights</code> operation returns a <code>NextToken</code>, include the returned <code>NextToken</code> in subsequent <code>ListInsights</code> operations to retrieve the next page of results.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>If your initial <code>ListInsights</code> operation returns a <code>NextToken</code>, include the returned <code>NextToken</code> in subsequent <code>ListInsights</code> operations to retrieve the next page of results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>If your initial <code>ListInsights</code> operation returns a <code>NextToken</code>, include the returned <code>NextToken</code> in subsequent <code>ListInsights</code> operations to retrieve the next page of results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Consumes the builder and constructs a [`ListInsightsInput`](crate::operation::list_insights::ListInsightsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::list_insights::ListInsightsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_insights::ListInsightsInput {
            entity: self.entity,
            time_range: self.time_range,
            sort_order: self.sort_order,
            max_results: self.max_results,
            next_token: self.next_token,
        })
    }
}