/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.lightsail.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Describes an alarm. *

*

* An alarm is a way to monitor your Lightsail resource metrics. For more information, see Alarms in Amazon * Lightsail. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Alarm implements Serializable, Cloneable, StructuredPojo { /** *

* The name of the alarm. *

*/ private String name; /** *

* The Amazon Resource Name (ARN) of the alarm. *

*/ private String arn; /** *

* The timestamp when the alarm was created. *

*/ private java.util.Date createdAt; /** *

* An object that lists information about the location of the alarm. *

*/ private ResourceLocation location; /** *

* The Lightsail resource type (e.g., Alarm). *

*/ private String resourceType; /** *

* 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. *

*/ private String supportCode; /** *

* An object that lists information about the resource monitored by the alarm. *

*/ private MonitoredResourceInfo monitoredResourceInfo; /** *

* The arithmetic operation used when comparing the specified statistic and threshold. *

*/ private String comparisonOperator; /** *

* The number of periods over which data is compared to the specified threshold. *

*/ private Integer evaluationPeriods; /** *

* The period, in seconds, over which the statistic is applied. *

*/ private Integer period; /** *

* The value against which the specified statistic is compared. *

*/ private Double threshold; /** *

* The number of data points that must not within the specified threshold to trigger the alarm. *

*/ private Integer datapointsToAlarm; /** *

* Specifies how the alarm handles missing data points. *

*

* An alarm can treat missing data in the following ways: *

* */ private String treatMissingData; /** *

* The statistic for the metric associated with the alarm. *

*

* The following statistics are available: *

* */ private String statistic; /** *

* The name of the metric associated with the alarm. *

*/ private String metricName; /** *

* The current state of the alarm. *

*

* An alarm has the following possible states: *

* */ private String state; /** *

* The unit of the metric associated with the alarm. *

*/ private String unit; /** *

* The contact protocols for the alarm, such as Email, SMS (text messaging), or both. *

*/ private java.util.List contactProtocols; /** *

* The alarm states that trigger a notification. *

*/ private java.util.List notificationTriggers; /** *

* Indicates whether the alarm is enabled. *

*/ private Boolean notificationEnabled; /** *

* The name of the alarm. *

* * @param name * The name of the alarm. */ public void setName(String name) { this.name = name; } /** *

* The name of the alarm. *

* * @return The name of the alarm. */ public String getName() { return this.name; } /** *

* The name of the alarm. *

* * @param name * The name of the alarm. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withName(String name) { setName(name); return this; } /** *

* The Amazon Resource Name (ARN) of the alarm. *

* * @param arn * The Amazon Resource Name (ARN) of the alarm. */ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the alarm. *

* * @return The Amazon Resource Name (ARN) of the alarm. */ public String getArn() { return this.arn; } /** *

* The Amazon Resource Name (ARN) of the alarm. *

* * @param arn * The Amazon Resource Name (ARN) of the alarm. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withArn(String arn) { setArn(arn); return this; } /** *

* The timestamp when the alarm was created. *

* * @param createdAt * The timestamp when the alarm was created. */ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** *

* The timestamp when the alarm was created. *

* * @return The timestamp when the alarm was created. */ public java.util.Date getCreatedAt() { return this.createdAt; } /** *

* The timestamp when the alarm was created. *

* * @param createdAt * The timestamp when the alarm was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; } /** *

* An object that lists information about the location of the alarm. *

* * @param location * An object that lists information about the location of the alarm. */ public void setLocation(ResourceLocation location) { this.location = location; } /** *

* An object that lists information about the location of the alarm. *

* * @return An object that lists information about the location of the alarm. */ public ResourceLocation getLocation() { return this.location; } /** *

* An object that lists information about the location of the alarm. *

* * @param location * An object that lists information about the location of the alarm. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withLocation(ResourceLocation location) { setLocation(location); return this; } /** *

* The Lightsail resource type (e.g., Alarm). *

* * @param resourceType * The Lightsail resource type (e.g., Alarm). * @see ResourceType */ public void setResourceType(String resourceType) { this.resourceType = resourceType; } /** *

* The Lightsail resource type (e.g., Alarm). *

* * @return The Lightsail resource type (e.g., Alarm). * @see ResourceType */ public String getResourceType() { return this.resourceType; } /** *

* The Lightsail resource type (e.g., Alarm). *

* * @param resourceType * The Lightsail resource type (e.g., Alarm). * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public Alarm withResourceType(String resourceType) { setResourceType(resourceType); return this; } /** *

* The Lightsail resource type (e.g., Alarm). *

* * @param resourceType * The Lightsail resource type (e.g., Alarm). * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public Alarm withResourceType(ResourceType resourceType) { this.resourceType = resourceType.toString(); return this; } /** *

* 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. *

* * @param supportCode * 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. */ public void setSupportCode(String supportCode) { this.supportCode = supportCode; } /** *

* 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. *

* * @return 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. */ public String getSupportCode() { return this.supportCode; } /** *

* 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. *

* * @param supportCode * 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. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withSupportCode(String supportCode) { setSupportCode(supportCode); return this; } /** *

* An object that lists information about the resource monitored by the alarm. *

* * @param monitoredResourceInfo * An object that lists information about the resource monitored by the alarm. */ public void setMonitoredResourceInfo(MonitoredResourceInfo monitoredResourceInfo) { this.monitoredResourceInfo = monitoredResourceInfo; } /** *

* An object that lists information about the resource monitored by the alarm. *

* * @return An object that lists information about the resource monitored by the alarm. */ public MonitoredResourceInfo getMonitoredResourceInfo() { return this.monitoredResourceInfo; } /** *

* An object that lists information about the resource monitored by the alarm. *

* * @param monitoredResourceInfo * An object that lists information about the resource monitored by the alarm. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withMonitoredResourceInfo(MonitoredResourceInfo monitoredResourceInfo) { setMonitoredResourceInfo(monitoredResourceInfo); return this; } /** *

* The arithmetic operation used when comparing the specified statistic and threshold. *

* * @param comparisonOperator * The arithmetic operation used when comparing the specified statistic and threshold. * @see ComparisonOperator */ public void setComparisonOperator(String comparisonOperator) { this.comparisonOperator = comparisonOperator; } /** *

* The arithmetic operation used when comparing the specified statistic and threshold. *

* * @return The arithmetic operation used when comparing the specified statistic and threshold. * @see ComparisonOperator */ public String getComparisonOperator() { return this.comparisonOperator; } /** *

* The arithmetic operation used when comparing the specified statistic and threshold. *

* * @param comparisonOperator * The arithmetic operation used when comparing the specified statistic and threshold. * @return Returns a reference to this object so that method calls can be chained together. * @see ComparisonOperator */ public Alarm withComparisonOperator(String comparisonOperator) { setComparisonOperator(comparisonOperator); return this; } /** *

* The arithmetic operation used when comparing the specified statistic and threshold. *

* * @param comparisonOperator * The arithmetic operation used when comparing the specified statistic and threshold. * @return Returns a reference to this object so that method calls can be chained together. * @see ComparisonOperator */ public Alarm withComparisonOperator(ComparisonOperator comparisonOperator) { this.comparisonOperator = comparisonOperator.toString(); return this; } /** *

* The number of periods over which data is compared to the specified threshold. *

* * @param evaluationPeriods * The number of periods over which data is compared to the specified threshold. */ public void setEvaluationPeriods(Integer evaluationPeriods) { this.evaluationPeriods = evaluationPeriods; } /** *

* The number of periods over which data is compared to the specified threshold. *

* * @return The number of periods over which data is compared to the specified threshold. */ public Integer getEvaluationPeriods() { return this.evaluationPeriods; } /** *

* The number of periods over which data is compared to the specified threshold. *

* * @param evaluationPeriods * The number of periods over which data is compared to the specified threshold. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withEvaluationPeriods(Integer evaluationPeriods) { setEvaluationPeriods(evaluationPeriods); return this; } /** *

* The period, in seconds, over which the statistic is applied. *

* * @param period * The period, in seconds, over which the statistic is applied. */ public void setPeriod(Integer period) { this.period = period; } /** *

* The period, in seconds, over which the statistic is applied. *

* * @return The period, in seconds, over which the statistic is applied. */ public Integer getPeriod() { return this.period; } /** *

* The period, in seconds, over which the statistic is applied. *

* * @param period * The period, in seconds, over which the statistic is applied. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withPeriod(Integer period) { setPeriod(period); return this; } /** *

* The value against which the specified statistic is compared. *

* * @param threshold * The value against which the specified statistic is compared. */ public void setThreshold(Double threshold) { this.threshold = threshold; } /** *

* The value against which the specified statistic is compared. *

* * @return The value against which the specified statistic is compared. */ public Double getThreshold() { return this.threshold; } /** *

* The value against which the specified statistic is compared. *

* * @param threshold * The value against which the specified statistic is compared. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withThreshold(Double threshold) { setThreshold(threshold); return this; } /** *

* The number of data points that must not within the specified threshold to trigger the alarm. *

* * @param datapointsToAlarm * The number of data points that must not within the specified threshold to trigger the alarm. */ public void setDatapointsToAlarm(Integer datapointsToAlarm) { this.datapointsToAlarm = datapointsToAlarm; } /** *

* The number of data points that must not within the specified threshold to trigger the alarm. *

* * @return The number of data points that must not within the specified threshold to trigger the alarm. */ public Integer getDatapointsToAlarm() { return this.datapointsToAlarm; } /** *

* The number of data points that must not within the specified threshold to trigger the alarm. *

* * @param datapointsToAlarm * The number of data points that must not within the specified threshold to trigger the alarm. * @return Returns a reference to this object so that method calls can be chained together. */ public Alarm withDatapointsToAlarm(Integer datapointsToAlarm) { setDatapointsToAlarm(datapointsToAlarm); return this; } /** *

* Specifies how the alarm handles missing data points. *

*

* An alarm can treat missing data in the following ways: *

* * * @param treatMissingData * Specifies how the alarm handles missing data points.

*

* An alarm can treat missing data in the following ways: *

*