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