/* * 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.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes whether an Amazon Lightsail content delivery network (CDN) distribution forwards cookies to the origin and, * if so, which ones. *
** For the cookies that you specify, your distribution caches separate versions of the specified content based on the * cookie values in viewer requests. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CookieObject implements Serializable, Cloneable, StructuredPojo { /** *
* Specifies which cookies to forward to the distribution's origin for a cache behavior: all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
*
* The specific cookies to forward to your distribution's origin. *
*/ private java.util.List
* Specifies which cookies to forward to the distribution's origin for a cache behavior: all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
*
all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
* @see ForwardValues
*/
public void setOption(String option) {
this.option = option;
}
/**
*
* Specifies which cookies to forward to the distribution's origin for a cache behavior: all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
*
all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
* @see ForwardValues
*/
public String getOption() {
return this.option;
}
/**
*
* Specifies which cookies to forward to the distribution's origin for a cache behavior: all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
*
all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ForwardValues
*/
public CookieObject withOption(String option) {
setOption(option);
return this;
}
/**
*
* Specifies which cookies to forward to the distribution's origin for a cache behavior: all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
*
all
,
* none
, or allow-list
to forward only the cookies specified in the
* cookiesAllowList
parameter.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ForwardValues
*/
public CookieObject withOption(ForwardValues option) {
this.option = option.toString();
return this;
}
/**
* * The specific cookies to forward to your distribution's origin. *
* * @return The specific cookies to forward to your distribution's origin. */ public java.util.List* The specific cookies to forward to your distribution's origin. *
* * @param cookiesAllowList * The specific cookies to forward to your distribution's origin. */ public void setCookiesAllowList(java.util.Collection* The specific cookies to forward to your distribution's origin. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setCookiesAllowList(java.util.Collection)} or {@link #withCookiesAllowList(java.util.Collection)} if you * want to override the existing values. *
* * @param cookiesAllowList * The specific cookies to forward to your distribution's origin. * @return Returns a reference to this object so that method calls can be chained together. */ public CookieObject withCookiesAllowList(String... cookiesAllowList) { if (this.cookiesAllowList == null) { setCookiesAllowList(new java.util.ArrayList* The specific cookies to forward to your distribution's origin. *
* * @param cookiesAllowList * The specific cookies to forward to your distribution's origin. * @return Returns a reference to this object so that method calls can be chained together. */ public CookieObject withCookiesAllowList(java.util.Collection