{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ELBV2.Types.Action
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ELBV2.Types.Action where

import qualified Amazonka.Core as Core
import Amazonka.ELBV2.Types.ActionTypeEnum
import Amazonka.ELBV2.Types.AuthenticateCognitoActionConfig
import Amazonka.ELBV2.Types.AuthenticateOidcActionConfig
import Amazonka.ELBV2.Types.FixedResponseActionConfig
import Amazonka.ELBV2.Types.ForwardActionConfig
import Amazonka.ELBV2.Types.RedirectActionConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | 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:/ 'newAction' smart constructor.
data Action = Action'
  { -- | [Application Load Balancer] Information for creating an action that
    -- returns a custom HTTP response. Specify only when @Type@ is
    -- @fixed-response@.
    Action -> Maybe FixedResponseActionConfig
fixedResponseConfig :: Prelude.Maybe FixedResponseActionConfig,
    -- | 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.
    Action -> Maybe Text
targetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | 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@.
    Action -> Maybe ForwardActionConfig
forwardConfig :: Prelude.Maybe ForwardActionConfig,
    -- | [Application Load Balancer] Information for creating a redirect action.
    -- Specify only when @Type@ is @redirect@.
    Action -> Maybe RedirectActionConfig
redirectConfig :: Prelude.Maybe RedirectActionConfig,
    -- | [HTTPS listeners] Information for using Amazon Cognito to authenticate
    -- users. Specify only when @Type@ is @authenticate-cognito@.
    Action -> Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig :: Prelude.Maybe AuthenticateCognitoActionConfig,
    -- | 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.
    Action -> Maybe Natural
order :: Prelude.Maybe Prelude.Natural,
    -- | [HTTPS listeners] Information about an identity provider that is
    -- compliant with OpenID Connect (OIDC). Specify only when @Type@ is
    -- @authenticate-oidc@.
    Action -> Maybe AuthenticateOidcActionConfig
authenticateOidcConfig :: Prelude.Maybe AuthenticateOidcActionConfig,
    -- | The type of action.
    Action -> ActionTypeEnum
type' :: ActionTypeEnum
  }
  deriving (Action -> Action -> Bool
(Action -> Action -> Bool)
-> (Action -> Action -> Bool) -> Eq Action
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Action -> Action -> Bool
$c/= :: Action -> Action -> Bool
== :: Action -> Action -> Bool
$c== :: Action -> Action -> Bool
Prelude.Eq, ReadPrec [Action]
ReadPrec Action
Int -> ReadS Action
ReadS [Action]
(Int -> ReadS Action)
-> ReadS [Action]
-> ReadPrec Action
-> ReadPrec [Action]
-> Read Action
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Action]
$creadListPrec :: ReadPrec [Action]
readPrec :: ReadPrec Action
$creadPrec :: ReadPrec Action
readList :: ReadS [Action]
$creadList :: ReadS [Action]
readsPrec :: Int -> ReadS Action
$creadsPrec :: Int -> ReadS Action
Prelude.Read, Int -> Action -> ShowS
[Action] -> ShowS
Action -> String
(Int -> Action -> ShowS)
-> (Action -> String) -> ([Action] -> ShowS) -> Show Action
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Action] -> ShowS
$cshowList :: [Action] -> ShowS
show :: Action -> String
$cshow :: Action -> String
showsPrec :: Int -> Action -> ShowS
$cshowsPrec :: Int -> Action -> ShowS
Prelude.Show, (forall x. Action -> Rep Action x)
-> (forall x. Rep Action x -> Action) -> Generic Action
forall x. Rep Action x -> Action
forall x. Action -> Rep Action x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Action x -> Action
$cfrom :: forall x. Action -> Rep Action x
Prelude.Generic)

