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.
pub use crate::operation::generate_rule_configuration::_generate_rule_configuration_input::GenerateRuleConfigurationInputBuilder;

pub use crate::operation::generate_rule_configuration::_generate_rule_configuration_output::GenerateRuleConfigurationOutputBuilder;

impl crate::operation::generate_rule_configuration::builders::GenerateRuleConfigurationInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::generate_rule_configuration::GenerateRuleConfigurationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::generate_rule_configuration::GenerateRuleConfigurationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.generate_rule_configuration();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GenerateRuleConfiguration`.
///
/// <p>Generates a rule configuration from a natural-language description. Provide a prompt along with the rule's firewall type and rule type. The service returns a configuration that you can use when you create or update a rule. If you also provide an existing configuration, the service edits that configuration instead of generating a new one.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GenerateRuleConfigurationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::generate_rule_configuration::builders::GenerateRuleConfigurationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::generate_rule_configuration::GenerateRuleConfigurationOutput,
        crate::operation::generate_rule_configuration::GenerateRuleConfigurationError,
    > for GenerateRuleConfigurationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::generate_rule_configuration::GenerateRuleConfigurationOutput,
            crate::operation::generate_rule_configuration::GenerateRuleConfigurationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GenerateRuleConfigurationFluentBuilder {
    /// Creates a new `GenerateRuleConfigurationFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the GenerateRuleConfiguration as a reference.
    pub fn as_input(&self) -> &crate::operation::generate_rule_configuration::builders::GenerateRuleConfigurationInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::generate_rule_configuration::GenerateRuleConfigurationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::generate_rule_configuration::GenerateRuleConfigurationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::generate_rule_configuration::GenerateRuleConfiguration::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::generate_rule_configuration::GenerateRuleConfiguration::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::generate_rule_configuration::GenerateRuleConfigurationOutput,
        crate::operation::generate_rule_configuration::GenerateRuleConfigurationError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>A natural-language description of the configuration that you want to generate.</p>
    pub fn prompt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.prompt(input.into());
        self
    }
    /// <p>A natural-language description of the configuration that you want to generate.</p>
    pub fn set_prompt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_prompt(input);
        self
    }
    /// <p>A natural-language description of the configuration that you want to generate.</p>
    pub fn get_prompt(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_prompt()
    }
    /// <p>The firewall type of the rule.</p>
    pub fn rule_firewall_type(mut self, input: crate::types::RuleFirewallType) -> Self {
        self.inner = self.inner.rule_firewall_type(input);
        self
    }
    /// <p>The firewall type of the rule.</p>
    pub fn set_rule_firewall_type(mut self, input: ::std::option::Option<crate::types::RuleFirewallType>) -> Self {
        self.inner = self.inner.set_rule_firewall_type(input);
        self
    }
    /// <p>The firewall type of the rule.</p>
    pub fn get_rule_firewall_type(&self) -> &::std::option::Option<crate::types::RuleFirewallType> {
        self.inner.get_rule_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.inner = self.inner.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 set_rule_type(mut self, input: ::std::option::Option<crate::types::RuleType>) -> Self {
        self.inner = self.inner.set_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.inner.get_rule_type()
    }
    /// <p>For AWS WAF configuration rules, the specific AWS WAF configuration variant to generate. This is optional; if you omit it, the service selects the variant.</p>
    pub fn waf_config_data_type(mut self, input: crate::types::WafConfigDataType) -> Self {
        self.inner = self.inner.waf_config_data_type(input);
        self
    }
    /// <p>For AWS WAF configuration rules, the specific AWS WAF configuration variant to generate. This is optional; if you omit it, the service selects the variant.</p>
    pub fn set_waf_config_data_type(mut self, input: ::std::option::Option<crate::types::WafConfigDataType>) -> Self {
        self.inner = self.inner.set_waf_config_data_type(input);
        self
    }
    /// <p>For AWS WAF configuration rules, the specific AWS WAF configuration variant to generate. This is optional; if you omit it, the service selects the variant.</p>
    pub fn get_waf_config_data_type(&self) -> &::std::option::Option<crate::types::WafConfigDataType> {
        self.inner.get_waf_config_data_type()
    }
    /// <p>An existing configuration to edit, as a JSON string. When you provide this value, the operation edits the configuration. When you omit it, the operation generates a new configuration.</p>
    pub fn current_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.current_configuration(input.into());
        self
    }
    /// <p>An existing configuration to edit, as a JSON string. When you provide this value, the operation edits the configuration. When you omit it, the operation generates a new configuration.</p>
    pub fn set_current_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_current_configuration(input);
        self
    }
    /// <p>An existing configuration to edit, as a JSON string. When you provide this value, the operation edits the configuration. When you omit it, the operation generates a new configuration.</p>
    pub fn get_current_configuration(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_current_configuration()
    }
    /// <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.inner = self.inner.client_token(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.inner = self.inner.set_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.inner.get_client_token()
    }
}