{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:results:EventsResponse' :: Maybe (HashMap Text ItemResponse)
results = forall a. Maybe a
Prelude.Nothing}
eventsResponse_results :: Lens.Lens' EventsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text ItemResponse))
eventsResponse_results :: Lens' EventsResponse (Maybe (HashMap Text ItemResponse))
eventsResponse_results = 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) 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 EventsResponse where
parseJSON :: Value -> Parser EventsResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EventsResponse"
( \Object
x ->
Maybe (HashMap Text ItemResponse) -> EventsResponse
EventsResponse'
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
"Results" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable EventsResponse where
hashWithSalt :: Int -> EventsResponse -> Int
hashWithSalt Int
_salt EventsResponse' {Maybe (HashMap Text ItemResponse)
results :: Maybe (HashMap Text ItemResponse)
$sel:results:EventsResponse' :: EventsResponse -> Maybe (HashMap Text ItemResponse)
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text ItemResponse)
results
instance Prelude.NFData EventsResponse where
rnf :: EventsResponse -> ()
rnf EventsResponse' {Maybe (HashMap Text ItemResponse)
results :: Maybe (HashMap Text ItemResponse)
$sel:results:EventsResponse' :: EventsResponse -> Maybe (HashMap Text ItemResponse)
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text ItemResponse)
results