aws_sdk_networkmanager/types/
_proposed_segment_change.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a proposed segment change. In some cases, the segment change must first be evaluated and accepted.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ProposedSegmentChange {
7    /// <p>The list of key-value tags that changed for the segment.</p>
8    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
9    /// <p>The rule number in the policy document that applies to this change.</p>
10    pub attachment_policy_rule_number: ::std::option::Option<i32>,
11    /// <p>The name of the segment to change.</p>
12    pub segment_name: ::std::option::Option<::std::string::String>,
13}
14impl ProposedSegmentChange {
15    /// <p>The list of key-value tags that changed for the segment.</p>
16    ///
17    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
18    pub fn tags(&self) -> &[crate::types::Tag] {
19        self.tags.as_deref().unwrap_or_default()
20    }
21    /// <p>The rule number in the policy document that applies to this change.</p>
22    pub fn attachment_policy_rule_number(&self) -> ::std::option::Option<i32> {
23        self.attachment_policy_rule_number
24    }
25    /// <p>The name of the segment to change.</p>
26    pub fn segment_name(&self) -> ::std::option::Option<&str> {
27        self.segment_name.as_deref()
28    }
29}
30impl ProposedSegmentChange {
31    /// Creates a new builder-style object to manufacture [`ProposedSegmentChange`](crate::types::ProposedSegmentChange).
32    pub fn builder() -> crate::types::builders::ProposedSegmentChangeBuilder {
33        crate::types::builders::ProposedSegmentChangeBuilder::default()
34    }
35}
36
37/// A builder for [`ProposedSegmentChange`](crate::types::ProposedSegmentChange).
38#[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    /// Appends an item to `tags`.
47    ///
48    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
49    ///
50    /// <p>The list of key-value tags that changed for the segment.</p>
51    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    /// <p>The list of key-value tags that changed for the segment.</p>
58    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    /// <p>The list of key-value tags that changed for the segment.</p>
63    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
64        &self.tags
65    }
66    /// <p>The rule number in the policy document that applies to this change.</p>
67    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    /// <p>The rule number in the policy document that applies to this change.</p>
72    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    /// <p>The rule number in the policy document that applies to this change.</p>
77    pub fn get_attachment_policy_rule_number(&self) -> &::std::option::Option<i32> {
78        &self.attachment_policy_rule_number
79    }
80    /// <p>The name of the segment to change.</p>
81    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    /// <p>The name of the segment to change.</p>
86    pub fn set_segment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.segment_name = input;
88        self
89    }
90    /// <p>The name of the segment to change.</p>
91    pub fn get_segment_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.segment_name
93    }
94    /// Consumes the builder and constructs a [`ProposedSegmentChange`](crate::types::ProposedSegmentChange).
95    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}