{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Pinpoint.ListTemplateVersions
(
ListTemplateVersions (..),
newListTemplateVersions,
listTemplateVersions_nextToken,
listTemplateVersions_pageSize,
listTemplateVersions_templateName,
listTemplateVersions_templateType,
ListTemplateVersionsResponse (..),
newListTemplateVersionsResponse,
listTemplateVersionsResponse_httpStatus,
listTemplateVersionsResponse_templateVersionsResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListTemplateVersions = ListTemplateVersions'
{
ListTemplateVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTemplateVersions -> Maybe Text
pageSize :: Prelude.Maybe Prelude.Text,
ListTemplateVersions -> Text
templateName :: Prelude.Text,
ListTemplateVersions -> Text
templateType :: Prelude.Text
}
deriving (ListTemplateVersions -> ListTemplateVersions -> Bool
(ListTemplateVersions -> ListTemplateVersions -> Bool)
-> (ListTemplateVersions -> ListTemplateVersions -> Bool)
-> Eq ListTemplateVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTemplateVersions -> ListTemplateVersions -> Bool
$c/= :: ListTemplateVersions -> ListTemplateVersions -> Bool
== :: ListTemplateVersions -> ListTemplateVersions -> Bool
$c== :: ListTemplateVersions -> ListTemplateVersions -> Bool
Prelude.Eq, ReadPrec [ListTemplateVersions]
ReadPrec ListTemplateVersions
Int -> ReadS ListTemplateVersions
ReadS [ListTemplateVersions]
(Int -> ReadS ListTemplateVersions)
-> ReadS [ListTemplateVersions]
-> ReadPrec ListTemplateVersions
-> ReadPrec [ListTemplateVersions]
-> Read ListTemplateVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTemplateVersions]
$creadListPrec :: ReadPrec [ListTemplateVersions]
readPrec :: ReadPrec ListTemplateVersions
$creadPrec :: ReadPrec ListTemplateVersions
readList :: ReadS [ListTemplateVersions]
$creadList :: ReadS [ListTemplateVersions]
readsPrec :: Int -> ReadS ListTemplateVersions
$creadsPrec :: Int -> ReadS ListTemplateVersions
Prelude.Read, Int -> ListTemplateVersions -> ShowS
[ListTemplateVersions] -> ShowS
ListTemplateVersions -> String
(Int -> ListTemplateVersions -> ShowS)
-> (ListTemplateVersions -> String)
-> ([ListTemplateVersions] -> ShowS)
-> Show ListTemplateVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTemplateVersions] -> ShowS
$cshowList :: [ListTemplateVersions] -> ShowS
show :: ListTemplateVersions -> String
$cshow :: ListTemplateVersions -> String
showsPrec :: Int -> ListTemplateVersions -> ShowS
$cshowsPrec :: Int -> ListTemplateVersions -> ShowS
Prelude.Show, (forall x. ListTemplateVersions -> Rep ListTemplateVersions x)
-> (forall x. Rep ListTemplateVersions x -> ListTemplateVersions)
-> Generic ListTemplateVersions
forall x. Rep ListTemplateVersions x -> ListTemplateVersions
forall x. ListTemplateVersions -> Rep ListTemplateVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTemplateVersions x -> ListTemplateVersions
$cfrom :: forall x. ListTemplateVersions -> Rep ListTemplateVersions x
Prelude.Generic)
newListTemplateVersions ::
Prelude.Text ->
Prelude.Text ->
ListTemplateVersions
newListTemplateVersions :: Text -> Text -> ListTemplateVersions
newListTemplateVersions Text
pTemplateName_ Text
pTemplateType_ =
ListTemplateVersions' :: Maybe Text -> Maybe Text -> Text -> Text -> ListTemplateVersions
ListTemplateVersions'
{ $sel:nextToken:ListTemplateVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListTemplateVersions' :: Maybe Text
pageSize = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateName:ListTemplateVersions' :: Text
templateName = Text
pTemplateName_,
$sel:templateType:ListTemplateVersions' :: Text
templateType = Text
pTemplateType_
}
listTemplateVersions_nextToken :: Lens.Lens' ListTemplateVersions (Prelude.Maybe Prelude.Text)
listTemplateVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTemplateVersions -> f ListTemplateVersions
listTemplateVersions_nextToken = (ListTemplateVersions -> Maybe Text)
-> (ListTemplateVersions -> Maybe Text -> ListTemplateVersions)
-> Lens
ListTemplateVersions ListTemplateVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTemplateVersions' :: ListTemplateVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTemplateVersions
s@ListTemplateVersions' {} Maybe Text
a -> ListTemplateVersions
s {$sel:nextToken:ListTemplateVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListTemplateVersions)
listTemplateVersions_pageSize :: Lens.Lens' ListTemplateVersions (Prelude.Maybe Prelude.Text)
listTemplateVersions_pageSize :: (Maybe Text -> f (Maybe Text))
-> ListTemplateVersions -> f ListTemplateVersions
listTemplateVersions_pageSize = (ListTemplateVersions -> Maybe Text)
-> (ListTemplateVersions -> Maybe Text -> ListTemplateVersions)
-> Lens
ListTemplateVersions ListTemplateVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersions' {Maybe Text
pageSize :: Maybe Text
$sel:pageSize:ListTemplateVersions' :: ListTemplateVersions -> Maybe Text
pageSize} -> Maybe Text
pageSize) (\s :: ListTemplateVersions
s@ListTemplateVersions' {} Maybe Text
a -> ListTemplateVersions
s {$sel:pageSize:ListTemplateVersions' :: Maybe Text
pageSize = Maybe Text
a} :: ListTemplateVersions)
listTemplateVersions_templateName :: Lens.Lens' ListTemplateVersions Prelude.Text
listTemplateVersions_templateName :: (Text -> f Text) -> ListTemplateVersions -> f ListTemplateVersions
listTemplateVersions_templateName = (ListTemplateVersions -> Text)
-> (ListTemplateVersions -> Text -> ListTemplateVersions)
-> Lens ListTemplateVersions ListTemplateVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersions' {Text
templateName :: Text
$sel:templateName:ListTemplateVersions' :: ListTemplateVersions -> Text
templateName} -> Text
templateName) (\s :: ListTemplateVersions
s@ListTemplateVersions' {} Text
a -> ListTemplateVersions
s {$sel:templateName:ListTemplateVersions' :: Text
templateName = Text
a} :: ListTemplateVersions)
listTemplateVersions_templateType :: Lens.Lens' ListTemplateVersions Prelude.Text
listTemplateVersions_templateType :: (Text -> f Text) -> ListTemplateVersions -> f ListTemplateVersions
listTemplateVersions_templateType = (ListTemplateVersions -> Text)
-> (ListTemplateVersions -> Text -> ListTemplateVersions)
-> Lens ListTemplateVersions ListTemplateVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersions' {Text
templateType :: Text
$sel:templateType:ListTemplateVersions' :: ListTemplateVersions -> Text
templateType} -> Text
templateType) (\s :: ListTemplateVersions
s@ListTemplateVersions' {} Text
a -> ListTemplateVersions
s {$sel:templateType:ListTemplateVersions' :: Text
templateType = Text
a} :: ListTemplateVersions)
instance Core.AWSRequest ListTemplateVersions where
type
AWSResponse ListTemplateVersions =
ListTemplateVersionsResponse
request :: ListTemplateVersions -> Request ListTemplateVersions
request = Service -> ListTemplateVersions -> Request ListTemplateVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListTemplateVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTemplateVersions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListTemplateVersions))
-> Logger
-> Service
-> Proxy ListTemplateVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTemplateVersions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> TemplateVersionsResponse -> ListTemplateVersionsResponse
ListTemplateVersionsResponse'
(Int -> TemplateVersionsResponse -> ListTemplateVersionsResponse)
-> Either String Int
-> Either
String (TemplateVersionsResponse -> ListTemplateVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either
String (TemplateVersionsResponse -> ListTemplateVersionsResponse)
-> Either String TemplateVersionsResponse
-> Either String ListTemplateVersionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String TemplateVersionsResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable ListTemplateVersions
instance Prelude.NFData ListTemplateVersions
instance Core.ToHeaders ListTemplateVersions where
toHeaders :: ListTemplateVersions -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListTemplateVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath ListTemplateVersions where
toPath :: ListTemplateVersions -> ByteString
toPath ListTemplateVersions' {Maybe Text
Text
templateType :: Text
templateName :: Text
pageSize :: Maybe Text
nextToken :: Maybe Text
$sel:templateType:ListTemplateVersions' :: ListTemplateVersions -> Text
$sel:templateName:ListTemplateVersions' :: ListTemplateVersions -> Text
$sel:pageSize:ListTemplateVersions' :: ListTemplateVersions -> Maybe Text
$sel:nextToken:ListTemplateVersions' :: ListTemplateVersions -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/templates/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateName,
ByteString
"/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateType,
ByteString
"/versions"
]
instance Core.ToQuery ListTemplateVersions where
toQuery :: ListTemplateVersions -> QueryString
toQuery ListTemplateVersions' {Maybe Text
Text
templateType :: Text
templateName :: Text
pageSize :: Maybe Text
nextToken :: Maybe Text
$sel:templateType:ListTemplateVersions' :: ListTemplateVersions -> Text
$sel:templateName:ListTemplateVersions' :: ListTemplateVersions -> Text
$sel:pageSize:ListTemplateVersions' :: ListTemplateVersions -> Maybe Text
$sel:nextToken:ListTemplateVersions' :: ListTemplateVersions -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"page-size" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
pageSize
]
data ListTemplateVersionsResponse = ListTemplateVersionsResponse'
{
ListTemplateVersionsResponse -> Int
httpStatus :: Prelude.Int,
ListTemplateVersionsResponse -> TemplateVersionsResponse
templateVersionsResponse :: TemplateVersionsResponse
}
deriving (ListTemplateVersionsResponse
-> ListTemplateVersionsResponse -> Bool
(ListTemplateVersionsResponse
-> ListTemplateVersionsResponse -> Bool)
-> (ListTemplateVersionsResponse
-> ListTemplateVersionsResponse -> Bool)
-> Eq ListTemplateVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTemplateVersionsResponse
-> ListTemplateVersionsResponse -> Bool
$c/= :: ListTemplateVersionsResponse
-> ListTemplateVersionsResponse -> Bool
== :: ListTemplateVersionsResponse
-> ListTemplateVersionsResponse -> Bool
$c== :: ListTemplateVersionsResponse
-> ListTemplateVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListTemplateVersionsResponse]
ReadPrec ListTemplateVersionsResponse
Int -> ReadS ListTemplateVersionsResponse
ReadS [ListTemplateVersionsResponse]
(Int -> ReadS ListTemplateVersionsResponse)
-> ReadS [ListTemplateVersionsResponse]
-> ReadPrec ListTemplateVersionsResponse
-> ReadPrec [ListTemplateVersionsResponse]
-> Read ListTemplateVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTemplateVersionsResponse]
$creadListPrec :: ReadPrec [ListTemplateVersionsResponse]
readPrec :: ReadPrec ListTemplateVersionsResponse
$creadPrec :: ReadPrec ListTemplateVersionsResponse
readList :: ReadS [ListTemplateVersionsResponse]
$creadList :: ReadS [ListTemplateVersionsResponse]
readsPrec :: Int -> ReadS ListTemplateVersionsResponse
$creadsPrec :: Int -> ReadS ListTemplateVersionsResponse
Prelude.Read, Int -> ListTemplateVersionsResponse -> ShowS
[ListTemplateVersionsResponse] -> ShowS
ListTemplateVersionsResponse -> String
(Int -> ListTemplateVersionsResponse -> ShowS)
-> (ListTemplateVersionsResponse -> String)
-> ([ListTemplateVersionsResponse] -> ShowS)
-> Show ListTemplateVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTemplateVersionsResponse] -> ShowS
$cshowList :: [ListTemplateVersionsResponse] -> ShowS
show :: ListTemplateVersionsResponse -> String
$cshow :: ListTemplateVersionsResponse -> String
showsPrec :: Int -> ListTemplateVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListTemplateVersionsResponse -> ShowS
Prelude.Show, (forall x.
ListTemplateVersionsResponse -> Rep ListTemplateVersionsResponse x)
-> (forall x.
Rep ListTemplateVersionsResponse x -> ListTemplateVersionsResponse)
-> Generic ListTemplateVersionsResponse
forall x.
Rep ListTemplateVersionsResponse x -> ListTemplateVersionsResponse
forall x.
ListTemplateVersionsResponse -> Rep ListTemplateVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTemplateVersionsResponse x -> ListTemplateVersionsResponse
$cfrom :: forall x.
ListTemplateVersionsResponse -> Rep ListTemplateVersionsResponse x
Prelude.Generic)
newListTemplateVersionsResponse ::
Prelude.Int ->
TemplateVersionsResponse ->
ListTemplateVersionsResponse
newListTemplateVersionsResponse :: Int -> TemplateVersionsResponse -> ListTemplateVersionsResponse
newListTemplateVersionsResponse
Int
pHttpStatus_
TemplateVersionsResponse
pTemplateVersionsResponse_ =
ListTemplateVersionsResponse' :: Int -> TemplateVersionsResponse -> ListTemplateVersionsResponse
ListTemplateVersionsResponse'
{ $sel:httpStatus:ListTemplateVersionsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:templateVersionsResponse:ListTemplateVersionsResponse' :: TemplateVersionsResponse
templateVersionsResponse =
TemplateVersionsResponse
pTemplateVersionsResponse_
}
listTemplateVersionsResponse_httpStatus :: Lens.Lens' ListTemplateVersionsResponse Prelude.Int
listTemplateVersionsResponse_httpStatus :: (Int -> f Int)
-> ListTemplateVersionsResponse -> f ListTemplateVersionsResponse
listTemplateVersionsResponse_httpStatus = (ListTemplateVersionsResponse -> Int)
-> (ListTemplateVersionsResponse
-> Int -> ListTemplateVersionsResponse)
-> Lens
ListTemplateVersionsResponse ListTemplateVersionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTemplateVersionsResponse' :: ListTemplateVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTemplateVersionsResponse
s@ListTemplateVersionsResponse' {} Int
a -> ListTemplateVersionsResponse
s {$sel:httpStatus:ListTemplateVersionsResponse' :: Int
httpStatus = Int
a} :: ListTemplateVersionsResponse)
listTemplateVersionsResponse_templateVersionsResponse :: Lens.Lens' ListTemplateVersionsResponse TemplateVersionsResponse
listTemplateVersionsResponse_templateVersionsResponse :: (TemplateVersionsResponse -> f TemplateVersionsResponse)
-> ListTemplateVersionsResponse -> f ListTemplateVersionsResponse
listTemplateVersionsResponse_templateVersionsResponse = (ListTemplateVersionsResponse -> TemplateVersionsResponse)
-> (ListTemplateVersionsResponse
-> TemplateVersionsResponse -> ListTemplateVersionsResponse)
-> Lens
ListTemplateVersionsResponse
ListTemplateVersionsResponse
TemplateVersionsResponse
TemplateVersionsResponse
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersionsResponse' {TemplateVersionsResponse
templateVersionsResponse :: TemplateVersionsResponse
$sel:templateVersionsResponse:ListTemplateVersionsResponse' :: ListTemplateVersionsResponse -> TemplateVersionsResponse
templateVersionsResponse} -> TemplateVersionsResponse
templateVersionsResponse) (\s :: ListTemplateVersionsResponse
s@ListTemplateVersionsResponse' {} TemplateVersionsResponse
a -> ListTemplateVersionsResponse
s {$sel:templateVersionsResponse:ListTemplateVersionsResponse' :: TemplateVersionsResponse
templateVersionsResponse = TemplateVersionsResponse
a} :: ListTemplateVersionsResponse)
instance Prelude.NFData ListTemplateVersionsResponse