com.amazonaws.services.simplesystemsmanagement.model.AlarmConfiguration Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.simplesystemsmanagement.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The details for the CloudWatch alarm you want to apply to an automation or command.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AlarmConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* When this value is true, your automation or command continues to run in cases where we can’t retrieve
* alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or
* INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false.
*
*/
private Boolean ignorePollAlarmFailure;
/**
*
* The name of the CloudWatch alarm specified in the configuration.
*
*/
private com.amazonaws.internal.SdkInternalList alarms;
/**
*
* When this value is true, your automation or command continues to run in cases where we can’t retrieve
* alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or
* INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false.
*
*
* @param ignorePollAlarmFailure
* When this value is true, your automation or command continues to run in cases where we can’t
* retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status
* of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default
* is false.
*/
public void setIgnorePollAlarmFailure(Boolean ignorePollAlarmFailure) {
this.ignorePollAlarmFailure = ignorePollAlarmFailure;
}
/**
*
* When this value is true, your automation or command continues to run in cases where we can’t retrieve
* alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or
* INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false.
*
*
* @return When this value is true, your automation or command continues to run in cases where we can’t
* retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm
* status of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value.
* Default is false.
*/
public Boolean getIgnorePollAlarmFailure() {
return this.ignorePollAlarmFailure;
}
/**
*
* When this value is true, your automation or command continues to run in cases where we can’t retrieve
* alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or
* INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false.
*
*
* @param ignorePollAlarmFailure
* When this value is true, your automation or command continues to run in cases where we can’t
* retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status
* of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default
* is false.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AlarmConfiguration withIgnorePollAlarmFailure(Boolean ignorePollAlarmFailure) {
setIgnorePollAlarmFailure(ignorePollAlarmFailure);
return this;
}
/**
*
* When this value is true, your automation or command continues to run in cases where we can’t retrieve
* alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or
* INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false.
*
*
* @return When this value is true, your automation or command continues to run in cases where we can’t
* retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm
* status of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value.
* Default is false.
*/
public Boolean isIgnorePollAlarmFailure() {
return this.ignorePollAlarmFailure;
}
/**
*
* The name of the CloudWatch alarm specified in the configuration.
*
*
* @return The name of the CloudWatch alarm specified in the configuration.
*/
public java.util.List getAlarms() {
if (alarms == null) {
alarms = new com.amazonaws.internal.SdkInternalList();
}
return alarms;
}
/**
*
* The name of the CloudWatch alarm specified in the configuration.
*
*
* @param alarms
* The name of the CloudWatch alarm specified in the configuration.
*/
public void setAlarms(java.util.Collection alarms) {
if (alarms == null) {
this.alarms = null;
return;
}
this.alarms = new com.amazonaws.internal.SdkInternalList(alarms);
}
/**
*
* The name of the CloudWatch alarm specified in the configuration.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAlarms(java.util.Collection)} or {@link #withAlarms(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param alarms
* The name of the CloudWatch alarm specified in the configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AlarmConfiguration withAlarms(Alarm... alarms) {
if (this.alarms == null) {
setAlarms(new com.amazonaws.internal.SdkInternalList(alarms.length));
}
for (Alarm ele : alarms) {
this.alarms.add(ele);
}
return this;
}
/**
*
* The name of the CloudWatch alarm specified in the configuration.
*
*
* @param alarms
* The name of the CloudWatch alarm specified in the configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AlarmConfiguration withAlarms(java.util.Collection alarms) {
setAlarms(alarms);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getIgnorePollAlarmFailure() != null)
sb.append("IgnorePollAlarmFailure: ").append(getIgnorePollAlarmFailure()).append(",");
if (getAlarms() != null)
sb.append("Alarms: ").append(getAlarms());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AlarmConfiguration == false)
return false;
AlarmConfiguration other = (AlarmConfiguration) obj;
if (other.getIgnorePollAlarmFailure() == null ^ this.getIgnorePollAlarmFailure() == null)
return false;
if (other.getIgnorePollAlarmFailure() != null && other.getIgnorePollAlarmFailure().equals(this.getIgnorePollAlarmFailure()) == false)
return false;
if (other.getAlarms() == null ^ this.getAlarms() == null)
return false;
if (other.getAlarms() != null && other.getAlarms().equals(this.getAlarms()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIgnorePollAlarmFailure() == null) ? 0 : getIgnorePollAlarmFailure().hashCode());
hashCode = prime * hashCode + ((getAlarms() == null) ? 0 : getAlarms().hashCode());
return hashCode;
}
@Override
public AlarmConfiguration clone() {
try {
return (AlarmConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.simplesystemsmanagement.model.transform.AlarmConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}