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

Specifies the redirect behavior and when a redirect is applied. For more * information about routing rules, see Configuring * advanced conditional redirects in the Amazon S3 User * Guide.

See Also:

AWS API * Reference

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

A container for describing a condition that must be met for the specified * redirect to apply. For example, 1. If request is for pages in the * /docs folder, redirect to the /documents folder. 2. If * request results in HTTP error 4xx, redirect request to another host where you * might process the error.

*/ inline const Condition& GetCondition() const{ return m_condition; } /** *

A container for describing a condition that must be met for the specified * redirect to apply. For example, 1. If request is for pages in the * /docs folder, redirect to the /documents folder. 2. If * request results in HTTP error 4xx, redirect request to another host where you * might process the error.

*/ inline bool ConditionHasBeenSet() const { return m_conditionHasBeenSet; } /** *

A container for describing a condition that must be met for the specified * redirect to apply. For example, 1. If request is for pages in the * /docs folder, redirect to the /documents folder. 2. If * request results in HTTP error 4xx, redirect request to another host where you * might process the error.

*/ inline void SetCondition(const Condition& value) { m_conditionHasBeenSet = true; m_condition = value; } /** *

A container for describing a condition that must be met for the specified * redirect to apply. For example, 1. If request is for pages in the * /docs folder, redirect to the /documents folder. 2. If * request results in HTTP error 4xx, redirect request to another host where you * might process the error.

*/ inline void SetCondition(Condition&& value) { m_conditionHasBeenSet = true; m_condition = std::move(value); } /** *

A container for describing a condition that must be met for the specified * redirect to apply. For example, 1. If request is for pages in the * /docs folder, redirect to the /documents folder. 2. If * request results in HTTP error 4xx, redirect request to another host where you * might process the error.

*/ inline RoutingRule& WithCondition(const Condition& value) { SetCondition(value); return *this;} /** *

A container for describing a condition that must be met for the specified * redirect to apply. For example, 1. If request is for pages in the * /docs folder, redirect to the /documents folder. 2. If * request results in HTTP error 4xx, redirect request to another host where you * might process the error.

*/ inline RoutingRule& WithCondition(Condition&& value) { SetCondition(std::move(value)); return *this;} /** *

Container for redirect information. You can redirect requests to another * host, to another page, or with another protocol. In the event of an error, you * can specify a different error code to return.

*/ inline const Redirect& GetRedirect() const{ return m_redirect; } /** *

Container for redirect information. You can redirect requests to another * host, to another page, or with another protocol. In the event of an error, you * can specify a different error code to return.

*/ inline bool RedirectHasBeenSet() const { return m_redirectHasBeenSet; } /** *

Container for redirect information. You can redirect requests to another * host, to another page, or with another protocol. In the event of an error, you * can specify a different error code to return.

*/ inline void SetRedirect(const Redirect& value) { m_redirectHasBeenSet = true; m_redirect = value; } /** *

Container for redirect information. You can redirect requests to another * host, to another page, or with another protocol. In the event of an error, you * can specify a different error code to return.

*/ inline void SetRedirect(Redirect&& value) { m_redirectHasBeenSet = true; m_redirect = std::move(value); } /** *

Container for redirect information. You can redirect requests to another * host, to another page, or with another protocol. In the event of an error, you * can specify a different error code to return.

*/ inline RoutingRule& WithRedirect(const Redirect& value) { SetRedirect(value); return *this;} /** *

Container for redirect information. You can redirect requests to another * host, to another page, or with another protocol. In the event of an error, you * can specify a different error code to return.

*/ inline RoutingRule& WithRedirect(Redirect&& value) { SetRedirect(std::move(value)); return *this;} private: Condition m_condition; bool m_conditionHasBeenSet; Redirect m_redirect; bool m_redirectHasBeenSet; }; } // namespace Model } // namespace S3 } // namespace Aws