Skip to main content

aws_sdk_networkfirewall/types/
_firewall_policy_metadata.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>High-level information about a firewall policy, returned by operations like create and describe. You can use the information provided in the metadata to retrieve and manage a firewall policy. You can retrieve all objects for a firewall policy by calling <code>DescribeFirewallPolicy</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct FirewallPolicyMetadata {
7    /// <p>The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>The Amazon Resource Name (ARN) of the firewall policy.</p>
10    pub arn: ::std::option::Option<::std::string::String>,
11}
12impl FirewallPolicyMetadata {
13    /// <p>The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.</p>
14    pub fn name(&self) -> ::std::option::Option<&str> {
15        self.name.as_deref()
16    }
17    /// <p>The Amazon Resource Name (ARN) of the firewall policy.</p>
18    pub fn arn(&self) -> ::std::option::Option<&str> {
19        self.arn.as_deref()
20    }
21}
22impl FirewallPolicyMetadata {
23    /// Creates a new builder-style object to manufacture [`FirewallPolicyMetadata`](crate::types::FirewallPolicyMetadata).
24    pub fn builder() -> crate::types::builders::FirewallPolicyMetadataBuilder {
25        crate::types::builders::FirewallPolicyMetadataBuilder::default()
26    }
27}
28
29/// A builder for [`FirewallPolicyMetadata`](crate::types::FirewallPolicyMetadata).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct FirewallPolicyMetadataBuilder {
33    pub(crate) name: ::std::option::Option<::std::string::String>,
34    pub(crate) arn: ::std::option::Option<::std::string::String>,
35}
36impl FirewallPolicyMetadataBuilder {
37    /// <p>The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.</p>
38    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.</p>
43    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.name = input;
45        self
46    }
47    /// <p>The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.</p>
48    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.name
50    }
51    /// <p>The Amazon Resource Name (ARN) of the firewall policy.</p>
52    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.arn = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The Amazon Resource Name (ARN) of the firewall policy.</p>
57    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.arn = input;
59        self
60    }
61    /// <p>The Amazon Resource Name (ARN) of the firewall policy.</p>
62    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
63        &self.arn
64    }
65    /// Consumes the builder and constructs a [`FirewallPolicyMetadata`](crate::types::FirewallPolicyMetadata).
66    pub fn build(self) -> crate::types::FirewallPolicyMetadata {
67        crate::types::FirewallPolicyMetadata {
68            name: self.name,
69            arn: self.arn,
70        }
71    }
72}