{-# 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.WAFRegional.Types.SizeConstraintSetUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.WAFRegional.Types.ChangeAction
import Amazonka.WAFRegional.Types.SizeConstraint
data SizeConstraintSetUpdate = SizeConstraintSetUpdate'
{
SizeConstraintSetUpdate -> ChangeAction
action :: ChangeAction,
SizeConstraintSetUpdate -> SizeConstraint
sizeConstraint :: SizeConstraint
}
deriving (SizeConstraintSetUpdate -> SizeConstraintSetUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SizeConstraintSetUpdate -> SizeConstraintSetUpdate -> Bool
$c/= :: SizeConstraintSetUpdate -> SizeConstraintSetUpdate -> Bool
== :: SizeConstraintSetUpdate -> SizeConstraintSetUpdate -> Bool
$c== :: SizeConstraintSetUpdate -> SizeConstraintSetUpdate -> Bool
Prelude.Eq, ReadPrec [SizeConstraintSetUpdate]
ReadPrec SizeConstraintSetUpdate
Int -> ReadS SizeConstraintSetUpdate
ReadS [SizeConstraintSetUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SizeConstraintSetUpdate]
$creadListPrec :: ReadPrec [SizeConstraintSetUpdate]
readPrec :: ReadPrec SizeConstraintSetUpdate
$creadPrec :: ReadPrec SizeConstraintSetUpdate
readList :: ReadS [SizeConstraintSetUpdate]
$creadList :: ReadS [SizeConstraintSetUpdate]
readsPrec :: Int -> ReadS SizeConstraintSetUpdate
$creadsPrec :: Int -> ReadS SizeConstraintSetUpdate
Prelude.Read, Int -> SizeConstraintSetUpdate -> ShowS
[SizeConstraintSetUpdate] -> ShowS
SizeConstraintSetUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SizeConstraintSetUpdate] -> ShowS
$cshowList :: [SizeConstraintSetUpdate] -> ShowS
show :: SizeConstraintSetUpdate -> String
$cshow :: SizeConstraintSetUpdate -> String
showsPrec :: Int -> SizeConstraintSetUpdate -> ShowS
$cshowsPrec :: Int -> SizeConstraintSetUpdate -> ShowS
Prelude.Show, forall x. Rep SizeConstraintSetUpdate x -> SizeConstraintSetUpdate
forall x. SizeConstraintSetUpdate -> Rep SizeConstraintSetUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SizeConstraintSetUpdate x -> SizeConstraintSetUpdate
$cfrom :: forall x. SizeConstraintSetUpdate -> Rep SizeConstraintSetUpdate x
Prelude.Generic)
newSizeConstraintSetUpdate ::
ChangeAction ->
SizeConstraint ->
SizeConstraintSetUpdate
newSizeConstraintSetUpdate :: ChangeAction -> SizeConstraint -> SizeConstraintSetUpdate
newSizeConstraintSetUpdate ChangeAction
pAction_ SizeConstraint
pSizeConstraint_ =
SizeConstraintSetUpdate'
{ $sel:action:SizeConstraintSetUpdate' :: ChangeAction
action = ChangeAction
pAction_,
$sel:sizeConstraint:SizeConstraintSetUpdate' :: SizeConstraint
sizeConstraint = SizeConstraint
pSizeConstraint_
}
sizeConstraintSetUpdate_action :: Lens.Lens' SizeConstraintSetUpdate ChangeAction
sizeConstraintSetUpdate_action :: Lens' SizeConstraintSetUpdate ChangeAction
sizeConstraintSetUpdate_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SizeConstraintSetUpdate' {ChangeAction
action :: ChangeAction
$sel:action:SizeConstraintSetUpdate' :: SizeConstraintSetUpdate -> ChangeAction
action} -> ChangeAction
action) (\s :: SizeConstraintSetUpdate
s@SizeConstraintSetUpdate' {} ChangeAction
a -> SizeConstraintSetUpdate
s {$sel:action:SizeConstraintSetUpdate' :: ChangeAction
action = ChangeAction
a} :: SizeConstraintSetUpdate)
sizeConstraintSetUpdate_sizeConstraint :: Lens.Lens' SizeConstraintSetUpdate SizeConstraint
sizeConstraintSetUpdate_sizeConstraint :: Lens' SizeConstraintSetUpdate SizeConstraint
sizeConstraintSetUpdate_sizeConstraint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SizeConstraintSetUpdate' {SizeConstraint
sizeConstraint :: SizeConstraint
$sel:sizeConstraint:SizeConstraintSetUpdate' :: SizeConstraintSetUpdate -> SizeConstraint
sizeConstraint} -> SizeConstraint
sizeConstraint) (\s :: SizeConstraintSetUpdate
s@SizeConstraintSetUpdate' {} SizeConstraint
a -> SizeConstraintSetUpdate
s {$sel:sizeConstraint:SizeConstraintSetUpdate' :: SizeConstraint
sizeConstraint = SizeConstraint
a} :: SizeConstraintSetUpdate)
instance Prelude.Hashable SizeConstraintSetUpdate where
hashWithSalt :: Int -> SizeConstraintSetUpdate -> Int
hashWithSalt Int
_salt SizeConstraintSetUpdate' {ChangeAction
SizeConstraint
sizeConstraint :: SizeConstraint
action :: ChangeAction
$sel:sizeConstraint:SizeConstraintSetUpdate' :: SizeConstraintSetUpdate -> SizeConstraint
$sel:action:SizeConstraintSetUpdate' :: SizeConstraintSetUpdate -> ChangeAction
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ChangeAction
action
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SizeConstraint
sizeConstraint
instance Prelude.NFData SizeConstraintSetUpdate where
rnf :: SizeConstraintSetUpdate -> ()
rnf SizeConstraintSetUpdate' {ChangeAction
SizeConstraint
sizeConstraint :: SizeConstraint
action :: ChangeAction
$sel:sizeConstraint:SizeConstraintSetUpdate' :: SizeConstraintSetUpdate -> SizeConstraint
$sel:action:SizeConstraintSetUpdate' :: SizeConstraintSetUpdate -> ChangeAction
..} =
forall a. NFData a => a -> ()
Prelude.rnf ChangeAction
action
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SizeConstraint
sizeConstraint
instance Data.ToJSON SizeConstraintSetUpdate where
toJSON :: SizeConstraintSetUpdate -> Value
toJSON SizeConstraintSetUpdate' {ChangeAction
SizeConstraint
sizeConstraint :: SizeConstraint
action :: ChangeAction
$sel:sizeConstraint:SizeConstraintSetUpdate' :: SizeConstraintSetUpdate -> SizeConstraint
$sel:action:SizeConstraintSetUpdate' :: SizeConstraintSetUpdate -> ChangeAction
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Action" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ChangeAction
action),
forall a. a -> Maybe a
Prelude.Just
(Key
"SizeConstraint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SizeConstraint
sizeConstraint)
]
)