#[non_exhaustive]pub struct AlarmBuilder { /* private fields */ }Expand description
A builder for Alarm.
Implementations§
Source§impl AlarmBuilder
impl AlarmBuilder
Sourcepub fn arn(self, input: impl Into<String>) -> Self
pub fn arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the alarm.
Sourcepub fn set_arn(self, input: Option<String>) -> Self
pub fn set_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the alarm.
Sourcepub fn created_at(self, input: DateTime) -> Self
pub fn created_at(self, input: DateTime) -> Self
The timestamp when the alarm was created.
Sourcepub fn set_created_at(self, input: Option<DateTime>) -> Self
pub fn set_created_at(self, input: Option<DateTime>) -> Self
The timestamp when the alarm was created.
Sourcepub fn get_created_at(&self) -> &Option<DateTime>
pub fn get_created_at(&self) -> &Option<DateTime>
The timestamp when the alarm was created.
Sourcepub fn location(self, input: ResourceLocation) -> Self
pub fn location(self, input: ResourceLocation) -> Self
An object that lists information about the location of the alarm.
Sourcepub fn set_location(self, input: Option<ResourceLocation>) -> Self
pub fn set_location(self, input: Option<ResourceLocation>) -> Self
An object that lists information about the location of the alarm.
Sourcepub fn get_location(&self) -> &Option<ResourceLocation>
pub fn get_location(&self) -> &Option<ResourceLocation>
An object that lists information about the location of the alarm.
Sourcepub fn resource_type(self, input: ResourceType) -> Self
pub fn resource_type(self, input: ResourceType) -> Self
The Lightsail resource type of the alarm.
Sourcepub fn set_resource_type(self, input: Option<ResourceType>) -> Self
pub fn set_resource_type(self, input: Option<ResourceType>) -> Self
The Lightsail resource type of the alarm.
Sourcepub fn get_resource_type(&self) -> &Option<ResourceType>
pub fn get_resource_type(&self) -> &Option<ResourceType>
The Lightsail resource type of the alarm.
Sourcepub fn support_code(self, input: impl Into<String>) -> Self
pub fn support_code(self, input: impl Into<String>) -> Self
The support code. Include this code in your email to support when you have questions about your Lightsail alarm. This code enables our support team to look up your Lightsail information more easily.
Sourcepub fn set_support_code(self, input: Option<String>) -> Self
pub fn set_support_code(self, input: Option<String>) -> Self
The support code. Include this code in your email to support when you have questions about your Lightsail alarm. This code enables our support team to look up your Lightsail information more easily.
Sourcepub fn get_support_code(&self) -> &Option<String>
pub fn get_support_code(&self) -> &Option<String>
The support code. Include this code in your email to support when you have questions about your Lightsail alarm. This code enables our support team to look up your Lightsail information more easily.
Sourcepub fn monitored_resource_info(self, input: MonitoredResourceInfo) -> Self
pub fn monitored_resource_info(self, input: MonitoredResourceInfo) -> Self
An object that lists information about the resource monitored by the alarm.
Sourcepub fn set_monitored_resource_info(
self,
input: Option<MonitoredResourceInfo>,
) -> Self
pub fn set_monitored_resource_info( self, input: Option<MonitoredResourceInfo>, ) -> Self
An object that lists information about the resource monitored by the alarm.
Sourcepub fn get_monitored_resource_info(&self) -> &Option<MonitoredResourceInfo>
pub fn get_monitored_resource_info(&self) -> &Option<MonitoredResourceInfo>
An object that lists information about the resource monitored by the alarm.
Sourcepub fn comparison_operator(self, input: ComparisonOperator) -> Self
pub fn comparison_operator(self, input: ComparisonOperator) -> Self
The arithmetic operation used when comparing the specified statistic and threshold.
Sourcepub fn set_comparison_operator(self, input: Option<ComparisonOperator>) -> Self
pub fn set_comparison_operator(self, input: Option<ComparisonOperator>) -> Self
The arithmetic operation used when comparing the specified statistic and threshold.
Sourcepub fn get_comparison_operator(&self) -> &Option<ComparisonOperator>
pub fn get_comparison_operator(&self) -> &Option<ComparisonOperator>
The arithmetic operation used when comparing the specified statistic and threshold.
Sourcepub fn evaluation_periods(self, input: i32) -> Self
pub fn evaluation_periods(self, input: i32) -> Self
The number of periods over which data is compared to the specified threshold.
Sourcepub fn set_evaluation_periods(self, input: Option<i32>) -> Self
pub fn set_evaluation_periods(self, input: Option<i32>) -> Self
The number of periods over which data is compared to the specified threshold.
Sourcepub fn get_evaluation_periods(&self) -> &Option<i32>
pub fn get_evaluation_periods(&self) -> &Option<i32>
The number of periods over which data is compared to the specified threshold.
Sourcepub fn period(self, input: i32) -> Self
pub fn period(self, input: i32) -> Self
The period, in seconds, over which the statistic is applied.
Sourcepub fn set_period(self, input: Option<i32>) -> Self
pub fn set_period(self, input: Option<i32>) -> Self
The period, in seconds, over which the statistic is applied.
Sourcepub fn get_period(&self) -> &Option<i32>
pub fn get_period(&self) -> &Option<i32>
The period, in seconds, over which the statistic is applied.
Sourcepub fn threshold(self, input: f64) -> Self
pub fn threshold(self, input: f64) -> Self
The value against which the specified statistic is compared.
Sourcepub fn set_threshold(self, input: Option<f64>) -> Self
pub fn set_threshold(self, input: Option<f64>) -> Self
The value against which the specified statistic is compared.
Sourcepub fn get_threshold(&self) -> &Option<f64>
pub fn get_threshold(&self) -> &Option<f64>
The value against which the specified statistic is compared.
Sourcepub fn datapoints_to_alarm(self, input: i32) -> Self
pub fn datapoints_to_alarm(self, input: i32) -> Self
The number of data points that must not within the specified threshold to trigger the alarm.
Sourcepub fn set_datapoints_to_alarm(self, input: Option<i32>) -> Self
pub fn set_datapoints_to_alarm(self, input: Option<i32>) -> Self
The number of data points that must not within the specified threshold to trigger the alarm.
Sourcepub fn get_datapoints_to_alarm(&self) -> &Option<i32>
pub fn get_datapoints_to_alarm(&self) -> &Option<i32>
The number of data points that must not within the specified threshold to trigger the alarm.
Sourcepub fn treat_missing_data(self, input: TreatMissingData) -> Self
pub fn treat_missing_data(self, input: TreatMissingData) -> Self
Specifies how the alarm handles missing data points.
An alarm can treat missing data in the following ways:
-
breaching- Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold. -
notBreaching- Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold. -
ignore- Ignore the missing data. Maintains the current alarm state. -
missing- Missing data is treated as missing.
Sourcepub fn set_treat_missing_data(self, input: Option<TreatMissingData>) -> Self
pub fn set_treat_missing_data(self, input: Option<TreatMissingData>) -> Self
Specifies how the alarm handles missing data points.
An alarm can treat missing data in the following ways:
-
breaching- Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold. -
notBreaching- Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold. -
ignore- Ignore the missing data. Maintains the current alarm state. -
missing- Missing data is treated as missing.
Sourcepub fn get_treat_missing_data(&self) -> &Option<TreatMissingData>
pub fn get_treat_missing_data(&self) -> &Option<TreatMissingData>
Specifies how the alarm handles missing data points.
An alarm can treat missing data in the following ways:
-
breaching- Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold. -
notBreaching- Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold. -
ignore- Ignore the missing data. Maintains the current alarm state. -
missing- Missing data is treated as missing.
Sourcepub fn statistic(self, input: MetricStatistic) -> Self
pub fn statistic(self, input: MetricStatistic) -> Self
The statistic for the metric associated with the alarm.
The following statistics are available:
-
Minimum- The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application. -
Maximum- The highest value observed during the specified period. Use this value to determine high volumes of activity for your application. -
Sum- All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric. -
Average- The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources. -
SampleCount- The count, or number, of data points used for the statistical calculation.
Sourcepub fn set_statistic(self, input: Option<MetricStatistic>) -> Self
pub fn set_statistic(self, input: Option<MetricStatistic>) -> Self
The statistic for the metric associated with the alarm.
The following statistics are available:
-
Minimum- The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application. -
Maximum- The highest value observed during the specified period. Use this value to determine high volumes of activity for your application. -
Sum- All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric. -
Average- The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources. -
SampleCount- The count, or number, of data points used for the statistical calculation.
Sourcepub fn get_statistic(&self) -> &Option<MetricStatistic>
pub fn get_statistic(&self) -> &Option<MetricStatistic>
The statistic for the metric associated with the alarm.
The following statistics are available:
-
Minimum- The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application. -
Maximum- The highest value observed during the specified period. Use this value to determine high volumes of activity for your application. -
Sum- All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric. -
Average- The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources. -
SampleCount- The count, or number, of data points used for the statistical calculation.
Sourcepub fn metric_name(self, input: MetricName) -> Self
pub fn metric_name(self, input: MetricName) -> Self
The name of the metric associated with the alarm.
Sourcepub fn set_metric_name(self, input: Option<MetricName>) -> Self
pub fn set_metric_name(self, input: Option<MetricName>) -> Self
The name of the metric associated with the alarm.
Sourcepub fn get_metric_name(&self) -> &Option<MetricName>
pub fn get_metric_name(&self) -> &Option<MetricName>
The name of the metric associated with the alarm.
Sourcepub fn state(self, input: AlarmState) -> Self
pub fn state(self, input: AlarmState) -> Self
The current state of the alarm.
An alarm has the following possible states:
-
ALARM- The metric is outside of the defined threshold. -
INSUFFICIENT_DATA- The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state. -
OK- The metric is within the defined threshold.
Sourcepub fn set_state(self, input: Option<AlarmState>) -> Self
pub fn set_state(self, input: Option<AlarmState>) -> Self
The current state of the alarm.
An alarm has the following possible states:
-
ALARM- The metric is outside of the defined threshold. -
INSUFFICIENT_DATA- The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state. -
OK- The metric is within the defined threshold.
Sourcepub fn get_state(&self) -> &Option<AlarmState>
pub fn get_state(&self) -> &Option<AlarmState>
The current state of the alarm.
An alarm has the following possible states:
-
ALARM- The metric is outside of the defined threshold. -
INSUFFICIENT_DATA- The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state. -
OK- The metric is within the defined threshold.
Sourcepub fn unit(self, input: MetricUnit) -> Self
pub fn unit(self, input: MetricUnit) -> Self
The unit of the metric associated with the alarm.
Sourcepub fn set_unit(self, input: Option<MetricUnit>) -> Self
pub fn set_unit(self, input: Option<MetricUnit>) -> Self
The unit of the metric associated with the alarm.
Sourcepub fn get_unit(&self) -> &Option<MetricUnit>
pub fn get_unit(&self) -> &Option<MetricUnit>
The unit of the metric associated with the alarm.
Sourcepub fn contact_protocols(self, input: ContactProtocol) -> Self
pub fn contact_protocols(self, input: ContactProtocol) -> Self
Appends an item to contact_protocols.
To override the contents of this collection use set_contact_protocols.
The contact protocols for the alarm, such as Email, SMS (text messaging), or both.
Sourcepub fn set_contact_protocols(self, input: Option<Vec<ContactProtocol>>) -> Self
pub fn set_contact_protocols(self, input: Option<Vec<ContactProtocol>>) -> Self
The contact protocols for the alarm, such as Email, SMS (text messaging), or both.
Sourcepub fn get_contact_protocols(&self) -> &Option<Vec<ContactProtocol>>
pub fn get_contact_protocols(&self) -> &Option<Vec<ContactProtocol>>
The contact protocols for the alarm, such as Email, SMS (text messaging), or both.
Sourcepub fn notification_triggers(self, input: AlarmState) -> Self
pub fn notification_triggers(self, input: AlarmState) -> Self
Appends an item to notification_triggers.
To override the contents of this collection use set_notification_triggers.
The alarm states that trigger a notification.
Sourcepub fn set_notification_triggers(self, input: Option<Vec<AlarmState>>) -> Self
pub fn set_notification_triggers(self, input: Option<Vec<AlarmState>>) -> Self
The alarm states that trigger a notification.
Sourcepub fn get_notification_triggers(&self) -> &Option<Vec<AlarmState>>
pub fn get_notification_triggers(&self) -> &Option<Vec<AlarmState>>
The alarm states that trigger a notification.
Sourcepub fn notification_enabled(self, input: bool) -> Self
pub fn notification_enabled(self, input: bool) -> Self
Indicates whether the alarm is enabled.
Sourcepub fn set_notification_enabled(self, input: Option<bool>) -> Self
pub fn set_notification_enabled(self, input: Option<bool>) -> Self
Indicates whether the alarm is enabled.
Sourcepub fn get_notification_enabled(&self) -> &Option<bool>
pub fn get_notification_enabled(&self) -> &Option<bool>
Indicates whether the alarm is enabled.
Trait Implementations§
Source§impl Clone for AlarmBuilder
impl Clone for AlarmBuilder
Source§fn clone(&self) -> AlarmBuilder
fn clone(&self) -> AlarmBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AlarmBuilder
impl Debug for AlarmBuilder
Source§impl Default for AlarmBuilder
impl Default for AlarmBuilder
Source§fn default() -> AlarmBuilder
fn default() -> AlarmBuilder
Source§impl PartialEq for AlarmBuilder
impl PartialEq for AlarmBuilder
impl StructuralPartialEq for AlarmBuilder
Auto Trait Implementations§
impl Freeze for AlarmBuilder
impl RefUnwindSafe for AlarmBuilder
impl Send for AlarmBuilder
impl Sync for AlarmBuilder
impl Unpin for AlarmBuilder
impl UnwindSafe for AlarmBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);