com.amazonaws.services.cloudfront.model.CreateRealtimeLogConfigRequest 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.cloudfront.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 CreateRealtimeLogConfigRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
*
*/
private com.amazonaws.internal.SdkInternalList endPoints;
/**
*
* A list of fields to include in each real-time log record.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*/
private com.amazonaws.internal.SdkInternalList fields;
/**
*
* A unique name to identify this real-time log configuration.
*
*/
private String name;
/**
*
* The sampling rate for this real-time log configuration. The sampling rate determines the percentage of viewer
* requests that are represented in the real-time log data. You must provide an integer between 1 and 100,
* inclusive.
*
*/
private Long samplingRate;
/**
*
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
*
*
* @return Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
*/
public java.util.List getEndPoints() {
if (endPoints == null) {
endPoints = new com.amazonaws.internal.SdkInternalList();
}
return endPoints;
}
/**
*
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
*
*
* @param endPoints
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
*/
public void setEndPoints(java.util.Collection endPoints) {
if (endPoints == null) {
this.endPoints = null;
return;
}
this.endPoints = new com.amazonaws.internal.SdkInternalList(endPoints);
}
/**
*
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEndPoints(java.util.Collection)} or {@link #withEndPoints(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param endPoints
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRealtimeLogConfigRequest withEndPoints(EndPoint... endPoints) {
if (this.endPoints == null) {
setEndPoints(new com.amazonaws.internal.SdkInternalList(endPoints.length));
}
for (EndPoint ele : endPoints) {
this.endPoints.add(ele);
}
return this;
}
/**
*
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
*
*
* @param endPoints
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRealtimeLogConfigRequest withEndPoints(java.util.Collection endPoints) {
setEndPoints(endPoints);
return this;
}
/**
*
* A list of fields to include in each real-time log record.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*
* @return A list of fields to include in each real-time log record.
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*/
public java.util.List getFields() {
if (fields == null) {
fields = new com.amazonaws.internal.SdkInternalList();
}
return fields;
}
/**
*
* A list of fields to include in each real-time log record.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*
* @param fields
* A list of fields to include in each real-time log record.
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*/
public void setFields(java.util.Collection fields) {
if (fields == null) {
this.fields = null;
return;
}
this.fields = new com.amazonaws.internal.SdkInternalList(fields);
}
/**
*
* A list of fields to include in each real-time log record.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setFields(java.util.Collection)} or {@link #withFields(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param fields
* A list of fields to include in each real-time log record.
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRealtimeLogConfigRequest withFields(String... fields) {
if (this.fields == null) {
setFields(new com.amazonaws.internal.SdkInternalList(fields.length));
}
for (String ele : fields) {
this.fields.add(ele);
}
return this;
}
/**
*
* A list of fields to include in each real-time log record.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*
* @param fields
* A list of fields to include in each real-time log record.
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRealtimeLogConfigRequest withFields(java.util.Collection fields) {
setFields(fields);
return this;
}
/**
*
* A unique name to identify this real-time log configuration.
*
*
* @param name
* A unique name to identify this real-time log configuration.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* A unique name to identify this real-time log configuration.
*
*
* @return A unique name to identify this real-time log configuration.
*/
public String getName() {
return this.name;
}
/**
*
* A unique name to identify this real-time log configuration.
*
*
* @param name
* A unique name to identify this real-time log configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRealtimeLogConfigRequest withName(String name) {
setName(name);
return this;
}
/**
*
* The sampling rate for this real-time log configuration. The sampling rate determines the percentage of viewer
* requests that are represented in the real-time log data. You must provide an integer between 1 and 100,
* inclusive.
*
*
* @param samplingRate
* The sampling rate for this real-time log configuration. The sampling rate determines the percentage of
* viewer requests that are represented in the real-time log data. You must provide an integer between 1 and
* 100, inclusive.
*/
public void setSamplingRate(Long samplingRate) {
this.samplingRate = samplingRate;
}
/**
*
* The sampling rate for this real-time log configuration. The sampling rate determines the percentage of viewer
* requests that are represented in the real-time log data. You must provide an integer between 1 and 100,
* inclusive.
*
*
* @return The sampling rate for this real-time log configuration. The sampling rate determines the percentage of
* viewer requests that are represented in the real-time log data. You must provide an integer between 1 and
* 100, inclusive.
*/
public Long getSamplingRate() {
return this.samplingRate;
}
/**
*
* The sampling rate for this real-time log configuration. The sampling rate determines the percentage of viewer
* requests that are represented in the real-time log data. You must provide an integer between 1 and 100,
* inclusive.
*
*
* @param samplingRate
* The sampling rate for this real-time log configuration. The sampling rate determines the percentage of
* viewer requests that are represented in the real-time log data. You must provide an integer between 1 and
* 100, inclusive.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRealtimeLogConfigRequest withSamplingRate(Long samplingRate) {
setSamplingRate(samplingRate);
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 (getEndPoints() != null)
sb.append("EndPoints: ").append(getEndPoints()).append(",");
if (getFields() != null)
sb.append("Fields: ").append(getFields()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getSamplingRate() != null)
sb.append("SamplingRate: ").append(getSamplingRate());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateRealtimeLogConfigRequest == false)
return false;
CreateRealtimeLogConfigRequest other = (CreateRealtimeLogConfigRequest) obj;
if (other.getEndPoints() == null ^ this.getEndPoints() == null)
return false;
if (other.getEndPoints() != null && other.getEndPoints().equals(this.getEndPoints()) == false)
return false;
if (other.getFields() == null ^ this.getFields() == null)
return false;
if (other.getFields() != null && other.getFields().equals(this.getFields()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getSamplingRate() == null ^ this.getSamplingRate() == null)
return false;
if (other.getSamplingRate() != null && other.getSamplingRate().equals(this.getSamplingRate()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEndPoints() == null) ? 0 : getEndPoints().hashCode());
hashCode = prime * hashCode + ((getFields() == null) ? 0 : getFields().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getSamplingRate() == null) ? 0 : getSamplingRate().hashCode());
return hashCode;
}
@Override
public CreateRealtimeLogConfigRequest clone() {
return (CreateRealtimeLogConfigRequest) super.clone();
}
}