// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateRuleInput {
/// <p>The identifier of the rule. This is the rule's Amazon Resource Name (ARN).</p>
pub rule_identifier: ::std::option::Option<::std::string::String>,
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub update_token: ::std::option::Option<::std::string::String>,
/// <p>The type of the rule. <code>CONFIGURATION</code> rules contain firewall settings, and <code>INSPECTION</code> rules contain rule groups.</p>
pub rule_type: ::std::option::Option<crate::types::RuleType>,
/// <p>A description of the rule.</p>
pub rule_description: ::std::option::Option<::std::string::String>,
/// <p>The firewall configuration for the rule, as a JSON document. The structure depends on the rule's firewall type and rule type. For an AWS WAF <code>INSPECTION</code> rule, provide an AWS WAF rule group. For an AWS WAF <code>CONFIGURATION</code> rule, provide a single web ACL setting, such as <code>DefaultAction</code> or <code>VisibilityConfig</code>; use <code>wafConfigDataType</code> to declare which setting the document contains. For the schema of each setting and complete examples, see <a href="https://docs.aws.amazon.com/network-security-manager/latest/devguide/what-is.html">Writing rule configurations</a> in the <i>AWS Network Security Manager Developer Guide</i>.</p>
pub configuration: ::std::option::Option<::aws_smithy_types::Document>,
/// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>).</p>
pub is_published: ::std::option::Option<bool>,
/// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
pub client_token: ::std::option::Option<::std::string::String>,
}
impl UpdateRuleInput {
/// <p>The identifier of the rule. This is the rule's Amazon Resource Name (ARN).</p>
pub fn rule_identifier(&self) -> ::std::option::Option<&str> {
self.rule_identifier.as_deref()
}
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub fn update_token(&self) -> ::std::option::Option<&str> {
self.update_token.as_deref()
}
/// <p>The type of the rule. <code>CONFIGURATION</code> rules contain firewall settings, and <code>INSPECTION</code> rules contain rule groups.</p>
pub fn rule_type(&self) -> ::std::option::Option<&crate::types::RuleType> {
self.rule_type.as_ref()
}
/// <p>A description of the rule.</p>
pub fn rule_description(&self) -> ::std::option::Option<&str> {
self.rule_description.as_deref()
}
/// <p>The firewall configuration for the rule, as a JSON document. The structure depends on the rule's firewall type and rule type. For an AWS WAF <code>INSPECTION</code> rule, provide an AWS WAF rule group. For an AWS WAF <code>CONFIGURATION</code> rule, provide a single web ACL setting, such as <code>DefaultAction</code> or <code>VisibilityConfig</code>; use <code>wafConfigDataType</code> to declare which setting the document contains. For the schema of each setting and complete examples, see <a href="https://docs.aws.amazon.com/network-security-manager/latest/devguide/what-is.html">Writing rule configurations</a> in the <i>AWS Network Security Manager Developer Guide</i>.</p>
pub fn configuration(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
self.configuration.as_ref()
}
/// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>).</p>
pub fn is_published(&self) -> ::std::option::Option<bool> {
self.is_published
}
/// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl UpdateRuleInput {
/// Creates a new builder-style object to manufacture [`UpdateRuleInput`](crate::operation::update_rule::UpdateRuleInput).
pub fn builder() -> crate::operation::update_rule::builders::UpdateRuleInputBuilder {
crate::operation::update_rule::builders::UpdateRuleInputBuilder::default()
}
}
/// A builder for [`UpdateRuleInput`](crate::operation::update_rule::UpdateRuleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateRuleInputBuilder {
pub(crate) rule_identifier: ::std::option::Option<::std::string::String>,
pub(crate) update_token: ::std::option::Option<::std::string::String>,
pub(crate) rule_type: ::std::option::Option<crate::types::RuleType>,
pub(crate) rule_description: ::std::option::Option<::std::string::String>,
pub(crate) configuration: ::std::option::Option<::aws_smithy_types::Document>,
pub(crate) is_published: ::std::option::Option<bool>,
pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl UpdateRuleInputBuilder {
/// <p>The identifier of the rule. This is the rule's Amazon Resource Name (ARN).</p>
/// This field is required.
pub fn rule_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rule_identifier = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the rule. This is the rule's Amazon Resource Name (ARN).</p>
pub fn set_rule_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rule_identifier = input;
self
}
/// <p>The identifier of the rule. This is the rule's Amazon Resource Name (ARN).</p>
pub fn get_rule_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.rule_identifier
}
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
/// This field is required.
pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.update_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.update_token = input;
self
}
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
&self.update_token
}
/// <p>The type of the rule. <code>CONFIGURATION</code> rules contain firewall settings, and <code>INSPECTION</code> rules contain rule groups.</p>
pub fn rule_type(mut self, input: crate::types::RuleType) -> Self {
self.rule_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of the rule. <code>CONFIGURATION</code> rules contain firewall settings, and <code>INSPECTION</code> rules contain rule groups.</p>
pub fn set_rule_type(mut self, input: ::std::option::Option<crate::types::RuleType>) -> Self {
self.rule_type = input;
self
}
/// <p>The type of the rule. <code>CONFIGURATION</code> rules contain firewall settings, and <code>INSPECTION</code> rules contain rule groups.</p>
pub fn get_rule_type(&self) -> &::std::option::Option<crate::types::RuleType> {
&self.rule_type
}
/// <p>A description of the rule.</p>
pub fn rule_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rule_description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the rule.</p>
pub fn set_rule_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rule_description = input;
self
}
/// <p>A description of the rule.</p>
pub fn get_rule_description(&self) -> &::std::option::Option<::std::string::String> {
&self.rule_description
}
/// <p>The firewall configuration for the rule, as a JSON document. The structure depends on the rule's firewall type and rule type. For an AWS WAF <code>INSPECTION</code> rule, provide an AWS WAF rule group. For an AWS WAF <code>CONFIGURATION</code> rule, provide a single web ACL setting, such as <code>DefaultAction</code> or <code>VisibilityConfig</code>; use <code>wafConfigDataType</code> to declare which setting the document contains. For the schema of each setting and complete examples, see <a href="https://docs.aws.amazon.com/network-security-manager/latest/devguide/what-is.html">Writing rule configurations</a> in the <i>AWS Network Security Manager Developer Guide</i>.</p>
pub fn configuration(mut self, input: ::aws_smithy_types::Document) -> Self {
self.configuration = ::std::option::Option::Some(input);
self
}
/// <p>The firewall configuration for the rule, as a JSON document. The structure depends on the rule's firewall type and rule type. For an AWS WAF <code>INSPECTION</code> rule, provide an AWS WAF rule group. For an AWS WAF <code>CONFIGURATION</code> rule, provide a single web ACL setting, such as <code>DefaultAction</code> or <code>VisibilityConfig</code>; use <code>wafConfigDataType</code> to declare which setting the document contains. For the schema of each setting and complete examples, see <a href="https://docs.aws.amazon.com/network-security-manager/latest/devguide/what-is.html">Writing rule configurations</a> in the <i>AWS Network Security Manager Developer Guide</i>.</p>
pub fn set_configuration(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.configuration = input;
self
}
/// <p>The firewall configuration for the rule, as a JSON document. The structure depends on the rule's firewall type and rule type. For an AWS WAF <code>INSPECTION</code> rule, provide an AWS WAF rule group. For an AWS WAF <code>CONFIGURATION</code> rule, provide a single web ACL setting, such as <code>DefaultAction</code> or <code>VisibilityConfig</code>; use <code>wafConfigDataType</code> to declare which setting the document contains. For the schema of each setting and complete examples, see <a href="https://docs.aws.amazon.com/network-security-manager/latest/devguide/what-is.html">Writing rule configurations</a> in the <i>AWS Network Security Manager Developer Guide</i>.</p>
pub fn get_configuration(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
&self.configuration
}
/// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>).</p>
/// This field is required.
pub fn is_published(mut self, input: bool) -> Self {
self.is_published = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>).</p>
pub fn set_is_published(mut self, input: ::std::option::Option<bool>) -> Self {
self.is_published = input;
self
}
/// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>).</p>
pub fn get_is_published(&self) -> &::std::option::Option<bool> {
&self.is_published
}
/// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// Consumes the builder and constructs a [`UpdateRuleInput`](crate::operation::update_rule::UpdateRuleInput).
pub fn build(self) -> ::std::result::Result<crate::operation::update_rule::UpdateRuleInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::update_rule::UpdateRuleInput {
rule_identifier: self.rule_identifier,
update_token: self.update_token,
rule_type: self.rule_type,
rule_description: self.rule_description,
configuration: self.configuration,
is_published: self.is_published,
client_token: self.client_token,
})
}
}