aws-sdk-networksecuritymanager 1.2.0

AWS SDK for AWS Network Security Manager Customer API
Documentation
// 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 GetRuleOutput {
    /// <p>The service-generated id of the rule.</p>
    pub rule_id: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
    pub rule_arn: ::std::string::String,
    /// <p>The name of the rule.</p>
    pub rule_name: ::std::string::String,
    /// <p>The firewall type associated with the resource.</p>
    pub firewall_type: crate::types::RuleFirewallType,
    /// <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.</p>
    pub configuration: ::aws_smithy_types::Document,
    /// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
    pub status: crate::types::EntityStatus,
    /// <p>The version of the resource.</p>
    pub version: ::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>Specifies whether the resource is a snapshot of a published version.</p>
    pub is_snapshot: ::std::option::Option<bool>,
    /// <p>Specifies whether a published version of the resource exists.</p>
    pub has_published_version: ::std::option::Option<bool>,
    /// <p>The time when the resource was last updated.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetRuleOutput {
    /// <p>The service-generated id of the rule.</p>
    pub fn rule_id(&self) -> &str {
        use std::ops::Deref;
        self.rule_id.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
    pub fn rule_arn(&self) -> &str {
        use std::ops::Deref;
        self.rule_arn.deref()
    }
    /// <p>The name of the rule.</p>
    pub fn rule_name(&self) -> &str {
        use std::ops::Deref;
        self.rule_name.deref()
    }
    /// <p>The firewall type associated with the resource.</p>
    pub fn firewall_type(&self) -> &crate::types::RuleFirewallType {
        &self.firewall_type
    }
    /// <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.</p>
    pub fn configuration(&self) -> &::aws_smithy_types::Document {
        &self.configuration
    }
    /// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
    pub fn status(&self) -> &crate::types::EntityStatus {
        &self.status
    }
    /// <p>The version of the resource.</p>
    pub fn version(&self) -> &str {
        use std::ops::Deref;
        self.version.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>Specifies whether the resource is a snapshot of a published version.</p>
    pub fn is_snapshot(&self) -> ::std::option::Option<bool> {
        self.is_snapshot
    }
    /// <p>Specifies whether a published version of the resource exists.</p>
    pub fn has_published_version(&self) -> ::std::option::Option<bool> {
        self.has_published_version
    }
    /// <p>The time when the resource was last updated.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetRuleOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetRuleOutput {
    /// Creates a new builder-style object to manufacture [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
    pub fn builder() -> crate::operation::get_rule::builders::GetRuleOutputBuilder {
        crate::operation::get_rule::builders::GetRuleOutputBuilder::default()
    }
}

/// A builder for [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRuleOutputBuilder {
    pub(crate) rule_id: ::std::option::Option<::std::string::String>,
    pub(crate) rule_arn: ::std::option::Option<::std::string::String>,
    pub(crate) rule_name: ::std::option::Option<::std::string::String>,
    pub(crate) firewall_type: ::std::option::Option<crate::types::RuleFirewallType>,
    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) status: ::std::option::Option<crate::types::EntityStatus>,
    pub(crate) version: ::std::option::Option<::std::string::String>,
    pub(crate) update_token: ::std::option::Option<::std::string::String>,
    pub(crate) is_snapshot: ::std::option::Option<bool>,
    pub(crate) has_published_version: ::std::option::Option<bool>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetRuleOutputBuilder {
    /// <p>The service-generated id of the rule.</p>
    /// This field is required.
    pub fn rule_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The service-generated id of the rule.</p>
    pub fn set_rule_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_id = input;
        self
    }
    /// <p>The service-generated id of the rule.</p>
    pub fn get_rule_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_id
    }
    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
    /// This field is required.
    pub fn rule_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
    pub fn set_rule_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
    pub fn get_rule_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_arn
    }
    /// <p>The name of the rule.</p>
    /// This field is required.
    pub fn rule_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the rule.</p>
    pub fn set_rule_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_name = input;
        self
    }
    /// <p>The name of the rule.</p>
    pub fn get_rule_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_name
    }
    /// <p>The firewall type associated with the resource.</p>
    /// This field is required.
    pub fn firewall_type(mut self, input: crate::types::RuleFirewallType) -> Self {
        self.firewall_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The firewall type associated with the resource.</p>
    pub fn set_firewall_type(mut self, input: ::std::option::Option<crate::types::RuleFirewallType>) -> Self {
        self.firewall_type = input;
        self
    }
    /// <p>The firewall type associated with the resource.</p>
    pub fn get_firewall_type(&self) -> &::std::option::Option<crate::types::RuleFirewallType> {
        &self.firewall_type
    }
    /// <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.</p>
    /// This field is required.
    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.</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.</p>
    pub fn get_configuration(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.configuration
    }
    /// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::EntityStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::EntityStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::EntityStatus> {
        &self.status
    }
    /// <p>The version of the resource.</p>
    /// This field is required.
    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the resource.</p>
    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.version = input;
        self
    }
    /// <p>The version of the resource.</p>
    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.version
    }
    /// <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(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>Specifies whether the resource is a snapshot of a published version.</p>
    pub fn is_snapshot(mut self, input: bool) -> Self {
        self.is_snapshot = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether the resource is a snapshot of a published version.</p>
    pub fn set_is_snapshot(mut self, input: ::std::option::Option<bool>) -> Self {
        self.is_snapshot = input;
        self
    }
    /// <p>Specifies whether the resource is a snapshot of a published version.</p>
    pub fn get_is_snapshot(&self) -> &::std::option::Option<bool> {
        &self.is_snapshot
    }
    /// <p>Specifies whether a published version of the resource exists.</p>
    pub fn has_published_version(mut self, input: bool) -> Self {
        self.has_published_version = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether a published version of the resource exists.</p>
    pub fn set_has_published_version(mut self, input: ::std::option::Option<bool>) -> Self {
        self.has_published_version = input;
        self
    }
    /// <p>Specifies whether a published version of the resource exists.</p>
    pub fn get_has_published_version(&self) -> &::std::option::Option<bool> {
        &self.has_published_version
    }
    /// <p>The time when the resource was last updated.</p>
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the resource was last updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The time when the resource was last updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`rule_id`](crate::operation::get_rule::builders::GetRuleOutputBuilder::rule_id)
    /// - [`rule_arn`](crate::operation::get_rule::builders::GetRuleOutputBuilder::rule_arn)
    /// - [`rule_name`](crate::operation::get_rule::builders::GetRuleOutputBuilder::rule_name)
    /// - [`firewall_type`](crate::operation::get_rule::builders::GetRuleOutputBuilder::firewall_type)
    /// - [`configuration`](crate::operation::get_rule::builders::GetRuleOutputBuilder::configuration)
    /// - [`status`](crate::operation::get_rule::builders::GetRuleOutputBuilder::status)
    /// - [`version`](crate::operation::get_rule::builders::GetRuleOutputBuilder::version)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_rule::GetRuleOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_rule::GetRuleOutput {
            rule_id: self.rule_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "rule_id",
                    "rule_id was not specified but it is required when building GetRuleOutput",
                )
            })?,
            rule_arn: self.rule_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "rule_arn",
                    "rule_arn was not specified but it is required when building GetRuleOutput",
                )
            })?,
            rule_name: self.rule_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "rule_name",
                    "rule_name was not specified but it is required when building GetRuleOutput",
                )
            })?,
            firewall_type: self.firewall_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "firewall_type",
                    "firewall_type was not specified but it is required when building GetRuleOutput",
                )
            })?,
            rule_type: self.rule_type,
            rule_description: self.rule_description,
            configuration: self.configuration.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "configuration",
                    "configuration was not specified but it is required when building GetRuleOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetRuleOutput",
                )
            })?,
            version: self.version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "version",
                    "version was not specified but it is required when building GetRuleOutput",
                )
            })?,
            update_token: self.update_token,
            is_snapshot: self.is_snapshot,
            has_published_version: self.has_published_version,
            updated_at: self.updated_at,
            _request_id: self._request_id,
        })
    }
}