aws_sdk_personalize/types/
_default_continuous_hyper_parameter_range.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides the name and default range of a continuous hyperparameter and whether the hyperparameter is tunable. A tunable hyperparameter can have its value determined during hyperparameter optimization (HPO).</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DefaultContinuousHyperParameterRange {
7    /// <p>The name of the hyperparameter.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>The minimum allowable value for the hyperparameter.</p>
10    pub min_value: f64,
11    /// <p>The maximum allowable value for the hyperparameter.</p>
12    pub max_value: f64,
13    /// <p>Whether the hyperparameter is tunable.</p>
14    pub is_tunable: bool,
15}
16impl DefaultContinuousHyperParameterRange {
17    /// <p>The name of the hyperparameter.</p>
18    pub fn name(&self) -> ::std::option::Option<&str> {
19        self.name.as_deref()
20    }
21    /// <p>The minimum allowable value for the hyperparameter.</p>
22    pub fn min_value(&self) -> f64 {
23        self.min_value
24    }
25    /// <p>The maximum allowable value for the hyperparameter.</p>
26    pub fn max_value(&self) -> f64 {
27        self.max_value
28    }
29    /// <p>Whether the hyperparameter is tunable.</p>
30    pub fn is_tunable(&self) -> bool {
31        self.is_tunable
32    }
33}
34impl DefaultContinuousHyperParameterRange {
35    /// Creates a new builder-style object to manufacture [`DefaultContinuousHyperParameterRange`](crate::types::DefaultContinuousHyperParameterRange).
36    pub fn builder() -> crate::types::builders::DefaultContinuousHyperParameterRangeBuilder {
37        crate::types::builders::DefaultContinuousHyperParameterRangeBuilder::default()
38    }
39}
40
41/// A builder for [`DefaultContinuousHyperParameterRange`](crate::types::DefaultContinuousHyperParameterRange).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct DefaultContinuousHyperParameterRangeBuilder {
45    pub(crate) name: ::std::option::Option<::std::string::String>,
46    pub(crate) min_value: ::std::option::Option<f64>,
47    pub(crate) max_value: ::std::option::Option<f64>,
48    pub(crate) is_tunable: ::std::option::Option<bool>,
49}
50impl DefaultContinuousHyperParameterRangeBuilder {
51    /// <p>The name of the hyperparameter.</p>
52    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the hyperparameter.</p>
57    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.name = input;
59        self
60    }
61    /// <p>The name of the hyperparameter.</p>
62    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.name
64    }
65    /// <p>The minimum allowable value for the hyperparameter.</p>
66    pub fn min_value(mut self, input: f64) -> Self {
67        self.min_value = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The minimum allowable value for the hyperparameter.</p>
71    pub fn set_min_value(mut self, input: ::std::option::Option<f64>) -> Self {
72        self.min_value = input;
73        self
74    }
75    /// <p>The minimum allowable value for the hyperparameter.</p>
76    pub fn get_min_value(&self) -> &::std::option::Option<f64> {
77        &self.min_value
78    }
79    /// <p>The maximum allowable value for the hyperparameter.</p>
80    pub fn max_value(mut self, input: f64) -> Self {
81        self.max_value = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>The maximum allowable value for the hyperparameter.</p>
85    pub fn set_max_value(mut self, input: ::std::option::Option<f64>) -> Self {
86        self.max_value = input;
87        self
88    }
89    /// <p>The maximum allowable value for the hyperparameter.</p>
90    pub fn get_max_value(&self) -> &::std::option::Option<f64> {
91        &self.max_value
92    }
93    /// <p>Whether the hyperparameter is tunable.</p>
94    pub fn is_tunable(mut self, input: bool) -> Self {
95        self.is_tunable = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>Whether the hyperparameter is tunable.</p>
99    pub fn set_is_tunable(mut self, input: ::std::option::Option<bool>) -> Self {
100        self.is_tunable = input;
101        self
102    }
103    /// <p>Whether the hyperparameter is tunable.</p>
104    pub fn get_is_tunable(&self) -> &::std::option::Option<bool> {
105        &self.is_tunable
106    }
107    /// Consumes the builder and constructs a [`DefaultContinuousHyperParameterRange`](crate::types::DefaultContinuousHyperParameterRange).
108    pub fn build(self) -> crate::types::DefaultContinuousHyperParameterRange {
109        crate::types::DefaultContinuousHyperParameterRange {
110            name: self.name,
111            min_value: self.min_value.unwrap_or_default(),
112            max_value: self.max_value.unwrap_or_default(),
113            is_tunable: self.is_tunable.unwrap_or_default(),
114        }
115    }
116}