{-# 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.ServerlessApplicationRepository.ListApplicationVersions
-- 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 versions for the specified application.
--
-- This operation returns paginated results.
module Amazonka.ServerlessApplicationRepository.ListApplicationVersions
  ( -- * Creating a Request
    ListApplicationVersions (..),
    newListApplicationVersions,

    -- * Request Lenses
    listApplicationVersions_nextToken,
    listApplicationVersions_maxItems,
    listApplicationVersions_applicationId,

    -- * Destructuring the Response
    ListApplicationVersionsResponse (..),
    newListApplicationVersionsResponse,

    -- * Response Lenses
    listApplicationVersionsResponse_versions,
    listApplicationVersionsResponse_nextToken,
    listApplicationVersionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListApplicationVersions' smart constructor.
data ListApplicationVersions = ListApplicationVersions'
  { -- | A token to specify where to start paginating.
    ListApplicationVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The total number of items to return.
    ListApplicationVersions -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the application.
    ListApplicationVersions -> Text
applicationId :: Prelude.Text
  }
  deriving (ListApplicationVersions -> ListApplicationVersions -> Bool
(ListApplicationVersions -> ListApplicationVersions -> Bool)
-> (ListApplicationVersions -> ListApplicationVersions -> Bool)
-> Eq ListApplicationVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApplicationVersions -> ListApplicationVersions -> Bool
$c/= :: ListApplicationVersions -> ListApplicationVersions -> Bool
== :: ListApplicationVersions -> ListApplicationVersions -> Bool
$c== :: ListApplicationVersions -> ListApplicationVersions -> Bool
Prelude.Eq, ReadPrec [ListApplicationVersions]
ReadPrec ListApplicationVersions
Int -> ReadS ListApplicationVersions
ReadS [ListApplicationVersions]
(Int -> ReadS ListApplicationVersions)
-> ReadS [ListApplicationVersions]
-> ReadPrec ListApplicationVersions
-> ReadPrec [ListApplicationVersions]
-> Read ListApplicationVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApplicationVersions]
$creadListPrec :: ReadPrec [ListApplicationVersions]
readPrec :: ReadPrec ListApplicationVersions
$creadPrec :: ReadPrec ListApplicationVersions
readList :: ReadS [ListApplicationVersions]
$creadList :: ReadS [ListApplicationVersions]
readsPrec :: Int -> ReadS ListApplicationVersions
$creadsPrec :: Int -> ReadS ListApplicationVersions
Prelude.Read, Int -> ListApplicationVersions -> ShowS
[ListApplicationVersions] -> ShowS
ListApplicationVersions -> String
(Int -> ListApplicationVersions -> ShowS)
-> (ListApplicationVersions -> String)
-> ([ListApplicationVersions] -> ShowS)
-> Show ListApplicationVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApplicationVersions] -> ShowS
$cshowList :: [ListApplicationVersions] -> ShowS
show :: ListApplicationVersions -> String
$cshow :: ListApplicationVersions -> String
showsPrec :: Int -> ListApplicationVersions -> ShowS
$cshowsPrec :: Int -> ListApplicationVersions -> ShowS
Prelude.Show, (forall x.
 ListApplicationVersions -> Rep ListApplicationVersions x)
-> (forall x.
    Rep ListApplicationVersions x -> ListApplicationVersions)
-> Generic ListApplicationVersions
forall x. Rep ListApplicationVersions x -> ListApplicationVersions
forall x. ListApplicationVersions -> Rep ListApplicationVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListApplicationVersions x -> ListApplicationVersions
$cfrom :: forall x. ListApplicationVersions -> Rep ListApplicationVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListApplicationVersions' 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', 'listApplicationVersions_nextToken' - A token to specify where to start paginating.
--
-- 'maxItems', 'listApplicationVersions_maxItems' - The total number of items to return.
--
-- 'applicationId', 'listApplicationVersions_applicationId' - The Amazon Resource Name (ARN) of the application.
newListApplicationVersions ::
  -- | 'applicationId'
  Prelude.Text ->
  ListApplicationVersions
newListApplicationVersions :: Text -> ListApplicationVersions
newListApplicationVersions Text
pApplicationId_ =
  ListApplicationVersions' :: Maybe Text -> Maybe Natural -> Text -> ListApplicationVersions
ListApplicationVersions'
    { $sel:nextToken:ListApplicationVersions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListApplicationVersions' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationId:ListApplicationVersions' :: Text
applicationId = Text
pApplicationId_
    }

-- | A token to specify where to start paginating.
listApplicationVersions_nextToken :: Lens.Lens' ListApplicationVersions (Prelude.Maybe Prelude.Text)
listApplicationVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListApplicationVersions -> f ListApplicationVersions
listApplicationVersions_nextToken = (ListApplicationVersions -> Maybe Text)
-> (ListApplicationVersions
    -> Maybe Text -> ListApplicationVersions)
-> Lens
     ListApplicationVersions
     ListApplicationVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApplicationVersions' :: ListApplicationVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApplicationVersions
s@ListApplicationVersions' {} Maybe Text
a -> ListApplicationVersions
s {$sel:nextToken:ListApplicationVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListApplicationVersions)

-- | The total number of items to return.
listApplicationVersions_maxItems :: Lens.Lens' ListApplicationVersions (Prelude.Maybe Prelude.Natural)
listApplicationVersions_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListApplicationVersions -> f ListApplicationVersions
listApplicationVersions_maxItems = (ListApplicationVersions -> Maybe Natural)
-> (ListApplicationVersions
    -> Maybe Natural -> ListApplicationVersions)
-> Lens
     ListApplicationVersions
     ListApplicationVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationVersions' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListApplicationVersions' :: ListApplicationVersions -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListApplicationVersions
s@ListApplicationVersions' {} Maybe Natural
a -> ListApplicationVersions
s {$sel:maxItems:ListApplicationVersions' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListApplicationVersions)

-- | The Amazon Resource Name (ARN) of the application.
listApplicationVersions_applicationId :: Lens.Lens' ListApplicationVersions Prelude.Text
listApplicationVersions_applicationId :: (Text -> f Text)
-> ListApplicationVersions -> f ListApplicationVersions
listApplicationVersions_applicationId = (ListApplicationVersions -> Text)
-> (ListApplicationVersions -> Text -> ListApplicationVersions)
-> Lens ListApplicationVersions ListApplicationVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationVersions' {Text
applicationId :: Text
$sel:applicationId:ListApplicationVersions' :: ListApplicationVersions -> Text
applicationId} -> Text
applicationId) (\s :: ListApplicationVersions
s@ListApplicationVersions' {} Text
a -> ListApplicationVersions
s {$sel:applicationId:ListApplicationVersions' :: Text
applicationId = Text
a} :: ListApplicationVersions)

