aws_sdk_applicationautoscaling/types/
_predictive_scaling_metric_dimension.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PredictiveScalingMetricDimension {
7 pub name: ::std::string::String,
9 pub value: ::std::string::String,
11}
12impl PredictiveScalingMetricDimension {
13 pub fn name(&self) -> &str {
15 use std::ops::Deref;
16 self.name.deref()
17 }
18 pub fn value(&self) -> &str {
20 use std::ops::Deref;
21 self.value.deref()
22 }
23}
24impl PredictiveScalingMetricDimension {
25 pub fn builder() -> crate::types::builders::PredictiveScalingMetricDimensionBuilder {
27 crate::types::builders::PredictiveScalingMetricDimensionBuilder::default()
28 }
29}
30
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct PredictiveScalingMetricDimensionBuilder {
35 pub(crate) name: ::std::option::Option<::std::string::String>,
36 pub(crate) value: ::std::option::Option<::std::string::String>,
37}
38impl PredictiveScalingMetricDimensionBuilder {
39 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42 self.name = ::std::option::Option::Some(input.into());
43 self
44 }
45 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47 self.name = input;
48 self
49 }
50 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
52 &self.name
53 }
54 pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57 self.value = ::std::option::Option::Some(input.into());
58 self
59 }
60 pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62 self.value = input;
63 self
64 }
65 pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
67 &self.value
68 }
69 pub fn build(self) -> ::std::result::Result<crate::types::PredictiveScalingMetricDimension, ::aws_smithy_types::error::operation::BuildError> {
74 ::std::result::Result::Ok(crate::types::PredictiveScalingMetricDimension {
75 name: self.name.ok_or_else(|| {
76 ::aws_smithy_types::error::operation::BuildError::missing_field(
77 "name",
78 "name was not specified but it is required when building PredictiveScalingMetricDimension",
79 )
80 })?,
81 value: self.value.ok_or_else(|| {
82 ::aws_smithy_types::error::operation::BuildError::missing_field(
83 "value",
84 "value was not specified but it is required when building PredictiveScalingMetricDimension",
85 )
86 })?,
87 })
88 }
89}