{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.QuickSight.ListTemplateVersions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all the versions of the templates in the current Amazon QuickSight
-- account.
--
-- This operation returns paginated results.
module Amazonka.QuickSight.ListTemplateVersions
  ( -- * Creating a Request
    ListTemplateVersions (..),
    newListTemplateVersions,

    -- * Request Lenses
    listTemplateVersions_nextToken,
    listTemplateVersions_maxResults,
    listTemplateVersions_awsAccountId,
    listTemplateVersions_templateId,

    -- * Destructuring the Response
    ListTemplateVersionsResponse (..),
    newListTemplateVersionsResponse,

    -- * Response Lenses
    listTemplateVersionsResponse_requestId,
    listTemplateVersionsResponse_templateVersionSummaryList,
    listTemplateVersionsResponse_nextToken,
    listTemplateVersionsResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListTemplateVersions' smart constructor.
data ListTemplateVersions = ListTemplateVersions'
  { -- | The token for the next set of results, or null if there are no more
    -- results.
    ListTemplateVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListTemplateVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the Amazon Web Services account that contains the templates
    -- that you\'re listing.
    ListTemplateVersions -> Text
awsAccountId :: Prelude.Text,
    -- | The ID for the template.
    ListTemplateVersions -> Text
templateId :: 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)

-- |
-- Create a value of 'ListTemplateVersions' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listTemplateVersions_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'maxResults', 'listTemplateVersions_maxResults' - The maximum number of results to be returned per request.
--
-- 'awsAccountId', 'listTemplateVersions_awsAccountId' - The ID of the Amazon Web Services account that contains the templates
-- that you\'re listing.
--
-- 'templateId', 'listTemplateVersions_templateId' - The ID for the template.
newListTemplateVersions ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'templateId'
  Prelude.Text ->
  ListTemplateVersions
newListTemplateVersions :: Text -> Text -> ListTemplateVersions
newListTemplateVersions Text
pAwsAccountId_ Text
pTemplateId_ =
  ListTemplateVersions' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListTemplateVersions
ListTemplateVersions'
    { $sel:nextToken:ListTemplateVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTemplateVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:ListTemplateVersions' :: Text
awsAccountId = Text
pAwsAccountId_,
      $sel:templateId:ListTemplateVersions' :: Text
templateId = Text
pTemplateId_
    }

-- | The token for the next set of results, or null if there are no more
-- results.
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)

-- | The maximum number of results to be returned per request.
listTemplateVersions_maxResults :: Lens.Lens' ListTemplateVersions (Prelude.Maybe Prelude.Natural)
listTemplateVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListTemplateVersions -> f ListTemplateVersions
listTemplateVersions_maxResults = (ListTemplateVersions -> Maybe Natural)
-> (ListTemplateVersions -> Maybe Natural -> ListTemplateVersions)
-> Lens
     ListTemplateVersions
     ListTemplateVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTemplateVersions' :: ListTemplateVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTemplateVersions
s@ListTemplateVersions' {} Maybe Natural
a -> ListTemplateVersions
s {$sel:maxResults:ListTemplateVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTemplateVersions)

-- | The ID of the Amazon Web Services account that contains the templates
-- that you\'re listing.
listTemplateVersions_awsAccountId :: Lens.Lens' ListTemplateVersions Prelude.Text
listTemplateVersions_awsAccountId :: (Text -> f Text) -> ListTemplateVersions -> f ListTemplateVersions
listTemplateVersions_awsAccountId = (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
awsAccountId :: Text
$sel:awsAccountId:ListTemplateVersions' :: ListTemplateVersions -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListTemplateVersions
s@ListTemplateVersions' {} Text
a -> ListTemplateVersions
s {$sel:awsAccountId:ListTemplateVersions' :: Text
awsAccountId = Text
a} :: ListTemplateVersions)

-- | The ID for the template.
listTemplateVersions_templateId :: Lens.Lens' ListTemplateVersions Prelude.Text
listTemplateVersions_templateId :: (Text -> f Text) -> ListTemplateVersions -> f ListTemplateVersions
listTemplateVersions_templateId = (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
templateId :: Text
$sel:templateId:ListTemplateVersions' :: ListTemplateVersions -> Text
templateId} -> Text
templateId) (\s :: ListTemplateVersions
s@ListTemplateVersions' {} Text
a -> ListTemplateVersions
s {$sel:templateId:ListTemplateVersions' :: Text
templateId = Text
a} :: ListTemplateVersions)