-- |
-- Create a value of 'Action' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'fixedResponseConfig', 'action_fixedResponseConfig' - [Application Load Balancer] Information for creating an action that
-- returns a custom HTTP response. Specify only when @Type@ is
-- @fixed-response@.
--
-- 'targetGroupArn', 'action_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.
--
-- 'forwardConfig', 'action_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@.
--
-- 'redirectConfig', 'action_redirectConfig' - [Application Load Balancer] Information for creating a redirect action.
-- Specify only when @Type@ is @redirect@.
--
-- 'authenticateCognitoConfig', 'action_authenticateCognitoConfig' - [HTTPS listeners] Information for using Amazon Cognito to authenticate
-- users. Specify only when @Type@ is @authenticate-cognito@.
--
-- 'order', 'action_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.
--
-- 'authenticateOidcConfig', 'action_authenticateOidcConfig' - [HTTPS listeners] Information about an identity provider that is
-- compliant with OpenID Connect (OIDC). Specify only when @Type@ is
-- @authenticate-oidc@.
--
-- 'type'', 'action_type' - The type of action.
newAction ::
  -- | 'type''
  ActionTypeEnum ->
  Action
newAction :: ActionTypeEnum -> Action
newAction ActionTypeEnum
pType_ =
  Action' :: Maybe FixedResponseActionConfig
-> Maybe Text
-> Maybe ForwardActionConfig
-> Maybe RedirectActionConfig
-> Maybe AuthenticateCognitoActionConfig
-> Maybe Natural
-> Maybe AuthenticateOidcActionConfig
-> ActionTypeEnum
-> Action
Action'
    { $sel:fixedResponseConfig:Action' :: Maybe FixedResponseActionConfig
fixedResponseConfig = Maybe FixedResponseActionConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:targetGroupArn:Action' :: Maybe Text
targetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:forwardConfig:Action' :: Maybe ForwardActionConfig
forwardConfig = Maybe ForwardActionConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:redirectConfig:Action' :: Maybe RedirectActionConfig
redirectConfig = Maybe RedirectActionConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:authenticateCognitoConfig:Action' :: Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig = Maybe AuthenticateCognitoActionConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:order:Action' :: Maybe Natural
order = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:authenticateOidcConfig:Action' :: Maybe AuthenticateOidcActionConfig
authenticateOidcConfig = Maybe AuthenticateOidcActionConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:type':Action' :: ActionTypeEnum
type' = ActionTypeEnum
pType_
    }

-- | [Application Load Balancer] Information for creating an action that
-- returns a custom HTTP response. Specify only when @Type@ is
-- @fixed-response@.
action_fixedResponseConfig :: Lens.Lens' Action (Prelude.Maybe FixedResponseActionConfig)
action_fixedResponseConfig :: (Maybe FixedResponseActionConfig
 -> f (Maybe FixedResponseActionConfig))
-> Action -> f Action
action_fixedResponseConfig = (Action -> Maybe FixedResponseActionConfig)
-> (Action -> Maybe FixedResponseActionConfig -> Action)
-> Lens
     Action
     Action
     (Maybe FixedResponseActionConfig)
     (Maybe FixedResponseActionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe FixedResponseActionConfig
fixedResponseConfig :: Maybe FixedResponseActionConfig
$sel:fixedResponseConfig:Action' :: Action -> Maybe FixedResponseActionConfig
fixedResponseConfig} -> Maybe FixedResponseActionConfig
fixedResponseConfig) (\s :: Action
s@Action' {} Maybe FixedResponseActionConfig
a -> Action
s {$sel:fixedResponseConfig:Action' :: Maybe FixedResponseActionConfig
fixedResponseConfig = Maybe FixedResponseActionConfig
a} :: Action)

-- | 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.
action_targetGroupArn :: Lens.Lens' Action (Prelude.Maybe Prelude.Text)
action_targetGroupArn :: (Maybe Text -> f (Maybe Text)) -> Action -> f Action
action_targetGroupArn = (Action -> Maybe Text)
-> (Action -> Maybe Text -> Action)
-> Lens Action Action (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe Text
targetGroupArn :: Maybe Text
$sel:targetGroupArn:Action' :: Action -> Maybe Text
targetGroupArn} -> Maybe Text
targetGroupArn) (\s :: Action
s@Action' {} Maybe Text
a -> Action
s {$sel:targetGroupArn:Action' :: Maybe Text
targetGroupArn = Maybe Text
a} :: Action)

