com.amazonaws.services.cloudfront.model.RealtimeLogConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudfront Show documentation
/*
* Copyright 2017-2022 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;
/**
*
* A real-time log configuration.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RealtimeLogConfig implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of this real-time log configuration.
*
*/
private String aRN;
/**
*
* The unique name of 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. The sampling rate is 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 for this
* real-time log configuration.
*
*/
private com.amazonaws.internal.SdkInternalList endPoints;
/**
*
* A list of fields that are included in each real-time log record. In an API response, the fields are provided in
* the same order in which they are sent to the Amazon Kinesis data stream.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*/
private com.amazonaws.internal.SdkInternalList fields;
/**
*
* The Amazon Resource Name (ARN) of this real-time log configuration.
*
*
* @param aRN
* The Amazon Resource Name (ARN) of this real-time log configuration.
*/
public void setARN(String aRN) {
this.aRN = aRN;
}
/**
*
* The Amazon Resource Name (ARN) of this real-time log configuration.
*
*
* @return The Amazon Resource Name (ARN) of this real-time log configuration.
*/
public String getARN() {
return this.aRN;
}
/**
*
* The Amazon Resource Name (ARN) of this real-time log configuration.
*
*
* @param aRN
* The Amazon Resource Name (ARN) of this real-time log configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RealtimeLogConfig withARN(String aRN) {
setARN(aRN);
return this;
}
/**
*
* The unique name of this real-time log configuration.
*
*
* @param name
* The unique name of this real-time log configuration.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The unique name of this real-time log configuration.
*
*
* @return The unique name of this real-time log configuration.
*/
public String getName() {
return this.name;
}
/**
*
* The unique name of this real-time log configuration.
*
*
* @param name
* The unique name of this real-time log configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RealtimeLogConfig 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. The sampling rate is 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. The sampling rate is 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. The sampling rate is 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. The sampling rate is 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. The sampling rate is 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. The sampling rate is an integer between 1
* and 100, inclusive.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RealtimeLogConfig withSamplingRate(Long samplingRate) {
setSamplingRate(samplingRate);
return this;
}
/**
*
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data for this
* real-time log configuration.
*
*
* @return Contains information about the Amazon Kinesis data stream where you are sending real-time log data for
* this real-time log configuration.
*/
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 for this
* real-time log configuration.
*
*
* @param endPoints
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data for
* this real-time log configuration.
*/
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 for this
* real-time log configuration.
*
*
* 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 for
* this real-time log configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RealtimeLogConfig 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 for this
* real-time log configuration.
*
*
* @param endPoints
* Contains information about the Amazon Kinesis data stream where you are sending real-time log data for
* this real-time log configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RealtimeLogConfig withEndPoints(java.util.Collection endPoints) {
setEndPoints(endPoints);
return this;
}
/**
*
* A list of fields that are included in each real-time log record. In an API response, the fields are provided in
* the same order in which they are sent to the Amazon Kinesis data stream.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*
* @return A list of fields that are included in each real-time log record. In an API response, the fields are
* provided in the same order in which they are sent to the Amazon Kinesis data stream.
*
* 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 that are included in each real-time log record. In an API response, the fields are provided in
* the same order in which they are sent to the Amazon Kinesis data stream.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*
* @param fields
* A list of fields that are included in each real-time log record. In an API response, the fields are
* provided in the same order in which they are sent to the Amazon Kinesis data stream.
*
* 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 that are included in each real-time log record. In an API response, the fields are provided in
* the same order in which they are sent to the Amazon Kinesis data stream.
*
*
* 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 that are included in each real-time log record. In an API response, the fields are
* provided in the same order in which they are sent to the Amazon Kinesis data stream.
*
* 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 RealtimeLogConfig 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 that are included in each real-time log record. In an API response, the fields are provided in
* the same order in which they are sent to the Amazon Kinesis data stream.
*
*
* For more information about fields, see Real-time log configuration fields in the Amazon CloudFront Developer Guide.
*
*
* @param fields
* A list of fields that are included in each real-time log record. In an API response, the fields are
* provided in the same order in which they are sent to the Amazon Kinesis data stream.
*
* 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 RealtimeLogConfig withFields(java.util.Collection fields) {
setFields(fields);
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 (getARN() != null)
sb.append("ARN: ").append(getARN()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getSamplingRate() != null)
sb.append("SamplingRate: ").append(getSamplingRate()).append(",");
if (getEndPoints() != null)
sb.append("EndPoints: ").append(getEndPoints()).append(",");
if (getFields() != null)
sb.append("Fields: ").append(getFields());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RealtimeLogConfig == false)
return false;
RealtimeLogConfig other = (RealtimeLogConfig) obj;
if (other.getARN() == null ^ this.getARN() == null)
return false;
if (other.getARN() != null && other.getARN().equals(this.getARN()) == 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;
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;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getARN() == null) ? 0 : getARN().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getSamplingRate() == null) ? 0 : getSamplingRate().hashCode());
hashCode = prime * hashCode + ((getEndPoints() == null) ? 0 : getEndPoints().hashCode());
hashCode = prime * hashCode + ((getFields() == null) ? 0 : getFields().hashCode());
return hashCode;
}
@Override
public RealtimeLogConfig clone() {
try {
return (RealtimeLogConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}