com.amazonaws.services.cloudwatch.model.DescribeAnomalyDetectorsRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudwatch 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.cloudwatch.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeAnomalyDetectorsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* Use the token returned by the previous operation to request the next page of results.
*
*/
private String nextToken;
/**
*
* The maximum number of results to return in one operation. The maximum value that you can specify is 100.
*
*
* To retrieve the remaining results, make another call with the returned NextToken
value.
*
*/
private Integer maxResults;
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified namespace.
*
*/
private String namespace;
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric name. If
* there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all
* returned.
*
*/
private String metricName;
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric dimensions.
* If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're
* all returned.
*
*/
private com.amazonaws.internal.SdkInternalList dimensions;
/**
*
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty, defaults
* to SINGLE_METRIC
.
*
*/
private com.amazonaws.internal.SdkInternalList anomalyDetectorTypes;
/**
*
* Use the token returned by the previous operation to request the next page of results.
*
*
* @param nextToken
* Use the token returned by the previous operation to request the next page of results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* Use the token returned by the previous operation to request the next page of results.
*
*
* @return Use the token returned by the previous operation to request the next page of results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* Use the token returned by the previous operation to request the next page of results.
*
*
* @param nextToken
* Use the token returned by the previous operation to request the next page of results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeAnomalyDetectorsRequest withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* The maximum number of results to return in one operation. The maximum value that you can specify is 100.
*
*
* To retrieve the remaining results, make another call with the returned NextToken
value.
*
*
* @param maxResults
* The maximum number of results to return in one operation. The maximum value that you can specify is
* 100.
*
* To retrieve the remaining results, make another call with the returned NextToken
value.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* The maximum number of results to return in one operation. The maximum value that you can specify is 100.
*
*
* To retrieve the remaining results, make another call with the returned NextToken
value.
*
*
* @return The maximum number of results to return in one operation. The maximum value that you can specify is
* 100.
*
* To retrieve the remaining results, make another call with the returned NextToken
value.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* The maximum number of results to return in one operation. The maximum value that you can specify is 100.
*
*
* To retrieve the remaining results, make another call with the returned NextToken
value.
*
*
* @param maxResults
* The maximum number of results to return in one operation. The maximum value that you can specify is
* 100.
*
* To retrieve the remaining results, make another call with the returned NextToken
value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeAnomalyDetectorsRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified namespace.
*
*
* @param namespace
* Limits the results to only the anomaly detection models that are associated with the specified namespace.
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified namespace.
*
*
* @return Limits the results to only the anomaly detection models that are associated with the specified namespace.
*/
public String getNamespace() {
return this.namespace;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified namespace.
*
*
* @param namespace
* Limits the results to only the anomaly detection models that are associated with the specified namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeAnomalyDetectorsRequest withNamespace(String namespace) {
setNamespace(namespace);
return this;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric name. If
* there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all
* returned.
*
*
* @param metricName
* Limits the results to only the anomaly detection models that are associated with the specified metric
* name. If there are multiple metrics with this name in different namespaces that have anomaly detection
* models, they're all returned.
*/
public void setMetricName(String metricName) {
this.metricName = metricName;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric name. If
* there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all
* returned.
*
*
* @return Limits the results to only the anomaly detection models that are associated with the specified metric
* name. If there are multiple metrics with this name in different namespaces that have anomaly detection
* models, they're all returned.
*/
public String getMetricName() {
return this.metricName;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric name. If
* there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all
* returned.
*
*
* @param metricName
* Limits the results to only the anomaly detection models that are associated with the specified metric
* name. If there are multiple metrics with this name in different namespaces that have anomaly detection
* models, they're all returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeAnomalyDetectorsRequest withMetricName(String metricName) {
setMetricName(metricName);
return this;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric dimensions.
* If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're
* all returned.
*
*
* @return Limits the results to only the anomaly detection models that are associated with the specified metric
* dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models
* associated, they're all returned.
*/
public java.util.List getDimensions() {
if (dimensions == null) {
dimensions = new com.amazonaws.internal.SdkInternalList();
}
return dimensions;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric dimensions.
* If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're
* all returned.
*
*
* @param dimensions
* Limits the results to only the anomaly detection models that are associated with the specified metric
* dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models
* associated, they're all returned.
*/
public void setDimensions(java.util.Collection dimensions) {
if (dimensions == null) {
this.dimensions = null;
return;
}
this.dimensions = new com.amazonaws.internal.SdkInternalList(dimensions);
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric dimensions.
* If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're
* all returned.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDimensions(java.util.Collection)} or {@link #withDimensions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param dimensions
* Limits the results to only the anomaly detection models that are associated with the specified metric
* dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models
* associated, they're all returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeAnomalyDetectorsRequest withDimensions(Dimension... dimensions) {
if (this.dimensions == null) {
setDimensions(new com.amazonaws.internal.SdkInternalList(dimensions.length));
}
for (Dimension ele : dimensions) {
this.dimensions.add(ele);
}
return this;
}
/**
*
* Limits the results to only the anomaly detection models that are associated with the specified metric dimensions.
* If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're
* all returned.
*
*
* @param dimensions
* Limits the results to only the anomaly detection models that are associated with the specified metric
* dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models
* associated, they're all returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeAnomalyDetectorsRequest withDimensions(java.util.Collection dimensions) {
setDimensions(dimensions);
return this;
}
/**
*
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty, defaults
* to SINGLE_METRIC
.
*
*
* @return The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty,
* defaults to SINGLE_METRIC
.
* @see AnomalyDetectorType
*/
public java.util.List getAnomalyDetectorTypes() {
if (anomalyDetectorTypes == null) {
anomalyDetectorTypes = new com.amazonaws.internal.SdkInternalList();
}
return anomalyDetectorTypes;
}
/**
*
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty, defaults
* to SINGLE_METRIC
.
*
*
* @param anomalyDetectorTypes
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty,
* defaults to SINGLE_METRIC
.
* @see AnomalyDetectorType
*/
public void setAnomalyDetectorTypes(java.util.Collection anomalyDetectorTypes) {
if (anomalyDetectorTypes == null) {
this.anomalyDetectorTypes = null;
return;
}
this.anomalyDetectorTypes = new com.amazonaws.internal.SdkInternalList(anomalyDetectorTypes);
}
/**
*
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty, defaults
* to SINGLE_METRIC
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAnomalyDetectorTypes(java.util.Collection)} or {@link #withAnomalyDetectorTypes(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param anomalyDetectorTypes
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty,
* defaults to SINGLE_METRIC
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalyDetectorType
*/
public DescribeAnomalyDetectorsRequest withAnomalyDetectorTypes(String... anomalyDetectorTypes) {
if (this.anomalyDetectorTypes == null) {
setAnomalyDetectorTypes(new com.amazonaws.internal.SdkInternalList(anomalyDetectorTypes.length));
}
for (String ele : anomalyDetectorTypes) {
this.anomalyDetectorTypes.add(ele);
}
return this;
}
/**
*
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty, defaults
* to SINGLE_METRIC
.
*
*
* @param anomalyDetectorTypes
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty,
* defaults to SINGLE_METRIC
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalyDetectorType
*/
public DescribeAnomalyDetectorsRequest withAnomalyDetectorTypes(java.util.Collection anomalyDetectorTypes) {
setAnomalyDetectorTypes(anomalyDetectorTypes);
return this;
}
/**
*
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty, defaults
* to SINGLE_METRIC
.
*
*
* @param anomalyDetectorTypes
* The anomaly detector types to request when using DescribeAnomalyDetectorsInput
. If empty,
* defaults to SINGLE_METRIC
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalyDetectorType
*/
public DescribeAnomalyDetectorsRequest withAnomalyDetectorTypes(AnomalyDetectorType... anomalyDetectorTypes) {
com.amazonaws.internal.SdkInternalList anomalyDetectorTypesCopy = new com.amazonaws.internal.SdkInternalList(
anomalyDetectorTypes.length);
for (AnomalyDetectorType value : anomalyDetectorTypes) {
anomalyDetectorTypesCopy.add(value.toString());
}
if (getAnomalyDetectorTypes() == null) {
setAnomalyDetectorTypes(anomalyDetectorTypesCopy);
} else {
getAnomalyDetectorTypes().addAll(anomalyDetectorTypesCopy);
}
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 (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getNamespace() != null)
sb.append("Namespace: ").append(getNamespace()).append(",");
if (getMetricName() != null)
sb.append("MetricName: ").append(getMetricName()).append(",");
if (getDimensions() != null)
sb.append("Dimensions: ").append(getDimensions()).append(",");
if (getAnomalyDetectorTypes() != null)
sb.append("AnomalyDetectorTypes: ").append(getAnomalyDetectorTypes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DescribeAnomalyDetectorsRequest == false)
return false;
DescribeAnomalyDetectorsRequest other = (DescribeAnomalyDetectorsRequest) obj;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
if (other.getNamespace() == null ^ this.getNamespace() == null)
return false;
if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false)
return false;
if (other.getMetricName() == null ^ this.getMetricName() == null)
return false;
if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false)
return false;
if (other.getDimensions() == null ^ this.getDimensions() == null)
return false;
if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false)
return false;
if (other.getAnomalyDetectorTypes() == null ^ this.getAnomalyDetectorTypes() == null)
return false;
if (other.getAnomalyDetectorTypes() != null && other.getAnomalyDetectorTypes().equals(this.getAnomalyDetectorTypes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode());
hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode());
hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode());
hashCode = prime * hashCode + ((getAnomalyDetectorTypes() == null) ? 0 : getAnomalyDetectorTypes().hashCode());
return hashCode;
}
@Override
public DescribeAnomalyDetectorsRequest clone() {
return (DescribeAnomalyDetectorsRequest) super.clone();
}
}