aws_sdk_networkmanager/types/
_proposed_segment_change.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ProposedSegmentChange {
7 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
9 pub attachment_policy_rule_number: ::std::option::Option<i32>,
11 pub segment_name: ::std::option::Option<::std::string::String>,
13}
14impl ProposedSegmentChange {
15 pub fn tags(&self) -> &[crate::types::Tag] {
19 self.tags.as_deref().unwrap_or_default()
20 }
21 pub fn attachment_policy_rule_number(&self) -> ::std::option::Option<i32> {
23 self.attachment_policy_rule_number
24 }
25 pub fn segment_name(&self) -> ::std::option::Option<&str> {
27 self.segment_name.as_deref()
28 }
29}
30impl ProposedSegmentChange {
31 pub fn builder() -> crate::types::builders::ProposedSegmentChangeBuilder {
33 crate::types::builders::ProposedSegmentChangeBuilder::default()
34 }
35}
36
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct ProposedSegmentChangeBuilder {
41 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
42 pub(crate) attachment_policy_rule_number: ::std::option::Option<i32>,
43 pub(crate) segment_name: ::std::option::Option<::std::string::String>,
44}
45impl ProposedSegmentChangeBuilder {
46 pub fn tags(mut self, input: crate::types::Tag) -> Self {
52 let mut v = self.tags.unwrap_or_default();
53 v.push(input);
54 self.tags = ::std::option::Option::Some(v);
55 self
56 }
57 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
59 self.tags = input;
60 self
61 }
62 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
64 &self.tags
65 }
66 pub fn attachment_policy_rule_number(mut self, input: i32) -> Self {
68 self.attachment_policy_rule_number = ::std::option::Option::Some(input);
69 self
70 }
71 pub fn set_attachment_policy_rule_number(mut self, input: ::std::option::Option<i32>) -> Self {
73 self.attachment_policy_rule_number = input;
74 self
75 }
76 pub fn get_attachment_policy_rule_number(&self) -> &::std::option::Option<i32> {
78 &self.attachment_policy_rule_number
79 }
80 pub fn segment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.segment_name = ::std::option::Option::Some(input.into());
83 self
84 }
85 pub fn set_segment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.segment_name = input;
88 self
89 }
90 pub fn get_segment_name(&self) -> &::std::option::Option<::std::string::String> {
92 &self.segment_name
93 }
94 pub fn build(self) -> crate::types::ProposedSegmentChange {
96 crate::types::ProposedSegmentChange {
97 tags: self.tags,
98 attachment_policy_rule_number: self.attachment_policy_rule_number,
99 segment_name: self.segment_name,
100 }
101 }
102}