aws-sdk-medialive 1.78.0

AWS SDK for AWS Elemental MediaLive
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_cloud_watch_alarm_template::_update_cloud_watch_alarm_template_output::UpdateCloudWatchAlarmTemplateOutputBuilder;

pub use crate::operation::update_cloud_watch_alarm_template::_update_cloud_watch_alarm_template_input::UpdateCloudWatchAlarmTemplateInputBuilder;

impl crate::operation::update_cloud_watch_alarm_template::builders::UpdateCloudWatchAlarmTemplateInputBuilder {
    /// 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_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_cloud_watch_alarm_template();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateCloudWatchAlarmTemplate`.
///
/// Updates the specified cloudwatch alarm template.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateCloudWatchAlarmTemplateFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_cloud_watch_alarm_template::builders::UpdateCloudWatchAlarmTemplateInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateOutput,
        crate::operation::update_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateError,
    > for UpdateCloudWatchAlarmTemplateFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateOutput,
            crate::operation::update_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateCloudWatchAlarmTemplateFluentBuilder {
    /// Creates a new `UpdateCloudWatchAlarmTemplateFluentBuilder`.
    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 UpdateCloudWatchAlarmTemplate as a reference.
    pub fn as_input(&self) -> &crate::operation::update_cloud_watch_alarm_template::builders::UpdateCloudWatchAlarmTemplateInputBuilder {
        &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_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateError,
            ::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_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplate::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplate::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_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateOutput,
        crate::operation::update_cloud_watch_alarm_template::UpdateCloudWatchAlarmTemplateError,
        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 comparison operator used to compare the specified statistic and the threshold.
    pub fn comparison_operator(mut self, input: crate::types::CloudWatchAlarmTemplateComparisonOperator) -> Self {
        self.inner = self.inner.comparison_operator(input);
        self
    }
    /// The comparison operator used to compare the specified statistic and the threshold.
    pub fn set_comparison_operator(mut self, input: ::std::option::Option<crate::types::CloudWatchAlarmTemplateComparisonOperator>) -> Self {
        self.inner = self.inner.set_comparison_operator(input);
        self
    }
    /// The comparison operator used to compare the specified statistic and the threshold.
    pub fn get_comparison_operator(&self) -> &::std::option::Option<crate::types::CloudWatchAlarmTemplateComparisonOperator> {
        self.inner.get_comparison_operator()
    }
    /// The number of datapoints within the evaluation period that must be breaching to trigger the alarm.
    pub fn datapoints_to_alarm(mut self, input: i32) -> Self {
        self.inner = self.inner.datapoints_to_alarm(input);
        self
    }
    /// The number of datapoints within the evaluation period that must be breaching to trigger the alarm.
    pub fn set_datapoints_to_alarm(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_datapoints_to_alarm(input);
        self
    }
    /// The number of datapoints within the evaluation period that must be breaching to trigger the alarm.
    pub fn get_datapoints_to_alarm(&self) -> &::std::option::Option<i32> {
        self.inner.get_datapoints_to_alarm()
    }
    /// A resource's optional description.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// A resource's optional description.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// A resource's optional description.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// The number of periods over which data is compared to the specified threshold.
    pub fn evaluation_periods(mut self, input: i32) -> Self {
        self.inner = self.inner.evaluation_periods(input);
        self
    }
    /// The number of periods over which data is compared to the specified threshold.
    pub fn set_evaluation_periods(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_evaluation_periods(input);
        self
    }
    /// The number of periods over which data is compared to the specified threshold.
    pub fn get_evaluation_periods(&self) -> &::std::option::Option<i32> {
        self.inner.get_evaluation_periods()
    }
    /// A cloudwatch alarm template group's identifier. Can be either be its id or current name.
    pub fn group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.group_identifier(input.into());
        self
    }
    /// A cloudwatch alarm template group's identifier. Can be either be its id or current name.
    pub fn set_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_group_identifier(input);
        self
    }
    /// A cloudwatch alarm template group's identifier. Can be either be its id or current name.
    pub fn get_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_group_identifier()
    }
    /// A cloudwatch alarm template's identifier. Can be either be its id or current name.
    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.identifier(input.into());
        self
    }
    /// A cloudwatch alarm template's identifier. Can be either be its id or current name.
    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_identifier(input);
        self
    }
    /// A cloudwatch alarm template's identifier. Can be either be its id or current name.
    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_identifier()
    }
    /// The name of the metric associated with the alarm. Must be compatible with targetResourceType.
    pub fn metric_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.metric_name(input.into());
        self
    }
    /// The name of the metric associated with the alarm. Must be compatible with targetResourceType.
    pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_metric_name(input);
        self
    }
    /// The name of the metric associated with the alarm. Must be compatible with targetResourceType.
    pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_metric_name()
    }
    /// A resource's name. Names must be unique within the scope of a resource type in a specific region.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// A resource's name. Names must be unique within the scope of a resource type in a specific region.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// A resource's name. Names must be unique within the scope of a resource type in a specific region.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// The period, in seconds, over which the specified statistic is applied.
    pub fn period(mut self, input: i32) -> Self {
        self.inner = self.inner.period(input);
        self
    }
    /// The period, in seconds, over which the specified statistic is applied.
    pub fn set_period(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_period(input);
        self
    }
    /// The period, in seconds, over which the specified statistic is applied.
    pub fn get_period(&self) -> &::std::option::Option<i32> {
        self.inner.get_period()
    }
    /// The statistic to apply to the alarm's metric data.
    pub fn statistic(mut self, input: crate::types::CloudWatchAlarmTemplateStatistic) -> Self {
        self.inner = self.inner.statistic(input);
        self
    }
    /// The statistic to apply to the alarm's metric data.
    pub fn set_statistic(mut self, input: ::std::option::Option<crate::types::CloudWatchAlarmTemplateStatistic>) -> Self {
        self.inner = self.inner.set_statistic(input);
        self
    }
    /// The statistic to apply to the alarm's metric data.
    pub fn get_statistic(&self) -> &::std::option::Option<crate::types::CloudWatchAlarmTemplateStatistic> {
        self.inner.get_statistic()
    }
    /// The resource type this template should dynamically generate cloudwatch metric alarms for.
    pub fn target_resource_type(mut self, input: crate::types::CloudWatchAlarmTemplateTargetResourceType) -> Self {
        self.inner = self.inner.target_resource_type(input);
        self
    }
    /// The resource type this template should dynamically generate cloudwatch metric alarms for.
    pub fn set_target_resource_type(mut self, input: ::std::option::Option<crate::types::CloudWatchAlarmTemplateTargetResourceType>) -> Self {
        self.inner = self.inner.set_target_resource_type(input);
        self
    }
    /// The resource type this template should dynamically generate cloudwatch metric alarms for.
    pub fn get_target_resource_type(&self) -> &::std::option::Option<crate::types::CloudWatchAlarmTemplateTargetResourceType> {
        self.inner.get_target_resource_type()
    }
    /// The threshold value to compare with the specified statistic.
    pub fn threshold(mut self, input: f64) -> Self {
        self.inner = self.inner.threshold(input);
        self
    }
    /// The threshold value to compare with the specified statistic.
    pub fn set_threshold(mut self, input: ::std::option::Option<f64>) -> Self {
        self.inner = self.inner.set_threshold(input);
        self
    }
    /// The threshold value to compare with the specified statistic.
    pub fn get_threshold(&self) -> &::std::option::Option<f64> {
        self.inner.get_threshold()
    }
    /// Specifies how missing data points are treated when evaluating the alarm's condition.
    pub fn treat_missing_data(mut self, input: crate::types::CloudWatchAlarmTemplateTreatMissingData) -> Self {
        self.inner = self.inner.treat_missing_data(input);
        self
    }
    /// Specifies how missing data points are treated when evaluating the alarm's condition.
    pub fn set_treat_missing_data(mut self, input: ::std::option::Option<crate::types::CloudWatchAlarmTemplateTreatMissingData>) -> Self {
        self.inner = self.inner.set_treat_missing_data(input);
        self
    }
    /// Specifies how missing data points are treated when evaluating the alarm's condition.
    pub fn get_treat_missing_data(&self) -> &::std::option::Option<crate::types::CloudWatchAlarmTemplateTreatMissingData> {
        self.inner.get_treat_missing_data()
    }
}