{-# 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.Config.Types.Scope 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 Scope = Scope'
{
Scope -> Maybe Text
complianceResourceId :: Prelude.Maybe Prelude.Text,
Scope -> Maybe [Text]
complianceResourceTypes :: Prelude.Maybe [Prelude.Text],
Scope -> Maybe Text
tagKey :: Prelude.Maybe Prelude.Text,
Scope -> Maybe Text
tagValue :: Prelude.Maybe Prelude.Text
}
deriving (Scope -> Scope -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scope -> Scope -> Bool
$c/= :: Scope -> Scope -> Bool
== :: Scope -> Scope -> Bool
$c== :: Scope -> Scope -> Bool
Prelude.Eq, ReadPrec [Scope]
ReadPrec Scope
Int -> ReadS Scope
ReadS [Scope]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Scope]
$creadListPrec :: ReadPrec [Scope]
readPrec :: ReadPrec Scope
$creadPrec :: ReadPrec Scope
readList :: ReadS [Scope]
$creadList :: ReadS [Scope]
readsPrec :: Int -> ReadS Scope
$creadsPrec :: Int -> ReadS Scope
Prelude.Read, Int -> Scope -> ShowS
[Scope] -> ShowS
Scope -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scope] -> ShowS
$cshowList :: [Scope] -> ShowS
show :: Scope -> String
$cshow :: Scope -> String
showsPrec :: Int -> Scope -> ShowS
$cshowsPrec :: Int -> Scope -> ShowS
Prelude.Show, forall x. Rep Scope x -> Scope
forall x. Scope -> Rep Scope x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Scope x -> Scope
$cfrom :: forall x. Scope -> Rep Scope x
Prelude.Generic)
newScope ::
Scope
newScope :: Scope
newScope =
Scope'
{ $sel:complianceResourceId:Scope' :: Maybe Text
complianceResourceId = forall a. Maybe a
Prelude.Nothing,
$sel:complianceResourceTypes:Scope' :: Maybe [Text]
complianceResourceTypes = forall a. Maybe a
Prelude.Nothing,
$sel:tagKey:Scope' :: Maybe Text
tagKey = forall a. Maybe a
Prelude.Nothing,
$sel:tagValue:Scope' :: Maybe Text
tagValue = forall a. Maybe a
Prelude.Nothing
}
scope_complianceResourceId :: Lens.Lens' Scope (Prelude.Maybe Prelude.Text)
scope_complianceResourceId :: Lens' Scope (Maybe Text)
scope_complianceResourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scope' {Maybe Text
complianceResourceId :: Maybe Text
$sel:complianceResourceId:Scope' :: Scope -> Maybe Text
complianceResourceId} -> Maybe Text
complianceResourceId) (\s :: Scope
s@Scope' {} Maybe Text
a -> Scope
s {$sel:complianceResourceId:Scope' :: Maybe Text
complianceResourceId = Maybe Text
a} :: Scope)
scope_complianceResourceTypes :: Lens.Lens' Scope (Prelude.Maybe [Prelude.Text])
scope_complianceResourceTypes :: Lens' Scope (Maybe [Text])
scope_complianceResourceTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scope' {Maybe [Text]
complianceResourceTypes :: Maybe [Text]
$sel:complianceResourceTypes:Scope' :: Scope -> Maybe [Text]
complianceResourceTypes} -> Maybe [Text]
complianceResourceTypes) (\s :: Scope
s@Scope' {} Maybe [Text]
a -> Scope
s {$sel:complianceResourceTypes:Scope' :: Maybe [Text]
complianceResourceTypes = Maybe [Text]
a} :: Scope) 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
scope_tagKey :: Lens.Lens' Scope (Prelude.Maybe Prelude.Text)
scope_tagKey :: Lens' Scope (Maybe Text)
scope_tagKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scope' {Maybe Text
tagKey :: Maybe Text
$sel:tagKey:Scope' :: Scope -> Maybe Text
tagKey} -> Maybe Text
tagKey) (\s :: Scope
s@Scope' {} Maybe Text
a -> Scope
s {$sel:tagKey:Scope' :: Maybe Text
tagKey = Maybe Text
a} :: Scope)
scope_tagValue :: Lens.Lens' Scope (Prelude.Maybe Prelude.Text)
scope_tagValue :: Lens' Scope (Maybe Text)
scope_tagValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scope' {Maybe Text
tagValue :: Maybe Text
$sel:tagValue:Scope' :: Scope -> Maybe Text
tagValue} -> Maybe Text
tagValue) (\s :: Scope
s@Scope' {} Maybe Text
a -> Scope
s {$sel:tagValue:Scope' :: Maybe Text
tagValue = Maybe Text
a} :: Scope)
instance Data.FromJSON Scope where
parseJSON :: Value -> Parser Scope
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Scope"
( \Object
x ->
Maybe Text -> Maybe [Text] -> Maybe Text -> Maybe Text -> Scope
Scope'
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
"ComplianceResourceId")
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
"TagKey")
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
"TagValue")
)
instance Prelude.Hashable Scope where
hashWithSalt :: Int -> Scope -> Int
hashWithSalt Int
_salt Scope' {Maybe [Text]
Maybe Text
tagValue :: Maybe Text
tagKey :: Maybe Text
complianceResourceTypes :: Maybe [Text]
complianceResourceId :: Maybe Text
$sel:tagValue:Scope' :: Scope -> Maybe Text
$sel:tagKey:Scope' :: Scope -> Maybe Text
$sel:complianceResourceTypes:Scope' :: Scope -> Maybe [Text]
$sel:complianceResourceId:Scope' :: Scope -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
complianceResourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
complianceResourceTypes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tagKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tagValue
instance Prelude.NFData Scope where
rnf :: Scope -> ()
rnf Scope' {Maybe [Text]
Maybe Text
tagValue :: Maybe Text
tagKey :: Maybe Text
complianceResourceTypes :: Maybe [Text]
complianceResourceId :: Maybe Text
$sel:tagValue:Scope' :: Scope -> Maybe Text
$sel:tagKey:Scope' :: Scope -> Maybe Text
$sel:complianceResourceTypes:Scope' :: Scope -> Maybe [Text]
$sel:complianceResourceId:Scope' :: Scope -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
complianceResourceId
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 Text
tagKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tagValue
instance Data.ToJSON Scope where
toJSON :: Scope -> Value
toJSON Scope' {Maybe [Text]
Maybe Text
tagValue :: Maybe Text
tagKey :: Maybe Text
complianceResourceTypes :: Maybe [Text]
complianceResourceId :: Maybe Text
$sel:tagValue:Scope' :: Scope -> Maybe Text
$sel:tagKey:Scope' :: Scope -> Maybe Text
$sel:complianceResourceTypes:Scope' :: Scope -> Maybe [Text]
$sel:complianceResourceId:Scope' :: Scope -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ComplianceResourceId" 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
complianceResourceId,
(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
"TagKey" 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
tagKey,
(Key
"TagValue" 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
tagValue
]
)