com.amazonaws.services.cloudfront.model.OriginShield 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;
/**
*
* CloudFront Origin Shield.
*
*
* Using Origin Shield can help reduce the load on your origin. For more information, see Using Origin Shield
* in the Amazon CloudFront Developer Guide.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OriginShield implements Serializable, Cloneable {
/**
*
* A flag that specifies whether Origin Shield is enabled.
*
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your origin. When
* it's disabled, CloudFront might send requests directly to your origin from multiple edge locations or regional
* edge caches.
*
*/
private Boolean enabled;
/**
*
* The Amazon Web Services Region for Origin Shield.
*
*
* Specify the Amazon Web Services Region that has the lowest latency to your origin. To specify a region, use the
* region code, not the region name. For example, specify the US East (Ohio) region as us-east-2
.
*
*
* When you enable CloudFront Origin Shield, you must specify the Amazon Web Services Region for Origin Shield. For
* the list of Amazon Web Services Regions that you can specify, and for help choosing the best Region for your
* origin, see Choosing the Amazon Web Services Region for Origin Shield in the Amazon CloudFront Developer Guide.
*
*/
private String originShieldRegion;
/**
*
* A flag that specifies whether Origin Shield is enabled.
*
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your origin. When
* it's disabled, CloudFront might send requests directly to your origin from multiple edge locations or regional
* edge caches.
*
*
* @param enabled
* A flag that specifies whether Origin Shield is enabled.
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your
* origin. When it's disabled, CloudFront might send requests directly to your origin from multiple edge
* locations or regional edge caches.
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
*
* A flag that specifies whether Origin Shield is enabled.
*
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your origin. When
* it's disabled, CloudFront might send requests directly to your origin from multiple edge locations or regional
* edge caches.
*
*
* @return A flag that specifies whether Origin Shield is enabled.
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your
* origin. When it's disabled, CloudFront might send requests directly to your origin from multiple edge
* locations or regional edge caches.
*/
public Boolean getEnabled() {
return this.enabled;
}
/**
*
* A flag that specifies whether Origin Shield is enabled.
*
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your origin. When
* it's disabled, CloudFront might send requests directly to your origin from multiple edge locations or regional
* edge caches.
*
*
* @param enabled
* A flag that specifies whether Origin Shield is enabled.
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your
* origin. When it's disabled, CloudFront might send requests directly to your origin from multiple edge
* locations or regional edge caches.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OriginShield withEnabled(Boolean enabled) {
setEnabled(enabled);
return this;
}
/**
*
* A flag that specifies whether Origin Shield is enabled.
*
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your origin. When
* it's disabled, CloudFront might send requests directly to your origin from multiple edge locations or regional
* edge caches.
*
*
* @return A flag that specifies whether Origin Shield is enabled.
*
* When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your
* origin. When it's disabled, CloudFront might send requests directly to your origin from multiple edge
* locations or regional edge caches.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
*
* The Amazon Web Services Region for Origin Shield.
*
*
* Specify the Amazon Web Services Region that has the lowest latency to your origin. To specify a region, use the
* region code, not the region name. For example, specify the US East (Ohio) region as us-east-2
.
*
*
* When you enable CloudFront Origin Shield, you must specify the Amazon Web Services Region for Origin Shield. For
* the list of Amazon Web Services Regions that you can specify, and for help choosing the best Region for your
* origin, see Choosing the Amazon Web Services Region for Origin Shield in the Amazon CloudFront Developer Guide.
*
*
* @param originShieldRegion
* The Amazon Web Services Region for Origin Shield.
*
* Specify the Amazon Web Services Region that has the lowest latency to your origin. To specify a region,
* use the region code, not the region name. For example, specify the US East (Ohio) region as
* us-east-2
.
*
*
* When you enable CloudFront Origin Shield, you must specify the Amazon Web Services Region for Origin
* Shield. For the list of Amazon Web Services Regions that you can specify, and for help choosing the best
* Region for your origin, see Choosing the Amazon Web Services Region for Origin Shield in the Amazon CloudFront Developer
* Guide.
*/
public void setOriginShieldRegion(String originShieldRegion) {
this.originShieldRegion = originShieldRegion;
}
/**
*
* The Amazon Web Services Region for Origin Shield.
*
*
* Specify the Amazon Web Services Region that has the lowest latency to your origin. To specify a region, use the
* region code, not the region name. For example, specify the US East (Ohio) region as us-east-2
.
*
*
* When you enable CloudFront Origin Shield, you must specify the Amazon Web Services Region for Origin Shield. For
* the list of Amazon Web Services Regions that you can specify, and for help choosing the best Region for your
* origin, see Choosing the Amazon Web Services Region for Origin Shield in the Amazon CloudFront Developer Guide.
*
*
* @return The Amazon Web Services Region for Origin Shield.
*
* Specify the Amazon Web Services Region that has the lowest latency to your origin. To specify a region,
* use the region code, not the region name. For example, specify the US East (Ohio) region as
* us-east-2
.
*
*
* When you enable CloudFront Origin Shield, you must specify the Amazon Web Services Region for Origin
* Shield. For the list of Amazon Web Services Regions that you can specify, and for help choosing the best
* Region for your origin, see Choosing the Amazon Web Services Region for Origin Shield in the Amazon CloudFront Developer
* Guide.
*/
public String getOriginShieldRegion() {
return this.originShieldRegion;
}
/**
*
* The Amazon Web Services Region for Origin Shield.
*
*
* Specify the Amazon Web Services Region that has the lowest latency to your origin. To specify a region, use the
* region code, not the region name. For example, specify the US East (Ohio) region as us-east-2
.
*
*
* When you enable CloudFront Origin Shield, you must specify the Amazon Web Services Region for Origin Shield. For
* the list of Amazon Web Services Regions that you can specify, and for help choosing the best Region for your
* origin, see Choosing the Amazon Web Services Region for Origin Shield in the Amazon CloudFront Developer Guide.
*
*
* @param originShieldRegion
* The Amazon Web Services Region for Origin Shield.
*
* Specify the Amazon Web Services Region that has the lowest latency to your origin. To specify a region,
* use the region code, not the region name. For example, specify the US East (Ohio) region as
* us-east-2
.
*
*
* When you enable CloudFront Origin Shield, you must specify the Amazon Web Services Region for Origin
* Shield. For the list of Amazon Web Services Regions that you can specify, and for help choosing the best
* Region for your origin, see Choosing the Amazon Web Services Region for Origin Shield in the Amazon CloudFront Developer
* Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OriginShield withOriginShieldRegion(String originShieldRegion) {
setOriginShieldRegion(originShieldRegion);
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 (getEnabled() != null)
sb.append("Enabled: ").append(getEnabled()).append(",");
if (getOriginShieldRegion() != null)
sb.append("OriginShieldRegion: ").append(getOriginShieldRegion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof OriginShield == false)
return false;
OriginShield other = (OriginShield) obj;
if (other.getEnabled() == null ^ this.getEnabled() == null)
return false;
if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false)
return false;
if (other.getOriginShieldRegion() == null ^ this.getOriginShieldRegion() == null)
return false;
if (other.getOriginShieldRegion() != null && other.getOriginShieldRegion().equals(this.getOriginShieldRegion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
hashCode = prime * hashCode + ((getOriginShieldRegion() == null) ? 0 : getOriginShieldRegion().hashCode());
return hashCode;
}
@Override
public OriginShield clone() {
try {
return (OriginShield) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}