Skip to main content

aws_sdk_ec2/types/
_network_acl_association.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes an association between a network ACL and a subnet.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct NetworkAclAssociation {
7    /// <p>The ID of the association between a network ACL and a subnet.</p>
8    pub network_acl_association_id: ::std::option::Option<::std::string::String>,
9    /// <p>The ID of the network ACL.</p>
10    pub network_acl_id: ::std::option::Option<::std::string::String>,
11    /// <p>The ID of the subnet.</p>
12    pub subnet_id: ::std::option::Option<::std::string::String>,
13}
14impl NetworkAclAssociation {
15    /// <p>The ID of the association between a network ACL and a subnet.</p>
16    pub fn network_acl_association_id(&self) -> ::std::option::Option<&str> {
17        self.network_acl_association_id.as_deref()
18    }
19    /// <p>The ID of the network ACL.</p>
20    pub fn network_acl_id(&self) -> ::std::option::Option<&str> {
21        self.network_acl_id.as_deref()
22    }
23    /// <p>The ID of the subnet.</p>
24    pub fn subnet_id(&self) -> ::std::option::Option<&str> {
25        self.subnet_id.as_deref()
26    }
27}
28impl NetworkAclAssociation {
29    /// Creates a new builder-style object to manufacture [`NetworkAclAssociation`](crate::types::NetworkAclAssociation).
30    pub fn builder() -> crate::types::builders::NetworkAclAssociationBuilder {
31        crate::types::builders::NetworkAclAssociationBuilder::default()
32    }
33}
34
35/// A builder for [`NetworkAclAssociation`](crate::types::NetworkAclAssociation).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct NetworkAclAssociationBuilder {
39    pub(crate) network_acl_association_id: ::std::option::Option<::std::string::String>,
40    pub(crate) network_acl_id: ::std::option::Option<::std::string::String>,
41    pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
42}
43impl NetworkAclAssociationBuilder {
44    /// <p>The ID of the association between a network ACL and a subnet.</p>
45    pub fn network_acl_association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.network_acl_association_id = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The ID of the association between a network ACL and a subnet.</p>
50    pub fn set_network_acl_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.network_acl_association_id = input;
52        self
53    }
54    /// <p>The ID of the association between a network ACL and a subnet.</p>
55    pub fn get_network_acl_association_id(&self) -> &::std::option::Option<::std::string::String> {
56        &self.network_acl_association_id
57    }
58    /// <p>The ID of the network ACL.</p>
59    pub fn network_acl_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.network_acl_id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The ID of the network ACL.</p>
64    pub fn set_network_acl_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.network_acl_id = input;
66        self
67    }
68    /// <p>The ID of the network ACL.</p>
69    pub fn get_network_acl_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.network_acl_id
71    }
72    /// <p>The ID of the subnet.</p>
73    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.subnet_id = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The ID of the subnet.</p>
78    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.subnet_id = input;
80        self
81    }
82    /// <p>The ID of the subnet.</p>
83    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
84        &self.subnet_id
85    }
86    /// Consumes the builder and constructs a [`NetworkAclAssociation`](crate::types::NetworkAclAssociation).
87    pub fn build(self) -> crate::types::NetworkAclAssociation {
88        crate::types::NetworkAclAssociation {
89            network_acl_association_id: self.network_acl_association_id,
90            network_acl_id: self.network_acl_id,
91            subnet_id: self.subnet_id,
92        }
93    }
94}