-- | 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@.
action_forwardConfig :: Lens.Lens' Action (Prelude.Maybe ForwardActionConfig)
action_forwardConfig :: (Maybe ForwardActionConfig -> f (Maybe ForwardActionConfig))
-> Action -> f Action
action_forwardConfig = (Action -> Maybe ForwardActionConfig)
-> (Action -> Maybe ForwardActionConfig -> Action)
-> Lens
     Action
     Action
     (Maybe ForwardActionConfig)
     (Maybe ForwardActionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe ForwardActionConfig
forwardConfig :: Maybe ForwardActionConfig
$sel:forwardConfig:Action' :: Action -> Maybe ForwardActionConfig
forwardConfig} -> Maybe ForwardActionConfig
forwardConfig) (\s :: Action
s@Action' {} Maybe ForwardActionConfig
a -> Action
s {$sel:forwardConfig:Action' :: Maybe ForwardActionConfig
forwardConfig = Maybe ForwardActionConfig
a} :: Action)

-- | [Application Load Balancer] Information for creating a redirect action.
-- Specify only when @Type@ is @redirect@.
action_redirectConfig :: Lens.Lens' Action (Prelude.Maybe RedirectActionConfig)
action_redirectConfig :: (Maybe RedirectActionConfig -> f (Maybe RedirectActionConfig))
-> Action -> f Action
action_redirectConfig = (Action -> Maybe RedirectActionConfig)
-> (Action -> Maybe RedirectActionConfig -> Action)
-> Lens
     Action
     Action
     (Maybe RedirectActionConfig)
     (Maybe RedirectActionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe RedirectActionConfig
redirectConfig :: Maybe RedirectActionConfig
$sel:redirectConfig:Action' :: Action -> Maybe RedirectActionConfig
redirectConfig} -> Maybe RedirectActionConfig
redirectConfig) (\s :: Action
s@Action' {} Maybe RedirectActionConfig
a -> Action
s {$sel:redirectConfig:Action' :: Maybe RedirectActionConfig
redirectConfig = Maybe RedirectActionConfig
a} :: Action)

-- | [HTTPS listeners] Information for using Amazon Cognito to authenticate
-- users. Specify only when @Type@ is @authenticate-cognito@.
action_authenticateCognitoConfig :: Lens.Lens' Action (Prelude.Maybe AuthenticateCognitoActionConfig)
action_authenticateCognitoConfig :: (Maybe AuthenticateCognitoActionConfig
 -> f (Maybe AuthenticateCognitoActionConfig))
-> Action -> f Action
action_authenticateCognitoConfig = (Action -> Maybe AuthenticateCognitoActionConfig)
-> (Action -> Maybe AuthenticateCognitoActionConfig -> Action)
-> Lens
     Action
     Action
     (Maybe AuthenticateCognitoActionConfig)
     (Maybe AuthenticateCognitoActionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig :: Maybe AuthenticateCognitoActionConfig
$sel:authenticateCognitoConfig:Action' :: Action -> Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig} -> Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig) (\s :: Action
s@Action' {} Maybe AuthenticateCognitoActionConfig
a -> Action
s {$sel:authenticateCognitoConfig:Action' :: Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig = Maybe AuthenticateCognitoActionConfig
a} :: Action)

-- | 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.
action_order :: Lens.Lens' Action (Prelude.Maybe Prelude.Natural)
action_order :: (Maybe Natural -> f (Maybe Natural)) -> Action -> f Action
action_order = (Action -> Maybe Natural)
-> (Action -> Maybe Natural -> Action)
-> Lens Action Action (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe Natural
order :: Maybe Natural
$sel:order:Action' :: Action -> Maybe Natural
order} -> Maybe Natural
order) (\s :: Action
s@Action' {} Maybe Natural
a -> Action
s {$sel:order:Action' :: Maybe Natural
order = Maybe Natural
a} :: Action)

-- | [HTTPS listeners] Information about an identity provider that is
-- compliant with OpenID Connect (OIDC). Specify only when @Type@ is
-- @authenticate-oidc@.
action_authenticateOidcConfig :: Lens.Lens' Action (Prelude.Maybe AuthenticateOidcActionConfig)
action_authenticateOidcConfig :: (Maybe AuthenticateOidcActionConfig
 -> f (Maybe AuthenticateOidcActionConfig))
