1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies the settings that define the relationships between segment groups for a segment.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SegmentGroupList {
    /// <p>An array that defines the set of segment criteria to evaluate when handling segment groups for the segment.</p>
    pub groups: ::std::option::Option<::std::vec::Vec<crate::types::SegmentGroup>>,
    /// <p>Specifies how to handle multiple segment groups for the segment. For example, if the segment includes three segment groups, whether the resulting segment includes endpoints that match all, any, or none of the segment groups.</p>
    pub include: ::std::option::Option<crate::types::Include>,
}
impl SegmentGroupList {
    /// <p>An array that defines the set of segment criteria to evaluate when handling segment groups for the segment.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.groups.is_none()`.
    pub fn groups(&self) -> &[crate::types::SegmentGroup] {
        self.groups.as_deref().unwrap_or_default()
    }
    /// <p>Specifies how to handle multiple segment groups for the segment. For example, if the segment includes three segment groups, whether the resulting segment includes endpoints that match all, any, or none of the segment groups.</p>
    pub fn include(&self) -> ::std::option::Option<&crate::types::Include> {
        self.include.as_ref()
    }
}
impl SegmentGroupList {
    /// Creates a new builder-style object to manufacture [`SegmentGroupList`](crate::types::SegmentGroupList).
    pub fn builder() -> crate::types::builders::SegmentGroupListBuilder {
        crate::types::builders::SegmentGroupListBuilder::default()
    }
}

/// A builder for [`SegmentGroupList`](crate::types::SegmentGroupList).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SegmentGroupListBuilder {
    pub(crate) groups: ::std::option::Option<::std::vec::Vec<crate::types::SegmentGroup>>,
    pub(crate) include: ::std::option::Option<crate::types::Include>,
}
impl SegmentGroupListBuilder {
    /// Appends an item to `groups`.
    ///
    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
    ///
    /// <p>An array that defines the set of segment criteria to evaluate when handling segment groups for the segment.</p>
    pub fn groups(mut self, input: crate::types::SegmentGroup) -> Self {
        let mut v = self.groups.unwrap_or_default();
        v.push(input);
        self.groups = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array that defines the set of segment criteria to evaluate when handling segment groups for the segment.</p>
    pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SegmentGroup>>) -> Self {
        self.groups = input;
        self
    }
    /// <p>An array that defines the set of segment criteria to evaluate when handling segment groups for the segment.</p>
    pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SegmentGroup>> {
        &self.groups
    }
    /// <p>Specifies how to handle multiple segment groups for the segment. For example, if the segment includes three segment groups, whether the resulting segment includes endpoints that match all, any, or none of the segment groups.</p>
    pub fn include(mut self, input: crate::types::Include) -> Self {
        self.include = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies how to handle multiple segment groups for the segment. For example, if the segment includes three segment groups, whether the resulting segment includes endpoints that match all, any, or none of the segment groups.</p>
    pub fn set_include(mut self, input: ::std::option::Option<crate::types::Include>) -> Self {
        self.include = input;
        self
    }
    /// <p>Specifies how to handle multiple segment groups for the segment. For example, if the segment includes three segment groups, whether the resulting segment includes endpoints that match all, any, or none of the segment groups.</p>
    pub fn get_include(&self) -> &::std::option::Option<crate::types::Include> {
        &self.include
    }
    /// Consumes the builder and constructs a [`SegmentGroupList`](crate::types::SegmentGroupList).
    pub fn build(self) -> crate::types::SegmentGroupList {
        crate::types::SegmentGroupList {
            groups: self.groups,
            include: self.include,
        }
    }
}