com.amazonaws.services.cloudfront.model.CachePolicyQueryStringsConfig 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;
/**
*
* An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are
* included in the cache key and in requests that CloudFront sends to the origin.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CachePolicyQueryStringsConfig implements Serializable, Cloneable {
/**
*
* Determines whether any URL query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin. Valid values are:
*
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that are
* listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to the
* origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin, except those that are listed in the QueryStringNames
* type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin.
*
*
*
*/
private String queryStringBehavior;
/**
*
* Contains the specific query strings in viewer requests that either are or are not
* included in the cache key and in requests that CloudFront sends to the origin. The behavior depends on whether
* the QueryStringBehavior
field in the CachePolicyQueryStringsConfig
type is set to
* whitelist
(the listed query strings are included) or allExcept
(the
* listed query strings are not included, but all other query strings are).
*
*/
private QueryStringNames queryStrings;
/**
*
* Determines whether any URL query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin. Valid values are:
*
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that are
* listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to the
* origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin, except those that are listed in the QueryStringNames
* type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin.
*
*
*
*
* @param queryStringBehavior
* Determines whether any URL query strings in viewer requests are included in the cache key and in requests
* that CloudFront sends to the origin. Valid values are:
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that
* are listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to
* the origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in
* requests that CloudFront sends to the origin, except those that are listed in the
* QueryStringNames
type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin.
*
*
* @see CachePolicyQueryStringBehavior
*/
public void setQueryStringBehavior(String queryStringBehavior) {
this.queryStringBehavior = queryStringBehavior;
}
/**
*
* Determines whether any URL query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin. Valid values are:
*
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that are
* listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to the
* origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin, except those that are listed in the QueryStringNames
* type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin.
*
*
*
*
* @return Determines whether any URL query strings in viewer requests are included in the cache key and in requests
* that CloudFront sends to the origin. Valid values are:
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that
* are listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to
* the origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in
* requests that CloudFront sends to the origin, except those that are listed in the
* QueryStringNames
type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests
* that CloudFront sends to the origin.
*
*
* @see CachePolicyQueryStringBehavior
*/
public String getQueryStringBehavior() {
return this.queryStringBehavior;
}
/**
*
* Determines whether any URL query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin. Valid values are:
*
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that are
* listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to the
* origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin, except those that are listed in the QueryStringNames
* type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin.
*
*
*
*
* @param queryStringBehavior
* Determines whether any URL query strings in viewer requests are included in the cache key and in requests
* that CloudFront sends to the origin. Valid values are:
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that
* are listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to
* the origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in
* requests that CloudFront sends to the origin, except those that are listed in the
* QueryStringNames
type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see CachePolicyQueryStringBehavior
*/
public CachePolicyQueryStringsConfig withQueryStringBehavior(String queryStringBehavior) {
setQueryStringBehavior(queryStringBehavior);
return this;
}
/**
*
* Determines whether any URL query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin. Valid values are:
*
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that are
* listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to the
* origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin, except those that are listed in the QueryStringNames
* type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin.
*
*
*
*
* @param queryStringBehavior
* Determines whether any URL query strings in viewer requests are included in the cache key and in requests
* that CloudFront sends to the origin. Valid values are:
*
* -
*
* none
– No query strings in viewer requests are included in the cache key or in requests that
* CloudFront sends to the origin. Even when this field is set to none
, any query strings that
* are listed in an OriginRequestPolicy
are included in origin requests.
*
*
* -
*
* whitelist
– Only the query strings in viewer requests that are listed in the
* QueryStringNames
type are included in the cache key and in requests that CloudFront sends to
* the origin.
*
*
* -
*
* allExcept
– All query strings in viewer requests are included in the cache key and in
* requests that CloudFront sends to the origin, except those that are listed in the
* QueryStringNames
type, which are not included.
*
*
* -
*
* all
– All query strings in viewer requests are included in the cache key and in requests that
* CloudFront sends to the origin.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see CachePolicyQueryStringBehavior
*/
public CachePolicyQueryStringsConfig withQueryStringBehavior(CachePolicyQueryStringBehavior queryStringBehavior) {
this.queryStringBehavior = queryStringBehavior.toString();
return this;
}
/**
*
* Contains the specific query strings in viewer requests that either are or are not
* included in the cache key and in requests that CloudFront sends to the origin. The behavior depends on whether
* the QueryStringBehavior
field in the CachePolicyQueryStringsConfig
type is set to
* whitelist
(the listed query strings are included) or allExcept
(the
* listed query strings are not included, but all other query strings are).
*
*
* @param queryStrings
* Contains the specific query strings in viewer requests that either are or are
* not included in the cache key and in requests that CloudFront sends to the origin. The behavior
* depends on whether the QueryStringBehavior
field in the
* CachePolicyQueryStringsConfig
type is set to whitelist
(the listed query strings
* are included) or allExcept
(the listed query strings are not
* included, but all other query strings are).
*/
public void setQueryStrings(QueryStringNames queryStrings) {
this.queryStrings = queryStrings;
}
/**
*
* Contains the specific query strings in viewer requests that either are or are not
* included in the cache key and in requests that CloudFront sends to the origin. The behavior depends on whether
* the QueryStringBehavior
field in the CachePolicyQueryStringsConfig
type is set to
* whitelist
(the listed query strings are included) or allExcept
(the
* listed query strings are not included, but all other query strings are).
*
*
* @return Contains the specific query strings in viewer requests that either are or are
* not included in the cache key and in requests that CloudFront sends to the origin. The behavior
* depends on whether the QueryStringBehavior
field in the
* CachePolicyQueryStringsConfig
type is set to whitelist
(the listed query
* strings are included) or allExcept
(the listed query strings are
* not included, but all other query strings are).
*/
public QueryStringNames getQueryStrings() {
return this.queryStrings;
}
/**
*
* Contains the specific query strings in viewer requests that either are or are not
* included in the cache key and in requests that CloudFront sends to the origin. The behavior depends on whether
* the QueryStringBehavior
field in the CachePolicyQueryStringsConfig
type is set to
* whitelist
(the listed query strings are included) or allExcept
(the
* listed query strings are not included, but all other query strings are).
*
*
* @param queryStrings
* Contains the specific query strings in viewer requests that either are or are
* not included in the cache key and in requests that CloudFront sends to the origin. The behavior
* depends on whether the QueryStringBehavior
field in the
* CachePolicyQueryStringsConfig
type is set to whitelist
(the listed query strings
* are included) or allExcept
(the listed query strings are not
* included, but all other query strings are).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CachePolicyQueryStringsConfig withQueryStrings(QueryStringNames queryStrings) {
setQueryStrings(queryStrings);
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 (getQueryStringBehavior() != null)
sb.append("QueryStringBehavior: ").append(getQueryStringBehavior()).append(",");
if (getQueryStrings() != null)
sb.append("QueryStrings: ").append(getQueryStrings());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CachePolicyQueryStringsConfig == false)
return false;
CachePolicyQueryStringsConfig other = (CachePolicyQueryStringsConfig) obj;
if (other.getQueryStringBehavior() == null ^ this.getQueryStringBehavior() == null)
return false;
if (other.getQueryStringBehavior() != null && other.getQueryStringBehavior().equals(this.getQueryStringBehavior()) == false)
return false;
if (other.getQueryStrings() == null ^ this.getQueryStrings() == null)
return false;
if (other.getQueryStrings() != null && other.getQueryStrings().equals(this.getQueryStrings()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getQueryStringBehavior() == null) ? 0 : getQueryStringBehavior().hashCode());
hashCode = prime * hashCode + ((getQueryStrings() == null) ? 0 : getQueryStrings().hashCode());
return hashCode;
}
@Override
public CachePolicyQueryStringsConfig clone() {
try {
return (CachePolicyQueryStringsConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}