/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace CloudFront { namespace Model { /** *

A complex type that controls whether access logs are written for the * distribution.

See Also:

AWS * API Reference

*/ class LoggingConfig { public: AWS_CLOUDFRONT_API LoggingConfig(); AWS_CLOUDFRONT_API LoggingConfig(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_CLOUDFRONT_API LoggingConfig& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_CLOUDFRONT_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; /** *

Specifies whether you want CloudFront to save access logs to an Amazon S3 * bucket. If you don't want to enable logging when you create a distribution or if * you want to disable logging for an existing distribution, specify * false for Enabled, and specify empty * Bucket and Prefix elements. If you specify * false for Enabled but you specify values for * Bucket, prefix, and IncludeCookies, the * values are automatically deleted.

*/ inline bool GetEnabled() const{ return m_enabled; } /** *

Specifies whether you want CloudFront to save access logs to an Amazon S3 * bucket. If you don't want to enable logging when you create a distribution or if * you want to disable logging for an existing distribution, specify * false for Enabled, and specify empty * Bucket and Prefix elements. If you specify * false for Enabled but you specify values for * Bucket, prefix, and IncludeCookies, the * values are automatically deleted.

*/ inline bool EnabledHasBeenSet() const { return m_enabledHasBeenSet; } /** *

Specifies whether you want CloudFront to save access logs to an Amazon S3 * bucket. If you don't want to enable logging when you create a distribution or if * you want to disable logging for an existing distribution, specify * false for Enabled, and specify empty * Bucket and Prefix elements. If you specify * false for Enabled but you specify values for * Bucket, prefix, and IncludeCookies, the * values are automatically deleted.

*/ inline void SetEnabled(bool value) { m_enabledHasBeenSet = true; m_enabled = value; } /** *

Specifies whether you want CloudFront to save access logs to an Amazon S3 * bucket. If you don't want to enable logging when you create a distribution or if * you want to disable logging for an existing distribution, specify * false for Enabled, and specify empty * Bucket and Prefix elements. If you specify * false for Enabled but you specify values for * Bucket, prefix, and IncludeCookies, the * values are automatically deleted.

*/ inline LoggingConfig& WithEnabled(bool value) { SetEnabled(value); return *this;} /** *

Specifies whether you want CloudFront to include cookies in access logs, * specify true for IncludeCookies. If you choose to * include cookies in logs, CloudFront logs all cookies regardless of how you * configure the cache behaviors for this distribution. If you don't want to * include cookies when you create a distribution or if you want to disable include * cookies for an existing distribution, specify false for * IncludeCookies.

*/ inline bool GetIncludeCookies() const{ return m_includeCookies; } /** *

Specifies whether you want CloudFront to include cookies in access logs, * specify true for IncludeCookies. If you choose to * include cookies in logs, CloudFront logs all cookies regardless of how you * configure the cache behaviors for this distribution. If you don't want to * include cookies when you create a distribution or if you want to disable include * cookies for an existing distribution, specify false for * IncludeCookies.

*/ inline bool IncludeCookiesHasBeenSet() const { return m_includeCookiesHasBeenSet; } /** *

Specifies whether you want CloudFront to include cookies in access logs, * specify true for IncludeCookies. If you choose to * include cookies in logs, CloudFront logs all cookies regardless of how you * configure the cache behaviors for this distribution. If you don't want to * include cookies when you create a distribution or if you want to disable include * cookies for an existing distribution, specify false for * IncludeCookies.

*/ inline void SetIncludeCookies(bool value) { m_includeCookiesHasBeenSet = true; m_includeCookies = value; } /** *

Specifies whether you want CloudFront to include cookies in access logs, * specify true for IncludeCookies. If you choose to * include cookies in logs, CloudFront logs all cookies regardless of how you * configure the cache behaviors for this distribution. If you don't want to * include cookies when you create a distribution or if you want to disable include * cookies for an existing distribution, specify false for * IncludeCookies.

*/ inline LoggingConfig& WithIncludeCookies(bool value) { SetIncludeCookies(value); return *this;} /** *

The Amazon S3 bucket to store the access logs in, for example, * myawslogbucket.s3.amazonaws.com.

*/ inline const Aws::String& GetBucket() const{ return m_bucket; } /** *

The Amazon S3 bucket to store the access logs in, for example, * myawslogbucket.s3.amazonaws.com.

*/ inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; } /** *

The Amazon S3 bucket to store the access logs in, for example, * myawslogbucket.s3.amazonaws.com.

*/ inline void SetBucket(const Aws::String& value) { m_bucketHasBeenSet = true; m_bucket = value; } /** *

The Amazon S3 bucket to store the access logs in, for example, * myawslogbucket.s3.amazonaws.com.

*/ inline void SetBucket(Aws::String&& value) { m_bucketHasBeenSet = true; m_bucket = std::move(value); } /** *

The Amazon S3 bucket to store the access logs in, for example, * myawslogbucket.s3.amazonaws.com.

*/ inline void SetBucket(const char* value) { m_bucketHasBeenSet = true; m_bucket.assign(value); } /** *

The Amazon S3 bucket to store the access logs in, for example, * myawslogbucket.s3.amazonaws.com.

*/ inline LoggingConfig& WithBucket(const Aws::String& value) { SetBucket(value); return *this;} /** *

The Amazon S3 bucket to store the access logs in, for example, * myawslogbucket.s3.amazonaws.com.

*/ inline LoggingConfig& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;} /** *

The Amazon S3 bucket to store the access logs in, for example, * myawslogbucket.s3.amazonaws.com.

*/ inline LoggingConfig& WithBucket(const char* value) { SetBucket(value); return *this;} /** *

An optional string that you want CloudFront to prefix to the access log * filenames for this distribution, for example, * myprefix/. If you want to enable logging, but you don't want to * specify a prefix, you still must include an empty Prefix element in * the Logging element.

*/ inline const Aws::String& GetPrefix() const{ return m_prefix; } /** *

An optional string that you want CloudFront to prefix to the access log * filenames for this distribution, for example, * myprefix/. If you want to enable logging, but you don't want to * specify a prefix, you still must include an empty Prefix element in * the Logging element.

*/ inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; } /** *

An optional string that you want CloudFront to prefix to the access log * filenames for this distribution, for example, * myprefix/. If you want to enable logging, but you don't want to * specify a prefix, you still must include an empty Prefix element in * the Logging element.

*/ inline void SetPrefix(const Aws::String& value) { m_prefixHasBeenSet = true; m_prefix = value; } /** *

An optional string that you want CloudFront to prefix to the access log * filenames for this distribution, for example, * myprefix/. If you want to enable logging, but you don't want to * specify a prefix, you still must include an empty Prefix element in * the Logging element.

*/ inline void SetPrefix(Aws::String&& value) { m_prefixHasBeenSet = true; m_prefix = std::move(value); } /** *

An optional string that you want CloudFront to prefix to the access log * filenames for this distribution, for example, * myprefix/. If you want to enable logging, but you don't want to * specify a prefix, you still must include an empty Prefix element in * the Logging element.

*/ inline void SetPrefix(const char* value) { m_prefixHasBeenSet = true; m_prefix.assign(value); } /** *

An optional string that you want CloudFront to prefix to the access log * filenames for this distribution, for example, * myprefix/. If you want to enable logging, but you don't want to * specify a prefix, you still must include an empty Prefix element in * the Logging element.

*/ inline LoggingConfig& WithPrefix(const Aws::String& value) { SetPrefix(value); return *this;} /** *

An optional string that you want CloudFront to prefix to the access log * filenames for this distribution, for example, * myprefix/. If you want to enable logging, but you don't want to * specify a prefix, you still must include an empty Prefix element in * the Logging element.

*/ inline LoggingConfig& WithPrefix(Aws::String&& value) { SetPrefix(std::move(value)); return *this;} /** *

An optional string that you want CloudFront to prefix to the access log * filenames for this distribution, for example, * myprefix/. If you want to enable logging, but you don't want to * specify a prefix, you still must include an empty Prefix element in * the Logging element.

*/ inline LoggingConfig& WithPrefix(const char* value) { SetPrefix(value); return *this;} private: bool m_enabled; bool m_enabledHasBeenSet = false; bool m_includeCookies; bool m_includeCookiesHasBeenSet = false; Aws::String m_bucket; bool m_bucketHasBeenSet = false; Aws::String m_prefix; bool m_prefixHasBeenSet = false; }; } // namespace Model } // namespace CloudFront } // namespace Aws