{-# 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.NetworkFirewall.Types.StatelessRuleGroupReference 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
data StatelessRuleGroupReference = StatelessRuleGroupReference'
{
StatelessRuleGroupReference -> Text
resourceArn :: Prelude.Text,
StatelessRuleGroupReference -> Natural
priority :: Prelude.Natural
}
deriving (StatelessRuleGroupReference -> StatelessRuleGroupReference -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatelessRuleGroupReference -> StatelessRuleGroupReference -> Bool
$c/= :: StatelessRuleGroupReference -> StatelessRuleGroupReference -> Bool
== :: StatelessRuleGroupReference -> StatelessRuleGroupReference -> Bool
$c== :: StatelessRuleGroupReference -> StatelessRuleGroupReference -> Bool
Prelude.Eq, ReadPrec [StatelessRuleGroupReference]
ReadPrec StatelessRuleGroupReference
Int -> ReadS StatelessRuleGroupReference
ReadS [StatelessRuleGroupReference]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatelessRuleGroupReference]
$creadListPrec :: ReadPrec [StatelessRuleGroupReference]
readPrec :: ReadPrec StatelessRuleGroupReference
$creadPrec :: ReadPrec StatelessRuleGroupReference
readList :: ReadS [StatelessRuleGroupReference]
$creadList :: ReadS [StatelessRuleGroupReference]
readsPrec :: Int -> ReadS StatelessRuleGroupReference
$creadsPrec :: Int -> ReadS StatelessRuleGroupReference
Prelude.Read, Int -> StatelessRuleGroupReference -> ShowS
[StatelessRuleGroupReference] -> ShowS
StatelessRuleGroupReference -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatelessRuleGroupReference] -> ShowS
$cshowList :: [StatelessRuleGroupReference] -> ShowS
show :: StatelessRuleGroupReference -> String
$cshow :: StatelessRuleGroupReference -> String
showsPrec :: Int -> StatelessRuleGroupReference -> ShowS
$cshowsPrec :: Int -> StatelessRuleGroupReference -> ShowS
Prelude.Show, forall x.
Rep StatelessRuleGroupReference x -> StatelessRuleGroupReference
forall x.
StatelessRuleGroupReference -> Rep StatelessRuleGroupReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StatelessRuleGroupReference x -> StatelessRuleGroupReference
$cfrom :: forall x.
StatelessRuleGroupReference -> Rep StatelessRuleGroupReference x
Prelude.Generic)
newStatelessRuleGroupReference ::
Prelude.Text ->
Prelude.Natural ->
StatelessRuleGroupReference
newStatelessRuleGroupReference :: Text -> Natural -> StatelessRuleGroupReference
newStatelessRuleGroupReference
Text
pResourceArn_
Natural
pPriority_ =
StatelessRuleGroupReference'
{ $sel:resourceArn:StatelessRuleGroupReference' :: Text
resourceArn =
Text
pResourceArn_,
$sel:priority:StatelessRuleGroupReference' :: Natural
priority = Natural
pPriority_
}
statelessRuleGroupReference_resourceArn :: Lens.Lens' StatelessRuleGroupReference Prelude.Text
statelessRuleGroupReference_resourceArn :: Lens' StatelessRuleGroupReference Text
statelessRuleGroupReference_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatelessRuleGroupReference' {Text
resourceArn :: Text
$sel:resourceArn:StatelessRuleGroupReference' :: StatelessRuleGroupReference -> Text
resourceArn} -> Text
resourceArn) (\s :: StatelessRuleGroupReference
s@StatelessRuleGroupReference' {} Text
a -> StatelessRuleGroupReference
s {$sel:resourceArn:StatelessRuleGroupReference' :: Text
resourceArn = Text
a} :: StatelessRuleGroupReference)
statelessRuleGroupReference_priority :: Lens.Lens' StatelessRuleGroupReference Prelude.Natural
statelessRuleGroupReference_priority :: Lens' StatelessRuleGroupReference Natural
statelessRuleGroupReference_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatelessRuleGroupReference' {Natural
priority :: Natural
$sel:priority:StatelessRuleGroupReference' :: StatelessRuleGroupReference -> Natural
priority} -> Natural
priority) (\s :: StatelessRuleGroupReference
s@StatelessRuleGroupReference' {} Natural
a -> StatelessRuleGroupReference
s {$sel:priority:StatelessRuleGroupReference' :: Natural
priority = Natural
a} :: StatelessRuleGroupReference)
instance Data.FromJSON StatelessRuleGroupReference where
parseJSON :: Value -> Parser StatelessRuleGroupReference
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StatelessRuleGroupReference"
( \Object
x ->
Text -> Natural -> StatelessRuleGroupReference
StatelessRuleGroupReference'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ResourceArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Priority")
)
instance Prelude.Hashable StatelessRuleGroupReference where
hashWithSalt :: Int -> StatelessRuleGroupReference -> Int
hashWithSalt Int
_salt StatelessRuleGroupReference' {Natural
Text
priority :: Natural
resourceArn :: Text
$sel:priority:StatelessRuleGroupReference' :: StatelessRuleGroupReference -> Natural
$sel:resourceArn:StatelessRuleGroupReference' :: StatelessRuleGroupReference -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
priority
instance Prelude.NFData StatelessRuleGroupReference where
rnf :: StatelessRuleGroupReference -> ()
rnf StatelessRuleGroupReference' {Natural
Text
priority :: Natural
resourceArn :: Text
$sel:priority:StatelessRuleGroupReference' :: StatelessRuleGroupReference -> Natural
$sel:resourceArn:StatelessRuleGroupReference' :: StatelessRuleGroupReference -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
priority
instance Data.ToJSON StatelessRuleGroupReference where
toJSON :: StatelessRuleGroupReference -> Value
toJSON StatelessRuleGroupReference' {Natural
Text
priority :: Natural
resourceArn :: Text
$sel:priority:StatelessRuleGroupReference' :: StatelessRuleGroupReference -> Natural
$sel:resourceArn:StatelessRuleGroupReference' :: StatelessRuleGroupReference -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ResourceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceArn),
forall a. a -> Maybe a
Prelude.Just (Key
"Priority" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
priority)
]
)