instance Core.AWSPager ListApplicationVersions where
  page :: ListApplicationVersions
-> AWSResponse ListApplicationVersions
-> Maybe ListApplicationVersions
page ListApplicationVersions
rq AWSResponse ListApplicationVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListApplicationVersions
ListApplicationVersionsResponse
rs
            ListApplicationVersionsResponse
-> Getting (First Text) ListApplicationVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListApplicationVersionsResponse
-> Const (First Text) ListApplicationVersionsResponse
Lens' ListApplicationVersionsResponse (Maybe Text)
listApplicationVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListApplicationVersionsResponse
 -> Const (First Text) ListApplicationVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListApplicationVersionsResponse 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 ListApplicationVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [VersionSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListApplicationVersions
ListApplicationVersionsResponse
rs
            ListApplicationVersionsResponse
-> Getting
     (First [VersionSummary])
     ListApplicationVersionsResponse
     [VersionSummary]
-> Maybe [VersionSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [VersionSummary]
 -> Const (First [VersionSummary]) (Maybe [VersionSummary]))
-> ListApplicationVersionsResponse
-> Const (First [VersionSummary]) ListApplicationVersionsResponse
Lens' ListApplicationVersionsResponse (Maybe [VersionSummary])
listApplicationVersionsResponse_versions
              ((Maybe [VersionSummary]
  -> Const (First [VersionSummary]) (Maybe [VersionSummary]))
 -> ListApplicationVersionsResponse
 -> Const (First [VersionSummary]) ListApplicationVersionsResponse)
-> (([VersionSummary]
     -> Const (First [VersionSummary]) [VersionSummary])
    -> Maybe [VersionSummary]
    -> Const (First [VersionSummary]) (Maybe [VersionSummary]))
-> Getting
     (First [VersionSummary])
     ListApplicationVersionsResponse
     [VersionSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([VersionSummary]
 -> Const (First [VersionSummary]) [VersionSummary])
-> Maybe [VersionSummary]
-> Const (First [VersionSummary]) (Maybe [VersionSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListApplicationVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListApplicationVersions -> Maybe ListApplicationVersions
forall a. a -> Maybe a
Prelude.Just (ListApplicationVersions -> Maybe ListApplicationVersions)
-> ListApplicationVersions -> Maybe ListApplicationVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListApplicationVersions
rq
          ListApplicationVersions
-> (ListApplicationVersions -> ListApplicationVersions)
-> ListApplicationVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListApplicationVersions -> Identity ListApplicationVersions
Lens
  ListApplicationVersions
  ListApplicationVersions
  (Maybe Text)
  (Maybe Text)
listApplicationVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListApplicationVersions -> Identity ListApplicationVersions)
-> Maybe Text -> ListApplicationVersions -> ListApplicationVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListApplicationVersions
ListApplicationVersionsResponse
rs
          ListApplicationVersionsResponse
-> Getting (First Text) ListApplicationVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListApplicationVersionsResponse
-> Const (First Text) ListApplicationVersionsResponse
Lens' ListApplicationVersionsResponse (Maybe Text)
listApplicationVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListApplicationVersionsResponse
 -> Const (First Text) ListApplicationVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListApplicationVersionsResponse 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 ListApplicationVersions where
  type
    AWSResponse ListApplicationVersions =
      ListApplicationVersionsResponse
  request :: ListApplicationVersions -> Request ListApplicationVersions
request = Service
-> ListApplicationVersions -> Request ListApplicationVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListApplicationVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListApplicationVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListApplicationVersions))
-> Logger
-> Service
-> Proxy ListApplicationVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListApplicationVersions)))
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 [VersionSummary]
-> Maybe Text -> Int -> ListApplicationVersionsResponse
ListApplicationVersionsResponse'
            (Maybe [VersionSummary]
 -> Maybe Text -> Int -> ListApplicationVersionsResponse)
