/* * 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.cloudtraildata.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 PutAuditEventsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a file. *
*/ private java.util.List* The ARN or ID (the ARN suffix) of a channel. *
*/ private String channelArn; /** ** A unique identifier that is conditionally required when the channel's resource policy includes an external ID. * This value can be any string, such as a passphrase or account number. *
*/ private String externalId; /** ** The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a file. *
* * @return The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a * file. */ public java.util.List* The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a file. *
* * @param auditEvents * The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a * file. */ public void setAuditEvents(java.util.Collection* The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a file. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setAuditEvents(java.util.Collection)} or {@link #withAuditEvents(java.util.Collection)} if you want to * override the existing values. *
* * @param auditEvents * The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a * file. * @return Returns a reference to this object so that method calls can be chained together. */ public PutAuditEventsRequest withAuditEvents(AuditEvent... auditEvents) { if (this.auditEvents == null) { setAuditEvents(new java.util.ArrayList* The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a file. *
* * @param auditEvents * The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a * file. * @return Returns a reference to this object so that method calls can be chained together. */ public PutAuditEventsRequest withAuditEvents(java.util.Collection* The ARN or ID (the ARN suffix) of a channel. *
* * @param channelArn * The ARN or ID (the ARN suffix) of a channel. */ public void setChannelArn(String channelArn) { this.channelArn = channelArn; } /** ** The ARN or ID (the ARN suffix) of a channel. *
* * @return The ARN or ID (the ARN suffix) of a channel. */ public String getChannelArn() { return this.channelArn; } /** ** The ARN or ID (the ARN suffix) of a channel. *
* * @param channelArn * The ARN or ID (the ARN suffix) of a channel. * @return Returns a reference to this object so that method calls can be chained together. */ public PutAuditEventsRequest withChannelArn(String channelArn) { setChannelArn(channelArn); return this; } /** ** A unique identifier that is conditionally required when the channel's resource policy includes an external ID. * This value can be any string, such as a passphrase or account number. *
* * @param externalId * A unique identifier that is conditionally required when the channel's resource policy includes an external * ID. This value can be any string, such as a passphrase or account number. */ public void setExternalId(String externalId) { this.externalId = externalId; } /** ** A unique identifier that is conditionally required when the channel's resource policy includes an external ID. * This value can be any string, such as a passphrase or account number. *
* * @return A unique identifier that is conditionally required when the channel's resource policy includes an * external ID. This value can be any string, such as a passphrase or account number. */ public String getExternalId() { return this.externalId; } /** ** A unique identifier that is conditionally required when the channel's resource policy includes an external ID. * This value can be any string, such as a passphrase or account number. *
* * @param externalId * A unique identifier that is conditionally required when the channel's resource policy includes an external * ID. This value can be any string, such as a passphrase or account number. * @return Returns a reference to this object so that method calls can be chained together. */ public PutAuditEventsRequest withExternalId(String externalId) { setExternalId(externalId); 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 (getAuditEvents() != null) sb.append("AuditEvents: ").append(getAuditEvents()).append(","); if (getChannelArn() != null) sb.append("ChannelArn: ").append(getChannelArn()).append(","); if (getExternalId() != null) sb.append("ExternalId: ").append(getExternalId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PutAuditEventsRequest == false) return false; PutAuditEventsRequest other = (PutAuditEventsRequest) obj; if (other.getAuditEvents() == null ^ this.getAuditEvents() == null) return false; if (other.getAuditEvents() != null && other.getAuditEvents().equals(this.getAuditEvents()) == false) return false; if (other.getChannelArn() == null ^ this.getChannelArn() == null) return false; if (other.getChannelArn() != null && other.getChannelArn().equals(this.getChannelArn()) == false) return false; if (other.getExternalId() == null ^ this.getExternalId() == null) return false; if (other.getExternalId() != null && other.getExternalId().equals(this.getExternalId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAuditEvents() == null) ? 0 : getAuditEvents().hashCode()); hashCode = prime * hashCode + ((getChannelArn() == null) ? 0 : getChannelArn().hashCode()); hashCode = prime * hashCode + ((getExternalId() == null) ? 0 : getExternalId().hashCode()); return hashCode; } @Override public PutAuditEventsRequest clone() { return (PutAuditEventsRequest) super.clone(); } }