aws_sdk_personalize/types/
_hpo_objective.rs1#[non_exhaustive]
7#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
8pub struct HpoObjective {
9 pub r#type: ::std::option::Option<::std::string::String>,
11 pub metric_name: ::std::option::Option<::std::string::String>,
13 pub metric_regex: ::std::option::Option<::std::string::String>,
15}
16impl HpoObjective {
17 pub fn r#type(&self) -> ::std::option::Option<&str> {
19 self.r#type.as_deref()
20 }
21 pub fn metric_name(&self) -> ::std::option::Option<&str> {
23 self.metric_name.as_deref()
24 }
25 pub fn metric_regex(&self) -> ::std::option::Option<&str> {
27 self.metric_regex.as_deref()
28 }
29}
30impl HpoObjective {
31 pub fn builder() -> crate::types::builders::HpoObjectiveBuilder {
33 crate::types::builders::HpoObjectiveBuilder::default()
34 }
35}
36
37#[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 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 pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.r#type = input;
54 self
55 }
56 pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
58 &self.r#type
59 }
60 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 pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.metric_name = input;
68 self
69 }
70 pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
72 &self.metric_name
73 }
74 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 pub fn set_metric_regex(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.metric_regex = input;
82 self
83 }
84 pub fn get_metric_regex(&self) -> &::std::option::Option<::std::string::String> {
86 &self.metric_regex
87 }
88 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}