aws_sdk_dynamodb/types/_auto_scaling_target_tracking_scaling_policy_configuration_description.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the properties of a target tracking scaling policy.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
7 /// <p>Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.</p>
8 pub disable_scale_in: ::std::option::Option<bool>,
9 /// <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start. The cooldown period is used to block subsequent scale in requests until it has expired. You should scale in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy during the cooldown period after a scale-in, application auto scaling scales out your scalable target immediately.</p>
10 pub scale_in_cooldown: ::std::option::Option<i32>,
11 /// <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start. While the cooldown period is in effect, the capacity that has been added by the previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next scale out. You should continuously (but not excessively) scale out.</p>
12 pub scale_out_cooldown: ::std::option::Option<i32>,
13 /// <p>The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).</p>
14 pub target_value: f64,
15}
16impl AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
17 /// <p>Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.</p>
18 pub fn disable_scale_in(&self) -> ::std::option::Option<bool> {
19 self.disable_scale_in
20 }
21 /// <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start. The cooldown period is used to block subsequent scale in requests until it has expired. You should scale in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy during the cooldown period after a scale-in, application auto scaling scales out your scalable target immediately.</p>
22 pub fn scale_in_cooldown(&self) -> ::std::option::Option<i32> {
23 self.scale_in_cooldown
24 }
25 /// <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start. While the cooldown period is in effect, the capacity that has been added by the previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next scale out. You should continuously (but not excessively) scale out.</p>
26 pub fn scale_out_cooldown(&self) -> ::std::option::Option<i32> {
27 self.scale_out_cooldown
28 }
29 /// <p>The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).</p>
30 pub fn target_value(&self) -> f64 {
31 self.target_value
32 }
33}
34impl AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
35 /// Creates a new builder-style object to manufacture [`AutoScalingTargetTrackingScalingPolicyConfigurationDescription`](crate::types::AutoScalingTargetTrackingScalingPolicyConfigurationDescription).
36 pub fn builder() -> crate::types::builders::AutoScalingTargetTrackingScalingPolicyConfigurationDescriptionBuilder {
37 crate::types::builders::AutoScalingTargetTrackingScalingPolicyConfigurationDescriptionBuilder::default()
38 }
39}
40
41/// A builder for [`AutoScalingTargetTrackingScalingPolicyConfigurationDescription`](crate::types::AutoScalingTargetTrackingScalingPolicyConfigurationDescription).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct AutoScalingTargetTrackingScalingPolicyConfigurationDescriptionBuilder {
45 pub(crate) disable_scale_in: ::std::option::Option<bool>,
46 pub(crate) scale_in_cooldown: ::std::option::Option<i32>,
47 pub(crate) scale_out_cooldown: ::std::option::Option<i32>,
48 pub(crate) target_value: ::std::option::Option<f64>,
49}
50impl AutoScalingTargetTrackingScalingPolicyConfigurationDescriptionBuilder {
51 /// <p>Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.</p>
52 pub fn disable_scale_in(mut self, input: bool) -> Self {
53 self.disable_scale_in = ::std::option::Option::Some(input);
54 self
55 }
56 /// <p>Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.</p>
57 pub fn set_disable_scale_in(mut self, input: ::std::option::Option<bool>) -> Self {
58 self.disable_scale_in = input;
59 self
60 }
61 /// <p>Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false.</p>
62 pub fn get_disable_scale_in(&self) -> &::std::option::Option<bool> {
63 &self.disable_scale_in
64 }
65 /// <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start. The cooldown period is used to block subsequent scale in requests until it has expired. You should scale in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy during the cooldown period after a scale-in, application auto scaling scales out your scalable target immediately.</p>
66 pub fn scale_in_cooldown(mut self, input: i32) -> Self {
67 self.scale_in_cooldown = ::std::option::Option::Some(input);
68 self
69 }
70 /// <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start. The cooldown period is used to block subsequent scale in requests until it has expired. You should scale in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy during the cooldown period after a scale-in, application auto scaling scales out your scalable target immediately.</p>
71 pub fn set_scale_in_cooldown(mut self, input: ::std::option::Option<i32>) -> Self {
72 self.scale_in_cooldown = input;
73 self
74 }
75 /// <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start. The cooldown period is used to block subsequent scale in requests until it has expired. You should scale in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy during the cooldown period after a scale-in, application auto scaling scales out your scalable target immediately.</p>
76 pub fn get_scale_in_cooldown(&self) -> &::std::option::Option<i32> {
77 &self.scale_in_cooldown
78 }
79 /// <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start. While the cooldown period is in effect, the capacity that has been added by the previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next scale out. You should continuously (but not excessively) scale out.</p>
80 pub fn scale_out_cooldown(mut self, input: i32) -> Self {
81 self.scale_out_cooldown = ::std::option::Option::Some(input);
82 self
83 }
84 /// <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start. While the cooldown period is in effect, the capacity that has been added by the previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next scale out. You should continuously (but not excessively) scale out.</p>
85 pub fn set_scale_out_cooldown(mut self, input: ::std::option::Option<i32>) -> Self {
86 self.scale_out_cooldown = input;
87 self
88 }
89 /// <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start. While the cooldown period is in effect, the capacity that has been added by the previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next scale out. You should continuously (but not excessively) scale out.</p>
90 pub fn get_scale_out_cooldown(&self) -> &::std::option::Option<i32> {
91 &self.scale_out_cooldown
92 }
93 /// <p>The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).</p>
94 /// This field is required.
95 pub fn target_value(mut self, input: f64) -> Self {
96 self.target_value = ::std::option::Option::Some(input);
97 self
98 }
99 /// <p>The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).</p>
100 pub fn set_target_value(mut self, input: ::std::option::Option<f64>) -> Self {
101 self.target_value = input;
102 self
103 }
104 /// <p>The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).</p>
105 pub fn get_target_value(&self) -> &::std::option::Option<f64> {
106 &self.target_value
107 }
108 /// Consumes the builder and constructs a [`AutoScalingTargetTrackingScalingPolicyConfigurationDescription`](crate::types::AutoScalingTargetTrackingScalingPolicyConfigurationDescription).
109 /// This method will fail if any of the following fields are not set:
110 /// - [`target_value`](crate::types::builders::AutoScalingTargetTrackingScalingPolicyConfigurationDescriptionBuilder::target_value)
111 pub fn build(
112 self,
113 ) -> ::std::result::Result<
114 crate::types::AutoScalingTargetTrackingScalingPolicyConfigurationDescription,
115 ::aws_smithy_types::error::operation::BuildError,
116 > {
117 ::std::result::Result::Ok(crate::types::AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
118 disable_scale_in: self.disable_scale_in,
119 scale_in_cooldown: self.scale_in_cooldown,
120 scale_out_cooldown: self.scale_out_cooldown,
121 target_value: self.target_value.ok_or_else(|| {
122 ::aws_smithy_types::error::operation::BuildError::missing_field(
123 "target_value",
124 "target_value was not specified but it is required when building AutoScalingTargetTrackingScalingPolicyConfigurationDescription",
125 )
126 })?,
127 })
128 }
129}