{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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.Prelude as Prelude
data Action = Action'
{
Action -> Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig :: Prelude.Maybe AuthenticateCognitoActionConfig,
Action -> Maybe AuthenticateOidcActionConfig
authenticateOidcConfig :: Prelude.Maybe AuthenticateOidcActionConfig,
Action -> Maybe FixedResponseActionConfig
fixedResponseConfig :: Prelude.Maybe FixedResponseActionConfig,
Action -> Maybe ForwardActionConfig
forwardConfig :: Prelude.Maybe ForwardActionConfig,
Action -> Maybe Natural
order :: Prelude.Maybe Prelude.Natural,
Action -> Maybe RedirectActionConfig
redirectConfig :: Prelude.Maybe RedirectActionConfig,
Action -> Maybe Text
targetGroupArn :: Prelude.Maybe Prelude.Text,
Action -> ActionTypeEnum
type' :: ActionTypeEnum
}
deriving (Action -> Action -> Bool
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]
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
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. 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'
{ $sel:authenticateCognitoConfig:Action' :: Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig =
forall a. Maybe a
Prelude.Nothing,
$sel:authenticateOidcConfig:Action' :: Maybe AuthenticateOidcActionConfig
authenticateOidcConfig = forall a. Maybe a
Prelude.Nothing,
$sel:fixedResponseConfig:Action' :: Maybe FixedResponseActionConfig
fixedResponseConfig = forall a. Maybe a
Prelude.Nothing,
$sel:forwardConfig:Action' :: Maybe ForwardActionConfig
forwardConfig = forall a. Maybe a
Prelude.Nothing,
$sel:order:Action' :: Maybe Natural
order = forall a. Maybe a
Prelude.Nothing,
$sel:redirectConfig:Action' :: Maybe RedirectActionConfig
redirectConfig = forall a. Maybe a
Prelude.Nothing,
$sel:targetGroupArn:Action' :: Maybe Text
targetGroupArn = forall a. Maybe a
Prelude.Nothing,
$sel:type':Action' :: ActionTypeEnum
type' = ActionTypeEnum
pType_
}
action_authenticateCognitoConfig :: Lens.Lens' Action (Prelude.Maybe AuthenticateCognitoActionConfig)
action_authenticateCognitoConfig :: Lens' Action (Maybe AuthenticateCognitoActionConfig)
action_authenticateCognitoConfig = 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_authenticateOidcConfig :: Lens.Lens' Action (Prelude.Maybe AuthenticateOidcActionConfig)
action_authenticateOidcConfig :: Lens' Action (Maybe AuthenticateOidcActionConfig)
action_authenticateOidcConfig = 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_fixedResponseConfig :: Lens.Lens' Action (Prelude.Maybe FixedResponseActionConfig)
action_fixedResponseConfig :: Lens' Action (Maybe FixedResponseActionConfig)
action_fixedResponseConfig = 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_forwardConfig :: Lens.Lens' Action (Prelude.Maybe ForwardActionConfig)
action_forwardConfig :: Lens' Action (Maybe ForwardActionConfig)
action_forwardConfig = 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_order :: Lens.Lens' Action (Prelude.Maybe Prelude.Natural)
action_order :: Lens' Action (Maybe Natural)
action_order = 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_redirectConfig :: Lens.Lens' Action (Prelude.Maybe RedirectActionConfig)
action_redirectConfig :: Lens' Action (Maybe RedirectActionConfig)
action_redirectConfig = 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_targetGroupArn :: Lens.Lens' Action (Prelude.Maybe Prelude.Text)
action_targetGroupArn :: Lens' Action (Maybe Text)
action_targetGroupArn = 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_type :: Lens.Lens' Action ActionTypeEnum
action_type :: Lens' Action ActionTypeEnum
action_type = 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 Data.FromXML Action where
parseXML :: [Node] -> Either String Action
parseXML [Node]
x =
Maybe AuthenticateCognitoActionConfig
-> Maybe AuthenticateOidcActionConfig
-> Maybe FixedResponseActionConfig
-> Maybe ForwardActionConfig
-> Maybe Natural
-> Maybe RedirectActionConfig
-> Maybe Text
-> ActionTypeEnum
-> Action
Action'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AuthenticateCognitoConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AuthenticateOidcConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FixedResponseConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ForwardConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Order")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RedirectConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TargetGroupArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Type")
instance Prelude.Hashable Action where
hashWithSalt :: Int -> Action -> Int
hashWithSalt Int
_salt Action' {Maybe Natural
Maybe Text
Maybe AuthenticateCognitoActionConfig
Maybe AuthenticateOidcActionConfig
Maybe FixedResponseActionConfig
Maybe RedirectActionConfig
Maybe ForwardActionConfig
ActionTypeEnum
type' :: ActionTypeEnum
targetGroupArn :: Maybe Text
redirectConfig :: Maybe RedirectActionConfig
order :: Maybe Natural
forwardConfig :: Maybe ForwardActionConfig
fixedResponseConfig :: Maybe FixedResponseActionConfig
authenticateOidcConfig :: Maybe AuthenticateOidcActionConfig
authenticateCognitoConfig :: Maybe AuthenticateCognitoActionConfig
$sel:type':Action' :: Action -> ActionTypeEnum
$sel:targetGroupArn:Action' :: Action -> Maybe Text
$sel:redirectConfig:Action' :: Action -> Maybe RedirectActionConfig
$sel:order:Action' :: Action -> Maybe Natural
$sel:forwardConfig:Action' :: Action -> Maybe ForwardActionConfig
$sel:fixedResponseConfig:Action' :: Action -> Maybe FixedResponseActionConfig
$sel:authenticateOidcConfig:Action' :: Action -> Maybe AuthenticateOidcActionConfig
$sel:authenticateCognitoConfig:Action' :: Action -> Maybe AuthenticateCognitoActionConfig
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthenticateOidcActionConfig
authenticateOidcConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FixedResponseActionConfig
fixedResponseConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ForwardActionConfig
forwardConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
order
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RedirectActionConfig
redirectConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetGroupArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ActionTypeEnum
type'
instance Prelude.NFData Action where
rnf :: Action -> ()
rnf Action' {Maybe Natural
Maybe Text
Maybe AuthenticateCognitoActionConfig
Maybe AuthenticateOidcActionConfig
Maybe FixedResponseActionConfig
Maybe RedirectActionConfig
Maybe ForwardActionConfig
ActionTypeEnum
type' :: ActionTypeEnum
targetGroupArn :: Maybe Text
redirectConfig :: Maybe RedirectActionConfig
order :: Maybe Natural
forwardConfig :: Maybe ForwardActionConfig
fixedResponseConfig :: Maybe FixedResponseActionConfig
authenticateOidcConfig :: Maybe AuthenticateOidcActionConfig
authenticateCognitoConfig :: Maybe AuthenticateCognitoActionConfig
$sel:type':Action' :: Action -> ActionTypeEnum
$sel:targetGroupArn:Action' :: Action -> Maybe Text
$sel:redirectConfig:Action' :: Action -> Maybe RedirectActionConfig
$sel:order:Action' :: Action -> Maybe Natural
$sel:forwardConfig:Action' :: Action -> Maybe ForwardActionConfig
$sel:fixedResponseConfig:Action' :: Action -> Maybe FixedResponseActionConfig
$sel:authenticateOidcConfig:Action' :: Action -> Maybe AuthenticateOidcActionConfig
$sel:authenticateCognitoConfig:Action' :: Action -> Maybe AuthenticateCognitoActionConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthenticateOidcActionConfig
authenticateOidcConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FixedResponseActionConfig
fixedResponseConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ForwardActionConfig
forwardConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
order
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RedirectActionConfig
redirectConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetGroupArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ActionTypeEnum
type'
instance Data.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
targetGroupArn :: Maybe Text
redirectConfig :: Maybe RedirectActionConfig
order :: Maybe Natural
forwardConfig :: Maybe ForwardActionConfig
fixedResponseConfig :: Maybe FixedResponseActionConfig
authenticateOidcConfig :: Maybe AuthenticateOidcActionConfig
authenticateCognitoConfig :: Maybe AuthenticateCognitoActionConfig
$sel:type':Action' :: Action -> ActionTypeEnum
$sel:targetGroupArn:Action' :: Action -> Maybe Text
$sel:redirectConfig:Action' :: Action -> Maybe RedirectActionConfig
$sel:order:Action' :: Action -> Maybe Natural
$sel:forwardConfig:Action' :: Action -> Maybe ForwardActionConfig
$sel:fixedResponseConfig:Action' :: Action -> Maybe FixedResponseActionConfig
$sel:authenticateOidcConfig:Action' :: Action -> Maybe AuthenticateOidcActionConfig
$sel:authenticateCognitoConfig:Action' :: Action -> Maybe AuthenticateCognitoActionConfig
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"AuthenticateCognitoConfig"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe AuthenticateCognitoActionConfig
authenticateCognitoConfig,
ByteString
"AuthenticateOidcConfig"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe AuthenticateOidcActionConfig
authenticateOidcConfig,
ByteString
"FixedResponseConfig" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe FixedResponseActionConfig
fixedResponseConfig,
ByteString
"ForwardConfig" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ForwardActionConfig
forwardConfig,
ByteString
"Order" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
order,
ByteString
"RedirectConfig" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe RedirectActionConfig
redirectConfig,
ByteString
"TargetGroupArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
targetGroupArn,
ByteString
"Type" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ActionTypeEnum
type'
]