instance Core.AWSPager ListTemplateVersions where
  page :: ListTemplateVersions
-> AWSResponse ListTemplateVersions -> Maybe ListTemplateVersions
page ListTemplateVersions
rq AWSResponse ListTemplateVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTemplateVersions
ListTemplateVersionsResponse
rs
            ListTemplateVersionsResponse
-> Getting (First Text) ListTemplateVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTemplateVersionsResponse
-> Const (First Text) ListTemplateVersionsResponse
Lens' ListTemplateVersionsResponse (Maybe Text)
listTemplateVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTemplateVersionsResponse
 -> Const (First Text) ListTemplateVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTemplateVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListTemplateVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [TemplateVersionSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTemplateVersions
ListTemplateVersionsResponse
rs
            ListTemplateVersionsResponse
-> Getting
     (First [TemplateVersionSummary])
     ListTemplateVersionsResponse
     [TemplateVersionSummary]
-> Maybe [TemplateVersionSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [TemplateVersionSummary]
 -> Const
      (First [TemplateVersionSummary]) (Maybe [TemplateVersionSummary]))
-> ListTemplateVersionsResponse
-> Const
     (First [TemplateVersionSummary]) ListTemplateVersionsResponse
Lens' ListTemplateVersionsResponse (Maybe [TemplateVersionSummary])
listTemplateVersionsResponse_templateVersionSummaryList
              ((Maybe [TemplateVersionSummary]
  -> Const
       (First [TemplateVersionSummary]) (Maybe [TemplateVersionSummary]))
 -> ListTemplateVersionsResponse
 -> Const
      (First [TemplateVersionSummary]) ListTemplateVersionsResponse)
-> (([TemplateVersionSummary]
     -> Const (First [TemplateVersionSummary]) [TemplateVersionSummary])
    -> Maybe [TemplateVersionSummary]
    -> Const
         (First [TemplateVersionSummary]) (Maybe [TemplateVersionSummary]))
-> Getting
     (First [TemplateVersionSummary])
     ListTemplateVersionsResponse
     [TemplateVersionSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TemplateVersionSummary]
 -> Const (First [TemplateVersionSummary]) [TemplateVersionSummary])
