com.amazonaws.services.cloudfront.model.CloudFrontOriginAccessIdentityConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudfront Show documentation
/*
* Copyright 2019-2024 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;
/**
*
* Origin access identity configuration. Send a GET
request to the
* /CloudFront API version/CloudFront/identity ID/config
resource.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CloudFrontOriginAccessIdentityConfig implements Serializable, Cloneable {
/**
*
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
*
* If the value of CallerReference
is new (regardless of the content of the
* CloudFrontOriginAccessIdentityConfig
object), a new origin access identity is created.
*
*
* If the CallerReference
is a value already sent in a previous identity request, and the content of
* the CloudFrontOriginAccessIdentityConfig
is identical to the original request (ignoring white
* space), the response includes the same information returned to the original request.
*
*
* If the CallerReference
is a value you already sent in a previous request to create an identity, but
* the content of the CloudFrontOriginAccessIdentityConfig
is different from the original request,
* CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
error.
*
*/
private String callerReference;
/**
*
* A comment to describe the origin access identity. The comment cannot be longer than 128 characters.
*
*/
private String comment;
/**
* Default constructor for CloudFrontOriginAccessIdentityConfig object. Callers should use the setter or fluent
* setter (with...) methods to initialize the object after creating it.
*/
public CloudFrontOriginAccessIdentityConfig() {
}
/**
* Constructs a new CloudFrontOriginAccessIdentityConfig object. Callers should use the setter or fluent setter
* (with...) methods to initialize any additional object members.
*
* @param callerReference
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
* If the value of CallerReference
is new (regardless of the content of the
* CloudFrontOriginAccessIdentityConfig
object), a new origin access identity is created.
*
*
* If the CallerReference
is a value already sent in a previous identity request, and the
* content of the CloudFrontOriginAccessIdentityConfig
is identical to the original request
* (ignoring white space), the response includes the same information returned to the original request.
*
*
* If the CallerReference
is a value you already sent in a previous request to create an
* identity, but the content of the CloudFrontOriginAccessIdentityConfig
is different from the
* original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
error.
*/
public CloudFrontOriginAccessIdentityConfig(String callerReference) {
setCallerReference(callerReference);
}
/**
*
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
*
* If the value of CallerReference
is new (regardless of the content of the
* CloudFrontOriginAccessIdentityConfig
object), a new origin access identity is created.
*
*
* If the CallerReference
is a value already sent in a previous identity request, and the content of
* the CloudFrontOriginAccessIdentityConfig
is identical to the original request (ignoring white
* space), the response includes the same information returned to the original request.
*
*
* If the CallerReference
is a value you already sent in a previous request to create an identity, but
* the content of the CloudFrontOriginAccessIdentityConfig
is different from the original request,
* CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
error.
*
*
* @param callerReference
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
* If the value of CallerReference
is new (regardless of the content of the
* CloudFrontOriginAccessIdentityConfig
object), a new origin access identity is created.
*
*
* If the CallerReference
is a value already sent in a previous identity request, and the
* content of the CloudFrontOriginAccessIdentityConfig
is identical to the original request
* (ignoring white space), the response includes the same information returned to the original request.
*
*
* If the CallerReference
is a value you already sent in a previous request to create an
* identity, but the content of the CloudFrontOriginAccessIdentityConfig
is different from the
* original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
error.
*/
public void setCallerReference(String callerReference) {
this.callerReference = callerReference;
}
/**
*
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
*
* If the value of CallerReference
is new (regardless of the content of the
* CloudFrontOriginAccessIdentityConfig
object), a new origin access identity is created.
*
*
* If the CallerReference
is a value already sent in a previous identity request, and the content of
* the CloudFrontOriginAccessIdentityConfig
is identical to the original request (ignoring white
* space), the response includes the same information returned to the original request.
*
*
* If the CallerReference
is a value you already sent in a previous request to create an identity, but
* the content of the CloudFrontOriginAccessIdentityConfig
is different from the original request,
* CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
error.
*
*
* @return A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
* If the value of CallerReference
is new (regardless of the content of the
* CloudFrontOriginAccessIdentityConfig
object), a new origin access identity is created.
*
*
* If the CallerReference
is a value already sent in a previous identity request, and the
* content of the CloudFrontOriginAccessIdentityConfig
is identical to the original request
* (ignoring white space), the response includes the same information returned to the original request.
*
*
* If the CallerReference
is a value you already sent in a previous request to create an
* identity, but the content of the CloudFrontOriginAccessIdentityConfig
is different from the
* original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
error.
*/
public String getCallerReference() {
return this.callerReference;
}
/**
*
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
*
* If the value of CallerReference
is new (regardless of the content of the
* CloudFrontOriginAccessIdentityConfig
object), a new origin access identity is created.
*
*
* If the CallerReference
is a value already sent in a previous identity request, and the content of
* the CloudFrontOriginAccessIdentityConfig
is identical to the original request (ignoring white
* space), the response includes the same information returned to the original request.
*
*
* If the CallerReference
is a value you already sent in a previous request to create an identity, but
* the content of the CloudFrontOriginAccessIdentityConfig
is different from the original request,
* CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
error.
*
*
* @param callerReference
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
* If the value of CallerReference
is new (regardless of the content of the
* CloudFrontOriginAccessIdentityConfig
object), a new origin access identity is created.
*
*
* If the CallerReference
is a value already sent in a previous identity request, and the
* content of the CloudFrontOriginAccessIdentityConfig
is identical to the original request
* (ignoring white space), the response includes the same information returned to the original request.
*
*
* If the CallerReference
is a value you already sent in a previous request to create an
* identity, but the content of the CloudFrontOriginAccessIdentityConfig
is different from the
* original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists
error.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CloudFrontOriginAccessIdentityConfig withCallerReference(String callerReference) {
setCallerReference(callerReference);
return this;
}
/**
*
* A comment to describe the origin access identity. The comment cannot be longer than 128 characters.
*
*
* @param comment
* A comment to describe the origin access identity. The comment cannot be longer than 128 characters.
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
*
* A comment to describe the origin access identity. The comment cannot be longer than 128 characters.
*
*
* @return A comment to describe the origin access identity. The comment cannot be longer than 128 characters.
*/
public String getComment() {
return this.comment;
}
/**
*
* A comment to describe the origin access identity. The comment cannot be longer than 128 characters.
*
*
* @param comment
* A comment to describe the origin access identity. The comment cannot be longer than 128 characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CloudFrontOriginAccessIdentityConfig withComment(String comment) {
setComment(comment);
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 (getCallerReference() != null)
sb.append("CallerReference: ").append(getCallerReference()).append(",");
if (getComment() != null)
sb.append("Comment: ").append(getComment());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CloudFrontOriginAccessIdentityConfig == false)
return false;
CloudFrontOriginAccessIdentityConfig other = (CloudFrontOriginAccessIdentityConfig) obj;
if (other.getCallerReference() == null ^ this.getCallerReference() == null)
return false;
if (other.getCallerReference() != null && other.getCallerReference().equals(this.getCallerReference()) == false)
return false;
if (other.getComment() == null ^ this.getComment() == null)
return false;
if (other.getComment() != null && other.getComment().equals(this.getComment()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCallerReference() == null) ? 0 : getCallerReference().hashCode());
hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode());
return hashCode;
}
@Override
public CloudFrontOriginAccessIdentityConfig clone() {
try {
return (CloudFrontOriginAccessIdentityConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}