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