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