aws_sdk_ssm/types/
_ops_item_filter.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct OpsItemFilter {
7 pub key: crate::types::OpsItemFilterKey,
9 pub values: ::std::vec::Vec<::std::string::String>,
11 pub operator: crate::types::OpsItemFilterOperator,
13}
14impl OpsItemFilter {
15 pub fn key(&self) -> &crate::types::OpsItemFilterKey {
17 &self.key
18 }
19 pub fn values(&self) -> &[::std::string::String] {
21 use std::ops::Deref;
22 self.values.deref()
23 }
24 pub fn operator(&self) -> &crate::types::OpsItemFilterOperator {
26 &self.operator
27 }
28}
29impl OpsItemFilter {
30 pub fn builder() -> crate::types::builders::OpsItemFilterBuilder {
32 crate::types::builders::OpsItemFilterBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct OpsItemFilterBuilder {
40 pub(crate) key: ::std::option::Option<crate::types::OpsItemFilterKey>,
41 pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
42 pub(crate) operator: ::std::option::Option<crate::types::OpsItemFilterOperator>,
43}
44impl OpsItemFilterBuilder {
45 pub fn key(mut self, input: crate::types::OpsItemFilterKey) -> Self {
48 self.key = ::std::option::Option::Some(input);
49 self
50 }
51 pub fn set_key(mut self, input: ::std::option::Option<crate::types::OpsItemFilterKey>) -> Self {
53 self.key = input;
54 self
55 }
56 pub fn get_key(&self) -> &::std::option::Option<crate::types::OpsItemFilterKey> {
58 &self.key
59 }
60 pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 let mut v = self.values.unwrap_or_default();
67 v.push(input.into());
68 self.values = ::std::option::Option::Some(v);
69 self
70 }
71 pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
73 self.values = input;
74 self
75 }
76 pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
78 &self.values
79 }
80 pub fn operator(mut self, input: crate::types::OpsItemFilterOperator) -> Self {
83 self.operator = ::std::option::Option::Some(input);
84 self
85 }
86 pub fn set_operator(mut self, input: ::std::option::Option<crate::types::OpsItemFilterOperator>) -> Self {
88 self.operator = input;
89 self
90 }
91 pub fn get_operator(&self) -> &::std::option::Option<crate::types::OpsItemFilterOperator> {
93 &self.operator
94 }
95 pub fn build(self) -> ::std::result::Result<crate::types::OpsItemFilter, ::aws_smithy_types::error::operation::BuildError> {
101 ::std::result::Result::Ok(crate::types::OpsItemFilter {
102 key: self.key.ok_or_else(|| {
103 ::aws_smithy_types::error::operation::BuildError::missing_field(
104 "key",
105 "key was not specified but it is required when building OpsItemFilter",
106 )
107 })?,
108 values: self.values.ok_or_else(|| {
109 ::aws_smithy_types::error::operation::BuildError::missing_field(
110 "values",
111 "values was not specified but it is required when building OpsItemFilter",
112 )
113 })?,
114 operator: self.operator.ok_or_else(|| {
115 ::aws_smithy_types::error::operation::BuildError::missing_field(
116 "operator",
117 "operator was not specified but it is required when building OpsItemFilter",
118 )
119 })?,
120 })
121 }
122}