-> Action -> f Action
action_authenticateOidcConfig = (Action -> Maybe AuthenticateOidcActionConfig)
-> (Action -> Maybe AuthenticateOidcActionConfig -> Action)
-> Lens
     Action
     Action
     (Maybe AuthenticateOidcActionConfig)
     (Maybe AuthenticateOidcActionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe AuthenticateOidcActionConfig
authenticateOidcConfig :: Maybe AuthenticateOidcActionConfig
$sel:authenticateOidcConfig:Action' :: Action -> Maybe AuthenticateOidcActionConfig
authenticateOidcConfig} -> Maybe AuthenticateOidcActionConfig
authenticateOidcConfig) (\s :: Action
s@Action' {} Maybe AuthenticateOidcActionConfig
a -> Action
s {$sel:authenticateOidcConfig:Action' :: Maybe AuthenticateOidcActionConfig
authenticateOidcConfig = Maybe AuthenticateOidcActionConfig
a} :: Action)

-- | The type of action.
action_type :: Lens.Lens' Action ActionTypeEnum
action_type :: (ActionTypeEnum -> f ActionTypeEnum) -> Action -> f Action
action_type = (Action -> ActionTypeEnum)
-> (Action -> ActionTypeEnum -> Action)
-> Lens Action Action ActionTypeEnum ActionTypeEnum
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {ActionTypeEnum
type' :: ActionTypeEnum
$sel:type':Action' :: Action -> ActionTypeEnum
type'} -> ActionTypeEnum
type') (\s :: Action
s@Action' {} ActionTypeEnum
a -> Action
s {$sel:type':Action' :: ActionTypeEnum
type' = ActionTypeEnum
a} :: Action)

instance Core.FromXML Action where
  parseXML :: [Node] -> Either String Action
parseXML [Node]
x =
    Maybe FixedResponseActionConfig
-> Maybe Text
-> Maybe ForwardActionConfig
-> Maybe RedirectActionConfig
-> Maybe AuthenticateCognitoActionConfig
-> Maybe Natural
-> Maybe AuthenticateOidcActionConfig
-> ActionTypeEnum
-> Action
Action'
      (Maybe FixedResponseActionConfig
 -> Maybe Text
 -> Maybe ForwardActionConfig
 -> Maybe RedirectActionConfig
 -> Maybe AuthenticateCognitoActionConfig
 -> Maybe Natural
 -> Maybe AuthenticateOidcActionConfig
 -> ActionTypeEnum
 -> Action)
-> Either String (Maybe FixedResponseActionConfig)
-> Either
     String
     (Maybe Text
      -> Maybe ForwardActionConfig
      -> Maybe RedirectActionConfig
      -> Maybe AuthenticateCognitoActionConfig
      -> Maybe Natural
      -> Maybe AuthenticateOidcActionConfig
      -> ActionTypeEnum
      -> Action)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe FixedResponseActionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FixedResponseConfig")
      Either
  String
  (Maybe Text
   -> Maybe ForwardActionConfig
   -> Maybe RedirectActionConfig
   -> Maybe AuthenticateCognitoActionConfig
   -> Maybe Natural
   -> Maybe AuthenticateOidcActionConfig
   -> ActionTypeEnum
   -> Action)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ForwardActionConfig
      -> Maybe RedirectActionConfig
      -> Maybe AuthenticateCognitoActionConfig
      -> Maybe Natural
      -> Maybe AuthenticateOidcActionConfig
      -> ActionTypeEnum
      -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TargetGroupArn")
      Either
  String
  (Maybe ForwardActionConfig
   -> Maybe RedirectActionConfig
   -> Maybe AuthenticateCognitoActionConfig
   -> Maybe Natural
   -> Maybe AuthenticateOidcActionConfig
   -> ActionTypeEnum
   -> Action)
