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

Information about an action.

Each rule must include exactly one of the * following types of actions: forward, fixed-response, * or redirect, and it must be the last action to be * performed.

See Also:

AWS * API Reference

*/ class Action { public: AWS_ELASTICLOADBALANCINGV2_API Action(); AWS_ELASTICLOADBALANCINGV2_API Action(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_ELASTICLOADBALANCINGV2_API Action& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_ELASTICLOADBALANCINGV2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_ELASTICLOADBALANCINGV2_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The type of action.

*/ inline const ActionTypeEnum& GetType() const{ return m_type; } /** *

The type of action.

*/ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** *

The type of action.

*/ inline void SetType(const ActionTypeEnum& value) { m_typeHasBeenSet = true; m_type = value; } /** *

The type of action.

*/ inline void SetType(ActionTypeEnum&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** *

The type of action.

*/ inline Action& WithType(const ActionTypeEnum& value) { SetType(value); return *this;} /** *

The type of action.

*/ inline Action& WithType(ActionTypeEnum&& value) { SetType(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the target group. Specify only when * Type is forward and you want to route to a single * target group. To route to one or more target groups, use * ForwardConfig instead.

*/ inline const Aws::String& GetTargetGroupArn() const{ return m_targetGroupArn; } /** *

The Amazon Resource Name (ARN) of the target group. Specify only when * Type is forward and you want to route to a single * target group. To route to one or more target groups, use * ForwardConfig instead.

*/ inline bool TargetGroupArnHasBeenSet() const { return m_targetGroupArnHasBeenSet; } /** *

The Amazon Resource Name (ARN) of the target group. Specify only when * Type is forward and you want to route to a single * target group. To route to one or more target groups, use * ForwardConfig instead.

*/ inline void SetTargetGroupArn(const Aws::String& value) { m_targetGroupArnHasBeenSet = true; m_targetGroupArn = value; } /** *

The Amazon Resource Name (ARN) of the target group. Specify only when * Type is forward and you want to route to a single * target group. To route to one or more target groups, use * ForwardConfig instead.

*/ inline void SetTargetGroupArn(Aws::String&& value) { m_targetGroupArnHasBeenSet = true; m_targetGroupArn = std::move(value); } /** *

The Amazon Resource Name (ARN) of the target group. Specify only when * Type is forward and you want to route to a single * target group. To route to one or more target groups, use * ForwardConfig instead.

*/ inline void SetTargetGroupArn(const char* value) { m_targetGroupArnHasBeenSet = true; m_targetGroupArn.assign(value); } /** *

The Amazon Resource Name (ARN) of the target group. Specify only when * Type is forward and you want to route to a single * target group. To route to one or more target groups, use * ForwardConfig instead.

*/ inline Action& WithTargetGroupArn(const Aws::String& value) { SetTargetGroupArn(value); return *this;} /** *

The Amazon Resource Name (ARN) of the target group. Specify only when * Type is forward and you want to route to a single * target group. To route to one or more target groups, use * ForwardConfig instead.

*/ inline Action& WithTargetGroupArn(Aws::String&& value) { SetTargetGroupArn(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the target group. Specify only when * Type is forward and you want to route to a single * target group. To route to one or more target groups, use * ForwardConfig instead.

*/ inline Action& WithTargetGroupArn(const char* value) { SetTargetGroupArn(value); return *this;} /** *

[HTTPS listeners] Information about an identity provider that is compliant * with OpenID Connect (OIDC). Specify only when Type is * authenticate-oidc.

*/ inline const AuthenticateOidcActionConfig& GetAuthenticateOidcConfig() const{ return m_authenticateOidcConfig; } /** *

[HTTPS listeners] Information about an identity provider that is compliant * with OpenID Connect (OIDC). Specify only when Type is * authenticate-oidc.

*/ inline bool AuthenticateOidcConfigHasBeenSet() const { return m_authenticateOidcConfigHasBeenSet; } /** *

[HTTPS listeners] Information about an identity provider that is compliant * with OpenID Connect (OIDC). Specify only when Type is * authenticate-oidc.

*/ inline void SetAuthenticateOidcConfig(const AuthenticateOidcActionConfig& value) { m_authenticateOidcConfigHasBeenSet = true; m_authenticateOidcConfig = value; } /** *

[HTTPS listeners] Information about an identity provider that is compliant * with OpenID Connect (OIDC). Specify only when Type is * authenticate-oidc.

*/ inline void SetAuthenticateOidcConfig(AuthenticateOidcActionConfig&& value) { m_authenticateOidcConfigHasBeenSet = true; m_authenticateOidcConfig = std::move(value); } /** *

[HTTPS listeners] Information about an identity provider that is compliant * with OpenID Connect (OIDC). Specify only when Type is * authenticate-oidc.

*/ inline Action& WithAuthenticateOidcConfig(const AuthenticateOidcActionConfig& value) { SetAuthenticateOidcConfig(value); return *this;} /** *

[HTTPS listeners] Information about an identity provider that is compliant * with OpenID Connect (OIDC). Specify only when Type is * authenticate-oidc.

*/ inline Action& WithAuthenticateOidcConfig(AuthenticateOidcActionConfig&& value) { SetAuthenticateOidcConfig(std::move(value)); return *this;} /** *

[HTTPS listeners] Information for using Amazon Cognito to authenticate users. * Specify only when Type is authenticate-cognito.

*/ inline const AuthenticateCognitoActionConfig& GetAuthenticateCognitoConfig() const{ return m_authenticateCognitoConfig; } /** *

[HTTPS listeners] Information for using Amazon Cognito to authenticate users. * Specify only when Type is authenticate-cognito.

*/ inline bool AuthenticateCognitoConfigHasBeenSet() const { return m_authenticateCognitoConfigHasBeenSet; } /** *

[HTTPS listeners] Information for using Amazon Cognito to authenticate users. * Specify only when Type is authenticate-cognito.

*/ inline void SetAuthenticateCognitoConfig(const AuthenticateCognitoActionConfig& value) { m_authenticateCognitoConfigHasBeenSet = true; m_authenticateCognitoConfig = value; } /** *

[HTTPS listeners] Information for using Amazon Cognito to authenticate users. * Specify only when Type is authenticate-cognito.

*/ inline void SetAuthenticateCognitoConfig(AuthenticateCognitoActionConfig&& value) { m_authenticateCognitoConfigHasBeenSet = true; m_authenticateCognitoConfig = std::move(value); } /** *

[HTTPS listeners] Information for using Amazon Cognito to authenticate users. * Specify only when Type is authenticate-cognito.

*/ inline Action& WithAuthenticateCognitoConfig(const AuthenticateCognitoActionConfig& value) { SetAuthenticateCognitoConfig(value); return *this;} /** *

[HTTPS listeners] Information for using Amazon Cognito to authenticate users. * Specify only when Type is authenticate-cognito.

*/ inline Action& WithAuthenticateCognitoConfig(AuthenticateCognitoActionConfig&& value) { SetAuthenticateCognitoConfig(std::move(value)); return *this;} /** *

The order for the action. This value is required for rules with multiple * actions. The action with the lowest value for order is performed first.

*/ inline int GetOrder() const{ return m_order; } /** *

The order for the action. This value is required for rules with multiple * actions. The action with the lowest value for order is performed first.

*/ inline bool OrderHasBeenSet() const { return m_orderHasBeenSet; } /** *

The order for the action. This value is required for rules with multiple * actions. The action with the lowest value for order is performed first.

*/ inline void SetOrder(int value) { m_orderHasBeenSet = true; m_order = value; } /** *

The order for the action. This value is required for rules with multiple * actions. The action with the lowest value for order is performed first.

*/ inline Action& WithOrder(int value) { SetOrder(value); return *this;} /** *

[Application Load Balancer] Information for creating a redirect action. * Specify only when Type is redirect.

*/ inline const RedirectActionConfig& GetRedirectConfig() const{ return m_redirectConfig; } /** *

[Application Load Balancer] Information for creating a redirect action. * Specify only when Type is redirect.

*/ inline bool RedirectConfigHasBeenSet() const { return m_redirectConfigHasBeenSet; } /** *

[Application Load Balancer] Information for creating a redirect action. * Specify only when Type is redirect.

*/ inline void SetRedirectConfig(const RedirectActionConfig& value) { m_redirectConfigHasBeenSet = true; m_redirectConfig = value; } /** *

[Application Load Balancer] Information for creating a redirect action. * Specify only when Type is redirect.

*/ inline void SetRedirectConfig(RedirectActionConfig&& value) { m_redirectConfigHasBeenSet = true; m_redirectConfig = std::move(value); } /** *

[Application Load Balancer] Information for creating a redirect action. * Specify only when Type is redirect.

*/ inline Action& WithRedirectConfig(const RedirectActionConfig& value) { SetRedirectConfig(value); return *this;} /** *

[Application Load Balancer] Information for creating a redirect action. * Specify only when Type is redirect.

*/ inline Action& WithRedirectConfig(RedirectActionConfig&& value) { SetRedirectConfig(std::move(value)); return *this;} /** *

[Application Load Balancer] Information for creating an action that returns a * custom HTTP response. Specify only when Type is * fixed-response.

*/ inline const FixedResponseActionConfig& GetFixedResponseConfig() const{ return m_fixedResponseConfig; } /** *

[Application Load Balancer] Information for creating an action that returns a * custom HTTP response. Specify only when Type is * fixed-response.

*/ inline bool FixedResponseConfigHasBeenSet() const { return m_fixedResponseConfigHasBeenSet; } /** *

[Application Load Balancer] Information for creating an action that returns a * custom HTTP response. Specify only when Type is * fixed-response.

*/ inline void SetFixedResponseConfig(const FixedResponseActionConfig& value) { m_fixedResponseConfigHasBeenSet = true; m_fixedResponseConfig = value; } /** *

[Application Load Balancer] Information for creating an action that returns a * custom HTTP response. Specify only when Type is * fixed-response.

*/ inline void SetFixedResponseConfig(FixedResponseActionConfig&& value) { m_fixedResponseConfigHasBeenSet = true; m_fixedResponseConfig = std::move(value); } /** *

[Application Load Balancer] Information for creating an action that returns a * custom HTTP response. Specify only when Type is * fixed-response.

*/ inline Action& WithFixedResponseConfig(const FixedResponseActionConfig& value) { SetFixedResponseConfig(value); return *this;} /** *

[Application Load Balancer] Information for creating an action that returns a * custom HTTP response. Specify only when Type is * fixed-response.

*/ inline Action& WithFixedResponseConfig(FixedResponseActionConfig&& value) { SetFixedResponseConfig(std::move(value)); return *this;} /** *

Information for creating an action that distributes requests among one or * more target groups. For Network Load Balancers, you can specify a single target * group. Specify only when Type is forward. If you * specify both ForwardConfig and TargetGroupArn, you can * specify only one target group using ForwardConfig and it must be * the same target group specified in TargetGroupArn.

*/ inline const ForwardActionConfig& GetForwardConfig() const{ return m_forwardConfig; } /** *

Information for creating an action that distributes requests among one or * more target groups. For Network Load Balancers, you can specify a single target * group. Specify only when Type is forward. If you * specify both ForwardConfig and TargetGroupArn, you can * specify only one target group using ForwardConfig and it must be * the same target group specified in TargetGroupArn.

*/ inline bool ForwardConfigHasBeenSet() const { return m_forwardConfigHasBeenSet; } /** *

Information for creating an action that distributes requests among one or * more target groups. For Network Load Balancers, you can specify a single target * group. Specify only when Type is forward. If you * specify both ForwardConfig and TargetGroupArn, you can * specify only one target group using ForwardConfig and it must be * the same target group specified in TargetGroupArn.

*/ inline void SetForwardConfig(const ForwardActionConfig& value) { m_forwardConfigHasBeenSet = true; m_forwardConfig = value; } /** *

Information for creating an action that distributes requests among one or * more target groups. For Network Load Balancers, you can specify a single target * group. Specify only when Type is forward. If you * specify both ForwardConfig and TargetGroupArn, you can * specify only one target group using ForwardConfig and it must be * the same target group specified in TargetGroupArn.

*/ inline void SetForwardConfig(ForwardActionConfig&& value) { m_forwardConfigHasBeenSet = true; m_forwardConfig = std::move(value); } /** *

Information for creating an action that distributes requests among one or * more target groups. For Network Load Balancers, you can specify a single target * group. Specify only when Type is forward. If you * specify both ForwardConfig and TargetGroupArn, you can * specify only one target group using ForwardConfig and it must be * the same target group specified in TargetGroupArn.

*/ inline Action& WithForwardConfig(const ForwardActionConfig& value) { SetForwardConfig(value); return *this;} /** *

Information for creating an action that distributes requests among one or * more target groups. For Network Load Balancers, you can specify a single target * group. Specify only when Type is forward. If you * specify both ForwardConfig and TargetGroupArn, you can * specify only one target group using ForwardConfig and it must be * the same target group specified in TargetGroupArn.

*/ inline Action& WithForwardConfig(ForwardActionConfig&& value) { SetForwardConfig(std::move(value)); return *this;} private: ActionTypeEnum m_type; bool m_typeHasBeenSet = false; Aws::String m_targetGroupArn; bool m_targetGroupArnHasBeenSet = false; AuthenticateOidcActionConfig m_authenticateOidcConfig; bool m_authenticateOidcConfigHasBeenSet = false; AuthenticateCognitoActionConfig m_authenticateCognitoConfig; bool m_authenticateCognitoConfigHasBeenSet = false; int m_order; bool m_orderHasBeenSet = false; RedirectActionConfig m_redirectConfig; bool m_redirectConfigHasBeenSet = false; FixedResponseActionConfig m_fixedResponseConfig; bool m_fixedResponseConfigHasBeenSet = false; ForwardActionConfig m_forwardConfig; bool m_forwardConfigHasBeenSet = false; }; } // namespace Model } // namespace ElasticLoadBalancingv2 } // namespace Aws