-> Either String (Maybe [VersionSummary])
-> Either
     String (Maybe Text -> Int -> ListApplicationVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [VersionSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"versions" Either String (Maybe (Maybe [VersionSummary]))
-> Maybe [VersionSummary] -> Either String (Maybe [VersionSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VersionSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Int -> ListApplicationVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListApplicationVersionsResponse)
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 -> ListApplicationVersionsResponse)
-> Either String Int
-> Either String ListApplicationVersionsResponse
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 ListApplicationVersions

instance Prelude.NFData ListApplicationVersions

instance Core.ToHeaders ListApplicationVersions where
  toHeaders :: ListApplicationVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListApplicationVersions -> 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 ListApplicationVersions where
  toPath :: ListApplicationVersions -> ByteString
toPath ListApplicationVersions' {Maybe Natural
Maybe Text
Text
applicationId :: Text
maxItems :: Maybe Natural
nextToken :: Maybe Text
$sel:applicationId:ListApplicationVersions' :: ListApplicationVersions -> Text
$sel:maxItems:ListApplicationVersions' :: ListApplicationVersions -> Maybe Natural
$sel:nextToken:ListApplicationVersions' :: ListApplicationVersions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/applications/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId,
        ByteString
"/versions"
      ]

instance Core.ToQuery ListApplicationVersions where
  toQuery :: ListApplicationVersions -> QueryString
toQuery ListApplicationVersions' {Maybe Natural
Maybe Text
Text
applicationId :: Text
maxItems :: Maybe Natural
nextToken :: Maybe Text
$sel:applicationId:ListApplicationVersions' :: ListApplicationVersions -> Text
$sel:maxItems:ListApplicationVersions' :: ListApplicationVersions -> Maybe Natural
$sel:nextToken:ListApplicationVersions' :: ListApplicationVersions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems
      ]

