1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/cloudfront/CloudFront_EXPORTS.h> 8 #include <aws/cloudfront/model/CachePolicyCookieBehavior.h> 9 #include <aws/cloudfront/model/CookieNames.h> 10 #include <utility> 11 12 namespace Aws 13 { 14 namespace Utils 15 { 16 namespace Xml 17 { 18 class XmlNode; 19 } // namespace Xml 20 } // namespace Utils 21 namespace CloudFront 22 { 23 namespace Model 24 { 25 26 /** 27 * <p>An object that determines whether any cookies in viewer requests (and if so, 28 * which cookies) are included in the cache key and automatically included in 29 * requests that CloudFront sends to the origin.</p><p><h3>See Also:</h3> <a 30 * href="http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/CachePolicyCookiesConfig">AWS 31 * API Reference</a></p> 32 */ 33 class AWS_CLOUDFRONT_API CachePolicyCookiesConfig 34 { 35 public: 36 CachePolicyCookiesConfig(); 37 CachePolicyCookiesConfig(const Aws::Utils::Xml::XmlNode& xmlNode); 38 CachePolicyCookiesConfig& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); 39 40 void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; 41 42 43 /** 44 * <p>Determines whether any cookies in viewer requests are included in the cache 45 * key and automatically included in requests that CloudFront sends to the origin. 46 * Valid values are:</p> <ul> <li> <p> <code>none</code> – Cookies in viewer 47 * requests are not included in the cache key and are not automatically included in 48 * requests that CloudFront sends to the origin. Even when this field is set to 49 * <code>none</code>, any cookies that are listed in an 50 * <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> 51 * </li> <li> <p> <code>whitelist</code> – The cookies in viewer requests that are 52 * listed in the <code>CookieNames</code> type are included in the cache key and 53 * automatically included in requests that CloudFront sends to the origin.</p> 54 * </li> <li> <p> <code>allExcept</code> – All cookies in viewer requests that are 55 * <i> <b>not</b> </i> listed in the <code>CookieNames</code> type are included in 56 * the cache key and automatically included in requests that CloudFront sends to 57 * the origin.</p> </li> <li> <p> <code>all</code> – All cookies in viewer requests 58 * are included in the cache key and are automatically included in requests that 59 * CloudFront sends to the origin.</p> </li> </ul> 60 */ GetCookieBehavior()61 inline const CachePolicyCookieBehavior& GetCookieBehavior() const{ return m_cookieBehavior; } 62 63 /** 64 * <p>Determines whether any cookies in viewer requests are included in the cache 65 * key and automatically included in requests that CloudFront sends to the origin. 66 * Valid values are:</p> <ul> <li> <p> <code>none</code> – Cookies in viewer 67 * requests are not included in the cache key and are not automatically included in 68 * requests that CloudFront sends to the origin. Even when this field is set to 69 * <code>none</code>, any cookies that are listed in an 70 * <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> 71 * </li> <li> <p> <code>whitelist</code> – The cookies in viewer requests that are 72 * listed in the <code>CookieNames</code> type are included in the cache key and 73 * automatically included in requests that CloudFront sends to the origin.</p> 74 * </li> <li> <p> <code>allExcept</code> – All cookies in viewer requests that are 75 * <i> <b>not</b> </i> listed in the <code>CookieNames</code> type are included in 76 * the cache key and automatically included in requests that CloudFront sends to 77 * the origin.</p> </li> <li> <p> <code>all</code> – All cookies in viewer requests 78 * are included in the cache key and are automatically included in requests that 79 * CloudFront sends to the origin.</p> </li> </ul> 80 */ CookieBehaviorHasBeenSet()81 inline bool CookieBehaviorHasBeenSet() const { return m_cookieBehaviorHasBeenSet; } 82 83 /** 84 * <p>Determines whether any cookies in viewer requests are included in the cache 85 * key and automatically included in requests that CloudFront sends to the origin. 86 * Valid values are:</p> <ul> <li> <p> <code>none</code> – Cookies in viewer 87 * requests are not included in the cache key and are not automatically included in 88 * requests that CloudFront sends to the origin. Even when this field is set to 89 * <code>none</code>, any cookies that are listed in an 90 * <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> 91 * </li> <li> <p> <code>whitelist</code> – The cookies in viewer requests that are 92 * listed in the <code>CookieNames</code> type are included in the cache key and 93 * automatically included in requests that CloudFront sends to the origin.</p> 94 * </li> <li> <p> <code>allExcept</code> – All cookies in viewer requests that are 95 * <i> <b>not</b> </i> listed in the <code>CookieNames</code> type are included in 96 * the cache key and automatically included in requests that CloudFront sends to 97 * the origin.</p> </li> <li> <p> <code>all</code> – All cookies in viewer requests 98 * are included in the cache key and are automatically included in requests that 99 * CloudFront sends to the origin.</p> </li> </ul> 100 */ SetCookieBehavior(const CachePolicyCookieBehavior & value)101 inline void SetCookieBehavior(const CachePolicyCookieBehavior& value) { m_cookieBehaviorHasBeenSet = true; m_cookieBehavior = value; } 102 103 /** 104 * <p>Determines whether any cookies in viewer requests are included in the cache 105 * key and automatically included in requests that CloudFront sends to the origin. 106 * Valid values are:</p> <ul> <li> <p> <code>none</code> – Cookies in viewer 107 * requests are not included in the cache key and are not automatically included in 108 * requests that CloudFront sends to the origin. Even when this field is set to 109 * <code>none</code>, any cookies that are listed in an 110 * <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> 111 * </li> <li> <p> <code>whitelist</code> – The cookies in viewer requests that are 112 * listed in the <code>CookieNames</code> type are included in the cache key and 113 * automatically included in requests that CloudFront sends to the origin.</p> 114 * </li> <li> <p> <code>allExcept</code> – All cookies in viewer requests that are 115 * <i> <b>not</b> </i> listed in the <code>CookieNames</code> type are included in 116 * the cache key and automatically included in requests that CloudFront sends to 117 * the origin.</p> </li> <li> <p> <code>all</code> – All cookies in viewer requests 118 * are included in the cache key and are automatically included in requests that 119 * CloudFront sends to the origin.</p> </li> </ul> 120 */ SetCookieBehavior(CachePolicyCookieBehavior && value)121 inline void SetCookieBehavior(CachePolicyCookieBehavior&& value) { m_cookieBehaviorHasBeenSet = true; m_cookieBehavior = std::move(value); } 122 123 /** 124 * <p>Determines whether any cookies in viewer requests are included in the cache 125 * key and automatically included in requests that CloudFront sends to the origin. 126 * Valid values are:</p> <ul> <li> <p> <code>none</code> – Cookies in viewer 127 * requests are not included in the cache key and are not automatically included in 128 * requests that CloudFront sends to the origin. Even when this field is set to 129 * <code>none</code>, any cookies that are listed in an 130 * <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> 131 * </li> <li> <p> <code>whitelist</code> – The cookies in viewer requests that are 132 * listed in the <code>CookieNames</code> type are included in the cache key and 133 * automatically included in requests that CloudFront sends to the origin.</p> 134 * </li> <li> <p> <code>allExcept</code> – All cookies in viewer requests that are 135 * <i> <b>not</b> </i> listed in the <code>CookieNames</code> type are included in 136 * the cache key and automatically included in requests that CloudFront sends to 137 * the origin.</p> </li> <li> <p> <code>all</code> – All cookies in viewer requests 138 * are included in the cache key and are automatically included in requests that 139 * CloudFront sends to the origin.</p> </li> </ul> 140 */ WithCookieBehavior(const CachePolicyCookieBehavior & value)141 inline CachePolicyCookiesConfig& WithCookieBehavior(const CachePolicyCookieBehavior& value) { SetCookieBehavior(value); return *this;} 142 143 /** 144 * <p>Determines whether any cookies in viewer requests are included in the cache 145 * key and automatically included in requests that CloudFront sends to the origin. 146 * Valid values are:</p> <ul> <li> <p> <code>none</code> – Cookies in viewer 147 * requests are not included in the cache key and are not automatically included in 148 * requests that CloudFront sends to the origin. Even when this field is set to 149 * <code>none</code>, any cookies that are listed in an 150 * <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> 151 * </li> <li> <p> <code>whitelist</code> – The cookies in viewer requests that are 152 * listed in the <code>CookieNames</code> type are included in the cache key and 153 * automatically included in requests that CloudFront sends to the origin.</p> 154 * </li> <li> <p> <code>allExcept</code> – All cookies in viewer requests that are 155 * <i> <b>not</b> </i> listed in the <code>CookieNames</code> type are included in 156 * the cache key and automatically included in requests that CloudFront sends to 157 * the origin.</p> </li> <li> <p> <code>all</code> – All cookies in viewer requests 158 * are included in the cache key and are automatically included in requests that 159 * CloudFront sends to the origin.</p> </li> </ul> 160 */ WithCookieBehavior(CachePolicyCookieBehavior && value)161 inline CachePolicyCookiesConfig& WithCookieBehavior(CachePolicyCookieBehavior&& value) { SetCookieBehavior(std::move(value)); return *this;} 162 163 164 GetCookies()165 inline const CookieNames& GetCookies() const{ return m_cookies; } 166 167 CookiesHasBeenSet()168 inline bool CookiesHasBeenSet() const { return m_cookiesHasBeenSet; } 169 170 SetCookies(const CookieNames & value)171 inline void SetCookies(const CookieNames& value) { m_cookiesHasBeenSet = true; m_cookies = value; } 172 173 SetCookies(CookieNames && value)174 inline void SetCookies(CookieNames&& value) { m_cookiesHasBeenSet = true; m_cookies = std::move(value); } 175 176 WithCookies(const CookieNames & value)177 inline CachePolicyCookiesConfig& WithCookies(const CookieNames& value) { SetCookies(value); return *this;} 178 179 WithCookies(CookieNames && value)180 inline CachePolicyCookiesConfig& WithCookies(CookieNames&& value) { SetCookies(std::move(value)); return *this;} 181 182 private: 183 184 CachePolicyCookieBehavior m_cookieBehavior; 185 bool m_cookieBehaviorHasBeenSet; 186 187 CookieNames m_cookies; 188 bool m_cookiesHasBeenSet; 189 }; 190 191 } // namespace Model 192 } // namespace CloudFront 193 } // namespace Aws 194