{-# 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.RecommendationRelatedEvent where
import qualified Amazonka.Core as Core
import Amazonka.DevOpsGuru.Types.RecommendationRelatedEventResource
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RecommendationRelatedEvent = RecommendationRelatedEvent'
{
RecommendationRelatedEvent
-> Maybe [RecommendationRelatedEventResource]
resources :: Prelude.Maybe [RecommendationRelatedEventResource],
RecommendationRelatedEvent -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (RecommendationRelatedEvent -> RecommendationRelatedEvent -> Bool
(RecommendationRelatedEvent -> RecommendationRelatedEvent -> Bool)
-> (RecommendationRelatedEvent
-> RecommendationRelatedEvent -> Bool)
-> Eq RecommendationRelatedEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationRelatedEvent -> RecommendationRelatedEvent -> Bool
$c/= :: RecommendationRelatedEvent -> RecommendationRelatedEvent -> Bool
== :: RecommendationRelatedEvent -> RecommendationRelatedEvent -> Bool
$c== :: RecommendationRelatedEvent -> RecommendationRelatedEvent -> Bool
Prelude.Eq, ReadPrec [RecommendationRelatedEvent]
ReadPrec RecommendationRelatedEvent
Int -> ReadS RecommendationRelatedEvent
ReadS [RecommendationRelatedEvent]
(Int -> ReadS RecommendationRelatedEvent)
-> ReadS [RecommendationRelatedEvent]
-> ReadPrec RecommendationRelatedEvent
-> ReadPrec [RecommendationRelatedEvent]
-> Read RecommendationRelatedEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationRelatedEvent]
$creadListPrec :: ReadPrec [RecommendationRelatedEvent]
readPrec :: ReadPrec RecommendationRelatedEvent
$creadPrec :: ReadPrec RecommendationRelatedEvent
readList :: ReadS [RecommendationRelatedEvent]
$creadList :: ReadS [RecommendationRelatedEvent]
readsPrec :: Int -> ReadS RecommendationRelatedEvent
$creadsPrec :: Int -> ReadS RecommendationRelatedEvent
Prelude.Read, Int -> RecommendationRelatedEvent -> ShowS
[RecommendationRelatedEvent] -> ShowS
RecommendationRelatedEvent -> String
(Int -> RecommendationRelatedEvent -> ShowS)
-> (RecommendationRelatedEvent -> String)
-> ([RecommendationRelatedEvent] -> ShowS)
-> Show RecommendationRelatedEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationRelatedEvent] -> ShowS
$cshowList :: [RecommendationRelatedEvent] -> ShowS
show :: RecommendationRelatedEvent -> String
$cshow :: RecommendationRelatedEvent -> String
showsPrec :: Int -> RecommendationRelatedEvent -> ShowS
$cshowsPrec :: Int -> RecommendationRelatedEvent -> ShowS
Prelude.Show, (forall x.
RecommendationRelatedEvent -> Rep RecommendationRelatedEvent x)
-> (forall x.
Rep RecommendationRelatedEvent x -> RecommendationRelatedEvent)
-> Generic RecommendationRelatedEvent
forall x.
Rep RecommendationRelatedEvent x -> RecommendationRelatedEvent
forall x.
RecommendationRelatedEvent -> Rep RecommendationRelatedEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecommendationRelatedEvent x -> RecommendationRelatedEvent
$cfrom :: forall x.
RecommendationRelatedEvent -> Rep RecommendationRelatedEvent x
Prelude.Generic)
newRecommendationRelatedEvent ::
RecommendationRelatedEvent
newRecommendationRelatedEvent :: RecommendationRelatedEvent
newRecommendationRelatedEvent =
RecommendationRelatedEvent' :: Maybe [RecommendationRelatedEventResource]
-> Maybe Text -> RecommendationRelatedEvent
RecommendationRelatedEvent'
{ $sel:resources:RecommendationRelatedEvent' :: Maybe [RecommendationRelatedEventResource]
resources =
Maybe [RecommendationRelatedEventResource]
forall a. Maybe a
Prelude.Nothing,
$sel:name:RecommendationRelatedEvent' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
recommendationRelatedEvent_resources :: Lens.Lens' RecommendationRelatedEvent (Prelude.Maybe [RecommendationRelatedEventResource])
recommendationRelatedEvent_resources :: (Maybe [RecommendationRelatedEventResource]
-> f (Maybe [RecommendationRelatedEventResource]))
-> RecommendationRelatedEvent -> f RecommendationRelatedEvent
recommendationRelatedEvent_resources = (RecommendationRelatedEvent
-> Maybe [RecommendationRelatedEventResource])
-> (RecommendationRelatedEvent
-> Maybe [RecommendationRelatedEventResource]
-> RecommendationRelatedEvent)
-> Lens
RecommendationRelatedEvent
RecommendationRelatedEvent
(Maybe [RecommendationRelatedEventResource])
(Maybe [RecommendationRelatedEventResource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationRelatedEvent' {Maybe [RecommendationRelatedEventResource]
resources :: Maybe [RecommendationRelatedEventResource]
$sel:resources:RecommendationRelatedEvent' :: RecommendationRelatedEvent
-> Maybe [RecommendationRelatedEventResource]
resources} -> Maybe [RecommendationRelatedEventResource]
resources) (\s :: RecommendationRelatedEvent
s@RecommendationRelatedEvent' {} Maybe [RecommendationRelatedEventResource]
a -> RecommendationRelatedEvent
s {$sel:resources:RecommendationRelatedEvent' :: Maybe [RecommendationRelatedEventResource]
resources = Maybe [RecommendationRelatedEventResource]
a} :: RecommendationRelatedEvent) ((Maybe [RecommendationRelatedEventResource]
-> f (Maybe [RecommendationRelatedEventResource]))
-> RecommendationRelatedEvent -> f RecommendationRelatedEvent)
-> ((Maybe [RecommendationRelatedEventResource]
-> f (Maybe [RecommendationRelatedEventResource]))
-> Maybe [RecommendationRelatedEventResource]
-> f (Maybe [RecommendationRelatedEventResource]))
-> (Maybe [RecommendationRelatedEventResource]
-> f (Maybe [RecommendationRelatedEventResource]))
-> RecommendationRelatedEvent
-> f RecommendationRelatedEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RecommendationRelatedEventResource]
[RecommendationRelatedEventResource]
[RecommendationRelatedEventResource]
[RecommendationRelatedEventResource]
-> Iso
(Maybe [RecommendationRelatedEventResource])
(Maybe [RecommendationRelatedEventResource])
(Maybe [RecommendationRelatedEventResource])
(Maybe [RecommendationRelatedEventResource])
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 AnIso
[RecommendationRelatedEventResource]
[RecommendationRelatedEventResource]
[RecommendationRelatedEventResource]
[RecommendationRelatedEventResource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
recommendationRelatedEvent_name :: Lens.Lens' RecommendationRelatedEvent (Prelude.Maybe Prelude.Text)
recommendationRelatedEvent_name :: (Maybe Text -> f (Maybe Text))
-> RecommendationRelatedEvent -> f RecommendationRelatedEvent
recommendationRelatedEvent_name = (RecommendationRelatedEvent -> Maybe Text)
-> (RecommendationRelatedEvent
-> Maybe Text -> RecommendationRelatedEvent)
-> Lens
RecommendationRelatedEvent
RecommendationRelatedEvent
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationRelatedEvent' {Maybe Text
name :: Maybe Text
$sel:name:RecommendationRelatedEvent' :: RecommendationRelatedEvent -> Maybe Text
name} -> Maybe Text
name) (\s :: RecommendationRelatedEvent
s@RecommendationRelatedEvent' {} Maybe Text
a -> RecommendationRelatedEvent
s {$sel:name:RecommendationRelatedEvent' :: Maybe Text
name = Maybe Text
a} :: RecommendationRelatedEvent)
instance Core.FromJSON RecommendationRelatedEvent where
parseJSON :: Value -> Parser RecommendationRelatedEvent
parseJSON =
String
-> (Object -> Parser RecommendationRelatedEvent)
-> Value
-> Parser RecommendationRelatedEvent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RecommendationRelatedEvent"
( \Object
x ->
Maybe [RecommendationRelatedEventResource]
-> Maybe Text -> RecommendationRelatedEvent
RecommendationRelatedEvent'
(Maybe [RecommendationRelatedEventResource]
-> Maybe Text -> RecommendationRelatedEvent)
-> Parser (Maybe [RecommendationRelatedEventResource])
-> Parser (Maybe Text -> RecommendationRelatedEvent)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Parser (Maybe (Maybe [RecommendationRelatedEventResource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Resources" Parser (Maybe (Maybe [RecommendationRelatedEventResource]))
-> Maybe [RecommendationRelatedEventResource]
-> Parser (Maybe [RecommendationRelatedEventResource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RecommendationRelatedEventResource]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> RecommendationRelatedEvent)
-> Parser (Maybe Text) -> Parser RecommendationRelatedEvent
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
)
instance Prelude.Hashable RecommendationRelatedEvent
instance Prelude.NFData RecommendationRelatedEvent