aws-sdk-computeoptimizerautomation 1.9.0

AWS SDK for Compute Optimizer Automation
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_automation_rule::_create_automation_rule_input::CreateAutomationRuleInputBuilder;

pub use crate::operation::create_automation_rule::_create_automation_rule_output::CreateAutomationRuleOutputBuilder;

impl crate::operation::create_automation_rule::builders::CreateAutomationRuleInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_automation_rule::CreateAutomationRuleOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_automation_rule::CreateAutomationRuleError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_automation_rule();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateAutomationRule`.
///
/// <p>Creates a new automation rule to apply recommended actions to resources based on specified criteria.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateAutomationRuleFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_automation_rule::builders::CreateAutomationRuleInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_automation_rule::CreateAutomationRuleOutput,
        crate::operation::create_automation_rule::CreateAutomationRuleError,
    > for CreateAutomationRuleFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_automation_rule::CreateAutomationRuleOutput,
            crate::operation::create_automation_rule::CreateAutomationRuleError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateAutomationRuleFluentBuilder {
    /// Creates a new `CreateAutomationRuleFluentBuilder`.
    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 CreateAutomationRule as a reference.
    pub fn as_input(&self) -> &crate::operation::create_automation_rule::builders::CreateAutomationRuleInputBuilder {
        &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::create_automation_rule::CreateAutomationRuleOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_automation_rule::CreateAutomationRuleError,
            ::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::create_automation_rule::CreateAutomationRule::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_automation_rule::CreateAutomationRule::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::create_automation_rule::CreateAutomationRuleOutput,
        crate::operation::create_automation_rule::CreateAutomationRuleError,
        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>The name of the automation rule.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>The name of the automation rule.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>The name of the automation rule.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>A description of the automation rule.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A description of the automation rule.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A description of the automation rule.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The type of rule.</p><note>
    /// <p>Only the management account or a delegated administrator can set the ruleType to be OrganizationRule.</p>
    /// </note>
    pub fn rule_type(mut self, input: crate::types::RuleType) -> Self {
        self.inner = self.inner.rule_type(input);
        self
    }
    /// <p>The type of rule.</p><note>
    /// <p>Only the management account or a delegated administrator can set the ruleType to be OrganizationRule.</p>
    /// </note>
    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 rule.</p><note>
    /// <p>Only the management account or a delegated administrator can set the ruleType to be OrganizationRule.</p>
    /// </note>
    pub fn get_rule_type(&self) -> &::std::option::Option<crate::types::RuleType> {
        self.inner.get_rule_type()
    }
    /// <p>Configuration for organization-level rules. Required for OrganizationRule type.</p>
    pub fn organization_configuration(mut self, input: crate::types::OrganizationConfiguration) -> Self {
        self.inner = self.inner.organization_configuration(input);
        self
    }
    /// <p>Configuration for organization-level rules. Required for OrganizationRule type.</p>
    pub fn set_organization_configuration(mut self, input: ::std::option::Option<crate::types::OrganizationConfiguration>) -> Self {
        self.inner = self.inner.set_organization_configuration(input);
        self
    }
    /// <p>Configuration for organization-level rules. Required for OrganizationRule type.</p>
    pub fn get_organization_configuration(&self) -> &::std::option::Option<crate::types::OrganizationConfiguration> {
        self.inner.get_organization_configuration()
    }
    /// <p>A string representation of a decimal number between 0 and 1 (having up to 30 digits after the decimal point) that determines the priority of the rule. When multiple rules match the same recommended action, Compute Optimizer assigns the action to the rule with the lowest priority value (highest priority), even if that rule is scheduled to run later than other matching rules.</p>
    pub fn priority(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.priority(input.into());
        self
    }
    /// <p>A string representation of a decimal number between 0 and 1 (having up to 30 digits after the decimal point) that determines the priority of the rule. When multiple rules match the same recommended action, Compute Optimizer assigns the action to the rule with the lowest priority value (highest priority), even if that rule is scheduled to run later than other matching rules.</p>
    pub fn set_priority(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_priority(input);
        self
    }
    /// <p>A string representation of a decimal number between 0 and 1 (having up to 30 digits after the decimal point) that determines the priority of the rule. When multiple rules match the same recommended action, Compute Optimizer assigns the action to the rule with the lowest priority value (highest priority), even if that rule is scheduled to run later than other matching rules.</p>
    pub fn get_priority(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_priority()
    }
    ///
    /// Appends an item to `recommendedActionTypes`.
    ///
    /// To override the contents of this collection use [`set_recommended_action_types`](Self::set_recommended_action_types).
    ///
    /// <p>The types of recommended actions this rule will automate.</p>
    pub fn recommended_action_types(mut self, input: crate::types::RecommendedActionType) -> Self {
        self.inner = self.inner.recommended_action_types(input);
        self
    }
    /// <p>The types of recommended actions this rule will automate.</p>
    pub fn set_recommended_action_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendedActionType>>) -> Self {
        self.inner = self.inner.set_recommended_action_types(input);
        self
    }
    /// <p>The types of recommended actions this rule will automate.</p>
    pub fn get_recommended_action_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendedActionType>> {
        self.inner.get_recommended_action_types()
    }
    /// <p>A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time.</p>
    pub fn criteria(mut self, input: crate::types::Criteria) -> Self {
        self.inner = self.inner.criteria(input);
        self
    }
    /// <p>A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time.</p>
    pub fn set_criteria(mut self, input: ::std::option::Option<crate::types::Criteria>) -> Self {
        self.inner = self.inner.set_criteria(input);
        self
    }
    /// <p>A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time.</p>
    pub fn get_criteria(&self) -> &::std::option::Option<crate::types::Criteria> {
        self.inner.get_criteria()
    }
    /// <p>The schedule for when the rule should run.</p>
    pub fn schedule(mut self, input: crate::types::Schedule) -> Self {
        self.inner = self.inner.schedule(input);
        self
    }
    /// <p>The schedule for when the rule should run.</p>
    pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::Schedule>) -> Self {
        self.inner = self.inner.set_schedule(input);
        self
    }
    /// <p>The schedule for when the rule should run.</p>
    pub fn get_schedule(&self) -> &::std::option::Option<crate::types::Schedule> {
        self.inner.get_schedule()
    }
    /// <p>The status of the rule</p>
    pub fn status(mut self, input: crate::types::RuleStatus) -> Self {
        self.inner = self.inner.status(input);
        self
    }
    /// <p>The status of the rule</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::RuleStatus>) -> Self {
        self.inner = self.inner.set_status(input);
        self
    }
    /// <p>The status of the rule</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::RuleStatus> {
        self.inner.get_status()
    }
    ///
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to associate with the rule.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>The tags to associate with the rule.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>The tags to associate with the rule.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
    /// <p>A unique identifier to ensure idempotency of the 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 identifier to ensure idempotency of the 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 identifier to ensure idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
}