aws-sdk-cloudwatchomni 1.2.0

AWS SDK for CloudWatch Omni
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_alert::_update_alert_input::UpdateAlertInputBuilder;

pub use crate::operation::update_alert::_update_alert_output::UpdateAlertOutputBuilder;

impl crate::operation::update_alert::builders::UpdateAlertInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_alert::UpdateAlertOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_alert::UpdateAlertError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_alert();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateAlert`.
///
/// Updates an existing alert. Only non-null fields overwrite existing values.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateAlertFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_alert::builders::UpdateAlertInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_alert::UpdateAlertOutput,
        crate::operation::update_alert::UpdateAlertError,
    > for UpdateAlertFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_alert::UpdateAlertOutput,
            crate::operation::update_alert::UpdateAlertError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateAlertFluentBuilder {
    /// Creates a new `UpdateAlertFluentBuilder`.
    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 UpdateAlert as a reference.
    pub fn as_input(&self) -> &crate::operation::update_alert::builders::UpdateAlertInputBuilder {
        &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::update_alert::UpdateAlertOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_alert::UpdateAlertError,
            ::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::update_alert::UpdateAlert::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_alert::UpdateAlert::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::update_alert::UpdateAlertOutput,
        crate::operation::update_alert::UpdateAlertError,
        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
    }
    /// The unique ID of the space.
    pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.space_id(input.into());
        self
    }
    /// The unique ID of the space.
    pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_space_id(input);
        self
    }
    /// The unique ID of the space.
    pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_space_id()
    }
    /// The alert to update.
    pub fn alert_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.alert_id(input.into());
        self
    }
    /// The alert to update.
    pub fn set_alert_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_alert_id(input);
        self
    }
    /// The alert to update.
    pub fn get_alert_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_alert_id()
    }
    /// The ID of the access profile associated with the alert.
    pub fn profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.profile_id(input.into());
        self
    }
    /// The ID of the access profile associated with the alert.
    pub fn set_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_profile_id(input);
        self
    }
    /// The ID of the access profile associated with the alert.
    pub fn get_profile_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_profile_id()
    }
    /// A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// A new description of the alert. Omit to leave unchanged.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// A new description of the alert. Omit to leave unchanged.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// A new description of the alert. Omit to leave unchanged.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
    pub fn rule(mut self, input: crate::types::Rule) -> Self {
        self.inner = self.inner.rule(input);
        self
    }
    /// The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
    pub fn set_rule(mut self, input: ::std::option::Option<crate::types::Rule>) -> Self {
        self.inner = self.inner.set_rule(input);
        self
    }
    /// The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
    pub fn get_rule(&self) -> &::std::option::Option<crate::types::Rule> {
        self.inner.get_rule()
    }
    /// Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
    pub fn notifications_enabled(mut self, input: bool) -> Self {
        self.inner = self.inner.notifications_enabled(input);
        self
    }
    /// Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
    pub fn set_notifications_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_notifications_enabled(input);
        self
    }
    /// Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
    pub fn get_notifications_enabled(&self) -> &::std::option::Option<bool> {
        self.inner.get_notifications_enabled()
    }
    ///
    /// Appends an item to `notificationRules`.
    ///
    /// To override the contents of this collection use [`set_notification_rules`](Self::set_notification_rules).
    ///
    /// Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
    pub fn notification_rules(mut self, input: crate::types::NotificationRule) -> Self {
        self.inner = self.inner.notification_rules(input);
        self
    }
    /// Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
    pub fn set_notification_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NotificationRule>>) -> Self {
        self.inner = self.inner.set_notification_rules(input);
        self
    }
    /// Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
    pub fn get_notification_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NotificationRule>> {
        self.inner.get_notification_rules()
    }
}