-> Maybe [TemplateVersionSummary]
-> Const
     (First [TemplateVersionSummary]) (Maybe [TemplateVersionSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListTemplateVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTemplateVersions -> Maybe ListTemplateVersions
forall a. a -> Maybe a
Prelude.Just (ListTemplateVersions -> Maybe ListTemplateVersions)
-> ListTemplateVersions -> Maybe ListTemplateVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTemplateVersions
rq
          ListTemplateVersions
-> (ListTemplateVersions -> ListTemplateVersions)
-> ListTemplateVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTemplateVersions -> Identity ListTemplateVersions
Lens
  ListTemplateVersions ListTemplateVersions (Maybe Text) (Maybe Text)
listTemplateVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTemplateVersions -> Identity ListTemplateVersions)
-> Maybe Text -> ListTemplateVersions -> ListTemplateVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTemplateVersions
ListTemplateVersionsResponse
rs
          ListTemplateVersionsResponse
-> Getting (First Text) ListTemplateVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTemplateVersionsResponse
-> Const (First Text) ListTemplateVersionsResponse
Lens' ListTemplateVersionsResponse (Maybe Text)
listTemplateVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTemplateVersionsResponse
 -> Const (First Text) ListTemplateVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTemplateVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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 ->
          Maybe Text
-> Maybe [TemplateVersionSummary]
-> Maybe Text
-> Int
-> ListTemplateVersionsResponse
ListTemplateVersionsResponse'
            (Maybe Text
 -> Maybe [TemplateVersionSummary]
 -> Maybe Text
 -> Int
 -> ListTemplateVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [TemplateVersionSummary]
      -> Maybe Text -> Int -> ListTemplateVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
            Either
  String
  (Maybe [TemplateVersionSummary]
   -> Maybe Text -> Int -> ListTemplateVersionsResponse)
-> Either String (Maybe [TemplateVersionSummary])
-> Either
     String (Maybe Text -> Int -> ListTemplateVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [TemplateVersionSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TemplateVersionSummaryList"
                            Either String (Maybe (Maybe [TemplateVersionSummary]))
-> Maybe [TemplateVersionSummary]
-> Either String (Maybe [TemplateVersionSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TemplateVersionSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Maybe Text -> Int -> ListTemplateVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListTemplateVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> ListTemplateVersionsResponse)
-> Either String Int -> Either String ListTemplateVersionsResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

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.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListTemplateVersions where
  toPath :: ListTemplateVersions -> ByteString
toPath ListTemplateVersions' {Maybe Natural
Maybe Text
Text
templateId :: Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:templateId:ListTemplateVersions' :: ListTemplateVersions -> Text
$sel:awsAccountId:ListTemplateVersions' :: ListTemplateVersions -> Text
$sel:maxResults:ListTemplateVersions' :: ListTemplateVersions -> Maybe Natural
$sel:nextToken:ListTemplateVersions' :: ListTemplateVersions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/templates/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateId,
        ByteString
"/versions"
      ]

instance Core.ToQuery ListTemplateVersions where
  toQuery :: ListTemplateVersions -> QueryString
toQuery ListTemplateVersions' {Maybe Natural
Maybe Text
Text
templateId :: Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:templateId:ListTemplateVersions' :: ListTemplateVersions -> Text
$sel:awsAccountId:ListTemplateVersions' :: ListTemplateVersions -> Text
$sel:maxResults:ListTemplateVersions' :: ListTemplateVersions -> Maybe Natural
$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
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListTemplateVersionsResponse' smart constructor.
data ListTemplateVersionsResponse = ListTemplateVersionsResponse'
  { -- | The Amazon Web Services request ID for this operation.
    ListTemplateVersionsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | A structure containing a list of all the versions of the specified
    -- template.
    ListTemplateVersionsResponse -> Maybe [TemplateVersionSummary]
templateVersionSummaryList :: Prelude.Maybe [TemplateVersionSummary],
    -- | The token for the next set of results, or null if there are no more
    -- results.
    ListTemplateVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    ListTemplateVersionsResponse -> Int
status :: Prelude.Int
  }
  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)

-- |
-- Create a value of 'ListTemplateVersionsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'requestId', 'listTemplateVersionsResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'templateVersionSummaryList', 'listTemplateVersionsResponse_templateVersionSummaryList' - A structure containing a list of all the versions of the specified
-- template.
--
-- 'nextToken', 'listTemplateVersionsResponse_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'status', 'listTemplateVersionsResponse_status' - The HTTP status of the request.
newListTemplateVersionsResponse ::
  -- | 'status'
  Prelude.Int ->
  ListTemplateVersionsResponse
newListTemplateVersionsResponse :: Int -> ListTemplateVersionsResponse
newListTemplateVersionsResponse Int
pStatus_ =
  ListTemplateVersionsResponse' :: Maybe Text
-> Maybe [TemplateVersionSummary]
-> Maybe Text
-> Int
-> ListTemplateVersionsResponse
ListTemplateVersionsResponse'
    { $sel:requestId:ListTemplateVersionsResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateVersionSummaryList:ListTemplateVersionsResponse' :: Maybe [TemplateVersionSummary]
templateVersionSummaryList = Maybe [TemplateVersionSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTemplateVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListTemplateVersionsResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
listTemplateVersionsResponse_requestId :: Lens.Lens' ListTemplateVersionsResponse (Prelude.Maybe Prelude.Text)
listTemplateVersionsResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListTemplateVersionsResponse -> f ListTemplateVersionsResponse
listTemplateVersionsResponse_requestId = (ListTemplateVersionsResponse -> Maybe Text)
-> (ListTemplateVersionsResponse
    -> Maybe Text -> ListTemplateVersionsResponse)
-> Lens' ListTemplateVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersionsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListTemplateVersionsResponse' :: ListTemplateVersionsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListTemplateVersionsResponse
s@ListTemplateVersionsResponse' {} Maybe Text
a -> ListTemplateVersionsResponse
s {$sel:requestId:ListTemplateVersionsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListTemplateVersionsResponse)

-- | A structure containing a list of all the versions of the specified
-- template.
listTemplateVersionsResponse_templateVersionSummaryList :: Lens.Lens' ListTemplateVersionsResponse (Prelude.Maybe [TemplateVersionSummary])
listTemplateVersionsResponse_templateVersionSummaryList :: (Maybe [TemplateVersionSummary]
 -> f (Maybe [TemplateVersionSummary]))
-> ListTemplateVersionsResponse -> f ListTemplateVersionsResponse
listTemplateVersionsResponse_templateVersionSummaryList = (ListTemplateVersionsResponse -> Maybe [TemplateVersionSummary])
-> (ListTemplateVersionsResponse
    -> Maybe [TemplateVersionSummary] -> ListTemplateVersionsResponse)
-> Lens'
     ListTemplateVersionsResponse (Maybe [TemplateVersionSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersionsResponse' {Maybe [TemplateVersionSummary]
templateVersionSummaryList :: Maybe [TemplateVersionSummary]
$sel:templateVersionSummaryList:ListTemplateVersionsResponse' :: ListTemplateVersionsResponse -> Maybe [TemplateVersionSummary]
templateVersionSummaryList} -> Maybe [TemplateVersionSummary]
templateVersionSummaryList) (\s :: ListTemplateVersionsResponse
s@ListTemplateVersionsResponse' {} Maybe [TemplateVersionSummary]
a -> ListTemplateVersionsResponse
s {$sel:templateVersionSummaryList:ListTemplateVersionsResponse' :: Maybe [TemplateVersionSummary]
templateVersionSummaryList = Maybe [TemplateVersionSummary]
a} :: ListTemplateVersionsResponse) ((Maybe [TemplateVersionSummary]
  -> f (Maybe [TemplateVersionSummary]))
 -> ListTemplateVersionsResponse -> f ListTemplateVersionsResponse)
-> ((Maybe [TemplateVersionSummary]
     -> f (Maybe [TemplateVersionSummary]))
    -> Maybe [TemplateVersionSummary]
    -> f (Maybe [TemplateVersionSummary]))
-> (Maybe [TemplateVersionSummary]
    -> f (Maybe [TemplateVersionSummary]))
-> ListTemplateVersionsResponse
-> f ListTemplateVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TemplateVersionSummary]
  [TemplateVersionSummary]
  [TemplateVersionSummary]
  [TemplateVersionSummary]
-> Iso
     (Maybe [TemplateVersionSummary])
     (Maybe [TemplateVersionSummary])
     (Maybe [TemplateVersionSummary])
     (Maybe [TemplateVersionSummary])
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
  [TemplateVersionSummary]
  [TemplateVersionSummary]
  [TemplateVersionSummary]
  [TemplateVersionSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of results, or null if there are no more
-- results.
listTemplateVersionsResponse_nextToken :: Lens.Lens' ListTemplateVersionsResponse (Prelude.Maybe Prelude.Text)
listTemplateVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTemplateVersionsResponse -> f ListTemplateVersionsResponse
listTemplateVersionsResponse_nextToken = (ListTemplateVersionsResponse -> Maybe Text)
-> (ListTemplateVersionsResponse
    -> Maybe Text -> ListTemplateVersionsResponse)
-> Lens' ListTemplateVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTemplateVersionsResponse' :: ListTemplateVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTemplateVersionsResponse
s@ListTemplateVersionsResponse' {} Maybe Text
a -> ListTemplateVersionsResponse
s {$sel:nextToken:ListTemplateVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTemplateVersionsResponse)

-- | The HTTP status of the request.
listTemplateVersionsResponse_status :: Lens.Lens' ListTemplateVersionsResponse Prelude.Int
listTemplateVersionsResponse_status :: (Int -> f Int)
-> ListTemplateVersionsResponse -> f ListTemplateVersionsResponse
listTemplateVersionsResponse_status = (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
status :: Int
$sel:status:ListTemplateVersionsResponse' :: ListTemplateVersionsResponse -> Int
status} -> Int
status) (\s :: ListTemplateVersionsResponse
s@ListTemplateVersionsResponse' {} Int
a -> ListTemplateVersionsResponse
s {$sel:status:ListTemplateVersionsResponse' :: Int
status = Int
a} :: ListTemplateVersionsResponse)

instance Prelude.NFData ListTemplateVersionsResponse