com.amazonaws.services.devopsguru.model.ReactiveAnomaly Maven / Gradle / Ivy
Show all versions of aws-java-sdk-devopsguru Show documentation
/*
* 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.devopsguru.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Details about a reactive anomaly. This object is returned by ListAnomalies
.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReactiveAnomaly implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ID of the reactive anomaly.
*
*/
private String id;
/**
*
* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
*
*/
private String severity;
/**
*
* The status of the anomaly.
*
*/
private String status;
private AnomalyTimeRange anomalyTimeRange;
/**
*
* An AnomalyReportedTimeRange
object that specifies the time range between when the anomaly is opened
* and the time when it is closed.
*
*/
private AnomalyReportedTimeRange anomalyReportedTimeRange;
/**
*
* Details about the source of the analyzed operational data that triggered the anomaly. The one supported source is
* Amazon CloudWatch metrics.
*
*/
private AnomalySourceDetails sourceDetails;
/**
*
* The ID of the insight that contains this anomaly. An insight is composed of related anomalies.
*
*/
private String associatedInsightId;
private ResourceCollection resourceCollection;
/**
*
* The type of the reactive anomaly. It can be one of the following types.
*
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal anomaly.
*
*
*
*/
private String type;
/**
*
* The name of the reactive anomaly.
*
*/
private String name;
/**
*
* A description of the reactive anomaly.
*
*/
private String description;
/**
*
* The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly is
* always `NULL`.
*
*/
private String causalAnomalyId;
/**
*
* The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
*
*/
private java.util.List anomalyResources;
/**
*
* The ID of the reactive anomaly.
*
*
* @param id
* The ID of the reactive anomaly.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The ID of the reactive anomaly.
*
*
* @return The ID of the reactive anomaly.
*/
public String getId() {
return this.id;
}
/**
*
* The ID of the reactive anomaly.
*
*
* @param id
* The ID of the reactive anomaly.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withId(String id) {
setId(id);
return this;
}
/**
*
* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
*
*
* @param severity
* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
* @see AnomalySeverity
*/
public void setSeverity(String severity) {
this.severity = severity;
}
/**
*
* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
*
*
* @return The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
* @see AnomalySeverity
*/
public String getSeverity() {
return this.severity;
}
/**
*
* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
*
*
* @param severity
* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalySeverity
*/
public ReactiveAnomaly withSeverity(String severity) {
setSeverity(severity);
return this;
}
/**
*
* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
*
*
* @param severity
* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's
* severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalySeverity
*/
public ReactiveAnomaly withSeverity(AnomalySeverity severity) {
this.severity = severity.toString();
return this;
}
/**
*
* The status of the anomaly.
*
*
* @param status
* The status of the anomaly.
* @see AnomalyStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the anomaly.
*
*
* @return The status of the anomaly.
* @see AnomalyStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the anomaly.
*
*
* @param status
* The status of the anomaly.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalyStatus
*/
public ReactiveAnomaly withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the anomaly.
*
*
* @param status
* The status of the anomaly.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalyStatus
*/
public ReactiveAnomaly withStatus(AnomalyStatus status) {
this.status = status.toString();
return this;
}
/**
* @param anomalyTimeRange
*/
public void setAnomalyTimeRange(AnomalyTimeRange anomalyTimeRange) {
this.anomalyTimeRange = anomalyTimeRange;
}
/**
* @return
*/
public AnomalyTimeRange getAnomalyTimeRange() {
return this.anomalyTimeRange;
}
/**
* @param anomalyTimeRange
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withAnomalyTimeRange(AnomalyTimeRange anomalyTimeRange) {
setAnomalyTimeRange(anomalyTimeRange);
return this;
}
/**
*
* An AnomalyReportedTimeRange
object that specifies the time range between when the anomaly is opened
* and the time when it is closed.
*
*
* @param anomalyReportedTimeRange
* An AnomalyReportedTimeRange
object that specifies the time range between when the anomaly is
* opened and the time when it is closed.
*/
public void setAnomalyReportedTimeRange(AnomalyReportedTimeRange anomalyReportedTimeRange) {
this.anomalyReportedTimeRange = anomalyReportedTimeRange;
}
/**
*
* An AnomalyReportedTimeRange
object that specifies the time range between when the anomaly is opened
* and the time when it is closed.
*
*
* @return An AnomalyReportedTimeRange
object that specifies the time range between when the anomaly is
* opened and the time when it is closed.
*/
public AnomalyReportedTimeRange getAnomalyReportedTimeRange() {
return this.anomalyReportedTimeRange;
}
/**
*
* An AnomalyReportedTimeRange
object that specifies the time range between when the anomaly is opened
* and the time when it is closed.
*
*
* @param anomalyReportedTimeRange
* An AnomalyReportedTimeRange
object that specifies the time range between when the anomaly is
* opened and the time when it is closed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withAnomalyReportedTimeRange(AnomalyReportedTimeRange anomalyReportedTimeRange) {
setAnomalyReportedTimeRange(anomalyReportedTimeRange);
return this;
}
/**
*
* Details about the source of the analyzed operational data that triggered the anomaly. The one supported source is
* Amazon CloudWatch metrics.
*
*
* @param sourceDetails
* Details about the source of the analyzed operational data that triggered the anomaly. The one supported
* source is Amazon CloudWatch metrics.
*/
public void setSourceDetails(AnomalySourceDetails sourceDetails) {
this.sourceDetails = sourceDetails;
}
/**
*
* Details about the source of the analyzed operational data that triggered the anomaly. The one supported source is
* Amazon CloudWatch metrics.
*
*
* @return Details about the source of the analyzed operational data that triggered the anomaly. The one supported
* source is Amazon CloudWatch metrics.
*/
public AnomalySourceDetails getSourceDetails() {
return this.sourceDetails;
}
/**
*
* Details about the source of the analyzed operational data that triggered the anomaly. The one supported source is
* Amazon CloudWatch metrics.
*
*
* @param sourceDetails
* Details about the source of the analyzed operational data that triggered the anomaly. The one supported
* source is Amazon CloudWatch metrics.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withSourceDetails(AnomalySourceDetails sourceDetails) {
setSourceDetails(sourceDetails);
return this;
}
/**
*
* The ID of the insight that contains this anomaly. An insight is composed of related anomalies.
*
*
* @param associatedInsightId
* The ID of the insight that contains this anomaly. An insight is composed of related anomalies.
*/
public void setAssociatedInsightId(String associatedInsightId) {
this.associatedInsightId = associatedInsightId;
}
/**
*
* The ID of the insight that contains this anomaly. An insight is composed of related anomalies.
*
*
* @return The ID of the insight that contains this anomaly. An insight is composed of related anomalies.
*/
public String getAssociatedInsightId() {
return this.associatedInsightId;
}
/**
*
* The ID of the insight that contains this anomaly. An insight is composed of related anomalies.
*
*
* @param associatedInsightId
* The ID of the insight that contains this anomaly. An insight is composed of related anomalies.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withAssociatedInsightId(String associatedInsightId) {
setAssociatedInsightId(associatedInsightId);
return this;
}
/**
* @param resourceCollection
*/
public void setResourceCollection(ResourceCollection resourceCollection) {
this.resourceCollection = resourceCollection;
}
/**
* @return
*/
public ResourceCollection getResourceCollection() {
return this.resourceCollection;
}
/**
* @param resourceCollection
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withResourceCollection(ResourceCollection resourceCollection) {
setResourceCollection(resourceCollection);
return this;
}
/**
*
* The type of the reactive anomaly. It can be one of the following types.
*
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal anomaly.
*
*
*
*
* @param type
* The type of the reactive anomaly. It can be one of the following types.
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal
* anomaly.
*
*
* @see AnomalyType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of the reactive anomaly. It can be one of the following types.
*
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal anomaly.
*
*
*
*
* @return The type of the reactive anomaly. It can be one of the following types.
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal
* anomaly.
*
*
* @see AnomalyType
*/
public String getType() {
return this.type;
}
/**
*
* The type of the reactive anomaly. It can be one of the following types.
*
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal anomaly.
*
*
*
*
* @param type
* The type of the reactive anomaly. It can be one of the following types.
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal
* anomaly.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalyType
*/
public ReactiveAnomaly withType(String type) {
setType(type);
return this;
}
/**
*
* The type of the reactive anomaly. It can be one of the following types.
*
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal anomaly.
*
*
*
*
* @param type
* The type of the reactive anomaly. It can be one of the following types.
*
* -
*
* CAUSAL
- the anomaly can cause a new insight.
*
*
* -
*
* CONTEXTUAL
- the anomaly contains additional information about an insight or its causal
* anomaly.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalyType
*/
public ReactiveAnomaly withType(AnomalyType type) {
this.type = type.toString();
return this;
}
/**
*
* The name of the reactive anomaly.
*
*
* @param name
* The name of the reactive anomaly.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the reactive anomaly.
*
*
* @return The name of the reactive anomaly.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the reactive anomaly.
*
*
* @param name
* The name of the reactive anomaly.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withName(String name) {
setName(name);
return this;
}
/**
*
* A description of the reactive anomaly.
*
*
* @param description
* A description of the reactive anomaly.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A description of the reactive anomaly.
*
*
* @return A description of the reactive anomaly.
*/
public String getDescription() {
return this.description;
}
/**
*
* A description of the reactive anomaly.
*
*
* @param description
* A description of the reactive anomaly.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly is
* always `NULL`.
*
*
* @param causalAnomalyId
* The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly
* is always `NULL`.
*/
public void setCausalAnomalyId(String causalAnomalyId) {
this.causalAnomalyId = causalAnomalyId;
}
/**
*
* The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly is
* always `NULL`.
*
*
* @return The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly
* is always `NULL`.
*/
public String getCausalAnomalyId() {
return this.causalAnomalyId;
}
/**
*
* The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly is
* always `NULL`.
*
*
* @param causalAnomalyId
* The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly
* is always `NULL`.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withCausalAnomalyId(String causalAnomalyId) {
setCausalAnomalyId(causalAnomalyId);
return this;
}
/**
*
* The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
*
*
* @return The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
*/
public java.util.List getAnomalyResources() {
return anomalyResources;
}
/**
*
* The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
*
*
* @param anomalyResources
* The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
*/
public void setAnomalyResources(java.util.Collection anomalyResources) {
if (anomalyResources == null) {
this.anomalyResources = null;
return;
}
this.anomalyResources = new java.util.ArrayList(anomalyResources);
}
/**
*
* The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAnomalyResources(java.util.Collection)} or {@link #withAnomalyResources(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param anomalyResources
* The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withAnomalyResources(AnomalyResource... anomalyResources) {
if (this.anomalyResources == null) {
setAnomalyResources(new java.util.ArrayList(anomalyResources.length));
}
for (AnomalyResource ele : anomalyResources) {
this.anomalyResources.add(ele);
}
return this;
}
/**
*
* The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
*
*
* @param anomalyResources
* The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReactiveAnomaly withAnomalyResources(java.util.Collection anomalyResources) {
setAnomalyResources(anomalyResources);
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 (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getSeverity() != null)
sb.append("Severity: ").append(getSeverity()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getAnomalyTimeRange() != null)
sb.append("AnomalyTimeRange: ").append(getAnomalyTimeRange()).append(",");
if (getAnomalyReportedTimeRange() != null)
sb.append("AnomalyReportedTimeRange: ").append(getAnomalyReportedTimeRange()).append(",");
if (getSourceDetails() != null)
sb.append("SourceDetails: ").append(getSourceDetails()).append(",");
if (getAssociatedInsightId() != null)
sb.append("AssociatedInsightId: ").append(getAssociatedInsightId()).append(",");
if (getResourceCollection() != null)
sb.append("ResourceCollection: ").append(getResourceCollection()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getCausalAnomalyId() != null)
sb.append("CausalAnomalyId: ").append(getCausalAnomalyId()).append(",");
if (getAnomalyResources() != null)
sb.append("AnomalyResources: ").append(getAnomalyResources());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ReactiveAnomaly == false)
return false;
ReactiveAnomaly other = (ReactiveAnomaly) obj;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getSeverity() == null ^ this.getSeverity() == null)
return false;
if (other.getSeverity() != null && other.getSeverity().equals(this.getSeverity()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getAnomalyTimeRange() == null ^ this.getAnomalyTimeRange() == null)
return false;
if (other.getAnomalyTimeRange() != null && other.getAnomalyTimeRange().equals(this.getAnomalyTimeRange()) == false)
return false;
if (other.getAnomalyReportedTimeRange() == null ^ this.getAnomalyReportedTimeRange() == null)
return false;
if (other.getAnomalyReportedTimeRange() != null && other.getAnomalyReportedTimeRange().equals(this.getAnomalyReportedTimeRange()) == false)
return false;
if (other.getSourceDetails() == null ^ this.getSourceDetails() == null)
return false;
if (other.getSourceDetails() != null && other.getSourceDetails().equals(this.getSourceDetails()) == false)
return false;
if (other.getAssociatedInsightId() == null ^ this.getAssociatedInsightId() == null)
return false;
if (other.getAssociatedInsightId() != null && other.getAssociatedInsightId().equals(this.getAssociatedInsightId()) == false)
return false;
if (other.getResourceCollection() == null ^ this.getResourceCollection() == null)
return false;
if (other.getResourceCollection() != null && other.getResourceCollection().equals(this.getResourceCollection()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getCausalAnomalyId() == null ^ this.getCausalAnomalyId() == null)
return false;
if (other.getCausalAnomalyId() != null && other.getCausalAnomalyId().equals(this.getCausalAnomalyId()) == false)
return false;
if (other.getAnomalyResources() == null ^ this.getAnomalyResources() == null)
return false;
if (other.getAnomalyResources() != null && other.getAnomalyResources().equals(this.getAnomalyResources()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getSeverity() == null) ? 0 : getSeverity().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getAnomalyTimeRange() == null) ? 0 : getAnomalyTimeRange().hashCode());
hashCode = prime * hashCode + ((getAnomalyReportedTimeRange() == null) ? 0 : getAnomalyReportedTimeRange().hashCode());
hashCode = prime * hashCode + ((getSourceDetails() == null) ? 0 : getSourceDetails().hashCode());
hashCode = prime * hashCode + ((getAssociatedInsightId() == null) ? 0 : getAssociatedInsightId().hashCode());
hashCode = prime * hashCode + ((getResourceCollection() == null) ? 0 : getResourceCollection().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getCausalAnomalyId() == null) ? 0 : getCausalAnomalyId().hashCode());
hashCode = prime * hashCode + ((getAnomalyResources() == null) ? 0 : getAnomalyResources().hashCode());
return hashCode;
}
@Override
public ReactiveAnomaly clone() {
try {
return (ReactiveAnomaly) 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.devopsguru.model.transform.ReactiveAnomalyMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}