-- | /See:/ 'newListApplicationVersionsResponse' smart constructor.
data ListApplicationVersionsResponse = ListApplicationVersionsResponse'
  { -- | An array of version summaries for the application.
    ListApplicationVersionsResponse -> Maybe [VersionSummary]
versions :: Prelude.Maybe [VersionSummary],
    -- | The token to request the next page of results.
    ListApplicationVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListApplicationVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListApplicationVersionsResponse
-> ListApplicationVersionsResponse -> Bool
(ListApplicationVersionsResponse
 -> ListApplicationVersionsResponse -> Bool)
-> (ListApplicationVersionsResponse
    -> ListApplicationVersionsResponse -> Bool)
-> Eq ListApplicationVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApplicationVersionsResponse
-> ListApplicationVersionsResponse -> Bool
$c/= :: ListApplicationVersionsResponse
-> ListApplicationVersionsResponse -> Bool
== :: ListApplicationVersionsResponse
-> ListApplicationVersionsResponse -> Bool
$c== :: ListApplicationVersionsResponse
-> ListApplicationVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListApplicationVersionsResponse]
ReadPrec ListApplicationVersionsResponse
Int -> ReadS ListApplicationVersionsResponse
ReadS [ListApplicationVersionsResponse]
(Int -> ReadS ListApplicationVersionsResponse)
-> ReadS [ListApplicationVersionsResponse]
-> ReadPrec ListApplicationVersionsResponse
-> ReadPrec [ListApplicationVersionsResponse]
-> Read ListApplicationVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApplicationVersionsResponse]
$creadListPrec :: ReadPrec [ListApplicationVersionsResponse]
readPrec :: ReadPrec ListApplicationVersionsResponse
$creadPrec :: ReadPrec ListApplicationVersionsResponse
readList :: ReadS [ListApplicationVersionsResponse]
$creadList :: ReadS [ListApplicationVersionsResponse]
readsPrec :: Int -> ReadS ListApplicationVersionsResponse
$creadsPrec :: Int -> ReadS ListApplicationVersionsResponse
Prelude.Read, Int -> ListApplicationVersionsResponse -> ShowS
[ListApplicationVersionsResponse] -> ShowS
ListApplicationVersionsResponse -> String
(Int -> ListApplicationVersionsResponse -> ShowS)
-> (ListApplicationVersionsResponse -> String)
-> ([ListApplicationVersionsResponse] -> ShowS)
-> Show ListApplicationVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApplicationVersionsResponse] -> ShowS
$cshowList :: [ListApplicationVersionsResponse] -> ShowS
show :: ListApplicationVersionsResponse -> String
$cshow :: ListApplicationVersionsResponse -> String
showsPrec :: Int -> ListApplicationVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListApplicationVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListApplicationVersionsResponse
 -> Rep ListApplicationVersionsResponse x)
-> (forall x.
    Rep ListApplicationVersionsResponse x
    -> ListApplicationVersionsResponse)
-> Generic ListApplicationVersionsResponse
forall x.
Rep ListApplicationVersionsResponse x
-> ListApplicationVersionsResponse
forall x.
ListApplicationVersionsResponse
-> Rep ListApplicationVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListApplicationVersionsResponse x
-> ListApplicationVersionsResponse
$cfrom :: forall x.
ListApplicationVersionsResponse
-> Rep ListApplicationVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListApplicationVersionsResponse' 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:
--
-- 'versions', 'listApplicationVersionsResponse_versions' - An array of version summaries for the application.
--
-- 'nextToken', 'listApplicationVersionsResponse_nextToken' - The token to request the next page of results.
--
-- 'httpStatus', 'listApplicationVersionsResponse_httpStatus' - The response's http status code.
newListApplicationVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListApplicationVersionsResponse
newListApplicationVersionsResponse :: Int -> ListApplicationVersionsResponse
newListApplicationVersionsResponse Int
pHttpStatus_ =
  ListApplicationVersionsResponse' :: Maybe [VersionSummary]
