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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A list of Amazon Web Services accounts and the active CloudFront key pairs in each account that CloudFront can use to verify the signatures of signed URLs and signed cookies.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ActiveTrustedSigners {
    /// <p>This field is <code>true</code> if any of the Amazon Web Services accounts in the list are configured as trusted signers. If not, this field is <code>false</code>.</p>
    pub enabled: bool,
    /// <p>The number of Amazon Web Services accounts in the list.</p>
    pub quantity: i32,
    /// <p>A list of Amazon Web Services accounts and the identifiers of active CloudFront key pairs in each account that CloudFront can use to verify the signatures of signed URLs and signed cookies.</p>
    pub items: ::std::option::Option<::std::vec::Vec<crate::types::Signer>>,
}
impl ActiveTrustedSigners {
    /// <p>This field is <code>true</code> if any of the Amazon Web Services accounts in the list are configured as trusted signers. If not, this field is <code>false</code>.</p>
    pub fn enabled(&self) -> bool {
        self.enabled
    }
    /// <p>The number of Amazon Web Services accounts in the list.</p>
    pub fn quantity(&self) -> i32 {
        self.quantity
    }
    /// <p>A list of Amazon Web Services accounts and the identifiers of active CloudFront key pairs in each account that CloudFront can use to verify the signatures of signed URLs and signed cookies.</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 `.items.is_none()`.
    pub fn items(&self) -> &[crate::types::Signer] {
        self.items.as_deref().unwrap_or_default()
    }
}
impl ActiveTrustedSigners {
    /// Creates a new builder-style object to manufacture [`ActiveTrustedSigners`](crate::types::ActiveTrustedSigners).
    pub fn builder() -> crate::types::builders::ActiveTrustedSignersBuilder {
        crate::types::builders::ActiveTrustedSignersBuilder::default()
    }
}

/// A builder for [`ActiveTrustedSigners`](crate::types::ActiveTrustedSigners).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ActiveTrustedSignersBuilder {
    pub(crate) enabled: ::std::option::Option<bool>,
    pub(crate) quantity: ::std::option::Option<i32>,
    pub(crate) items: ::std::option::Option<::std::vec::Vec<crate::types::Signer>>,
}
impl ActiveTrustedSignersBuilder {
    /// <p>This field is <code>true</code> if any of the Amazon Web Services accounts in the list are configured as trusted signers. If not, this field is <code>false</code>.</p>
    /// This field is required.
    pub fn enabled(mut self, input: bool) -> Self {
        self.enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>This field is <code>true</code> if any of the Amazon Web Services accounts in the list are configured as trusted signers. If not, this field is <code>false</code>.</p>
    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.enabled = input;
        self
    }
    /// <p>This field is <code>true</code> if any of the Amazon Web Services accounts in the list are configured as trusted signers. If not, this field is <code>false</code>.</p>
    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
        &self.enabled
    }
    /// <p>The number of Amazon Web Services accounts in the list.</p>
    /// This field is required.
    pub fn quantity(mut self, input: i32) -> Self {
        self.quantity = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of Amazon Web Services accounts in the list.</p>
    pub fn set_quantity(mut self, input: ::std::option::Option<i32>) -> Self {
        self.quantity = input;
        self
    }
    /// <p>The number of Amazon Web Services accounts in the list.</p>
    pub fn get_quantity(&self) -> &::std::option::Option<i32> {
        &self.quantity
    }
    /// Appends an item to `items`.
    ///
    /// To override the contents of this collection use [`set_items`](Self::set_items).
    ///
    /// <p>A list of Amazon Web Services accounts and the identifiers of active CloudFront key pairs in each account that CloudFront can use to verify the signatures of signed URLs and signed cookies.</p>
    pub fn items(mut self, input: crate::types::Signer) -> Self {
        let mut v = self.items.unwrap_or_default();
        v.push(input);
        self.items = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of Amazon Web Services accounts and the identifiers of active CloudFront key pairs in each account that CloudFront can use to verify the signatures of signed URLs and signed cookies.</p>
    pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Signer>>) -> Self {
        self.items = input;
        self
    }
    /// <p>A list of Amazon Web Services accounts and the identifiers of active CloudFront key pairs in each account that CloudFront can use to verify the signatures of signed URLs and signed cookies.</p>
    pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Signer>> {
        &self.items
    }
    /// Consumes the builder and constructs a [`ActiveTrustedSigners`](crate::types::ActiveTrustedSigners).
    /// This method will fail if any of the following fields are not set:
    /// - [`enabled`](crate::types::builders::ActiveTrustedSignersBuilder::enabled)
    /// - [`quantity`](crate::types::builders::ActiveTrustedSignersBuilder::quantity)
    pub fn build(self) -> ::std::result::Result<crate::types::ActiveTrustedSigners, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::ActiveTrustedSigners {
            enabled: self.enabled.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "enabled",
                    "enabled was not specified but it is required when building ActiveTrustedSigners",
                )
            })?,
            quantity: self.quantity.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "quantity",
                    "quantity was not specified but it is required when building ActiveTrustedSigners",
                )
            })?,
            items: self.items,
        })
    }
}