|
| 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 | + |
| 9 | +namespace Aws |
| 10 | +{ |
| 11 | +namespace Utils |
| 12 | +{ |
| 13 | +namespace Xml |
| 14 | +{ |
| 15 | + class XmlNode; |
| 16 | +} // namespace Xml |
| 17 | +} // namespace Utils |
| 18 | +namespace CloudFront |
| 19 | +{ |
| 20 | +namespace Model |
| 21 | +{ |
| 22 | + |
| 23 | + /** |
| 24 | + * <p>A configuration for enabling the <code>Server-Timing</code> header in HTTP |
| 25 | + * responses sent from CloudFront. CloudFront adds this header to HTTP responses |
| 26 | + * that it sends in response to requests that match a cache behavior that's |
| 27 | + * associated with this response headers policy.</p> <p>You can use the |
| 28 | + * <code>Server-Timing</code> header to view metrics that can help you gain |
| 29 | + * insights about the behavior and performance of CloudFront. For example, you can |
| 30 | + * see which cache layer served a cache hit, or the first byte latency from the |
| 31 | + * origin when there was a cache miss. You can use the metrics in the |
| 32 | + * <code>Server-Timing</code> header to troubleshoot issues or test the efficiency |
| 33 | + * of your CloudFront configuration. For more information, see <a |
| 34 | + * href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/understanding-response-headers-policies.html#server-timing-header">Server-Timing |
| 35 | + * header</a> in the <i>Amazon CloudFront Developer Guide</i>.</p><p><h3>See |
| 36 | + * Also:</h3> <a |
| 37 | + * href="http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/ResponseHeadersPolicyServerTimingHeadersConfig">AWS |
| 38 | + * API Reference</a></p> |
| 39 | + */ |
| 40 | + class AWS_CLOUDFRONT_API ResponseHeadersPolicyServerTimingHeadersConfig |
| 41 | + { |
| 42 | + public: |
| 43 | + ResponseHeadersPolicyServerTimingHeadersConfig(); |
| 44 | + ResponseHeadersPolicyServerTimingHeadersConfig(const Aws::Utils::Xml::XmlNode& xmlNode); |
| 45 | + ResponseHeadersPolicyServerTimingHeadersConfig& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); |
| 46 | + |
| 47 | + void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; |
| 48 | + |
| 49 | + |
| 50 | + /** |
| 51 | + * <p>A Boolean that determines whether CloudFront adds the |
| 52 | + * <code>Server-Timing</code> header to HTTP responses that it sends in response to |
| 53 | + * requests that match a cache behavior that's associated with this response |
| 54 | + * headers policy.</p> |
| 55 | + */ |
| 56 | + inline bool GetEnabled() const{ return m_enabled; } |
| 57 | + |
| 58 | + /** |
| 59 | + * <p>A Boolean that determines whether CloudFront adds the |
| 60 | + * <code>Server-Timing</code> header to HTTP responses that it sends in response to |
| 61 | + * requests that match a cache behavior that's associated with this response |
| 62 | + * headers policy.</p> |
| 63 | + */ |
| 64 | + inline bool EnabledHasBeenSet() const { return m_enabledHasBeenSet; } |
| 65 | + |
| 66 | + /** |
| 67 | + * <p>A Boolean that determines whether CloudFront adds the |
| 68 | + * <code>Server-Timing</code> header to HTTP responses that it sends in response to |
| 69 | + * requests that match a cache behavior that's associated with this response |
| 70 | + * headers policy.</p> |
| 71 | + */ |
| 72 | + inline void SetEnabled(bool value) { m_enabledHasBeenSet = true; m_enabled = value; } |
| 73 | + |
| 74 | + /** |
| 75 | + * <p>A Boolean that determines whether CloudFront adds the |
| 76 | + * <code>Server-Timing</code> header to HTTP responses that it sends in response to |
| 77 | + * requests that match a cache behavior that's associated with this response |
| 78 | + * headers policy.</p> |
| 79 | + */ |
| 80 | + inline ResponseHeadersPolicyServerTimingHeadersConfig& WithEnabled(bool value) { SetEnabled(value); return *this;} |
| 81 | + |
| 82 | + |
| 83 | + /** |
| 84 | + * <p>A number 0–100 (inclusive) that specifies the percentage of responses that |
| 85 | + * you want CloudFront to add the <code>Server-Timing</code> header to. When you |
| 86 | + * set the sampling rate to 100, CloudFront adds the <code>Server-Timing</code> |
| 87 | + * header to the HTTP response for every request that matches the cache behavior |
| 88 | + * that this response headers policy is attached to. When you set it to 50, |
| 89 | + * CloudFront adds the header to 50% of the responses for requests that match the |
| 90 | + * cache behavior. You can set the sampling rate to any number 0–100 with up to |
| 91 | + * four decimal places.</p> |
| 92 | + */ |
| 93 | + inline double GetSamplingRate() const{ return m_samplingRate; } |
| 94 | + |
| 95 | + /** |
| 96 | + * <p>A number 0–100 (inclusive) that specifies the percentage of responses that |
| 97 | + * you want CloudFront to add the <code>Server-Timing</code> header to. When you |
| 98 | + * set the sampling rate to 100, CloudFront adds the <code>Server-Timing</code> |
| 99 | + * header to the HTTP response for every request that matches the cache behavior |
| 100 | + * that this response headers policy is attached to. When you set it to 50, |
| 101 | + * CloudFront adds the header to 50% of the responses for requests that match the |
| 102 | + * cache behavior. You can set the sampling rate to any number 0–100 with up to |
| 103 | + * four decimal places.</p> |
| 104 | + */ |
| 105 | + inline bool SamplingRateHasBeenSet() const { return m_samplingRateHasBeenSet; } |
| 106 | + |
| 107 | + /** |
| 108 | + * <p>A number 0–100 (inclusive) that specifies the percentage of responses that |
| 109 | + * you want CloudFront to add the <code>Server-Timing</code> header to. When you |
| 110 | + * set the sampling rate to 100, CloudFront adds the <code>Server-Timing</code> |
| 111 | + * header to the HTTP response for every request that matches the cache behavior |
| 112 | + * that this response headers policy is attached to. When you set it to 50, |
| 113 | + * CloudFront adds the header to 50% of the responses for requests that match the |
| 114 | + * cache behavior. You can set the sampling rate to any number 0–100 with up to |
| 115 | + * four decimal places.</p> |
| 116 | + */ |
| 117 | + inline void SetSamplingRate(double value) { m_samplingRateHasBeenSet = true; m_samplingRate = value; } |
| 118 | + |
| 119 | + /** |
| 120 | + * <p>A number 0–100 (inclusive) that specifies the percentage of responses that |
| 121 | + * you want CloudFront to add the <code>Server-Timing</code> header to. When you |
| 122 | + * set the sampling rate to 100, CloudFront adds the <code>Server-Timing</code> |
| 123 | + * header to the HTTP response for every request that matches the cache behavior |
| 124 | + * that this response headers policy is attached to. When you set it to 50, |
| 125 | + * CloudFront adds the header to 50% of the responses for requests that match the |
| 126 | + * cache behavior. You can set the sampling rate to any number 0–100 with up to |
| 127 | + * four decimal places.</p> |
| 128 | + */ |
| 129 | + inline ResponseHeadersPolicyServerTimingHeadersConfig& WithSamplingRate(double value) { SetSamplingRate(value); return *this;} |
| 130 | + |
| 131 | + private: |
| 132 | + |
| 133 | + bool m_enabled; |
| 134 | + bool m_enabledHasBeenSet; |
| 135 | + |
| 136 | + double m_samplingRate; |
| 137 | + bool m_samplingRateHasBeenSet; |
| 138 | + }; |
| 139 | + |
| 140 | +} // namespace Model |
| 141 | +} // namespace CloudFront |
| 142 | +} // namespace Aws |
0 commit comments