{-# 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.Backup.Types.ControlScope 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 ControlScope = ControlScope'
{
ControlScope -> Maybe (NonEmpty Text)
complianceResourceIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
ControlScope -> Maybe [Text]
complianceResourceTypes :: Prelude.Maybe [Prelude.Text],
ControlScope -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (ControlScope -> ControlScope -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControlScope -> ControlScope -> Bool
$c/= :: ControlScope -> ControlScope -> Bool
== :: ControlScope -> ControlScope -> Bool
$c== :: ControlScope -> ControlScope -> Bool
Prelude.Eq, ReadPrec [ControlScope]
ReadPrec ControlScope
Int -> ReadS ControlScope
ReadS [ControlScope]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ControlScope]
$creadListPrec :: ReadPrec [ControlScope]
readPrec :: ReadPrec ControlScope
$creadPrec :: ReadPrec ControlScope
readList :: ReadS [ControlScope]
$creadList :: ReadS [ControlScope]
readsPrec :: Int -> ReadS ControlScope
$creadsPrec :: Int -> ReadS ControlScope
Prelude.Read, Int -> ControlScope -> ShowS
[ControlScope] -> ShowS
ControlScope -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ControlScope] -> ShowS
$cshowList :: [ControlScope] -> ShowS
show :: ControlScope -> String
$cshow :: ControlScope -> String
showsPrec :: Int -> ControlScope -> ShowS
$cshowsPrec :: Int -> ControlScope -> ShowS
Prelude.Show, forall x. Rep ControlScope x -> ControlScope
forall x. ControlScope -> Rep ControlScope x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ControlScope x -> ControlScope
$cfrom :: forall x. ControlScope -> Rep ControlScope x
Prelude.Generic)
newControlScope ::
ControlScope
newControlScope :: ControlScope
newControlScope =
ControlScope'
{ $sel:complianceResourceIds:ControlScope' :: Maybe (NonEmpty Text)
complianceResourceIds =
forall a. Maybe a
Prelude.Nothing,
$sel:complianceResourceTypes:ControlScope' :: Maybe [Text]
complianceResourceTypes = forall a. Maybe a
Prelude.Nothing,
$sel:tags:ControlScope' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
}
controlScope_complianceResourceIds :: Lens.Lens' ControlScope (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
controlScope_complianceResourceIds :: Lens' ControlScope (Maybe (NonEmpty Text))
controlScope_complianceResourceIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlScope' {Maybe (NonEmpty Text)
complianceResourceIds :: Maybe (NonEmpty Text)
$sel:complianceResourceIds:ControlScope' :: ControlScope -> Maybe (NonEmpty Text)
complianceResourceIds} -> Maybe (NonEmpty Text)
complianceResourceIds) (\s :: ControlScope
s@ControlScope' {} Maybe (NonEmpty Text)
a -> ControlScope
s {$sel:complianceResourceIds:ControlScope' :: Maybe (NonEmpty Text)
complianceResourceIds = Maybe (NonEmpty Text)
a} :: ControlScope) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
controlScope_complianceResourceTypes :: Lens.Lens' ControlScope (Prelude.Maybe [Prelude.Text])
controlScope_complianceResourceTypes :: Lens' ControlScope (Maybe [Text])
controlScope_complianceResourceTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlScope' {Maybe [Text]
complianceResourceTypes :: Maybe [Text]
$sel:complianceResourceTypes:ControlScope' :: ControlScope -> Maybe [Text]
complianceResourceTypes} -> Maybe [Text]
complianceResourceTypes) (\s :: ControlScope
s@ControlScope' {} Maybe [Text]
a -> ControlScope
s {$sel:complianceResourceTypes:ControlScope' :: Maybe [Text]
complianceResourceTypes = Maybe [Text]
a} :: ControlScope) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
controlScope_tags :: Lens.Lens' ControlScope (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
controlScope_tags :: Lens' ControlScope (Maybe (HashMap Text Text))
controlScope_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlScope' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ControlScope' :: ControlScope -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ControlScope
s@ControlScope' {} Maybe (HashMap Text Text)
a -> ControlScope
s {$sel:tags:ControlScope' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ControlScope) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ControlScope where
parseJSON :: Value -> Parser ControlScope
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ControlScope"
( \Object
x ->
Maybe (NonEmpty Text)
-> Maybe [Text] -> Maybe (HashMap Text Text) -> ControlScope
ControlScope'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ComplianceResourceIds")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ComplianceResourceTypes"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ControlScope where
hashWithSalt :: Int -> ControlScope -> Int
hashWithSalt Int
_salt ControlScope' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
complianceResourceTypes :: Maybe [Text]
complianceResourceIds :: Maybe (NonEmpty Text)
$sel:tags:ControlScope' :: ControlScope -> Maybe (HashMap Text Text)
$sel:complianceResourceTypes:ControlScope' :: ControlScope -> Maybe [Text]
$sel:complianceResourceIds:ControlScope' :: ControlScope -> Maybe (NonEmpty Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
complianceResourceIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
complianceResourceTypes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
instance Prelude.NFData ControlScope where
rnf :: ControlScope -> ()
rnf ControlScope' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
complianceResourceTypes :: Maybe [Text]
complianceResourceIds :: Maybe (NonEmpty Text)
$sel:tags:ControlScope' :: ControlScope -> Maybe (HashMap Text Text)
$sel:complianceResourceTypes:ControlScope' :: ControlScope -> Maybe [Text]
$sel:complianceResourceIds:ControlScope' :: ControlScope -> Maybe (NonEmpty Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
complianceResourceIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
complianceResourceTypes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
instance Data.ToJSON ControlScope where
toJSON :: ControlScope -> Value
toJSON ControlScope' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
complianceResourceTypes :: Maybe [Text]
complianceResourceIds :: Maybe (NonEmpty Text)
$sel:tags:ControlScope' :: ControlScope -> Maybe (HashMap Text Text)
$sel:complianceResourceTypes:ControlScope' :: ControlScope -> Maybe [Text]
$sel:complianceResourceIds:ControlScope' :: ControlScope -> Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ComplianceResourceIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
complianceResourceIds,
(Key
"ComplianceResourceTypes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
complianceResourceTypes,
(Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
]
)