aws-sdk-devopsguru 1.98.0

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

/// <p>Recommendation information to help you remediate detected anomalous behavior that generated an insight.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Recommendation {
    /// <p>A description of the problem.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>A hyperlink to information to help you address the problem.</p>
    pub link: ::std::option::Option<::std::string::String>,
    /// <p>The name of the recommendation.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
    pub reason: ::std::option::Option<::std::string::String>,
    /// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
    pub related_events: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedEvent>>,
    /// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
    pub related_anomalies: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomaly>>,
    /// <p>The category type of the recommendation.</p>
    pub category: ::std::option::Option<::std::string::String>,
}
impl Recommendation {
    /// <p>A description of the problem.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>A hyperlink to information to help you address the problem.</p>
    pub fn link(&self) -> ::std::option::Option<&str> {
        self.link.as_deref()
    }
    /// <p>The name of the recommendation.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
    pub fn reason(&self) -> ::std::option::Option<&str> {
        self.reason.as_deref()
    }
    /// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</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 `.related_events.is_none()`.
    pub fn related_events(&self) -> &[crate::types::RecommendationRelatedEvent] {
        self.related_events.as_deref().unwrap_or_default()
    }
    /// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</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 `.related_anomalies.is_none()`.
    pub fn related_anomalies(&self) -> &[crate::types::RecommendationRelatedAnomaly] {
        self.related_anomalies.as_deref().unwrap_or_default()
    }
    /// <p>The category type of the recommendation.</p>
    pub fn category(&self) -> ::std::option::Option<&str> {
        self.category.as_deref()
    }
}
impl Recommendation {
    /// Creates a new builder-style object to manufacture [`Recommendation`](crate::types::Recommendation).
    pub fn builder() -> crate::types::builders::RecommendationBuilder {
        crate::types::builders::RecommendationBuilder::default()
    }
}

/// A builder for [`Recommendation`](crate::types::Recommendation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RecommendationBuilder {
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) link: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) reason: ::std::option::Option<::std::string::String>,
    pub(crate) related_events: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedEvent>>,
    pub(crate) related_anomalies: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomaly>>,
    pub(crate) category: ::std::option::Option<::std::string::String>,
}
impl RecommendationBuilder {
    /// <p>A description of the problem.</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>A description of the problem.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the problem.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>A hyperlink to information to help you address the problem.</p>
    pub fn link(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.link = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A hyperlink to information to help you address the problem.</p>
    pub fn set_link(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.link = input;
        self
    }
    /// <p>A hyperlink to information to help you address the problem.</p>
    pub fn get_link(&self) -> &::std::option::Option<::std::string::String> {
        &self.link
    }
    /// <p>The name of the recommendation.</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 recommendation.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the recommendation.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reason = input;
        self
    }
    /// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.reason
    }
    /// Appends an item to `related_events`.
    ///
    /// To override the contents of this collection use [`set_related_events`](Self::set_related_events).
    ///
    /// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
    pub fn related_events(mut self, input: crate::types::RecommendationRelatedEvent) -> Self {
        let mut v = self.related_events.unwrap_or_default();
        v.push(input);
        self.related_events = ::std::option::Option::Some(v);
        self
    }
    /// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
    pub fn set_related_events(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedEvent>>) -> Self {
        self.related_events = input;
        self
    }
    /// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
    pub fn get_related_events(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedEvent>> {
        &self.related_events
    }
    /// Appends an item to `related_anomalies`.
    ///
    /// To override the contents of this collection use [`set_related_anomalies`](Self::set_related_anomalies).
    ///
    /// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
    pub fn related_anomalies(mut self, input: crate::types::RecommendationRelatedAnomaly) -> Self {
        let mut v = self.related_anomalies.unwrap_or_default();
        v.push(input);
        self.related_anomalies = ::std::option::Option::Some(v);
        self
    }
    /// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
    pub fn set_related_anomalies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomaly>>) -> Self {
        self.related_anomalies = input;
        self
    }
    /// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
    pub fn get_related_anomalies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomaly>> {
        &self.related_anomalies
    }
    /// <p>The category type of the recommendation.</p>
    pub fn category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.category = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The category type of the recommendation.</p>
    pub fn set_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.category = input;
        self
    }
    /// <p>The category type of the recommendation.</p>
    pub fn get_category(&self) -> &::std::option::Option<::std::string::String> {
        &self.category
    }
    /// Consumes the builder and constructs a [`Recommendation`](crate::types::Recommendation).
    pub fn build(self) -> crate::types::Recommendation {
        crate::types::Recommendation {
            description: self.description,
            link: self.link,
            name: self.name,
            reason: self.reason,
            related_events: self.related_events,
            related_anomalies: self.related_anomalies,
            category: self.category,
        }
    }
}