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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information for a single version of a managed rule set.</p><note>
/// <p>This is intended for use only by vendors of managed rule sets. Vendors are Amazon Web Services and Amazon Web Services Marketplace sellers.</p>
/// <p>Vendors, you can use the managed rule set APIs to provide controlled rollout of your versioned managed rule group offerings for your customers. The APIs are <code>ListManagedRuleSets</code>, <code>GetManagedRuleSet</code>, <code>PutManagedRuleSetVersions</code>, and <code>UpdateManagedRuleSetVersionExpiryDate</code>.</p>
/// </note>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ManagedRuleSetVersion {
    /// <p>The Amazon Resource Name (ARN) of the vendor rule group that's used to define the published version of your managed rule group.</p>
    pub associated_rule_group_arn: ::std::option::Option<::std::string::String>,
    /// <p>The web ACL capacity units (WCUs) required for this rule group.</p>
    /// <p>WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html">WAF web ACL capacity units (WCU)</a> in the <i>WAF Developer Guide</i>.</p>
    pub capacity: ::std::option::Option<i64>,
    /// <p>The amount of time you expect this version of your managed rule group to last, in days.</p>
    pub forecasted_lifetime: ::std::option::Option<i32>,
    /// <p>The time that you first published this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub publish_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The last time that you updated this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub last_update_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time that this version is set to expire.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub expiry_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl ManagedRuleSetVersion {
    /// <p>The Amazon Resource Name (ARN) of the vendor rule group that's used to define the published version of your managed rule group.</p>
    pub fn associated_rule_group_arn(&self) -> ::std::option::Option<&str> {
        self.associated_rule_group_arn.as_deref()
    }
    /// <p>The web ACL capacity units (WCUs) required for this rule group.</p>
    /// <p>WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html">WAF web ACL capacity units (WCU)</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn capacity(&self) -> ::std::option::Option<i64> {
        self.capacity
    }
    /// <p>The amount of time you expect this version of your managed rule group to last, in days.</p>
    pub fn forecasted_lifetime(&self) -> ::std::option::Option<i32> {
        self.forecasted_lifetime
    }
    /// <p>The time that you first published this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn publish_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.publish_timestamp.as_ref()
    }
    /// <p>The last time that you updated this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn last_update_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_update_timestamp.as_ref()
    }
    /// <p>The time that this version is set to expire.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn expiry_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.expiry_timestamp.as_ref()
    }
}
impl ManagedRuleSetVersion {
    /// Creates a new builder-style object to manufacture [`ManagedRuleSetVersion`](crate::types::ManagedRuleSetVersion).
    pub fn builder() -> crate::types::builders::ManagedRuleSetVersionBuilder {
        crate::types::builders::ManagedRuleSetVersionBuilder::default()
    }
}

/// A builder for [`ManagedRuleSetVersion`](crate::types::ManagedRuleSetVersion).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ManagedRuleSetVersionBuilder {
    pub(crate) associated_rule_group_arn: ::std::option::Option<::std::string::String>,
    pub(crate) capacity: ::std::option::Option<i64>,
    pub(crate) forecasted_lifetime: ::std::option::Option<i32>,
    pub(crate) publish_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_update_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) expiry_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl ManagedRuleSetVersionBuilder {
    /// <p>The Amazon Resource Name (ARN) of the vendor rule group that's used to define the published version of your managed rule group.</p>
    pub fn associated_rule_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.associated_rule_group_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the vendor rule group that's used to define the published version of your managed rule group.</p>
    pub fn set_associated_rule_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.associated_rule_group_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the vendor rule group that's used to define the published version of your managed rule group.</p>
    pub fn get_associated_rule_group_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.associated_rule_group_arn
    }
    /// <p>The web ACL capacity units (WCUs) required for this rule group.</p>
    /// <p>WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html">WAF web ACL capacity units (WCU)</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn capacity(mut self, input: i64) -> Self {
        self.capacity = ::std::option::Option::Some(input);
        self
    }
    /// <p>The web ACL capacity units (WCUs) required for this rule group.</p>
    /// <p>WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html">WAF web ACL capacity units (WCU)</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn set_capacity(mut self, input: ::std::option::Option<i64>) -> Self {
        self.capacity = input;
        self
    }
    /// <p>The web ACL capacity units (WCUs) required for this rule group.</p>
    /// <p>WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html">WAF web ACL capacity units (WCU)</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn get_capacity(&self) -> &::std::option::Option<i64> {
        &self.capacity
    }
    /// <p>The amount of time you expect this version of your managed rule group to last, in days.</p>
    pub fn forecasted_lifetime(mut self, input: i32) -> Self {
        self.forecasted_lifetime = ::std::option::Option::Some(input);
        self
    }
    /// <p>The amount of time you expect this version of your managed rule group to last, in days.</p>
    pub fn set_forecasted_lifetime(mut self, input: ::std::option::Option<i32>) -> Self {
        self.forecasted_lifetime = input;
        self
    }
    /// <p>The amount of time you expect this version of your managed rule group to last, in days.</p>
    pub fn get_forecasted_lifetime(&self) -> &::std::option::Option<i32> {
        &self.forecasted_lifetime
    }
    /// <p>The time that you first published this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn publish_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.publish_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time that you first published this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn set_publish_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.publish_timestamp = input;
        self
    }
    /// <p>The time that you first published this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn get_publish_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.publish_timestamp
    }
    /// <p>The last time that you updated this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn last_update_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_update_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The last time that you updated this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn set_last_update_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_update_timestamp = input;
        self
    }
    /// <p>The last time that you updated this version.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn get_last_update_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_update_timestamp
    }
    /// <p>The time that this version is set to expire.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn expiry_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.expiry_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time that this version is set to expire.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn set_expiry_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.expiry_timestamp = input;
        self
    }
    /// <p>The time that this version is set to expire.</p>
    /// <p>Times are in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z. For example, "2016-09-27T14:50Z".</p>
    pub fn get_expiry_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.expiry_timestamp
    }
    /// Consumes the builder and constructs a [`ManagedRuleSetVersion`](crate::types::ManagedRuleSetVersion).
    pub fn build(self) -> crate::types::ManagedRuleSetVersion {
        crate::types::ManagedRuleSetVersion {
            associated_rule_group_arn: self.associated_rule_group_arn,
            capacity: self.capacity,
            forecasted_lifetime: self.forecasted_lifetime,
            publish_timestamp: self.publish_timestamp,
            last_update_timestamp: self.last_update_timestamp,
            expiry_timestamp: self.expiry_timestamp,
        }
    }
}