aws_sdk_eks/types/
_update_labels_payload.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateLabelsPayload {
7 pub add_or_update_labels: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
9 pub remove_labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11}
12impl UpdateLabelsPayload {
13 pub fn add_or_update_labels(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
15 self.add_or_update_labels.as_ref()
16 }
17 pub fn remove_labels(&self) -> &[::std::string::String] {
21 self.remove_labels.as_deref().unwrap_or_default()
22 }
23}
24impl UpdateLabelsPayload {
25 pub fn builder() -> crate::types::builders::UpdateLabelsPayloadBuilder {
27 crate::types::builders::UpdateLabelsPayloadBuilder::default()
28 }
29}
30
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct UpdateLabelsPayloadBuilder {
35 pub(crate) add_or_update_labels: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
36 pub(crate) remove_labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
37}
38impl UpdateLabelsPayloadBuilder {
39 pub fn add_or_update_labels(
45 mut self,
46 k: impl ::std::convert::Into<::std::string::String>,
47 v: impl ::std::convert::Into<::std::string::String>,
48 ) -> Self {
49 let mut hash_map = self.add_or_update_labels.unwrap_or_default();
50 hash_map.insert(k.into(), v.into());
51 self.add_or_update_labels = ::std::option::Option::Some(hash_map);
52 self
53 }
54 pub fn set_add_or_update_labels(
56 mut self,
57 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
58 ) -> Self {
59 self.add_or_update_labels = input;
60 self
61 }
62 pub fn get_add_or_update_labels(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
64 &self.add_or_update_labels
65 }
66 pub fn remove_labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72 let mut v = self.remove_labels.unwrap_or_default();
73 v.push(input.into());
74 self.remove_labels = ::std::option::Option::Some(v);
75 self
76 }
77 pub fn set_remove_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
79 self.remove_labels = input;
80 self
81 }
82 pub fn get_remove_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
84 &self.remove_labels
85 }
86 pub fn build(self) -> crate::types::UpdateLabelsPayload {
88 crate::types::UpdateLabelsPayload {
89 add_or_update_labels: self.add_or_update_labels,
90 remove_labels: self.remove_labels,
91 }
92 }
93}