{-# 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.JourneysResponse 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.JourneyResponse
import qualified Amazonka.Prelude as Prelude
data JourneysResponse = JourneysResponse'
{
JourneysResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
JourneysResponse -> [JourneyResponse]
item :: [JourneyResponse]
}
deriving (JourneysResponse -> JourneysResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JourneysResponse -> JourneysResponse -> Bool
$c/= :: JourneysResponse -> JourneysResponse -> Bool
== :: JourneysResponse -> JourneysResponse -> Bool
$c== :: JourneysResponse -> JourneysResponse -> Bool
Prelude.Eq, ReadPrec [JourneysResponse]
ReadPrec JourneysResponse
Int -> ReadS JourneysResponse
ReadS [JourneysResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JourneysResponse]
$creadListPrec :: ReadPrec [JourneysResponse]
readPrec :: ReadPrec JourneysResponse
$creadPrec :: ReadPrec JourneysResponse
readList :: ReadS [JourneysResponse]
$creadList :: ReadS [JourneysResponse]
readsPrec :: Int -> ReadS JourneysResponse
$creadsPrec :: Int -> ReadS JourneysResponse
Prelude.Read, Int -> JourneysResponse -> ShowS
[JourneysResponse] -> ShowS
JourneysResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JourneysResponse] -> ShowS
$cshowList :: [JourneysResponse] -> ShowS
show :: JourneysResponse -> String
$cshow :: JourneysResponse -> String
showsPrec :: Int -> JourneysResponse -> ShowS
$cshowsPrec :: Int -> JourneysResponse -> ShowS
Prelude.Show, forall x. Rep JourneysResponse x -> JourneysResponse
forall x. JourneysResponse -> Rep JourneysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JourneysResponse x -> JourneysResponse
$cfrom :: forall x. JourneysResponse -> Rep JourneysResponse x
Prelude.Generic)
newJourneysResponse ::
JourneysResponse
newJourneysResponse :: JourneysResponse
newJourneysResponse =
JourneysResponse'
{ $sel:nextToken:JourneysResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:item:JourneysResponse' :: [JourneyResponse]
item = forall a. Monoid a => a
Prelude.mempty
}
journeysResponse_nextToken :: Lens.Lens' JourneysResponse (Prelude.Maybe Prelude.Text)
journeysResponse_nextToken :: Lens' JourneysResponse (Maybe Text)
journeysResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneysResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:JourneysResponse' :: JourneysResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: JourneysResponse
s@JourneysResponse' {} Maybe Text
a -> JourneysResponse
s {$sel:nextToken:JourneysResponse' :: Maybe Text
nextToken = Maybe Text
a} :: JourneysResponse)
journeysResponse_item :: Lens.Lens' JourneysResponse [JourneyResponse]
journeysResponse_item :: Lens' JourneysResponse [JourneyResponse]
journeysResponse_item = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneysResponse' {[JourneyResponse]
item :: [JourneyResponse]
$sel:item:JourneysResponse' :: JourneysResponse -> [JourneyResponse]
item} -> [JourneyResponse]
item) (\s :: JourneysResponse
s@JourneysResponse' {} [JourneyResponse]
a -> JourneysResponse
s {$sel:item:JourneysResponse' :: [JourneyResponse]
item = [JourneyResponse]
a} :: JourneysResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON JourneysResponse where
parseJSON :: Value -> Parser JourneysResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JourneysResponse"
( \Object
x ->
Maybe Text -> [JourneyResponse] -> JourneysResponse
JourneysResponse'
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
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Item" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable JourneysResponse where
hashWithSalt :: Int -> JourneysResponse -> Int
hashWithSalt Int
_salt JourneysResponse' {[JourneyResponse]
Maybe Text
item :: [JourneyResponse]
nextToken :: Maybe Text
$sel:item:JourneysResponse' :: JourneysResponse -> [JourneyResponse]
$sel:nextToken:JourneysResponse' :: JourneysResponse -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [JourneyResponse]
item
instance Prelude.NFData JourneysResponse where
rnf :: JourneysResponse -> ()
rnf JourneysResponse' {[JourneyResponse]
Maybe Text
item :: [JourneyResponse]
nextToken :: Maybe Text
$sel:item:JourneysResponse' :: JourneysResponse -> [JourneyResponse]
$sel:nextToken:JourneysResponse' :: JourneysResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [JourneyResponse]
item