aws_sdk_personalize/types/
_hpo_objective.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The metric to optimize during hyperparameter optimization (HPO).</p><note>
4/// <p>Amazon Personalize doesn't support configuring the <code>hpoObjective</code> at this time.</p>
5/// </note>
6#[non_exhaustive]
7#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
8pub struct HpoObjective {
9    /// <p>The type of the metric. Valid values are <code>Maximize</code> and <code>Minimize</code>.</p>
10    pub r#type: ::std::option::Option<::std::string::String>,
11    /// <p>The name of the metric.</p>
12    pub metric_name: ::std::option::Option<::std::string::String>,
13    /// <p>A regular expression for finding the metric in the training job logs.</p>
14    pub metric_regex: ::std::option::Option<::std::string::String>,
15}
16impl HpoObjective {
17    /// <p>The type of the metric. Valid values are <code>Maximize</code> and <code>Minimize</code>.</p>
18    pub fn r#type(&self) -> ::std::option::Option<&str> {
19        self.r#type.as_deref()
20    }
21    /// <p>The name of the metric.</p>
22    pub fn metric_name(&self) -> ::std::option::Option<&str> {
23        self.metric_name.as_deref()
24    }
25    /// <p>A regular expression for finding the metric in the training job logs.</p>
26    pub fn metric_regex(&self) -> ::std::option::Option<&str> {
27        self.metric_regex.as_deref()
28    }
29}
30impl HpoObjective {
31    /// Creates a new builder-style object to manufacture [`HpoObjective`](crate::types::HpoObjective).
32    pub fn builder() -> crate::types::builders::HpoObjectiveBuilder {
33        crate::types::builders::HpoObjectiveBuilder::default()
34    }
35}
36
37/// A builder for [`HpoObjective`](crate::types::HpoObjective).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct HpoObjectiveBuilder {
41    pub(crate) r#type: ::std::option::Option<::std::string::String>,
42    pub(crate) metric_name: ::std::option::Option<::std::string::String>,
43    pub(crate) metric_regex: ::std::option::Option<::std::string::String>,
44}
45impl HpoObjectiveBuilder {
46    /// <p>The type of the metric. Valid values are <code>Maximize</code> and <code>Minimize</code>.</p>
47    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.r#type = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The type of the metric. Valid values are <code>Maximize</code> and <code>Minimize</code>.</p>
52    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.r#type = input;
54        self
55    }
56    /// <p>The type of the metric. Valid values are <code>Maximize</code> and <code>Minimize</code>.</p>
57    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
58        &self.r#type
59    }
60    /// <p>The name of the metric.</p>
61    pub fn metric_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.metric_name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the metric.</p>
66    pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.metric_name = input;
68        self
69    }
70    /// <p>The name of the metric.</p>
71    pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.metric_name
73    }
74    /// <p>A regular expression for finding the metric in the training job logs.</p>
75    pub fn metric_regex(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.metric_regex = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>A regular expression for finding the metric in the training job logs.</p>
80    pub fn set_metric_regex(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.metric_regex = input;
82        self
83    }
84    /// <p>A regular expression for finding the metric in the training job logs.</p>
85    pub fn get_metric_regex(&self) -> &::std::option::Option<::std::string::String> {
86        &self.metric_regex
87    }
88    /// Consumes the builder and constructs a [`HpoObjective`](crate::types::HpoObjective).
89    pub fn build(self) -> crate::types::HpoObjective {
90        crate::types::HpoObjective {
91            r#type: self.r#type,
92            metric_name: self.metric_name,
93            metric_regex: self.metric_regex,
94        }
95    }
96}