aws-sdk-eks 1.129.0

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

/// <p>A check that provides recommendations to remedy potential upgrade-impacting issues.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Insight {
    /// <p>The ID of the insight.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the insight.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The category of the insight.</p>
    pub category: ::std::option::Option<crate::types::Category>,
    /// <p>The Kubernetes minor version associated with an insight if applicable.</p>
    pub kubernetes_version: ::std::option::Option<::std::string::String>,
    /// <p>The time Amazon EKS last successfully completed a refresh of this insight check on the cluster.</p>
    pub last_refresh_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time the status of the insight last changed.</p>
    pub last_transition_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The description of the insight which includes alert criteria, remediation recommendation, and additional resources (contains Markdown).</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>An object containing more detail on the status of the insight resource.</p>
    pub insight_status: ::std::option::Option<crate::types::InsightStatus>,
    /// <p>A summary of how to remediate the finding of this insight if applicable.</p>
    pub recommendation: ::std::option::Option<::std::string::String>,
    /// <p>Links to sources that provide additional context on the insight.</p>
    pub additional_info: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The details about each resource listed in the insight check result.</p>
    pub resources: ::std::option::Option<::std::vec::Vec<crate::types::InsightResourceDetail>>,
    /// <p>Summary information that relates to the category of the insight. Currently only returned with certain insights having category <code>UPGRADE_READINESS</code>.</p>
    pub category_specific_summary: ::std::option::Option<crate::types::InsightCategorySpecificSummary>,
}
impl Insight {
    /// <p>The ID of the insight.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The name of the insight.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The category of the insight.</p>
    pub fn category(&self) -> ::std::option::Option<&crate::types::Category> {
        self.category.as_ref()
    }
    /// <p>The Kubernetes minor version associated with an insight if applicable.</p>
    pub fn kubernetes_version(&self) -> ::std::option::Option<&str> {
        self.kubernetes_version.as_deref()
    }
    /// <p>The time Amazon EKS last successfully completed a refresh of this insight check on the cluster.</p>
    pub fn last_refresh_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_refresh_time.as_ref()
    }
    /// <p>The time the status of the insight last changed.</p>
    pub fn last_transition_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_transition_time.as_ref()
    }
    /// <p>The description of the insight which includes alert criteria, remediation recommendation, and additional resources (contains Markdown).</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>An object containing more detail on the status of the insight resource.</p>
    pub fn insight_status(&self) -> ::std::option::Option<&crate::types::InsightStatus> {
        self.insight_status.as_ref()
    }
    /// <p>A summary of how to remediate the finding of this insight if applicable.</p>
    pub fn recommendation(&self) -> ::std::option::Option<&str> {
        self.recommendation.as_deref()
    }
    /// <p>Links to sources that provide additional context on the insight.</p>
    pub fn additional_info(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.additional_info.as_ref()
    }
    /// <p>The details about each resource listed in the insight check result.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`.
    pub fn resources(&self) -> &[crate::types::InsightResourceDetail] {
        self.resources.as_deref().unwrap_or_default()
    }
    /// <p>Summary information that relates to the category of the insight. Currently only returned with certain insights having category <code>UPGRADE_READINESS</code>.</p>
    pub fn category_specific_summary(&self) -> ::std::option::Option<&crate::types::InsightCategorySpecificSummary> {
        self.category_specific_summary.as_ref()
    }
}
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) id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) category: ::std::option::Option<crate::types::Category>,
    pub(crate) kubernetes_version: ::std::option::Option<::std::string::String>,
    pub(crate) last_refresh_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_transition_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) insight_status: ::std::option::Option<crate::types::InsightStatus>,
    pub(crate) recommendation: ::std::option::Option<::std::string::String>,
    pub(crate) additional_info: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::InsightResourceDetail>>,
    pub(crate) category_specific_summary: ::std::option::Option<crate::types::InsightCategorySpecificSummary>,
}
impl InsightBuilder {
    /// <p>The ID of the insight.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the insight.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The ID of the insight.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The name of the insight.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the insight.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the insight.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The category of the insight.</p>
    pub fn category(mut self, input: crate::types::Category) -> Self {
        self.category = ::std::option::Option::Some(input);
        self
    }
    /// <p>The category of the insight.</p>
    pub fn set_category(mut self, input: ::std::option::Option<crate::types::Category>) -> Self {
        self.category = input;
        self
    }
    /// <p>The category of the insight.</p>
    pub fn get_category(&self) -> &::std::option::Option<crate::types::Category> {
        &self.category
    }
    /// <p>The Kubernetes minor version associated with an insight if applicable.</p>
    pub fn kubernetes_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kubernetes_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Kubernetes minor version associated with an insight if applicable.</p>
    pub fn set_kubernetes_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kubernetes_version = input;
        self
    }
    /// <p>The Kubernetes minor version associated with an insight if applicable.</p>
    pub fn get_kubernetes_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.kubernetes_version
    }
    /// <p>The time Amazon EKS last successfully completed a refresh of this insight check on the cluster.</p>
    pub fn last_refresh_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_refresh_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time Amazon EKS last successfully completed a refresh of this insight check on the cluster.</p>
    pub fn set_last_refresh_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_refresh_time = input;
        self
    }
    /// <p>The time Amazon EKS last successfully completed a refresh of this insight check on the cluster.</p>
    pub fn get_last_refresh_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_refresh_time
    }
    /// <p>The time the status of the insight last changed.</p>
    pub fn last_transition_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_transition_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time the status of the insight last changed.</p>
    pub fn set_last_transition_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_transition_time = input;
        self
    }
    /// <p>The time the status of the insight last changed.</p>
    pub fn get_last_transition_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_transition_time
    }
    /// <p>The description of the insight which includes alert criteria, remediation recommendation, and additional resources (contains Markdown).</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the insight which includes alert criteria, remediation recommendation, and additional resources (contains Markdown).</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the insight which includes alert criteria, remediation recommendation, and additional resources (contains Markdown).</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>An object containing more detail on the status of the insight resource.</p>
    pub fn insight_status(mut self, input: crate::types::InsightStatus) -> Self {
        self.insight_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object containing more detail on the status of the insight resource.</p>
    pub fn set_insight_status(mut self, input: ::std::option::Option<crate::types::InsightStatus>) -> Self {
        self.insight_status = input;
        self
    }
    /// <p>An object containing more detail on the status of the insight resource.</p>
    pub fn get_insight_status(&self) -> &::std::option::Option<crate::types::InsightStatus> {
        &self.insight_status
    }
    /// <p>A summary of how to remediate the finding of this insight if applicable.</p>
    pub fn recommendation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.recommendation = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A summary of how to remediate the finding of this insight if applicable.</p>
    pub fn set_recommendation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.recommendation = input;
        self
    }
    /// <p>A summary of how to remediate the finding of this insight if applicable.</p>
    pub fn get_recommendation(&self) -> &::std::option::Option<::std::string::String> {
        &self.recommendation
    }
    /// Adds a key-value pair to `additional_info`.
    ///
    /// To override the contents of this collection use [`set_additional_info`](Self::set_additional_info).
    ///
    /// <p>Links to sources that provide additional context on the insight.</p>
    pub fn additional_info(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.additional_info.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.additional_info = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Links to sources that provide additional context on the insight.</p>
    pub fn set_additional_info(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.additional_info = input;
        self
    }
    /// <p>Links to sources that provide additional context on the insight.</p>
    pub fn get_additional_info(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.additional_info
    }
    /// Appends an item to `resources`.
    ///
    /// To override the contents of this collection use [`set_resources`](Self::set_resources).
    ///
    /// <p>The details about each resource listed in the insight check result.</p>
    pub fn resources(mut self, input: crate::types::InsightResourceDetail) -> Self {
        let mut v = self.resources.unwrap_or_default();
        v.push(input);
        self.resources = ::std::option::Option::Some(v);
        self
    }
    /// <p>The details about each resource listed in the insight check result.</p>
    pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InsightResourceDetail>>) -> Self {
        self.resources = input;
        self
    }
    /// <p>The details about each resource listed in the insight check result.</p>
    pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InsightResourceDetail>> {
        &self.resources
    }
    /// <p>Summary information that relates to the category of the insight. Currently only returned with certain insights having category <code>UPGRADE_READINESS</code>.</p>
    pub fn category_specific_summary(mut self, input: crate::types::InsightCategorySpecificSummary) -> Self {
        self.category_specific_summary = ::std::option::Option::Some(input);
        self
    }
    /// <p>Summary information that relates to the category of the insight. Currently only returned with certain insights having category <code>UPGRADE_READINESS</code>.</p>
    pub fn set_category_specific_summary(mut self, input: ::std::option::Option<crate::types::InsightCategorySpecificSummary>) -> Self {
        self.category_specific_summary = input;
        self
    }
    /// <p>Summary information that relates to the category of the insight. Currently only returned with certain insights having category <code>UPGRADE_READINESS</code>.</p>
    pub fn get_category_specific_summary(&self) -> &::std::option::Option<crate::types::InsightCategorySpecificSummary> {
        &self.category_specific_summary
    }
    /// Consumes the builder and constructs a [`Insight`](crate::types::Insight).
    pub fn build(self) -> crate::types::Insight {
        crate::types::Insight {
            id: self.id,
            name: self.name,
            category: self.category,
            kubernetes_version: self.kubernetes_version,
            last_refresh_time: self.last_refresh_time,
            last_transition_time: self.last_transition_time,
            description: self.description,
            insight_status: self.insight_status,
            recommendation: self.recommendation,
            additional_info: self.additional_info,
            resources: self.resources,
            category_specific_summary: self.category_specific_summary,
        }
    }
}