aws-sdk-computeoptimizerautomation 1.5.0

AWS SDK for Compute Optimizer Automation
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time. You can specify up to 20 conditions per filter criteria and 20 values per condition.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Criteria {
    /// <p>Filter criteria for Amazon Web Services regions where resources must be located.</p>
    pub region: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
    /// <p>Filter criteria for specific resource ARNs to include or exclude.</p>
    pub resource_arn: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
    /// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</p>
    pub ebs_volume_type: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
    /// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</p>
    pub ebs_volume_size_in_gib: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>,
    /// <p>Filter criteria for estimated monthly cost savings from the recommended action.</p>
    pub estimated_monthly_savings: ::std::option::Option<::std::vec::Vec<crate::types::DoubleCriteriaCondition>>,
    /// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</p>
    pub resource_tag: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTagsCriteriaCondition>>,
    /// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</p>
    pub look_back_period_in_days: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>,
    /// <p>Filter criteria indicating whether the recommended action requires a resource restart.</p>
    pub restart_needed: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
}
impl Criteria {
    /// <p>Filter criteria for Amazon Web Services regions where resources must be located.</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 `.region.is_none()`.
    pub fn region(&self) -> &[crate::types::StringCriteriaCondition] {
        self.region.as_deref().unwrap_or_default()
    }
    /// <p>Filter criteria for specific resource ARNs to include or exclude.</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 `.resource_arn.is_none()`.
    pub fn resource_arn(&self) -> &[crate::types::StringCriteriaCondition] {
        self.resource_arn.as_deref().unwrap_or_default()
    }
    /// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</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 `.ebs_volume_type.is_none()`.
    pub fn ebs_volume_type(&self) -> &[crate::types::StringCriteriaCondition] {
        self.ebs_volume_type.as_deref().unwrap_or_default()
    }
    /// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</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 `.ebs_volume_size_in_gib.is_none()`.
    pub fn ebs_volume_size_in_gib(&self) -> &[crate::types::IntegerCriteriaCondition] {
        self.ebs_volume_size_in_gib.as_deref().unwrap_or_default()
    }
    /// <p>Filter criteria for estimated monthly cost savings from the recommended action.</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 `.estimated_monthly_savings.is_none()`.
    pub fn estimated_monthly_savings(&self) -> &[crate::types::DoubleCriteriaCondition] {
        self.estimated_monthly_savings.as_deref().unwrap_or_default()
    }
    /// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</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 `.resource_tag.is_none()`.
    pub fn resource_tag(&self) -> &[crate::types::ResourceTagsCriteriaCondition] {
        self.resource_tag.as_deref().unwrap_or_default()
    }
    /// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</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 `.look_back_period_in_days.is_none()`.
    pub fn look_back_period_in_days(&self) -> &[crate::types::IntegerCriteriaCondition] {
        self.look_back_period_in_days.as_deref().unwrap_or_default()
    }
    /// <p>Filter criteria indicating whether the recommended action requires a resource restart.</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 `.restart_needed.is_none()`.
    pub fn restart_needed(&self) -> &[crate::types::StringCriteriaCondition] {
        self.restart_needed.as_deref().unwrap_or_default()
    }
}
impl Criteria {
    /// Creates a new builder-style object to manufacture [`Criteria`](crate::types::Criteria).
    pub fn builder() -> crate::types::builders::CriteriaBuilder {
        crate::types::builders::CriteriaBuilder::default()
    }
}

