{-# 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 Amazonka.DevOpsGuru.Types.CloudFormationCollection
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourceCollection = ResourceCollection'
{
ResourceCollection -> Maybe CloudFormationCollection
cloudFormation :: Prelude.Maybe CloudFormationCollection
}
deriving (ResourceCollection -> ResourceCollection -> Bool
(ResourceCollection -> ResourceCollection -> Bool)
-> (ResourceCollection -> ResourceCollection -> Bool)
-> Eq ResourceCollection
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]
(Int -> ReadS ResourceCollection)
-> ReadS [ResourceCollection]
-> ReadPrec ResourceCollection
-> ReadPrec [ResourceCollection]
-> Read 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
(Int -> ResourceCollection -> ShowS)
-> (ResourceCollection -> String)
-> ([ResourceCollection] -> ShowS)
-> Show ResourceCollection
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. ResourceCollection -> Rep ResourceCollection x)
-> (forall x. Rep ResourceCollection x -> ResourceCollection)
-> Generic ResourceCollection
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' :: Maybe CloudFormationCollection -> ResourceCollection
ResourceCollection'
{ $sel:cloudFormation:ResourceCollection' :: Maybe CloudFormationCollection
cloudFormation =
Maybe CloudFormationCollection
forall a. Maybe a
Prelude.Nothing
}
resourceCollection_cloudFormation :: Lens.Lens' ResourceCollection (Prelude.Maybe CloudFormationCollection)
resourceCollection_cloudFormation :: (Maybe CloudFormationCollection
-> f (Maybe CloudFormationCollection))
-> ResourceCollection -> f ResourceCollection
resourceCollection_cloudFormation = (ResourceCollection -> Maybe CloudFormationCollection)
-> (ResourceCollection
-> Maybe CloudFormationCollection -> ResourceCollection)
-> Lens
ResourceCollection
ResourceCollection
(Maybe CloudFormationCollection)
(Maybe CloudFormationCollection)
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)
instance Core.FromJSON ResourceCollection where
parseJSON :: Value -> Parser ResourceCollection
parseJSON =
String
-> (Object -> Parser ResourceCollection)
-> Value
-> Parser ResourceCollection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourceCollection"
( \Object
x ->
Maybe CloudFormationCollection -> ResourceCollection
ResourceCollection'
(Maybe CloudFormationCollection -> ResourceCollection)
-> Parser (Maybe CloudFormationCollection)
-> Parser ResourceCollection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CloudFormationCollection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CloudFormation")
)
instance Prelude.Hashable ResourceCollection
instance Prelude.NFData ResourceCollection
instance Core.ToJSON ResourceCollection where
toJSON :: ResourceCollection -> Value
toJSON ResourceCollection' {Maybe CloudFormationCollection
cloudFormation :: Maybe CloudFormationCollection
$sel:cloudFormation:ResourceCollection' :: ResourceCollection -> Maybe CloudFormationCollection
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CloudFormation" Text -> CloudFormationCollection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CloudFormationCollection -> Pair)
-> Maybe CloudFormationCollection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudFormationCollection
cloudFormation
]
)