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