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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <note>
/// <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p>
/// <p><b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use.</p>
/// </note>
/// <p>Contains the identifier and the name of the <code>IPSet</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct IpSetSummary {
/// <p>The <code>IPSetId</code> for an <code>IPSet</code>. You can use <code>IPSetId</code> in a <code>GetIPSet</code> request to get detailed information about an <code>IPSet</code>.</p>
pub ip_set_id: ::std::string::String,
/// <p>A friendly name or description of the <code>IPSet</code>. You can't change the name of an <code>IPSet</code> after you create it.</p>
pub name: ::std::string::String,
}
impl IpSetSummary {
/// <p>The <code>IPSetId</code> for an <code>IPSet</code>. You can use <code>IPSetId</code> in a <code>GetIPSet</code> request to get detailed information about an <code>IPSet</code>.</p>
pub fn ip_set_id(&self) -> &str {
use std::ops::Deref;
self.ip_set_id.deref()
}
/// <p>A friendly name or description of the <code>IPSet</code>. You can't change the name of an <code>IPSet</code> after you create it.</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
}
impl IpSetSummary {
/// Creates a new builder-style object to manufacture [`IpSetSummary`](crate::types::IpSetSummary).
pub fn builder() -> crate::types::builders::IpSetSummaryBuilder {
crate::types::builders::IpSetSummaryBuilder::default()
}
}
/// A builder for [`IpSetSummary`](crate::types::IpSetSummary).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct IpSetSummaryBuilder {
pub(crate) ip_set_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
}
impl IpSetSummaryBuilder {
/// <p>The <code>IPSetId</code> for an <code>IPSet</code>. You can use <code>IPSetId</code> in a <code>GetIPSet</code> request to get detailed information about an <code>IPSet</code>.</p>
/// This field is required.
pub fn ip_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.ip_set_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The <code>IPSetId</code> for an <code>IPSet</code>. You can use <code>IPSetId</code> in a <code>GetIPSet</code> request to get detailed information about an <code>IPSet</code>.</p>
pub fn set_ip_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.ip_set_id = input;
self
}
/// <p>The <code>IPSetId</code> for an <code>IPSet</code>. You can use <code>IPSetId</code> in a <code>GetIPSet</code> request to get detailed information about an <code>IPSet</code>.</p>
pub fn get_ip_set_id(&self) -> &::std::option::Option<::std::string::String> {
&self.ip_set_id
}
/// <p>A friendly name or description of the <code>IPSet</code>. You can't change the name of an <code>IPSet</code> after you create it.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>A friendly name or description of the <code>IPSet</code>. You can't change the name of an <code>IPSet</code> after you create it.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>A friendly name or description of the <code>IPSet</code>. You can't change the name of an <code>IPSet</code> after you create it.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Consumes the builder and constructs a [`IpSetSummary`](crate::types::IpSetSummary).
/// This method will fail if any of the following fields are not set:
/// - [`ip_set_id`](crate::types::builders::IpSetSummaryBuilder::ip_set_id)
/// - [`name`](crate::types::builders::IpSetSummaryBuilder::name)
pub fn build(self) -> ::std::result::Result<crate::types::IpSetSummary, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::IpSetSummary {
ip_set_id: self.ip_set_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"ip_set_id",
"ip_set_id was not specified but it is required when building IpSetSummary",
)
})?,
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building IpSetSummary",
)
})?,
})
}
}