-> Either String (Maybe ForwardActionConfig)
-> Either
     String
     (Maybe RedirectActionConfig
      -> Maybe AuthenticateCognitoActionConfig
      -> Maybe Natural
      -> Maybe AuthenticateOidcActionConfig
      -> ActionTypeEnum
      -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ForwardActionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ForwardConfig")
      Either
  String
  (Maybe RedirectActionConfig
   -> Maybe AuthenticateCognitoActionConfig
   -> Maybe Natural
   -> Maybe AuthenticateOidcActionConfig
   -> ActionTypeEnum
   -> Action)
-> Either String (Maybe RedirectActionConfig)
-> Either
     String
     (Maybe AuthenticateCognitoActionConfig
      -> Maybe Natural
      -> Maybe AuthenticateOidcActionConfig
      -> ActionTypeEnum
      -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe RedirectActionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RedirectConfig")
      Either
  String
  (Maybe AuthenticateCognitoActionConfig
   -> Maybe Natural
   -> Maybe AuthenticateOidcActionConfig
   -> ActionTypeEnum
   -> Action)
-> Either String (Maybe AuthenticateCognitoActionConfig)
-> Either
     String
     (Maybe Natural
      -> Maybe AuthenticateOidcActionConfig -> ActionTypeEnum -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe AuthenticateCognitoActionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AuthenticateCognitoConfig")
      Either
  String
  (Maybe Natural
   -> Maybe AuthenticateOidcActionConfig -> ActionTypeEnum -> Action)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe AuthenticateOidcActionConfig -> ActionTypeEnum -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Order")
      Either
  String
  (Maybe AuthenticateOidcActionConfig -> ActionTypeEnum -> Action)
-> Either String (Maybe AuthenticateOidcActionConfig)
-> Either String (ActionTypeEnum -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe AuthenticateOidcActionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AuthenticateOidcConfig")
      Either String (ActionTypeEnum -> Action)
-> Either String ActionTypeEnum -> Either String Action
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ActionTypeEnum
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Type")

instance Prelude.Hashable Action

instance Prelude.NFData Action

instance Core.ToQuery Action where
  toQuery :: Action -> QueryString
toQuery Action' {Maybe Natural
Maybe Text
Maybe AuthenticateCognitoActionConfig
Maybe AuthenticateOidcActionConfig
Maybe FixedResponseActionConfig
Maybe RedirectActionConfig
Maybe ForwardActionConfig
ActionTypeEnum
type' :: ActionTypeEnum
authenticateOidcConfig :: Maybe AuthenticateOidcActionConfig
order :: Maybe Natural
authenticateCognitoConfig :: Maybe AuthenticateCognitoActionConfig
redirectConfig :: Maybe RedirectActionConfig
forwardConfig :: Maybe ForwardActionConfig
targetGroupArn :: Maybe Text
fixedResponseConfig :: Maybe FixedResponseActionConfig
$sel:type':Action' :: Action -> ActionTypeEnum
$sel:authenticateOidcConfig:Action' :: Action -> Maybe AuthenticateOidcActionConfig
$sel:order:Action' :: Action -> Maybe Natural
$sel:authenticateCognitoConfig:Action' :: Action -> Maybe AuthenticateCognitoActionConfig
$sel:redirectConfig:Action' :: Action -> Maybe RedirectActionConfig
$sel:forwardConfig:Action' :: Action -> Maybe ForwardActionConfig
$sel:targetGroupArn:Action' :: Action -> Maybe Text
$sel:fixedResponseConfig:Action' :: Action -> Maybe FixedResponseActionConfig
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"FixedResponseConfig" ByteString -> Maybe FixedResponseActionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe FixedResponseActionConfig
fixedResponseConfig,
        ByteString
"TargetGroupArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
targetGroupArn,
        ByteString
"ForwardConfig" ByteString -> Maybe ForwardActionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ForwardActionConfig
forwardConfig,
        ByteString
"RedirectConfig" ByteString -> Maybe RedirectActionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RedirectActionConfig
redirectConfig,
        ByteString
"AuthenticateCognitoConfig"
          ByteString -> Maybe AuthenticateCognitoActionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig,
        ByteString
"Order" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
order,
        ByteString
"AuthenticateOidcConfig"
          ByteString -> Maybe AuthenticateOidcActionConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AuthenticateOidcActionConfig
authenticateOidcConfig,
        ByteString
"Type" ByteString -> ActionTypeEnum -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ActionTypeEnum
type'
      ]