aws_sdk_sagemakergeospatial/types/
_filter.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Filter {
7 pub name: ::std::string::String,
9 pub r#type: ::std::string::String,
11 pub minimum: ::std::option::Option<f32>,
13 pub maximum: ::std::option::Option<f32>,
15}
16impl Filter {
17 pub fn name(&self) -> &str {
19 use std::ops::Deref;
20 self.name.deref()
21 }
22 pub fn r#type(&self) -> &str {
24 use std::ops::Deref;
25 self.r#type.deref()
26 }
27 pub fn minimum(&self) -> ::std::option::Option<f32> {
29 self.minimum
30 }
31 pub fn maximum(&self) -> ::std::option::Option<f32> {
33 self.maximum
34 }
35}
36impl Filter {
37 pub fn builder() -> crate::types::builders::FilterBuilder {
39 crate::types::builders::FilterBuilder::default()
40 }
41}
42
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct FilterBuilder {
47 pub(crate) name: ::std::option::Option<::std::string::String>,
48 pub(crate) r#type: ::std::option::Option<::std::string::String>,
49 pub(crate) minimum: ::std::option::Option<f32>,
50 pub(crate) maximum: ::std::option::Option<f32>,
51}
52impl FilterBuilder {
53 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56 self.name = ::std::option::Option::Some(input.into());
57 self
58 }
59 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61 self.name = input;
62 self
63 }
64 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
66 &self.name
67 }
68 pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71 self.r#type = ::std::option::Option::Some(input.into());
72 self
73 }
74 pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.r#type = input;
77 self
78 }
79 pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
81 &self.r#type
82 }
83 pub fn minimum(mut self, input: f32) -> Self {
85 self.minimum = ::std::option::Option::Some(input);
86 self
87 }
88 pub fn set_minimum(mut self, input: ::std::option::Option<f32>) -> Self {
90 self.minimum = input;
91 self
92 }
93 pub fn get_minimum(&self) -> &::std::option::Option<f32> {
95 &self.minimum
96 }
97 pub fn maximum(mut self, input: f32) -> Self {
99 self.maximum = ::std::option::Option::Some(input);
100 self
101 }
102 pub fn set_maximum(mut self, input: ::std::option::Option<f32>) -> Self {
104 self.maximum = input;
105 self
106 }
107 pub fn get_maximum(&self) -> &::std::option::Option<f32> {
109 &self.maximum
110 }
111 pub fn build(self) -> ::std::result::Result<crate::types::Filter, ::aws_smithy_types::error::operation::BuildError> {
116 ::std::result::Result::Ok(crate::types::Filter {
117 name: self.name.ok_or_else(|| {
118 ::aws_smithy_types::error::operation::BuildError::missing_field(
119 "name",
120 "name was not specified but it is required when building Filter",
121 )
122 })?,
123 r#type: self.r#type.ok_or_else(|| {
124 ::aws_smithy_types::error::operation::BuildError::missing_field(
125 "r#type",
126 "r#type was not specified but it is required when building Filter",
127 )
128 })?,
129 minimum: self.minimum,
130 maximum: self.maximum,
131 })
132 }
133}