
com.amazonaws.services.lightsail.model.UpdateDistributionRequest Maven / Gradle / Ivy
/*
* 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.lightsail.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 UpdateDistributionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the distribution to update.
*
*
* Use the GetDistributions
action to get a list of distribution names that you can specify.
*
*/
private String distributionName;
/**
*
* An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket, or load
* balancer.
*
*
* The distribution pulls, caches, and serves content from the origin.
*
*/
private InputOrigin origin;
/**
*
* An object that describes the default cache behavior for the distribution.
*
*/
private CacheBehavior defaultCacheBehavior;
/**
*
* An object that describes the cache behavior settings for the distribution.
*
*
*
* The cacheBehaviorSettings
specified in your UpdateDistributionRequest
will replace your
* distribution's existing settings.
*
*
*/
private CacheSettings cacheBehaviorSettings;
/**
*
* An array of objects that describe the per-path cache behavior for the distribution.
*
*/
private java.util.List cacheBehaviors;
/**
*
* Indicates whether to enable the distribution.
*
*/
private Boolean isEnabled;
/**
*
* The name of the distribution to update.
*
*
* Use the GetDistributions
action to get a list of distribution names that you can specify.
*
*
* @param distributionName
* The name of the distribution to update.
*
* Use the GetDistributions
action to get a list of distribution names that you can specify.
*/
public void setDistributionName(String distributionName) {
this.distributionName = distributionName;
}
/**
*
* The name of the distribution to update.
*
*
* Use the GetDistributions
action to get a list of distribution names that you can specify.
*
*
* @return The name of the distribution to update.
*
* Use the GetDistributions
action to get a list of distribution names that you can specify.
*/
public String getDistributionName() {
return this.distributionName;
}
/**
*
* The name of the distribution to update.
*
*
* Use the GetDistributions
action to get a list of distribution names that you can specify.
*
*
* @param distributionName
* The name of the distribution to update.
*
* Use the GetDistributions
action to get a list of distribution names that you can specify.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateDistributionRequest withDistributionName(String distributionName) {
setDistributionName(distributionName);
return this;
}
/**
*
* An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket, or load
* balancer.
*
*
* The distribution pulls, caches, and serves content from the origin.
*
*
* @param origin
* An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket,
* or load balancer.
*
* The distribution pulls, caches, and serves content from the origin.
*/
public void setOrigin(InputOrigin origin) {
this.origin = origin;
}
/**
*
* An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket, or load
* balancer.
*
*
* The distribution pulls, caches, and serves content from the origin.
*
*
* @return An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket,
* or load balancer.
*
* The distribution pulls, caches, and serves content from the origin.
*/
public InputOrigin getOrigin() {
return this.origin;
}
/**
*
* An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket, or load
* balancer.
*
*
* The distribution pulls, caches, and serves content from the origin.
*
*
* @param origin
* An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket,
* or load balancer.
*
* The distribution pulls, caches, and serves content from the origin.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateDistributionRequest withOrigin(InputOrigin origin) {
setOrigin(origin);
return this;
}
/**
*
* An object that describes the default cache behavior for the distribution.
*
*
* @param defaultCacheBehavior
* An object that describes the default cache behavior for the distribution.
*/
public void setDefaultCacheBehavior(CacheBehavior defaultCacheBehavior) {
this.defaultCacheBehavior = defaultCacheBehavior;
}
/**
*
* An object that describes the default cache behavior for the distribution.
*
*
* @return An object that describes the default cache behavior for the distribution.
*/
public CacheBehavior getDefaultCacheBehavior() {
return this.defaultCacheBehavior;
}
/**
*
* An object that describes the default cache behavior for the distribution.
*
*
* @param defaultCacheBehavior
* An object that describes the default cache behavior for the distribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateDistributionRequest withDefaultCacheBehavior(CacheBehavior defaultCacheBehavior) {
setDefaultCacheBehavior(defaultCacheBehavior);
return this;
}
/**
*
* An object that describes the cache behavior settings for the distribution.
*
*
*
* The cacheBehaviorSettings
specified in your UpdateDistributionRequest
will replace your
* distribution's existing settings.
*
*
*
* @param cacheBehaviorSettings
* An object that describes the cache behavior settings for the distribution.
*
* The cacheBehaviorSettings
specified in your UpdateDistributionRequest
will
* replace your distribution's existing settings.
*
*/
public void setCacheBehaviorSettings(CacheSettings cacheBehaviorSettings) {
this.cacheBehaviorSettings = cacheBehaviorSettings;
}
/**
*
* An object that describes the cache behavior settings for the distribution.
*
*
*
* The cacheBehaviorSettings
specified in your UpdateDistributionRequest
will replace your
* distribution's existing settings.
*
*
*
* @return An object that describes the cache behavior settings for the distribution.
*
* The cacheBehaviorSettings
specified in your UpdateDistributionRequest
will
* replace your distribution's existing settings.
*
*/
public CacheSettings getCacheBehaviorSettings() {
return this.cacheBehaviorSettings;
}
/**
*
* An object that describes the cache behavior settings for the distribution.
*
*
*
* The cacheBehaviorSettings
specified in your UpdateDistributionRequest
will replace your
* distribution's existing settings.
*
*
*
* @param cacheBehaviorSettings
* An object that describes the cache behavior settings for the distribution.
*
* The cacheBehaviorSettings
specified in your UpdateDistributionRequest
will
* replace your distribution's existing settings.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateDistributionRequest withCacheBehaviorSettings(CacheSettings cacheBehaviorSettings) {
setCacheBehaviorSettings(cacheBehaviorSettings);
return this;
}
/**
*
* An array of objects that describe the per-path cache behavior for the distribution.
*
*
* @return An array of objects that describe the per-path cache behavior for the distribution.
*/
public java.util.List getCacheBehaviors() {
return cacheBehaviors;
}
/**
*
* An array of objects that describe the per-path cache behavior for the distribution.
*
*
* @param cacheBehaviors
* An array of objects that describe the per-path cache behavior for the distribution.
*/
public void setCacheBehaviors(java.util.Collection cacheBehaviors) {
if (cacheBehaviors == null) {
this.cacheBehaviors = null;
return;
}
this.cacheBehaviors = new java.util.ArrayList(cacheBehaviors);
}
/**
*
* An array of objects that describe the per-path cache behavior for the distribution.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCacheBehaviors(java.util.Collection)} or {@link #withCacheBehaviors(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param cacheBehaviors
* An array of objects that describe the per-path cache behavior for the distribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateDistributionRequest withCacheBehaviors(CacheBehaviorPerPath... cacheBehaviors) {
if (this.cacheBehaviors == null) {
setCacheBehaviors(new java.util.ArrayList(cacheBehaviors.length));
}
for (CacheBehaviorPerPath ele : cacheBehaviors) {
this.cacheBehaviors.add(ele);
}
return this;
}
/**
*
* An array of objects that describe the per-path cache behavior for the distribution.
*
*
* @param cacheBehaviors
* An array of objects that describe the per-path cache behavior for the distribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateDistributionRequest withCacheBehaviors(java.util.Collection cacheBehaviors) {
setCacheBehaviors(cacheBehaviors);
return this;
}
/**
*
* Indicates whether to enable the distribution.
*
*
* @param isEnabled
* Indicates whether to enable the distribution.
*/
public void setIsEnabled(Boolean isEnabled) {
this.isEnabled = isEnabled;
}
/**
*
* Indicates whether to enable the distribution.
*
*
* @return Indicates whether to enable the distribution.
*/
public Boolean getIsEnabled() {
return this.isEnabled;
}
/**
*
* Indicates whether to enable the distribution.
*
*
* @param isEnabled
* Indicates whether to enable the distribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateDistributionRequest withIsEnabled(Boolean isEnabled) {
setIsEnabled(isEnabled);
return this;
}
/**
*
* Indicates whether to enable the distribution.
*
*
* @return Indicates whether to enable the distribution.
*/
public Boolean isEnabled() {
return this.isEnabled;
}
/**
* 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 (getDistributionName() != null)
sb.append("DistributionName: ").append(getDistributionName()).append(",");
if (getOrigin() != null)
sb.append("Origin: ").append(getOrigin()).append(",");
if (getDefaultCacheBehavior() != null)
sb.append("DefaultCacheBehavior: ").append(getDefaultCacheBehavior()).append(",");
if (getCacheBehaviorSettings() != null)
sb.append("CacheBehaviorSettings: ").append(getCacheBehaviorSettings()).append(",");
if (getCacheBehaviors() != null)
sb.append("CacheBehaviors: ").append(getCacheBehaviors()).append(",");
if (getIsEnabled() != null)
sb.append("IsEnabled: ").append(getIsEnabled());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateDistributionRequest == false)
return false;
UpdateDistributionRequest other = (UpdateDistributionRequest) obj;
if (other.getDistributionName() == null ^ this.getDistributionName() == null)
return false;
if (other.getDistributionName() != null && other.getDistributionName().equals(this.getDistributionName()) == false)
return false;
if (other.getOrigin() == null ^ this.getOrigin() == null)
return false;
if (other.getOrigin() != null && other.getOrigin().equals(this.getOrigin()) == false)
return false;
if (other.getDefaultCacheBehavior() == null ^ this.getDefaultCacheBehavior() == null)
return false;
if (other.getDefaultCacheBehavior() != null && other.getDefaultCacheBehavior().equals(this.getDefaultCacheBehavior()) == false)
return false;
if (other.getCacheBehaviorSettings() == null ^ this.getCacheBehaviorSettings() == null)
return false;
if (other.getCacheBehaviorSettings() != null && other.getCacheBehaviorSettings().equals(this.getCacheBehaviorSettings()) == false)
return false;
if (other.getCacheBehaviors() == null ^ this.getCacheBehaviors() == null)
return false;
if (other.getCacheBehaviors() != null && other.getCacheBehaviors().equals(this.getCacheBehaviors()) == false)
return false;
if (other.getIsEnabled() == null ^ this.getIsEnabled() == null)
return false;
if (other.getIsEnabled() != null && other.getIsEnabled().equals(this.getIsEnabled()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDistributionName() == null) ? 0 : getDistributionName().hashCode());
hashCode = prime * hashCode + ((getOrigin() == null) ? 0 : getOrigin().hashCode());
hashCode = prime * hashCode + ((getDefaultCacheBehavior() == null) ? 0 : getDefaultCacheBehavior().hashCode());
hashCode = prime * hashCode + ((getCacheBehaviorSettings() == null) ? 0 : getCacheBehaviorSettings().hashCode());
hashCode = prime * hashCode + ((getCacheBehaviors() == null) ? 0 : getCacheBehaviors().hashCode());
hashCode = prime * hashCode + ((getIsEnabled() == null) ? 0 : getIsEnabled().hashCode());
return hashCode;
}
@Override
public UpdateDistributionRequest clone() {
return (UpdateDistributionRequest) super.clone();
}
}