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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains information that allowed the authorization.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Allowed {
/// <p>A list of policies that allowed the authentication.</p>
pub policies: ::std::option::Option<::std::vec::Vec<crate::types::Policy>>,
}
impl Allowed {
/// <p>A list of policies that allowed the authentication.</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 `.policies.is_none()`.
pub fn policies(&self) -> &[crate::types::Policy] {
self.policies.as_deref().unwrap_or_default()
}
}
impl Allowed {
/// Creates a new builder-style object to manufacture [`Allowed`](crate::types::Allowed).
pub fn builder() -> crate::types::builders::AllowedBuilder {
crate::types::builders::AllowedBuilder::default()
}
}
/// A builder for [`Allowed`](crate::types::Allowed).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AllowedBuilder {
pub(crate) policies: ::std::option::Option<::std::vec::Vec<crate::types::Policy>>,
}
impl AllowedBuilder {
/// Appends an item to `policies`.
///
/// To override the contents of this collection use [`set_policies`](Self::set_policies).
///
/// <p>A list of policies that allowed the authentication.</p>
pub fn policies(mut self, input: crate::types::Policy) -> Self {
let mut v = self.policies.unwrap_or_default();
v.push(input);
self.policies = ::std::option::Option::Some(v);
self
}
/// <p>A list of policies that allowed the authentication.</p>
pub fn set_policies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Policy>>) -> Self {
self.policies = input;
self
}
/// <p>A list of policies that allowed the authentication.</p>
pub fn get_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Policy>> {
&self.policies
}
/// Consumes the builder and constructs a [`Allowed`](crate::types::Allowed).
pub fn build(self) -> crate::types::Allowed {
crate::types::Allowed { policies: self.policies }
}
}