{-# 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.DevOpsGuru.Types.ResourceCollection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DevOpsGuru.Types.CloudFormationCollection
import Amazonka.DevOpsGuru.Types.TagCollection
import qualified Amazonka.Prelude as Prelude
data ResourceCollection = ResourceCollection'
{
ResourceCollection -> Maybe CloudFormationCollection
cloudFormation :: Prelude.Maybe CloudFormationCollection,
ResourceCollection -> Maybe [TagCollection]
tags :: Prelude.Maybe [TagCollection]
}
deriving (ResourceCollection -> ResourceCollection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceCollection -> ResourceCollection -> Bool
$c/= :: ResourceCollection -> ResourceCollection -> Bool
== :: ResourceCollection -> ResourceCollection -> Bool
$c== :: ResourceCollection -> ResourceCollection -> Bool
Prelude.Eq, ReadPrec [ResourceCollection]
ReadPrec ResourceCollection
Int -> ReadS ResourceCollection
ReadS [ResourceCollection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceCollection]
$creadListPrec :: ReadPrec [ResourceCollection]
readPrec :: ReadPrec ResourceCollection
$creadPrec :: ReadPrec ResourceCollection
readList :: ReadS [ResourceCollection]
$creadList :: ReadS [ResourceCollection]
readsPrec :: Int -> ReadS ResourceCollection
$creadsPrec :: Int -> ReadS ResourceCollection
Prelude.Read, Int -> ResourceCollection -> ShowS
[ResourceCollection] -> ShowS
ResourceCollection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceCollection] -> ShowS
$cshowList :: [ResourceCollection] -> ShowS
show :: ResourceCollection -> String
$cshow :: ResourceCollection -> String
showsPrec :: Int -> ResourceCollection -> ShowS
$cshowsPrec :: Int -> ResourceCollection -> ShowS
Prelude.Show, forall x. Rep ResourceCollection x -> ResourceCollection
forall x. ResourceCollection -> Rep ResourceCollection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceCollection x -> ResourceCollection
$cfrom :: forall x. ResourceCollection -> Rep ResourceCollection x
Prelude.Generic)
newResourceCollection ::
ResourceCollection
newResourceCollection :: ResourceCollection
newResourceCollection =
ResourceCollection'
{ $sel:cloudFormation:ResourceCollection' :: Maybe CloudFormationCollection
cloudFormation =
forall a. Maybe a
Prelude.Nothing,
$sel:tags:ResourceCollection' :: Maybe [TagCollection]
tags = forall a. Maybe a
Prelude.Nothing
}
resourceCollection_cloudFormation :: Lens.Lens' ResourceCollection (Prelude.Maybe CloudFormationCollection)
resourceCollection_cloudFormation :: Lens' ResourceCollection (Maybe CloudFormationCollection)
resourceCollection_cloudFormation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceCollection' {Maybe CloudFormationCollection
cloudFormation :: Maybe CloudFormationCollection
$sel:cloudFormation:ResourceCollection' :: ResourceCollection -> Maybe CloudFormationCollection
cloudFormation} -> Maybe CloudFormationCollection
cloudFormation) (\s :: ResourceCollection
s@ResourceCollection' {} Maybe CloudFormationCollection
a -> ResourceCollection
s {$sel:cloudFormation:ResourceCollection' :: Maybe CloudFormationCollection
cloudFormation = Maybe CloudFormationCollection
a} :: ResourceCollection)
resourceCollection_tags :: Lens.Lens' ResourceCollection (Prelude.Maybe [TagCollection])
resourceCollection_tags :: Lens' ResourceCollection (Maybe [TagCollection])
resourceCollection_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceCollection' {Maybe [TagCollection]
tags :: Maybe [TagCollection]
$sel:tags:ResourceCollection' :: ResourceCollection -> Maybe [TagCollection]
tags} -> Maybe [TagCollection]
tags) (\s :: ResourceCollection
s@ResourceCollection' {} Maybe [TagCollection]
a -> ResourceCollection
s {$sel:tags:ResourceCollection' :: Maybe [TagCollection]
tags = Maybe [TagCollection]
a} :: ResourceCollection) 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 ResourceCollection where
parseJSON :: Value -> Parser ResourceCollection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResourceCollection"
( \Object
x ->
Maybe CloudFormationCollection
-> Maybe [TagCollection] -> ResourceCollection
ResourceCollection'
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
"CloudFormation")
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 ResourceCollection where
hashWithSalt :: Int -> ResourceCollection -> Int
hashWithSalt Int
_salt ResourceCollection' {Maybe [TagCollection]
Maybe CloudFormationCollection
tags :: Maybe [TagCollection]
cloudFormation :: Maybe CloudFormationCollection
$sel:tags:ResourceCollection' :: ResourceCollection -> Maybe [TagCollection]
$sel:cloudFormation:ResourceCollection' :: ResourceCollection -> Maybe CloudFormationCollection
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudFormationCollection
cloudFormation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagCollection]
tags
instance Prelude.NFData ResourceCollection where
rnf :: ResourceCollection -> ()
rnf ResourceCollection' {Maybe [TagCollection]
Maybe CloudFormationCollection
tags :: Maybe [TagCollection]
cloudFormation :: Maybe CloudFormationCollection
$sel:tags:ResourceCollection' :: ResourceCollection -> Maybe [TagCollection]
$sel:cloudFormation:ResourceCollection' :: ResourceCollection -> Maybe CloudFormationCollection
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CloudFormationCollection
cloudFormation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagCollection]
tags
instance Data.ToJSON ResourceCollection where
toJSON :: ResourceCollection -> Value
toJSON ResourceCollection' {Maybe [TagCollection]
Maybe CloudFormationCollection
tags :: Maybe [TagCollection]
cloudFormation :: Maybe CloudFormationCollection
$sel:tags:ResourceCollection' :: ResourceCollection -> Maybe [TagCollection]
$sel:cloudFormation:ResourceCollection' :: ResourceCollection -> Maybe CloudFormationCollection
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CloudFormation" 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 CloudFormationCollection
cloudFormation,
(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 [TagCollection]
tags
]
)