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>Represents an insight returned by the <code>ListInsights</code> operation. An insight is a notification about a domain event or recommendation that helps you optimize your Amazon OpenSearch Service domain.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Insight {
    /// <p>The unique identifier of the insight.</p>
    pub insight_id: ::std::option::Option<::std::string::String>,
    /// <p>The display name of the insight.</p>
    pub display_name: ::std::option::Option<::std::string::String>,
    /// <p>The type of the insight. Possible values are <code>EVENT</code> and <code>RECOMMENDATION</code>.</p>
    pub r#type: ::std::option::Option<crate::types::InsightType>,
    /// <p>The priority level of the insight. Possible values are <code>CRITICAL</code>, <code>HIGH</code>, <code>MEDIUM</code>, and <code>LOW</code>.</p>
    pub priority: ::std::option::Option<crate::types::InsightPriorityLevel>,
    /// <p>The current status of the insight. Possible values are <code>ACTIVE</code>, <code>RESOLVED</code>, and <code>DISMISSED</code>.</p>
    pub status: ::std::option::Option<crate::types::InsightStatus>,
    /// <p>The timestamp when the insight was created, in epoch milliseconds.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The timestamp when the insight was last updated, in epoch milliseconds.</p>
    pub update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Indicates whether the insight is experimental.</p>
    pub is_experimental: ::std::option::Option<bool>,
}
impl Insight {
    /// <p>The unique identifier of the insight.</p>
    pub fn insight_id(&self) -> ::std::option::Option<&str> {
        self.insight_id.as_deref()
    }
    /// <p>The display name of the insight.</p>
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// <p>The type of the insight. Possible values are <code>EVENT</code> and <code>RECOMMENDATION</code>.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::InsightType> {
        self.r#type.as_ref()
    }
    /// <p>The priority level of the insight. Possible values are <code>CRITICAL</code>, <code>HIGH</code>, <code>MEDIUM</code>, and <code>LOW</code>.</p>
    pub fn priority(&self) -> ::std::option::Option<&crate::types::InsightPriorityLevel> {
        self.priority.as_ref()
    }
    /// <p>The current status of the insight. Possible values are <code>ACTIVE</code>, <code>RESOLVED</code>, and <code>DISMISSED</code>.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::InsightStatus> {
        self.status.as_ref()
    }
    /// <p>The timestamp when the insight was created, in epoch milliseconds.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>The timestamp when the insight was last updated, in epoch milliseconds.</p>
    pub fn update_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.update_time.as_ref()
    }
    /// <p>Indicates whether the insight is experimental.</p>
    pub fn is_experimental(&self) -> ::std::option::Option<bool> {
        self.is_experimental
    }
}
impl Insight {
    /// Creates a new builder-style object to manufacture [`Insight`](crate::types::Insight).
    pub fn builder() -> crate::types::builders::InsightBuilder {
        crate::types::builders::InsightBuilder::default()
    }
}

/// A builder for [`Insight`](crate::types::Insight).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InsightBuilder {
    pub(crate) insight_id: ::std::option::Option<::std::string::String>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::InsightType>,
    pub(crate) priority: ::std::option::Option<crate::types::InsightPriorityLevel>,
    pub(crate) status: ::std::option::Option<crate::types::InsightStatus>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) is_experimental: ::std::option::Option<bool>,
}
impl InsightBuilder {
    /// <p>The unique identifier of the insight.</p>
    pub fn insight_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.insight_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the insight.</p>
    pub fn set_insight_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.insight_id = input;
        self
    }
    /// <p>The unique identifier of the insight.</p>
    pub fn get_insight_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.insight_id
    }
    /// <p>The display name of the insight.</p>
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.display_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The display name of the insight.</p>
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// <p>The display name of the insight.</p>
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// <p>The type of the insight. Possible values are <code>EVENT</code> and <code>RECOMMENDATION</code>.</p>
    pub fn r#type(mut self, input: crate::types::InsightType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the insight. Possible values are <code>EVENT</code> and <code>RECOMMENDATION</code>.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::InsightType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of the insight. Possible values are <code>EVENT</code> and <code>RECOMMENDATION</code>.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::InsightType> {
        &self.r#type
    }
    /// <p>The priority level of the insight. Possible values are <code>CRITICAL</code>, <code>HIGH</code>, <code>MEDIUM</code>, and <code>LOW</code>.</p>
    pub fn priority(mut self, input: crate::types::InsightPriorityLevel) -> Self {
        self.priority = ::std::option::Option::Some(input);
        self
    }
    /// <p>The priority level of the insight. Possible values are <code>CRITICAL</code>, <code>HIGH</code>, <code>MEDIUM</code>, and <code>LOW</code>.</p>
    pub fn set_priority(mut self, input: ::std::option::Option<crate::types::InsightPriorityLevel>) -> Self {
        self.priority = input;
        self
    }
    /// <p>The priority level of the insight. Possible values are <code>CRITICAL</code>, <code>HIGH</code>, <code>MEDIUM</code>, and <code>LOW</code>.</p>
    pub fn get_priority(&self) -> &::std::option::Option<crate::types::InsightPriorityLevel> {
        &self.priority
    }
    /// <p>The current status of the insight. Possible values are <code>ACTIVE</code>, <code>RESOLVED</code>, and <code>DISMISSED</code>.</p>
    pub fn status(mut self, input: crate::types::InsightStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the insight. Possible values are <code>ACTIVE</code>, <code>RESOLVED</code>, and <code>DISMISSED</code>.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::InsightStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the insight. Possible values are <code>ACTIVE</code>, <code>RESOLVED</code>, and <code>DISMISSED</code>.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::InsightStatus> {
        &self.status
    }
    /// <p>The timestamp when the insight was created, in epoch milliseconds.</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp when the insight was created, in epoch milliseconds.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The timestamp when the insight was created, in epoch milliseconds.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The timestamp when the insight was last updated, in epoch milliseconds.</p>
    pub fn update_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.update_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp when the insight was last updated, in epoch milliseconds.</p>
    pub fn set_update_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.update_time = input;
        self
    }
    /// <p>The timestamp when the insight was last updated, in epoch milliseconds.</p>
    pub fn get_update_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.update_time
    }
    /// <p>Indicates whether the insight is experimental.</p>
    pub fn is_experimental(mut self, input: bool) -> Self {
        self.is_experimental = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the insight is experimental.</p>
    pub fn set_is_experimental(mut self, input: ::std::option::Option<bool>) -> Self {
        self.is_experimental = input;
        self
    }
    /// <p>Indicates whether the insight is experimental.</p>
    pub fn get_is_experimental(&self) -> &::std::option::Option<bool> {
        &self.is_experimental
    }
    /// Consumes the builder and constructs a [`Insight`](crate::types::Insight).
    pub fn build(self) -> crate::types::Insight {
        crate::types::Insight {
            insight_id: self.insight_id,
            display_name: self.display_name,
            r#type: self.r#type,
            priority: self.priority,
            status: self.status,
            creation_time: self.creation_time,
            update_time: self.update_time,
            is_experimental: self.is_experimental,
        }
    }
}