-> Maybe Text -> Int -> ListApplicationVersionsResponse
ListApplicationVersionsResponse'
    { $sel:versions:ListApplicationVersionsResponse' :: Maybe [VersionSummary]
versions =
        Maybe [VersionSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListApplicationVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListApplicationVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of version summaries for the application.
listApplicationVersionsResponse_versions :: Lens.Lens' ListApplicationVersionsResponse (Prelude.Maybe [VersionSummary])
listApplicationVersionsResponse_versions :: (Maybe [VersionSummary] -> f (Maybe [VersionSummary]))
-> ListApplicationVersionsResponse
-> f ListApplicationVersionsResponse
listApplicationVersionsResponse_versions = (ListApplicationVersionsResponse -> Maybe [VersionSummary])
-> (ListApplicationVersionsResponse
    -> Maybe [VersionSummary] -> ListApplicationVersionsResponse)
-> Lens' ListApplicationVersionsResponse (Maybe [VersionSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationVersionsResponse' {Maybe [VersionSummary]
versions :: Maybe [VersionSummary]
$sel:versions:ListApplicationVersionsResponse' :: ListApplicationVersionsResponse -> Maybe [VersionSummary]
versions} -> Maybe [VersionSummary]
versions) (\s :: ListApplicationVersionsResponse
s@ListApplicationVersionsResponse' {} Maybe [VersionSummary]
a -> ListApplicationVersionsResponse
s {$sel:versions:ListApplicationVersionsResponse' :: Maybe [VersionSummary]
versions = Maybe [VersionSummary]
a} :: ListApplicationVersionsResponse) ((Maybe [VersionSummary] -> f (Maybe [VersionSummary]))
 -> ListApplicationVersionsResponse
 -> f ListApplicationVersionsResponse)
-> ((Maybe [VersionSummary] -> f (Maybe [VersionSummary]))
    -> Maybe [VersionSummary] -> f (Maybe [VersionSummary]))
-> (Maybe [VersionSummary] -> f (Maybe [VersionSummary]))
-> ListApplicationVersionsResponse
-> f ListApplicationVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VersionSummary] [VersionSummary] [VersionSummary] [VersionSummary]
-> Iso
     (Maybe [VersionSummary])
     (Maybe [VersionSummary])
     (Maybe [VersionSummary])
     (Maybe [VersionSummary])
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
  [VersionSummary] [VersionSummary] [VersionSummary] [VersionSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to request the next page of results.
listApplicationVersionsResponse_nextToken :: Lens.Lens' ListApplicationVersionsResponse (Prelude.Maybe Prelude.Text)
listApplicationVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListApplicationVersionsResponse
-> f ListApplicationVersionsResponse
listApplicationVersionsResponse_nextToken = (ListApplicationVersionsResponse -> Maybe Text)
-> (ListApplicationVersionsResponse
    -> Maybe Text -> ListApplicationVersionsResponse)
-> Lens' ListApplicationVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApplicationVersionsResponse' :: ListApplicationVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApplicationVersionsResponse
s@ListApplicationVersionsResponse' {} Maybe Text
a -> ListApplicationVersionsResponse
s {$sel:nextToken:ListApplicationVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListApplicationVersionsResponse)

-- | The response's http status code.
listApplicationVersionsResponse_httpStatus :: Lens.Lens' ListApplicationVersionsResponse Prelude.Int
listApplicationVersionsResponse_httpStatus :: (Int -> f Int)
-> ListApplicationVersionsResponse
-> f ListApplicationVersionsResponse
listApplicationVersionsResponse_httpStatus = (ListApplicationVersionsResponse -> Int)
-> (ListApplicationVersionsResponse
    -> Int -> ListApplicationVersionsResponse)
-> Lens
     ListApplicationVersionsResponse
     ListApplicationVersionsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListApplicationVersionsResponse' :: ListApplicationVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListApplicationVersionsResponse
s@ListApplicationVersionsResponse' {} Int
a -> ListApplicationVersionsResponse
s {$sel:httpStatus:ListApplicationVersionsResponse' :: Int
httpStatus = Int
a} :: ListApplicationVersionsResponse)

instance
  Prelude.NFData
    ListApplicationVersionsResponse