aws_sdk_wafv2/operation/check_capacity/
_check_capacity_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CheckCapacityInput {
6    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
7    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
8    /// <ul>
9    /// <li>
10    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
11    /// <li>
12    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
13    /// </ul>
14    pub scope: ::std::option::Option<crate::types::Scope>,
15    /// <p>An array of <code>Rule</code> that you're configuring to use in a rule group or web ACL.</p>
16    pub rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
17}
18impl CheckCapacityInput {
19    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
20    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
21    /// <ul>
22    /// <li>
23    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
24    /// <li>
25    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
26    /// </ul>
27    pub fn scope(&self) -> ::std::option::Option<&crate::types::Scope> {
28        self.scope.as_ref()
29    }
30    /// <p>An array of <code>Rule</code> that you're configuring to use in a rule group or web ACL.</p>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.rules.is_none()`.
33    pub fn rules(&self) -> &[crate::types::Rule] {
34        self.rules.as_deref().unwrap_or_default()
35    }
36}
37impl CheckCapacityInput {
38    /// Creates a new builder-style object to manufacture [`CheckCapacityInput`](crate::operation::check_capacity::CheckCapacityInput).
39    pub fn builder() -> crate::operation::check_capacity::builders::CheckCapacityInputBuilder {
40        crate::operation::check_capacity::builders::CheckCapacityInputBuilder::default()
41    }
42}
43
44/// A builder for [`CheckCapacityInput`](crate::operation::check_capacity::CheckCapacityInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct CheckCapacityInputBuilder {
48    pub(crate) scope: ::std::option::Option<crate::types::Scope>,
49    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
50}
51impl CheckCapacityInputBuilder {
52    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
53    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
54    /// <ul>
55    /// <li>
56    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
57    /// <li>
58    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
59    /// </ul>
60    /// This field is required.
61    pub fn scope(mut self, input: crate::types::Scope) -> Self {
62        self.scope = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
66    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
67    /// <ul>
68    /// <li>
69    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
70    /// <li>
71    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
72    /// </ul>
73    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
74        self.scope = input;
75        self
76    }
77    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
78    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
79    /// <ul>
80    /// <li>
81    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
82    /// <li>
83    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
84    /// </ul>
85    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
86        &self.scope
87    }
88    /// Appends an item to `rules`.
89    ///
90    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
91    ///
92    /// <p>An array of <code>Rule</code> that you're configuring to use in a rule group or web ACL.</p>
93    pub fn rules(mut self, input: crate::types::Rule) -> Self {
94        let mut v = self.rules.unwrap_or_default();
95        v.push(input);
96        self.rules = ::std::option::Option::Some(v);
97        self
98    }
99    /// <p>An array of <code>Rule</code> that you're configuring to use in a rule group or web ACL.</p>
100    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>) -> Self {
101        self.rules = input;
102        self
103    }
104    /// <p>An array of <code>Rule</code> that you're configuring to use in a rule group or web ACL.</p>
105    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
106        &self.rules
107    }
108    /// Consumes the builder and constructs a [`CheckCapacityInput`](crate::operation::check_capacity::CheckCapacityInput).
109    pub fn build(
110        self,
111    ) -> ::std::result::Result<crate::operation::check_capacity::CheckCapacityInput, ::aws_smithy_types::error::operation::BuildError> {
112        ::std::result::Result::Ok(crate::operation::check_capacity::CheckCapacityInput {
113            scope: self.scope,
114            rules: self.rules,
115        })
116    }
117}