/// A builder for [`Criteria`](crate::types::Criteria).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CriteriaBuilder {
    pub(crate) region: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
    pub(crate) resource_arn: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
    pub(crate) ebs_volume_type: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
    pub(crate) ebs_volume_size_in_gib: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>,
    pub(crate) estimated_monthly_savings: ::std::option::Option<::std::vec::Vec<crate::types::DoubleCriteriaCondition>>,
    pub(crate) resource_tag: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTagsCriteriaCondition>>,
    pub(crate) look_back_period_in_days: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>,
    pub(crate) restart_needed: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
}
impl CriteriaBuilder {
    /// Appends an item to `region`.
    ///
    /// To override the contents of this collection use [`set_region`](Self::set_region).
    ///
    /// <p>Filter criteria for Amazon Web Services regions where resources must be located.</p>
    pub fn region(mut self, input: crate::types::StringCriteriaCondition) -> Self {
        let mut v = self.region.unwrap_or_default();
        v.push(input);
        self.region = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filter criteria for Amazon Web Services regions where resources must be located.</p>
    pub fn set_region(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>) -> Self {
        self.region = input;
        self
    }
    /// <p>Filter criteria for Amazon Web Services regions where resources must be located.</p>
    pub fn get_region(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>> {
        &self.region
    }
    /// Appends an item to `resource_arn`.
    ///
    /// To override the contents of this collection use [`set_resource_arn`](Self::set_resource_arn).
    ///
    /// <p>Filter criteria for specific resource ARNs to include or exclude.</p>
    pub fn resource_arn(mut self, input: crate::types::StringCriteriaCondition) -> Self {
        let mut v = self.resource_arn.unwrap_or_default();
        v.push(input);
        self.resource_arn = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filter criteria for specific resource ARNs to include or exclude.</p>
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>) -> Self {
        self.resource_arn = input;
        self
    }
    /// <p>Filter criteria for specific resource ARNs to include or exclude.</p>
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>> {
        &self.resource_arn
    }
    /// Appends an item to `ebs_volume_type`.
    ///
    /// To override the contents of this collection use [`set_ebs_volume_type`](Self::set_ebs_volume_type).
    ///
    /// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</p>
    pub fn ebs_volume_type(mut self, input: crate::types::StringCriteriaCondition) -> Self {
        let mut v = self.ebs_volume_type.unwrap_or_default();
        v.push(input);
        self.ebs_volume_type = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</p>
    pub fn set_ebs_volume_type(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>) -> Self {
        self.ebs_volume_type = input;
        self
    }
    /// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</p>
    pub fn get_ebs_volume_type(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>> {
        &self.ebs_volume_type
    }
    /// Appends an item to `ebs_volume_size_in_gib`.
    ///
    /// To override the contents of this collection use [`set_ebs_volume_size_in_gib`](Self::set_ebs_volume_size_in_gib).
    ///
    /// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</p>
    pub fn ebs_volume_size_in_gib(mut self, input: crate::types::IntegerCriteriaCondition) -> Self {
        let mut v = self.ebs_volume_size_in_gib.unwrap_or_default();
        v.push(input);
        self.ebs_volume_size_in_gib = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</p>
    pub fn set_ebs_volume_size_in_gib(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>) -> Self {
        self.ebs_volume_size_in_gib = input;
        self
    }
    /// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</p>
    pub fn get_ebs_volume_size_in_gib(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>> {
        &self.ebs_volume_size_in_gib
    }
    /// Appends an item to `estimated_monthly_savings`.
    ///
    /// To override the contents of this collection use [`set_estimated_monthly_savings`](Self::set_estimated_monthly_savings).
    ///
    /// <p>Filter criteria for estimated monthly cost savings from the recommended action.</p>
    pub fn estimated_monthly_savings(mut self, input: crate::types::DoubleCriteriaCondition) -> Self {
        let mut v = self.estimated_monthly_savings.unwrap_or_default();
        v.push(input);
        self.estimated_monthly_savings = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filter criteria for estimated monthly cost savings from the recommended action.</p>
    pub fn set_estimated_monthly_savings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DoubleCriteriaCondition>>) -> Self {
        self.estimated_monthly_savings = input;
        self
    }
    /// <p>Filter criteria for estimated monthly cost savings from the recommended action.</p>
    pub fn get_estimated_monthly_savings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DoubleCriteriaCondition>> {
        &self.estimated_monthly_savings
    }
    /// Appends an item to `resource_tag`.
    ///
    /// To override the contents of this collection use [`set_resource_tag`](Self::set_resource_tag).
    ///
    /// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</p>
    pub fn resource_tag(mut self, input: crate::types::ResourceTagsCriteriaCondition) -> Self {
        let mut v = self.resource_tag.unwrap_or_default();
        v.push(input);
        self.resource_tag = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</p>
    pub fn set_resource_tag(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTagsCriteriaCondition>>) -> Self {
        self.resource_tag = input;
        self
    }
    /// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</p>
    pub fn get_resource_tag(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTagsCriteriaCondition>> {
        &self.resource_tag
    }
    /// Appends an item to `look_back_period_in_days`.
    ///
    /// To override the contents of this collection use [`set_look_back_period_in_days`](Self::set_look_back_period_in_days).
    ///
    /// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</p>
    pub fn look_back_period_in_days(mut self, input: crate::types::IntegerCriteriaCondition) -> Self {
        let mut v = self.look_back_period_in_days.unwrap_or_default();
        v.push(input);
        self.look_back_period_in_days = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</p>
    pub fn set_look_back_period_in_days(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>) -> Self {
        self.look_back_period_in_days = input;
        self
    }
    /// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</p>
    pub fn get_look_back_period_in_days(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>> {
        &self.look_back_period_in_days
    }
    /// Appends an item to `restart_needed`.
    ///
    /// To override the contents of this collection use [`set_restart_needed`](Self::set_restart_needed).
    ///
    /// <p>Filter criteria indicating whether the recommended action requires a resource restart.</p>
    pub fn restart_needed(mut self, input: crate::types::StringCriteriaCondition) -> Self {
        let mut v = self.restart_needed.unwrap_or_default();
        v.push(input);
        self.restart_needed = ::std::option::Option::Some(v);
        self
    }
    /// <p>Filter criteria indicating whether the recommended action requires a resource restart.</p>
    pub fn set_restart_needed(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>) -> Self {
        self.restart_needed = input;
        self
    }
    /// <p>Filter criteria indicating whether the recommended action requires a resource restart.</p>
    pub fn get_restart_needed(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>> {
        &self.restart_needed
    }
    /// Consumes the builder and constructs a [`Criteria`](crate::types::Criteria).
    pub fn build(self) -> crate::types::Criteria {
        crate::types::Criteria {
            region: self.region,
            resource_arn: self.resource_arn,
            ebs_volume_type: self.ebs_volume_type,
            ebs_volume_size_in_gib: self.ebs_volume_size_in_gib,
            estimated_monthly_savings: self.estimated_monthly_savings,
            resource_tag: self.resource_tag,
            look_back_period_in_days: self.look_back_period_in_days,
            restart_needed: self.restart_needed,
        }
    }
}