com.amazonaws.services.cloudtrail.model.PutInsightSelectorsRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudtrail Show documentation
/*
* 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.cloudtrail.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 PutInsightSelectorsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the CloudTrail trail for which you want to change or add Insights selectors.
*
*/
private String trailName;
/**
*
* A JSON string that contains the insight types you want to log on a trail. ApiCallRateInsight
and
* ApiErrorRateInsight
are valid Insight types.
*
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are aggregated
* per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error codes. The
* error is shown if the API call is unsuccessful.
*
*/
private com.amazonaws.internal.SdkInternalList insightSelectors;
/**
*
* The name of the CloudTrail trail for which you want to change or add Insights selectors.
*
*
* @param trailName
* The name of the CloudTrail trail for which you want to change or add Insights selectors.
*/
public void setTrailName(String trailName) {
this.trailName = trailName;
}
/**
*
* The name of the CloudTrail trail for which you want to change or add Insights selectors.
*
*
* @return The name of the CloudTrail trail for which you want to change or add Insights selectors.
*/
public String getTrailName() {
return this.trailName;
}
/**
*
* The name of the CloudTrail trail for which you want to change or add Insights selectors.
*
*
* @param trailName
* The name of the CloudTrail 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 PutInsightSelectorsRequest withTrailName(String trailName) {
setTrailName(trailName);
return this;
}
/**
*
* A JSON string that contains the insight types you want to log on a trail. ApiCallRateInsight
and
* ApiErrorRateInsight
are valid Insight types.
*
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are aggregated
* per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error codes. The
* error is shown if the API call is unsuccessful.
*
*
* @return A JSON string that contains the insight types you want to log on a trail. ApiCallRateInsight
* and ApiErrorRateInsight
are valid Insight types.
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are
* aggregated per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error
* codes. The error is shown if the API call is unsuccessful.
*/
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. ApiCallRateInsight
and
* ApiErrorRateInsight
are valid Insight types.
*
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are aggregated
* per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error codes. The
* error is shown if the API call is unsuccessful.
*
*
* @param insightSelectors
* A JSON string that contains the insight types you want to log on a trail. ApiCallRateInsight
* and ApiErrorRateInsight
are valid Insight types.
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are
* aggregated per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error
* codes. The error is shown if the API call is unsuccessful.
*/
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. ApiCallRateInsight
and
* ApiErrorRateInsight
are valid Insight types.
*
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are aggregated
* per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error codes. The
* error is shown if the API call is unsuccessful.
*
*
* 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. ApiCallRateInsight
* and ApiErrorRateInsight
are valid Insight types.
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are
* aggregated per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error
* codes. The error is shown if the API call is unsuccessful.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutInsightSelectorsRequest 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. ApiCallRateInsight
and
* ApiErrorRateInsight
are valid Insight types.
*
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are aggregated
* per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error codes. The
* error is shown if the API call is unsuccessful.
*
*
* @param insightSelectors
* A JSON string that contains the insight types you want to log on a trail. ApiCallRateInsight
* and ApiErrorRateInsight
are valid Insight types.
*
* The ApiCallRateInsight
Insights type analyzes write-only management API calls that are
* aggregated per minute against a baseline API call volume.
*
*
* The ApiErrorRateInsight
Insights type analyzes management API calls that result in error
* codes. The error is shown if the API call is unsuccessful.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutInsightSelectorsRequest 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 (getTrailName() != null)
sb.append("TrailName: ").append(getTrailName()).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 PutInsightSelectorsRequest == false)
return false;
PutInsightSelectorsRequest other = (PutInsightSelectorsRequest) obj;
if (other.getTrailName() == null ^ this.getTrailName() == null)
return false;
if (other.getTrailName() != null && other.getTrailName().equals(this.getTrailName()) == 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 + ((getTrailName() == null) ? 0 : getTrailName().hashCode());
hashCode = prime * hashCode + ((getInsightSelectors() == null) ? 0 : getInsightSelectors().hashCode());
return hashCode;
}
@Override
public PutInsightSelectorsRequest clone() {
return (PutInsightSelectorsRequest) super.clone();
}
}