aws_sdk_opsworks/operation/set_load_based_auto_scaling/_set_load_based_auto_scaling_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct SetLoadBasedAutoScalingInput {
6 /// <p>The layer ID.</p>
7 pub layer_id: ::std::option::Option<::std::string::String>,
8 /// <p>Enables load-based auto scaling for the layer.</p>
9 pub enable: ::std::option::Option<bool>,
10 /// <p>An <code>AutoScalingThresholds</code> object with the upscaling threshold configuration. If the load exceeds these thresholds for a specified amount of time, OpsWorks Stacks starts a specified number of instances.</p>
11 pub up_scaling: ::std::option::Option<crate::types::AutoScalingThresholds>,
12 /// <p>An <code>AutoScalingThresholds</code> object with the downscaling threshold configuration. If the load falls below these thresholds for a specified amount of time, OpsWorks Stacks stops a specified number of instances.</p>
13 pub down_scaling: ::std::option::Option<crate::types::AutoScalingThresholds>,
14}
15impl SetLoadBasedAutoScalingInput {
16 /// <p>The layer ID.</p>
17 pub fn layer_id(&self) -> ::std::option::Option<&str> {
18 self.layer_id.as_deref()
19 }
20 /// <p>Enables load-based auto scaling for the layer.</p>
21 pub fn enable(&self) -> ::std::option::Option<bool> {
22 self.enable
23 }
24 /// <p>An <code>AutoScalingThresholds</code> object with the upscaling threshold configuration. If the load exceeds these thresholds for a specified amount of time, OpsWorks Stacks starts a specified number of instances.</p>
25 pub fn up_scaling(&self) -> ::std::option::Option<&crate::types::AutoScalingThresholds> {
26 self.up_scaling.as_ref()
27 }
28 /// <p>An <code>AutoScalingThresholds</code> object with the downscaling threshold configuration. If the load falls below these thresholds for a specified amount of time, OpsWorks Stacks stops a specified number of instances.</p>
29 pub fn down_scaling(&self) -> ::std::option::Option<&crate::types::AutoScalingThresholds> {
30 self.down_scaling.as_ref()
31 }
32}
33impl SetLoadBasedAutoScalingInput {
34 /// Creates a new builder-style object to manufacture [`SetLoadBasedAutoScalingInput`](crate::operation::set_load_based_auto_scaling::SetLoadBasedAutoScalingInput).
35 pub fn builder() -> crate::operation::set_load_based_auto_scaling::builders::SetLoadBasedAutoScalingInputBuilder {
36 crate::operation::set_load_based_auto_scaling::builders::SetLoadBasedAutoScalingInputBuilder::default()
37 }
38}
39
40/// A builder for [`SetLoadBasedAutoScalingInput`](crate::operation::set_load_based_auto_scaling::SetLoadBasedAutoScalingInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct SetLoadBasedAutoScalingInputBuilder {
44 pub(crate) layer_id: ::std::option::Option<::std::string::String>,
45 pub(crate) enable: ::std::option::Option<bool>,
46 pub(crate) up_scaling: ::std::option::Option<crate::types::AutoScalingThresholds>,
47 pub(crate) down_scaling: ::std::option::Option<crate::types::AutoScalingThresholds>,
48}
49impl SetLoadBasedAutoScalingInputBuilder {
50 /// <p>The layer ID.</p>
51 /// This field is required.
52 pub fn layer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.layer_id = ::std::option::Option::Some(input.into());
54 self
55 }
56 /// <p>The layer ID.</p>
57 pub fn set_layer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.layer_id = input;
59 self
60 }
61 /// <p>The layer ID.</p>
62 pub fn get_layer_id(&self) -> &::std::option::Option<::std::string::String> {
63 &self.layer_id
64 }
65 /// <p>Enables load-based auto scaling for the layer.</p>
66 pub fn enable(mut self, input: bool) -> Self {
67 self.enable = ::std::option::Option::Some(input);
68 self
69 }
70 /// <p>Enables load-based auto scaling for the layer.</p>
71 pub fn set_enable(mut self, input: ::std::option::Option<bool>) -> Self {
72 self.enable = input;
73 self
74 }
75 /// <p>Enables load-based auto scaling for the layer.</p>
76 pub fn get_enable(&self) -> &::std::option::Option<bool> {
77 &self.enable
78 }
79 /// <p>An <code>AutoScalingThresholds</code> object with the upscaling threshold configuration. If the load exceeds these thresholds for a specified amount of time, OpsWorks Stacks starts a specified number of instances.</p>
80 pub fn up_scaling(mut self, input: crate::types::AutoScalingThresholds) -> Self {
81 self.up_scaling = ::std::option::Option::Some(input);
82 self
83 }
84 /// <p>An <code>AutoScalingThresholds</code> object with the upscaling threshold configuration. If the load exceeds these thresholds for a specified amount of time, OpsWorks Stacks starts a specified number of instances.</p>
85 pub fn set_up_scaling(mut self, input: ::std::option::Option<crate::types::AutoScalingThresholds>) -> Self {
86 self.up_scaling = input;
87 self
88 }
89 /// <p>An <code>AutoScalingThresholds</code> object with the upscaling threshold configuration. If the load exceeds these thresholds for a specified amount of time, OpsWorks Stacks starts a specified number of instances.</p>
90 pub fn get_up_scaling(&self) -> &::std::option::Option<crate::types::AutoScalingThresholds> {
91 &self.up_scaling
92 }
93 /// <p>An <code>AutoScalingThresholds</code> object with the downscaling threshold configuration. If the load falls below these thresholds for a specified amount of time, OpsWorks Stacks stops a specified number of instances.</p>
94 pub fn down_scaling(mut self, input: crate::types::AutoScalingThresholds) -> Self {
95 self.down_scaling = ::std::option::Option::Some(input);
96 self
97 }
98 /// <p>An <code>AutoScalingThresholds</code> object with the downscaling threshold configuration. If the load falls below these thresholds for a specified amount of time, OpsWorks Stacks stops a specified number of instances.</p>
99 pub fn set_down_scaling(mut self, input: ::std::option::Option<crate::types::AutoScalingThresholds>) -> Self {
100 self.down_scaling = input;
101 self
102 }
103 /// <p>An <code>AutoScalingThresholds</code> object with the downscaling threshold configuration. If the load falls below these thresholds for a specified amount of time, OpsWorks Stacks stops a specified number of instances.</p>
104 pub fn get_down_scaling(&self) -> &::std::option::Option<crate::types::AutoScalingThresholds> {
105 &self.down_scaling
106 }
107 /// Consumes the builder and constructs a [`SetLoadBasedAutoScalingInput`](crate::operation::set_load_based_auto_scaling::SetLoadBasedAutoScalingInput).
108 pub fn build(
109 self,
110 ) -> ::std::result::Result<
111 crate::operation::set_load_based_auto_scaling::SetLoadBasedAutoScalingInput,
112 ::aws_smithy_types::error::operation::BuildError,
113 > {
114 ::std::result::Result::Ok(crate::operation::set_load_based_auto_scaling::SetLoadBasedAutoScalingInput {
115 layer_id: self.layer_id,
116 enable: self.enable,
117 up_scaling: self.up_scaling,
118 down_scaling: self.down_scaling,
119 })
120 }
121}