aws_sdk_fms/types/_policy_type_scope.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Defines the policy types that the specified Firewall Manager administrator can manage.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PolicyTypeScope {
7 /// <p>The list of policy types that the specified Firewall Manager administrator can manage.</p>
8 pub policy_types: ::std::option::Option<::std::vec::Vec<crate::types::SecurityServiceType>>,
9 /// <p>Allows the specified Firewall Manager administrator to manage all Firewall Manager policy types, except for third-party policy types. Third-party policy types can only be managed by the Firewall Manager default administrator.</p>
10 pub all_policy_types_enabled: bool,
11}
12impl PolicyTypeScope {
13 /// <p>The list of policy types that the specified Firewall Manager administrator can manage.</p>
14 ///
15 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.policy_types.is_none()`.
16 pub fn policy_types(&self) -> &[crate::types::SecurityServiceType] {
17 self.policy_types.as_deref().unwrap_or_default()
18 }
19 /// <p>Allows the specified Firewall Manager administrator to manage all Firewall Manager policy types, except for third-party policy types. Third-party policy types can only be managed by the Firewall Manager default administrator.</p>
20 pub fn all_policy_types_enabled(&self) -> bool {
21 self.all_policy_types_enabled
22 }
23}
24impl PolicyTypeScope {
25 /// Creates a new builder-style object to manufacture [`PolicyTypeScope`](crate::types::PolicyTypeScope).
26 pub fn builder() -> crate::types::builders::PolicyTypeScopeBuilder {
27 crate::types::builders::PolicyTypeScopeBuilder::default()
28 }
29}
30
31/// A builder for [`PolicyTypeScope`](crate::types::PolicyTypeScope).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct PolicyTypeScopeBuilder {
35 pub(crate) policy_types: ::std::option::Option<::std::vec::Vec<crate::types::SecurityServiceType>>,
36 pub(crate) all_policy_types_enabled: ::std::option::Option<bool>,
37}
38impl PolicyTypeScopeBuilder {
39 /// Appends an item to `policy_types`.
40 ///
41 /// To override the contents of this collection use [`set_policy_types`](Self::set_policy_types).
42 ///
43 /// <p>The list of policy types that the specified Firewall Manager administrator can manage.</p>
44 pub fn policy_types(mut self, input: crate::types::SecurityServiceType) -> Self {
45 let mut v = self.policy_types.unwrap_or_default();
46 v.push(input);
47 self.policy_types = ::std::option::Option::Some(v);
48 self
49 }
50 /// <p>The list of policy types that the specified Firewall Manager administrator can manage.</p>
51 pub fn set_policy_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SecurityServiceType>>) -> Self {
52 self.policy_types = input;
53 self
54 }
55 /// <p>The list of policy types that the specified Firewall Manager administrator can manage.</p>
56 pub fn get_policy_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SecurityServiceType>> {
57 &self.policy_types
58 }
59 /// <p>Allows the specified Firewall Manager administrator to manage all Firewall Manager policy types, except for third-party policy types. Third-party policy types can only be managed by the Firewall Manager default administrator.</p>
60 pub fn all_policy_types_enabled(mut self, input: bool) -> Self {
61 self.all_policy_types_enabled = ::std::option::Option::Some(input);
62 self
63 }
64 /// <p>Allows the specified Firewall Manager administrator to manage all Firewall Manager policy types, except for third-party policy types. Third-party policy types can only be managed by the Firewall Manager default administrator.</p>
65 pub fn set_all_policy_types_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
66 self.all_policy_types_enabled = input;
67 self
68 }
69 /// <p>Allows the specified Firewall Manager administrator to manage all Firewall Manager policy types, except for third-party policy types. Third-party policy types can only be managed by the Firewall Manager default administrator.</p>
70 pub fn get_all_policy_types_enabled(&self) -> &::std::option::Option<bool> {
71 &self.all_policy_types_enabled
72 }
73 /// Consumes the builder and constructs a [`PolicyTypeScope`](crate::types::PolicyTypeScope).
74 pub fn build(self) -> crate::types::PolicyTypeScope {
75 crate::types::PolicyTypeScope {
76 policy_types: self.policy_types,
77 all_policy_types_enabled: self.all_policy_types_enabled.unwrap_or_default(),
78 }
79 }
80}