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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An object that represents the egress filter rules for a service mesh.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EgressFilter {
    /// <p>The egress filter type. By default, the type is <code>DROP_ALL</code>, which allows egress only from virtual nodes to other defined resources in the service mesh (and any traffic to <code>*.amazonaws.com</code> for Amazon Web Services API calls). You can set the egress filter type to <code>ALLOW_ALL</code> to allow egress to any endpoint inside or outside of the service mesh.</p>
    pub r#type: crate::types::EgressFilterType,
}
impl EgressFilter {
    /// <p>The egress filter type. By default, the type is <code>DROP_ALL</code>, which allows egress only from virtual nodes to other defined resources in the service mesh (and any traffic to <code>*.amazonaws.com</code> for Amazon Web Services API calls). You can set the egress filter type to <code>ALLOW_ALL</code> to allow egress to any endpoint inside or outside of the service mesh.</p>
    pub fn r#type(&self) -> &crate::types::EgressFilterType {
        &self.r#type
    }
}
impl EgressFilter {
    /// Creates a new builder-style object to manufacture [`EgressFilter`](crate::types::EgressFilter).
    pub fn builder() -> crate::types::builders::EgressFilterBuilder {
        crate::types::builders::EgressFilterBuilder::default()
    }
}

/// A builder for [`EgressFilter`](crate::types::EgressFilter).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EgressFilterBuilder {
    pub(crate) r#type: ::std::option::Option<crate::types::EgressFilterType>,
}
impl EgressFilterBuilder {
    /// <p>The egress filter type. By default, the type is <code>DROP_ALL</code>, which allows egress only from virtual nodes to other defined resources in the service mesh (and any traffic to <code>*.amazonaws.com</code> for Amazon Web Services API calls). You can set the egress filter type to <code>ALLOW_ALL</code> to allow egress to any endpoint inside or outside of the service mesh.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::EgressFilterType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The egress filter type. By default, the type is <code>DROP_ALL</code>, which allows egress only from virtual nodes to other defined resources in the service mesh (and any traffic to <code>*.amazonaws.com</code> for Amazon Web Services API calls). You can set the egress filter type to <code>ALLOW_ALL</code> to allow egress to any endpoint inside or outside of the service mesh.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::EgressFilterType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The egress filter type. By default, the type is <code>DROP_ALL</code>, which allows egress only from virtual nodes to other defined resources in the service mesh (and any traffic to <code>*.amazonaws.com</code> for Amazon Web Services API calls). You can set the egress filter type to <code>ALLOW_ALL</code> to allow egress to any endpoint inside or outside of the service mesh.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::EgressFilterType> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`EgressFilter`](crate::types::EgressFilter).
    /// This method will fail if any of the following fields are not set:
    /// - [`r#type`](crate::types::builders::EgressFilterBuilder::r#type)
    pub fn build(self) -> ::std::result::Result<crate::types::EgressFilter, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::EgressFilter {
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building EgressFilter",
                )
            })?,
        })
    }
}