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

A complex type that controls which HTTP methods CloudFront processes and * forwards to your Amazon S3 bucket or your custom origin. There are three * choices:

  • CloudFront forwards only GET and * HEAD requests.

  • CloudFront forwards only * GET, HEAD, and OPTIONS requests.

    *
  • CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, * POST, and DELETE requests.

If you pick * the third choice, you may need to restrict access to your Amazon S3 bucket or to * your custom origin so users can't perform operations that you don't want them * to. For example, you might not want users to have permissions to delete objects * from your origin.

See Also:

AWS * API Reference

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

The number of HTTP methods that you want CloudFront to forward to your * origin. Valid values are 2 (for GET and HEAD * requests), 3 (for GET, HEAD, and OPTIONS * requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST, and * DELETE requests).

*/ inline int GetQuantity() const{ return m_quantity; } /** *

The number of HTTP methods that you want CloudFront to forward to your * origin. Valid values are 2 (for GET and HEAD * requests), 3 (for GET, HEAD, and OPTIONS * requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST, and * DELETE requests).

*/ inline bool QuantityHasBeenSet() const { return m_quantityHasBeenSet; } /** *

The number of HTTP methods that you want CloudFront to forward to your * origin. Valid values are 2 (for GET and HEAD * requests), 3 (for GET, HEAD, and OPTIONS * requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST, and * DELETE requests).

*/ inline void SetQuantity(int value) { m_quantityHasBeenSet = true; m_quantity = value; } /** *

The number of HTTP methods that you want CloudFront to forward to your * origin. Valid values are 2 (for GET and HEAD * requests), 3 (for GET, HEAD, and OPTIONS * requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST, and * DELETE requests).

*/ inline AllowedMethods& WithQuantity(int value) { SetQuantity(value); return *this;} /** *

A complex type that contains the HTTP methods that you want CloudFront to * process and forward to your origin.

*/ inline const Aws::Vector& GetItems() const{ return m_items; } /** *

A complex type that contains the HTTP methods that you want CloudFront to * process and forward to your origin.

*/ inline bool ItemsHasBeenSet() const { return m_itemsHasBeenSet; } /** *

A complex type that contains the HTTP methods that you want CloudFront to * process and forward to your origin.

*/ inline void SetItems(const Aws::Vector& value) { m_itemsHasBeenSet = true; m_items = value; } /** *

A complex type that contains the HTTP methods that you want CloudFront to * process and forward to your origin.

*/ inline void SetItems(Aws::Vector&& value) { m_itemsHasBeenSet = true; m_items = std::move(value); } /** *

A complex type that contains the HTTP methods that you want CloudFront to * process and forward to your origin.

*/ inline AllowedMethods& WithItems(const Aws::Vector& value) { SetItems(value); return *this;} /** *

A complex type that contains the HTTP methods that you want CloudFront to * process and forward to your origin.

*/ inline AllowedMethods& WithItems(Aws::Vector&& value) { SetItems(std::move(value)); return *this;} /** *

A complex type that contains the HTTP methods that you want CloudFront to * process and forward to your origin.

*/ inline AllowedMethods& AddItems(const Method& value) { m_itemsHasBeenSet = true; m_items.push_back(value); return *this; } /** *

A complex type that contains the HTTP methods that you want CloudFront to * process and forward to your origin.

*/ inline AllowedMethods& AddItems(Method&& value) { m_itemsHasBeenSet = true; m_items.push_back(std::move(value)); return *this; } inline const CachedMethods& GetCachedMethods() const{ return m_cachedMethods; } inline bool CachedMethodsHasBeenSet() const { return m_cachedMethodsHasBeenSet; } inline void SetCachedMethods(const CachedMethods& value) { m_cachedMethodsHasBeenSet = true; m_cachedMethods = value; } inline void SetCachedMethods(CachedMethods&& value) { m_cachedMethodsHasBeenSet = true; m_cachedMethods = std::move(value); } inline AllowedMethods& WithCachedMethods(const CachedMethods& value) { SetCachedMethods(value); return *this;} inline AllowedMethods& WithCachedMethods(CachedMethods&& value) { SetCachedMethods(std::move(value)); return *this;} private: int m_quantity; bool m_quantityHasBeenSet = false; Aws::Vector m_items; bool m_itemsHasBeenSet = false; CachedMethods m_cachedMethods; bool m_cachedMethodsHasBeenSet = false; }; } // namespace Model } // namespace CloudFront } // namespace Aws