com.amazonaws.services.cloudtrail.model.PutInsightSelectorsResult Maven / Gradle / Ivy
/*
* Copyright 2016-2021 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.cloudtrail.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PutInsightSelectorsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
*
*/
private String trailARN;
/**
*
* A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
*
*/
private com.amazonaws.internal.SdkInternalList insightSelectors;
/**
*
* The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
*
*
* @param trailARN
* The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
*/
public void setTrailARN(String trailARN) {
this.trailARN = trailARN;
}
/**
*
* The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
*
*
* @return The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
*/
public String getTrailARN() {
return this.trailARN;
}
/**
*
* The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
*
*
* @param trailARN
* The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutInsightSelectorsResult withTrailARN(String trailARN) {
setTrailARN(trailARN);
return this;
}
/**
*
* A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
*
*
* @return A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
*/
public java.util.List getInsightSelectors() {
if (insightSelectors == null) {
insightSelectors = new com.amazonaws.internal.SdkInternalList();
}
return insightSelectors;
}
/**
*
* A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
*
*
* @param insightSelectors
* A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
*/
public void setInsightSelectors(java.util.Collection insightSelectors) {
if (insightSelectors == null) {
this.insightSelectors = null;
return;
}
this.insightSelectors = new com.amazonaws.internal.SdkInternalList(insightSelectors);
}
/**
*
* A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setInsightSelectors(java.util.Collection)} or {@link #withInsightSelectors(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param insightSelectors
* A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutInsightSelectorsResult withInsightSelectors(InsightSelector... insightSelectors) {
if (this.insightSelectors == null) {
setInsightSelectors(new com.amazonaws.internal.SdkInternalList(insightSelectors.length));
}
for (InsightSelector ele : insightSelectors) {
this.insightSelectors.add(ele);
}
return this;
}
/**
*
* A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
*
*
* @param insightSelectors
* A JSON string that contains the insight types you want to log on a trail. In this release, only
* ApiCallRateInsight
is supported as an insight type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutInsightSelectorsResult withInsightSelectors(java.util.Collection insightSelectors) {
setInsightSelectors(insightSelectors);
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 (getTrailARN() != null)
sb.append("TrailARN: ").append(getTrailARN()).append(",");
if (getInsightSelectors() != null)
sb.append("InsightSelectors: ").append(getInsightSelectors());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PutInsightSelectorsResult == false)
return false;
PutInsightSelectorsResult other = (PutInsightSelectorsResult) obj;
if (other.getTrailARN() == null ^ this.getTrailARN() == null)
return false;
if (other.getTrailARN() != null && other.getTrailARN().equals(this.getTrailARN()) == false)
return false;
if (other.getInsightSelectors() == null ^ this.getInsightSelectors() == null)
return false;
if (other.getInsightSelectors() != null && other.getInsightSelectors().equals(this.getInsightSelectors()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTrailARN() == null) ? 0 : getTrailARN().hashCode());
hashCode = prime * hashCode + ((getInsightSelectors() == null) ? 0 : getInsightSelectors().hashCode());
return hashCode;
}
@Override
public PutInsightSelectorsResult clone() {
try {
return (PutInsightSelectorsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}