com.amazonaws.services.cloudtrail.model.PutEventSelectorsResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudtrail Show documentation
/*
* 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 PutEventSelectorsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* Specifies the ARN of the trail that was updated with event selectors. The format of a trail ARN is:
*
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*
*/
private String trailARN;
/**
*
* Specifies the event selectors configured for your trail.
*
*/
private com.amazonaws.internal.SdkInternalList eventSelectors;
/**
*
* Specifies the advanced event selectors configured for your trail.
*
*/
private com.amazonaws.internal.SdkInternalList advancedEventSelectors;
/**
*
* Specifies the ARN of the trail that was updated with event selectors. The format of a trail ARN is:
*
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*
*
* @param trailARN
* Specifies the ARN of the trail that was updated with event selectors. The format of a trail ARN is:
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*/
public void setTrailARN(String trailARN) {
this.trailARN = trailARN;
}
/**
*
* Specifies the ARN of the trail that was updated with event selectors. The format of a trail ARN is:
*
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*
*
* @return Specifies the ARN of the trail that was updated with event selectors. The format of a trail ARN is:
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*/
public String getTrailARN() {
return this.trailARN;
}
/**
*
* Specifies the ARN of the trail that was updated with event selectors. The format of a trail ARN is:
*
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*
*
* @param trailARN
* Specifies the ARN of the trail that was updated with event selectors. The format of a trail ARN is:
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutEventSelectorsResult withTrailARN(String trailARN) {
setTrailARN(trailARN);
return this;
}
/**
*
* Specifies the event selectors configured for your trail.
*
*
* @return Specifies the event selectors configured for your trail.
*/
public java.util.List getEventSelectors() {
if (eventSelectors == null) {
eventSelectors = new com.amazonaws.internal.SdkInternalList();
}
return eventSelectors;
}
/**
*
* Specifies the event selectors configured for your trail.
*
*
* @param eventSelectors
* Specifies the event selectors configured for your trail.
*/
public void setEventSelectors(java.util.Collection eventSelectors) {
if (eventSelectors == null) {
this.eventSelectors = null;
return;
}
this.eventSelectors = new com.amazonaws.internal.SdkInternalList(eventSelectors);
}
/**
*
* Specifies the event selectors configured for your trail.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEventSelectors(java.util.Collection)} or {@link #withEventSelectors(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param eventSelectors
* Specifies the event selectors configured for your trail.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutEventSelectorsResult withEventSelectors(EventSelector... eventSelectors) {
if (this.eventSelectors == null) {
setEventSelectors(new com.amazonaws.internal.SdkInternalList(eventSelectors.length));
}
for (EventSelector ele : eventSelectors) {
this.eventSelectors.add(ele);
}
return this;
}
/**
*
* Specifies the event selectors configured for your trail.
*
*
* @param eventSelectors
* Specifies the event selectors configured for your trail.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutEventSelectorsResult withEventSelectors(java.util.Collection eventSelectors) {
setEventSelectors(eventSelectors);
return this;
}
/**
*
* Specifies the advanced event selectors configured for your trail.
*
*
* @return Specifies the advanced event selectors configured for your trail.
*/
public java.util.List getAdvancedEventSelectors() {
if (advancedEventSelectors == null) {
advancedEventSelectors = new com.amazonaws.internal.SdkInternalList();
}
return advancedEventSelectors;
}
/**
*
* Specifies the advanced event selectors configured for your trail.
*
*
* @param advancedEventSelectors
* Specifies the advanced event selectors configured for your trail.
*/
public void setAdvancedEventSelectors(java.util.Collection advancedEventSelectors) {
if (advancedEventSelectors == null) {
this.advancedEventSelectors = null;
return;
}
this.advancedEventSelectors = new com.amazonaws.internal.SdkInternalList(advancedEventSelectors);
}
/**
*
* Specifies the advanced event selectors configured for your trail.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAdvancedEventSelectors(java.util.Collection)} or
* {@link #withAdvancedEventSelectors(java.util.Collection)} if you want to override the existing values.
*
*
* @param advancedEventSelectors
* Specifies the advanced event selectors configured for your trail.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutEventSelectorsResult withAdvancedEventSelectors(AdvancedEventSelector... advancedEventSelectors) {
if (this.advancedEventSelectors == null) {
setAdvancedEventSelectors(new com.amazonaws.internal.SdkInternalList(advancedEventSelectors.length));
}
for (AdvancedEventSelector ele : advancedEventSelectors) {
this.advancedEventSelectors.add(ele);
}
return this;
}
/**
*
* Specifies the advanced event selectors configured for your trail.
*
*
* @param advancedEventSelectors
* Specifies the advanced event selectors configured for your trail.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutEventSelectorsResult withAdvancedEventSelectors(java.util.Collection advancedEventSelectors) {
setAdvancedEventSelectors(advancedEventSelectors);
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 (getEventSelectors() != null)
sb.append("EventSelectors: ").append(getEventSelectors()).append(",");
if (getAdvancedEventSelectors() != null)
sb.append("AdvancedEventSelectors: ").append(getAdvancedEventSelectors());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PutEventSelectorsResult == false)
return false;
PutEventSelectorsResult other = (PutEventSelectorsResult) obj;
if (other.getTrailARN() == null ^ this.getTrailARN() == null)
return false;
if (other.getTrailARN() != null && other.getTrailARN().equals(this.getTrailARN()) == false)
return false;
if (other.getEventSelectors() == null ^ this.getEventSelectors() == null)
return false;
if (other.getEventSelectors() != null && other.getEventSelectors().equals(this.getEventSelectors()) == false)
return false;
if (other.getAdvancedEventSelectors() == null ^ this.getAdvancedEventSelectors() == null)
return false;
if (other.getAdvancedEventSelectors() != null && other.getAdvancedEventSelectors().equals(this.getAdvancedEventSelectors()) == 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 + ((getEventSelectors() == null) ? 0 : getEventSelectors().hashCode());
hashCode = prime * hashCode + ((getAdvancedEventSelectors() == null) ? 0 : getAdvancedEventSelectors().hashCode());
return hashCode;
}
@Override
public PutEventSelectorsResult clone() {
try {
return (PutEventSelectorsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}