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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A set of rules that is managed by Amazon Web Services and Amazon Web Services Marketplace sellers to provide versioned managed rule groups for customers of WAF.</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 ManagedRuleSet {
/// <p>The name of the managed rule set. You use this, along with the rule set ID, to identify the rule set.</p>
/// <p>This name is assigned to the corresponding managed rule group, which your customers can access and use.</p>
pub name: ::std::string::String,
/// <p>A unique identifier for the managed rule set. The ID is returned in the responses to commands like <code>list</code>. You provide it to operations like <code>get</code> and <code>update</code>.</p>
pub id: ::std::string::String,
/// <p>The Amazon Resource Name (ARN) of the entity.</p>
pub arn: ::std::string::String,
/// <p>A description of the set that helps with identification.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The versions of this managed rule set that are available for use by customers.</p>
pub published_versions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ManagedRuleSetVersion>>,
/// <p>The version that you would like your customers to use.</p>
pub recommended_version: ::std::option::Option<::std::string::String>,
/// <p>The label namespace prefix for the managed rule groups that are offered to customers from this managed rule set. All labels that are added by rules in the managed rule group have this prefix.</p>
/// <ul>
/// <li>
/// <p>The syntax for the label namespace prefix for a managed rule group is the following:</p>
/// <p><code>awswaf:managed:<vendor>
/// :
/// <rule group name></rule>
/// </vendor></code>:</p></li>
/// <li>
/// <p>When a rule with a label matches a web request, WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon:</p>
/// <p><code><label namespace>:<label from rule></label></label></code></p></li>
/// </ul>
pub label_namespace: ::std::option::Option<::std::string::String>,
}
impl ManagedRuleSet {
/// <p>The name of the managed rule set. You use this, along with the rule set ID, to identify the rule set.</p>
/// <p>This name is assigned to the corresponding managed rule group, which your customers can access and use.</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
/// <p>A unique identifier for the managed rule set. The ID is returned in the responses to commands like <code>list</code>. You provide it to operations like <code>get</code> and <code>update</code>.</p>
pub fn id(&self) -> &str {
use std::ops::Deref;
self.id.deref()
}
/// <p>The Amazon Resource Name (ARN) of the entity.</p>
pub fn arn(&self) -> &str {
use std::ops::Deref;
self.arn.deref()
}
/// <p>A description of the set that helps with identification.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The versions of this managed rule set that are available for use by customers.</p>
pub fn published_versions(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ManagedRuleSetVersion>> {
self.published_versions.as_ref()
}
/// <p>The version that you would like your customers to use.</p>
pub fn recommended_version(&self) -> ::std::option::Option<&str> {
self.recommended_version.as_deref()
}
/// <p>The label namespace prefix for the managed rule groups that are offered to customers from this managed rule set. All labels that are added by rules in the managed rule group have this prefix.</p>
/// <ul>
/// <li>
/// <p>The syntax for the label namespace prefix for a managed rule group is the following:</p>
/// <p><code>awswaf:managed:<vendor>
/// :
/// <rule group name></rule>
/// </vendor></code>:</p></li>
/// <li>
/// <p>When a rule with a label matches a web request, WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon:</p>
/// <p><code><label namespace>:<label from rule></label></label></code></p></li>
/// </ul>
pub fn label_namespace(&self) -> ::std::option::Option<&str> {
self.label_namespace.as_deref()
}
}
impl ManagedRuleSet {
/// Creates a new builder-style object to manufacture [`ManagedRuleSet`](crate::types::ManagedRuleSet).
pub fn builder() -> crate::types::builders::ManagedRuleSetBuilder {
crate::types::builders::ManagedRuleSetBuilder::default()
}
}
/// A builder for [`ManagedRuleSet`](crate::types::ManagedRuleSet).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ManagedRuleSetBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) published_versions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ManagedRuleSetVersion>>,
pub(crate) recommended_version: ::std::option::Option<::std::string::String>,
pub(crate) label_namespace: ::std::option::Option<::std::string::String>,
}
impl ManagedRuleSetBuilder {
/// <p>The name of the managed rule set. You use this, along with the rule set ID, to identify the rule set.</p>
/// <p>This name is assigned to the corresponding managed rule group, which your customers can access and use.</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>The name of the managed rule set. You use this, along with the rule set ID, to identify the rule set.</p>
/// <p>This name is assigned to the corresponding managed rule group, which your customers can access and use.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the managed rule set. You use this, along with the rule set ID, to identify the rule set.</p>
/// <p>This name is assigned to the corresponding managed rule group, which your customers can access and use.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>A unique identifier for the managed rule set. The ID is returned in the responses to commands like <code>list</code>. You provide it to operations like <code>get</code> and <code>update</code>.</p>
/// This field is required.
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique identifier for the managed rule set. The ID is returned in the responses to commands like <code>list</code>. You provide it to operations like <code>get</code> and <code>update</code>.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>A unique identifier for the managed rule set. The ID is returned in the responses to commands like <code>list</code>. You provide it to operations like <code>get</code> and <code>update</code>.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The Amazon Resource Name (ARN) of the entity.</p>
/// This field is required.
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the entity.</p>
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the entity.</p>
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
/// <p>A description of the set that helps with identification.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the set that helps with identification.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>A description of the set that helps with identification.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// Adds a key-value pair to `published_versions`.
///
/// To override the contents of this collection use [`set_published_versions`](Self::set_published_versions).
///
/// <p>The versions of this managed rule set that are available for use by customers.</p>
pub fn published_versions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ManagedRuleSetVersion) -> Self {
let mut hash_map = self.published_versions.unwrap_or_default();
hash_map.insert(k.into(), v);
self.published_versions = ::std::option::Option::Some(hash_map);
self
}
/// <p>The versions of this managed rule set that are available for use by customers.</p>
pub fn set_published_versions(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ManagedRuleSetVersion>>,
) -> Self {
self.published_versions = input;
self
}
/// <p>The versions of this managed rule set that are available for use by customers.</p>
pub fn get_published_versions(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ManagedRuleSetVersion>> {
&self.published_versions
}
/// <p>The version that you would like your customers to use.</p>
pub fn recommended_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.recommended_version = ::std::option::Option::Some(input.into());
self
}
/// <p>The version that you would like your customers to use.</p>
pub fn set_recommended_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.recommended_version = input;
self
}
/// <p>The version that you would like your customers to use.</p>
pub fn get_recommended_version(&self) -> &::std::option::Option<::std::string::String> {
&self.recommended_version
}
/// <p>The label namespace prefix for the managed rule groups that are offered to customers from this managed rule set. All labels that are added by rules in the managed rule group have this prefix.</p>
/// <ul>
/// <li>
/// <p>The syntax for the label namespace prefix for a managed rule group is the following:</p>
/// <p><code>awswaf:managed:<vendor>
/// :
/// <rule group name></rule>
/// </vendor></code>:</p></li>
/// <li>
/// <p>When a rule with a label matches a web request, WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon:</p>
/// <p><code><label namespace>:<label from rule></label></label></code></p></li>
/// </ul>
pub fn label_namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.label_namespace = ::std::option::Option::Some(input.into());
self
}
/// <p>The label namespace prefix for the managed rule groups that are offered to customers from this managed rule set. All labels that are added by rules in the managed rule group have this prefix.</p>
/// <ul>
/// <li>
/// <p>The syntax for the label namespace prefix for a managed rule group is the following:</p>
/// <p><code>awswaf:managed:<vendor>
/// :
/// <rule group name></rule>
/// </vendor></code>:</p></li>
/// <li>
/// <p>When a rule with a label matches a web request, WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon:</p>
/// <p><code><label namespace>:<label from rule></label></label></code></p></li>
/// </ul>
pub fn set_label_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.label_namespace = input;
self
}
/// <p>The label namespace prefix for the managed rule groups that are offered to customers from this managed rule set. All labels that are added by rules in the managed rule group have this prefix.</p>
/// <ul>
/// <li>
/// <p>The syntax for the label namespace prefix for a managed rule group is the following:</p>
/// <p><code>awswaf:managed:<vendor>
/// :
/// <rule group name></rule>
/// </vendor></code>:</p></li>
/// <li>
/// <p>When a rule with a label matches a web request, WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon:</p>
/// <p><code><label namespace>:<label from rule></label></label></code></p></li>
/// </ul>
pub fn get_label_namespace(&self) -> &::std::option::Option<::std::string::String> {
&self.label_namespace
}
/// Consumes the builder and constructs a [`ManagedRuleSet`](crate::types::ManagedRuleSet).
/// This method will fail if any of the following fields are not set:
/// - [`name`](crate::types::builders::ManagedRuleSetBuilder::name)
/// - [`id`](crate::types::builders::ManagedRuleSetBuilder::id)
/// - [`arn`](crate::types::builders::ManagedRuleSetBuilder::arn)
pub fn build(self) -> ::std::result::Result<crate::types::ManagedRuleSet, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::ManagedRuleSet {
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 ManagedRuleSet",
)
})?,
id: self.id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"id",
"id was not specified but it is required when building ManagedRuleSet",
)
})?,
arn: self.arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"arn",
"arn was not specified but it is required when building ManagedRuleSet",
)
})?,
description: self.description,
published_versions: self.published_versions,
recommended_version: self.recommended_version,
label_namespace: self.label_namespace,
})
}
}