{-# 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 #-}
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
data Action = Action'
{
Action -> Maybe FixedResponseActionConfig
fixedResponseConfig :: Prelude.Maybe FixedResponseActionConfig,
Action -> Maybe Text
targetGroupArn :: Prelude.Maybe Prelude.Text,
Action -> Maybe ForwardActionConfig
forwardConfig :: Prelude.Maybe ForwardActionConfig,
Action -> Maybe RedirectActionConfig
redirectConfig :: Prelude.Maybe RedirectActionConfig,
Action -> Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig :: Prelude.Maybe AuthenticateCognitoActionConfig,
Action -> Maybe Natural
order :: Prelude.Maybe Prelude.Natural,
Action -> Maybe AuthenticateOidcActionConfig
authenticateOidcConfig :: Prelude.Maybe AuthenticateOidcActionConfig,
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)
newAction ::
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_
}
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)
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)
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)
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)
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)
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)
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)
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'
]