{-# 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.AccessAnalyzer.Types.InlineArchiveRule where
import Amazonka.AccessAnalyzer.Types.Criterion
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 InlineArchiveRule = InlineArchiveRule'
{
InlineArchiveRule -> Text
ruleName :: Prelude.Text,
InlineArchiveRule -> HashMap Text Criterion
filter' :: Prelude.HashMap Prelude.Text Criterion
}
deriving (InlineArchiveRule -> InlineArchiveRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InlineArchiveRule -> InlineArchiveRule -> Bool
$c/= :: InlineArchiveRule -> InlineArchiveRule -> Bool
== :: InlineArchiveRule -> InlineArchiveRule -> Bool
$c== :: InlineArchiveRule -> InlineArchiveRule -> Bool
Prelude.Eq, ReadPrec [InlineArchiveRule]
ReadPrec InlineArchiveRule
Int -> ReadS InlineArchiveRule
ReadS [InlineArchiveRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InlineArchiveRule]
$creadListPrec :: ReadPrec [InlineArchiveRule]
readPrec :: ReadPrec InlineArchiveRule
$creadPrec :: ReadPrec InlineArchiveRule
readList :: ReadS [InlineArchiveRule]
$creadList :: ReadS [InlineArchiveRule]
readsPrec :: Int -> ReadS InlineArchiveRule
$creadsPrec :: Int -> ReadS InlineArchiveRule
Prelude.Read, Int -> InlineArchiveRule -> ShowS
[InlineArchiveRule] -> ShowS
InlineArchiveRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlineArchiveRule] -> ShowS
$cshowList :: [InlineArchiveRule] -> ShowS
show :: InlineArchiveRule -> String
$cshow :: InlineArchiveRule -> String
showsPrec :: Int -> InlineArchiveRule -> ShowS
$cshowsPrec :: Int -> InlineArchiveRule -> ShowS
Prelude.Show, forall x. Rep InlineArchiveRule x -> InlineArchiveRule
forall x. InlineArchiveRule -> Rep InlineArchiveRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InlineArchiveRule x -> InlineArchiveRule
$cfrom :: forall x. InlineArchiveRule -> Rep InlineArchiveRule x
Prelude.Generic)
newInlineArchiveRule ::
Prelude.Text ->
InlineArchiveRule
newInlineArchiveRule :: Text -> InlineArchiveRule
newInlineArchiveRule Text
pRuleName_ =
InlineArchiveRule'
{ $sel:ruleName:InlineArchiveRule' :: Text
ruleName = Text
pRuleName_,
$sel:filter':InlineArchiveRule' :: HashMap Text Criterion
filter' = forall a. Monoid a => a
Prelude.mempty
}
inlineArchiveRule_ruleName :: Lens.Lens' InlineArchiveRule Prelude.Text
inlineArchiveRule_ruleName :: Lens' InlineArchiveRule Text
inlineArchiveRule_ruleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InlineArchiveRule' {Text
ruleName :: Text
$sel:ruleName:InlineArchiveRule' :: InlineArchiveRule -> Text
ruleName} -> Text
ruleName) (\s :: InlineArchiveRule
s@InlineArchiveRule' {} Text
a -> InlineArchiveRule
s {$sel:ruleName:InlineArchiveRule' :: Text
ruleName = Text
a} :: InlineArchiveRule)
inlineArchiveRule_filter :: Lens.Lens' InlineArchiveRule (Prelude.HashMap Prelude.Text Criterion)
inlineArchiveRule_filter :: Lens' InlineArchiveRule (HashMap Text Criterion)
inlineArchiveRule_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InlineArchiveRule' {HashMap Text Criterion
filter' :: HashMap Text Criterion
$sel:filter':InlineArchiveRule' :: InlineArchiveRule -> HashMap Text Criterion
filter'} -> HashMap Text Criterion
filter') (\s :: InlineArchiveRule
s@InlineArchiveRule' {} HashMap Text Criterion
a -> InlineArchiveRule
s {$sel:filter':InlineArchiveRule' :: HashMap Text Criterion
filter' = HashMap Text Criterion
a} :: InlineArchiveRule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable InlineArchiveRule where
hashWithSalt :: Int -> InlineArchiveRule -> Int
hashWithSalt Int
_salt InlineArchiveRule' {Text
HashMap Text Criterion
filter' :: HashMap Text Criterion
ruleName :: Text
$sel:filter':InlineArchiveRule' :: InlineArchiveRule -> HashMap Text Criterion
$sel:ruleName:InlineArchiveRule' :: InlineArchiveRule -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text Criterion
filter'
instance Prelude.NFData InlineArchiveRule where
rnf :: InlineArchiveRule -> ()
rnf InlineArchiveRule' {Text
HashMap Text Criterion
filter' :: HashMap Text Criterion
ruleName :: Text
$sel:filter':InlineArchiveRule' :: InlineArchiveRule -> HashMap Text Criterion
$sel:ruleName:InlineArchiveRule' :: InlineArchiveRule -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text Criterion
filter'
instance Data.ToJSON InlineArchiveRule where
toJSON :: InlineArchiveRule -> Value
toJSON InlineArchiveRule' {Text
HashMap Text Criterion
filter' :: HashMap Text Criterion
ruleName :: Text
$sel:filter':InlineArchiveRule' :: InlineArchiveRule -> HashMap Text Criterion
$sel:ruleName:InlineArchiveRule' :: InlineArchiveRule -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ruleName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ruleName),
forall a. a -> Maybe a
Prelude.Just (Key
"filter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text Criterion
filter')
]
)