{-# 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.EventsRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.EventsBatch
import qualified Amazonka.Prelude as Prelude
data EventsRequest = EventsRequest'
{
EventsRequest -> HashMap Text EventsBatch
batchItem :: Prelude.HashMap Prelude.Text EventsBatch
}
deriving (EventsRequest -> EventsRequest -> Bool
(EventsRequest -> EventsRequest -> Bool)
-> (EventsRequest -> EventsRequest -> Bool) -> Eq EventsRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventsRequest -> EventsRequest -> Bool
$c/= :: EventsRequest -> EventsRequest -> Bool
== :: EventsRequest -> EventsRequest -> Bool
$c== :: EventsRequest -> EventsRequest -> Bool
Prelude.Eq, ReadPrec [EventsRequest]
ReadPrec EventsRequest
Int -> ReadS EventsRequest
ReadS [EventsRequest]
(Int -> ReadS EventsRequest)
-> ReadS [EventsRequest]
-> ReadPrec EventsRequest
-> ReadPrec [EventsRequest]
-> Read EventsRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventsRequest]
$creadListPrec :: ReadPrec [EventsRequest]
readPrec :: ReadPrec EventsRequest
$creadPrec :: ReadPrec EventsRequest
readList :: ReadS [EventsRequest]
$creadList :: ReadS [EventsRequest]
readsPrec :: Int -> ReadS EventsRequest
$creadsPrec :: Int -> ReadS EventsRequest
Prelude.Read, Int -> EventsRequest -> ShowS
[EventsRequest] -> ShowS
EventsRequest -> String
(Int -> EventsRequest -> ShowS)
-> (EventsRequest -> String)
-> ([EventsRequest] -> ShowS)
-> Show EventsRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventsRequest] -> ShowS
$cshowList :: [EventsRequest] -> ShowS
show :: EventsRequest -> String
$cshow :: EventsRequest -> String
showsPrec :: Int -> EventsRequest -> ShowS
$cshowsPrec :: Int -> EventsRequest -> ShowS
Prelude.Show, (forall x. EventsRequest -> Rep EventsRequest x)
-> (forall x. Rep EventsRequest x -> EventsRequest)
-> Generic EventsRequest
forall x. Rep EventsRequest x -> EventsRequest
forall x. EventsRequest -> Rep EventsRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventsRequest x -> EventsRequest
$cfrom :: forall x. EventsRequest -> Rep EventsRequest x
Prelude.Generic)
newEventsRequest ::
EventsRequest
newEventsRequest :: EventsRequest
newEventsRequest =
EventsRequest' :: HashMap Text EventsBatch -> EventsRequest
EventsRequest' {$sel:batchItem:EventsRequest' :: HashMap Text EventsBatch
batchItem = HashMap Text EventsBatch
forall a. Monoid a => a
Prelude.mempty}
eventsRequest_batchItem :: Lens.Lens' EventsRequest (Prelude.HashMap Prelude.Text EventsBatch)
eventsRequest_batchItem :: (HashMap Text EventsBatch -> f (HashMap Text EventsBatch))
-> EventsRequest -> f EventsRequest
eventsRequest_batchItem = (EventsRequest -> HashMap Text EventsBatch)
-> (EventsRequest -> HashMap Text EventsBatch -> EventsRequest)
-> Lens
EventsRequest
EventsRequest
(HashMap Text EventsBatch)
(HashMap Text EventsBatch)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventsRequest' {HashMap Text EventsBatch
batchItem :: HashMap Text EventsBatch
$sel:batchItem:EventsRequest' :: EventsRequest -> HashMap Text EventsBatch
batchItem} -> HashMap Text EventsBatch
batchItem) (\s :: EventsRequest
s@EventsRequest' {} HashMap Text EventsBatch
a -> EventsRequest
s {$sel:batchItem:EventsRequest' :: HashMap Text EventsBatch
batchItem = HashMap Text EventsBatch
a} :: EventsRequest) ((HashMap Text EventsBatch -> f (HashMap Text EventsBatch))
-> EventsRequest -> f EventsRequest)
-> ((HashMap Text EventsBatch -> f (HashMap Text EventsBatch))
-> HashMap Text EventsBatch -> f (HashMap Text EventsBatch))
-> (HashMap Text EventsBatch -> f (HashMap Text EventsBatch))
-> EventsRequest
-> f EventsRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text EventsBatch -> f (HashMap Text EventsBatch))
-> HashMap Text EventsBatch -> f (HashMap Text EventsBatch)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable EventsRequest
instance Prelude.NFData EventsRequest
instance Core.ToJSON EventsRequest where
toJSON :: EventsRequest -> Value
toJSON EventsRequest' {HashMap Text EventsBatch
batchItem :: HashMap Text EventsBatch
$sel:batchItem:EventsRequest' :: EventsRequest -> HashMap Text EventsBatch
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BatchItem" Text -> HashMap Text EventsBatch -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text EventsBatch
batchItem)]
)