{-# 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.ElasticBeanstalk.DescribeApplicationVersions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieve a list of application versions.
--
-- This operation returns paginated results.
module Amazonka.ElasticBeanstalk.DescribeApplicationVersions
  ( -- * Creating a Request
    DescribeApplicationVersions (..),
    newDescribeApplicationVersions,

    -- * Request Lenses
    describeApplicationVersions_applicationName,
    describeApplicationVersions_maxRecords,
    describeApplicationVersions_nextToken,
    describeApplicationVersions_versionLabels,

    -- * Destructuring the Response
    DescribeApplicationVersionsResponse (..),
    newDescribeApplicationVersionsResponse,

    -- * Response Lenses
    describeApplicationVersionsResponse_applicationVersions,
    describeApplicationVersionsResponse_nextToken,
    describeApplicationVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticBeanstalk.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Request to describe application versions.
--
-- /See:/ 'newDescribeApplicationVersions' smart constructor.
data DescribeApplicationVersions = DescribeApplicationVersions'
  { -- | Specify an application name to show only application versions for that
    -- application.
    DescribeApplicationVersions -> Maybe Text
applicationName :: Prelude.Maybe Prelude.Text,
    -- | For a paginated request. Specify a maximum number of application
    -- versions to include in each response.
    --
    -- If no @MaxRecords@ is specified, all available application versions are
    -- retrieved in a single response.
    DescribeApplicationVersions -> Maybe Natural
maxRecords :: Prelude.Maybe Prelude.Natural,
    -- | For a paginated request. Specify a token from a previous response page
    -- to retrieve the next response page. All other parameter values must be
    -- identical to the ones specified in the initial request.
    --
    -- If no @NextToken@ is specified, the first page is retrieved.
    DescribeApplicationVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specify a version label to show a specific application version.
    DescribeApplicationVersions -> Maybe [Text]
versionLabels :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeApplicationVersions -> DescribeApplicationVersions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeApplicationVersions -> DescribeApplicationVersions -> Bool
$c/= :: DescribeApplicationVersions -> DescribeApplicationVersions -> Bool
== :: DescribeApplicationVersions -> DescribeApplicationVersions -> Bool
$c== :: DescribeApplicationVersions -> DescribeApplicationVersions -> Bool
Prelude.Eq, ReadPrec [DescribeApplicationVersions]
ReadPrec DescribeApplicationVersions
Int -> ReadS DescribeApplicationVersions
ReadS [DescribeApplicationVersions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeApplicationVersions]
$creadListPrec :: ReadPrec [DescribeApplicationVersions]
readPrec :: ReadPrec DescribeApplicationVersions
$creadPrec :: ReadPrec DescribeApplicationVersions
readList :: ReadS [DescribeApplicationVersions]
$creadList :: ReadS [DescribeApplicationVersions]
readsPrec :: Int -> ReadS DescribeApplicationVersions
$creadsPrec :: Int -> ReadS DescribeApplicationVersions
Prelude.Read, Int -> DescribeApplicationVersions -> ShowS
[DescribeApplicationVersions] -> ShowS
DescribeApplicationVersions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeApplicationVersions] -> ShowS
$cshowList :: [DescribeApplicationVersions] -> ShowS
show :: DescribeApplicationVersions -> String
$cshow :: DescribeApplicationVersions -> String
showsPrec :: Int -> DescribeApplicationVersions -> ShowS
$cshowsPrec :: Int -> DescribeApplicationVersions -> ShowS
Prelude.Show, forall x.
Rep DescribeApplicationVersions x -> DescribeApplicationVersions
forall x.
DescribeApplicationVersions -> Rep DescribeApplicationVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeApplicationVersions x -> DescribeApplicationVersions
$cfrom :: forall x.
DescribeApplicationVersions -> Rep DescribeApplicationVersions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeApplicationVersions' 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:
--
-- 'applicationName', 'describeApplicationVersions_applicationName' - Specify an application name to show only application versions for that
-- application.
--
-- 'maxRecords', 'describeApplicationVersions_maxRecords' - For a paginated request. Specify a maximum number of application
-- versions to include in each response.
--
-- If no @MaxRecords@ is specified, all available application versions are
-- retrieved in a single response.
--
-- 'nextToken', 'describeApplicationVersions_nextToken' - For a paginated request. Specify a token from a previous response page
-- to retrieve the next response page. All other parameter values must be
-- identical to the ones specified in the initial request.
--
-- If no @NextToken@ is specified, the first page is retrieved.
--
-- 'versionLabels', 'describeApplicationVersions_versionLabels' - Specify a version label to show a specific application version.
newDescribeApplicationVersions ::
  DescribeApplicationVersions
newDescribeApplicationVersions :: DescribeApplicationVersions
newDescribeApplicationVersions =
  DescribeApplicationVersions'
    { $sel:applicationName:DescribeApplicationVersions' :: Maybe Text
applicationName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeApplicationVersions' :: Maybe Natural
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeApplicationVersions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:versionLabels:DescribeApplicationVersions' :: Maybe [Text]
versionLabels = forall a. Maybe a
Prelude.Nothing
    }

-- | Specify an application name to show only application versions for that
-- application.
describeApplicationVersions_applicationName :: Lens.Lens' DescribeApplicationVersions (Prelude.Maybe Prelude.Text)
describeApplicationVersions_applicationName :: Lens' DescribeApplicationVersions (Maybe Text)
describeApplicationVersions_applicationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplicationVersions' {Maybe Text
applicationName :: Maybe Text
$sel:applicationName:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Text
applicationName} -> Maybe Text
applicationName) (\s :: DescribeApplicationVersions
s@DescribeApplicationVersions' {} Maybe Text
a -> DescribeApplicationVersions
s {$sel:applicationName:DescribeApplicationVersions' :: Maybe Text
applicationName = Maybe Text
a} :: DescribeApplicationVersions)

-- | For a paginated request. Specify a maximum number of application
-- versions to include in each response.
--
-- If no @MaxRecords@ is specified, all available application versions are
-- retrieved in a single response.
describeApplicationVersions_maxRecords :: Lens.Lens' DescribeApplicationVersions (Prelude.Maybe Prelude.Natural)
describeApplicationVersions_maxRecords :: Lens' DescribeApplicationVersions (Maybe Natural)
describeApplicationVersions_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplicationVersions' {Maybe Natural
maxRecords :: Maybe Natural
$sel:maxRecords:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Natural
maxRecords} -> Maybe Natural
maxRecords) (\s :: DescribeApplicationVersions
s@DescribeApplicationVersions' {} Maybe Natural
a -> DescribeApplicationVersions
s {$sel:maxRecords:DescribeApplicationVersions' :: Maybe Natural
maxRecords = Maybe Natural
a} :: DescribeApplicationVersions)

-- | For a paginated request. Specify a token from a previous response page
-- to retrieve the next response page. All other parameter values must be
-- identical to the ones specified in the initial request.
--
-- If no @NextToken@ is specified, the first page is retrieved.
describeApplicationVersions_nextToken :: Lens.Lens' DescribeApplicationVersions (Prelude.Maybe Prelude.Text)
describeApplicationVersions_nextToken :: Lens' DescribeApplicationVersions (Maybe Text)
describeApplicationVersions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplicationVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeApplicationVersions
s@DescribeApplicationVersions' {} Maybe Text
a -> DescribeApplicationVersions
s {$sel:nextToken:DescribeApplicationVersions' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeApplicationVersions)

-- | Specify a version label to show a specific application version.
describeApplicationVersions_versionLabels :: Lens.Lens' DescribeApplicationVersions (Prelude.Maybe [Prelude.Text])
describeApplicationVersions_versionLabels :: Lens' DescribeApplicationVersions (Maybe [Text])
describeApplicationVersions_versionLabels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplicationVersions' {Maybe [Text]
versionLabels :: Maybe [Text]
$sel:versionLabels:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe [Text]
versionLabels} -> Maybe [Text]
versionLabels) (\s :: DescribeApplicationVersions
s@DescribeApplicationVersions' {} Maybe [Text]
a -> DescribeApplicationVersions
s {$sel:versionLabels:DescribeApplicationVersions' :: Maybe [Text]
versionLabels = Maybe [Text]
a} :: DescribeApplicationVersions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager DescribeApplicationVersions where
  page :: DescribeApplicationVersions
-> AWSResponse DescribeApplicationVersions
-> Maybe DescribeApplicationVersions
page DescribeApplicationVersions
rq AWSResponse DescribeApplicationVersions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeApplicationVersions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeApplicationVersionsResponse (Maybe Text)
describeApplicationVersionsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeApplicationVersions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeApplicationVersionsResponse
  (Maybe [ApplicationVersionDescription])
describeApplicationVersionsResponse_applicationVersions
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeApplicationVersions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeApplicationVersions (Maybe Text)
describeApplicationVersions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeApplicationVersions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeApplicationVersionsResponse (Maybe Text)
describeApplicationVersionsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeApplicationVersions where
  type
    AWSResponse DescribeApplicationVersions =
      DescribeApplicationVersionsResponse
  request :: (Service -> Service)
-> DescribeApplicationVersions
-> Request DescribeApplicationVersions
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeApplicationVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeApplicationVersions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeApplicationVersionsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [ApplicationVersionDescription]
-> Maybe Text -> Int -> DescribeApplicationVersionsResponse
DescribeApplicationVersionsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ApplicationVersions"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeApplicationVersions where
  hashWithSalt :: Int -> DescribeApplicationVersions -> Int
hashWithSalt Int
_salt DescribeApplicationVersions' {Maybe Natural
Maybe [Text]
Maybe Text
versionLabels :: Maybe [Text]
nextToken :: Maybe Text
maxRecords :: Maybe Natural
applicationName :: Maybe Text
$sel:versionLabels:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe [Text]
$sel:nextToken:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Text
$sel:maxRecords:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Natural
$sel:applicationName:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
applicationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
versionLabels

instance Prelude.NFData DescribeApplicationVersions where
  rnf :: DescribeApplicationVersions -> ()
rnf DescribeApplicationVersions' {Maybe Natural
Maybe [Text]
Maybe Text
versionLabels :: Maybe [Text]
nextToken :: Maybe Text
maxRecords :: Maybe Natural
applicationName :: Maybe Text
$sel:versionLabels:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe [Text]
$sel:nextToken:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Text
$sel:maxRecords:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Natural
$sel:applicationName:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
applicationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe [Text]
versionLabels

instance Data.ToHeaders DescribeApplicationVersions where
  toHeaders :: DescribeApplicationVersions -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DescribeApplicationVersions where
  toPath :: DescribeApplicationVersions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeApplicationVersions where
  toQuery :: DescribeApplicationVersions -> QueryString
toQuery DescribeApplicationVersions' {Maybe Natural
Maybe [Text]
Maybe Text
versionLabels :: Maybe [Text]
nextToken :: Maybe Text
maxRecords :: Maybe Natural
applicationName :: Maybe Text
$sel:versionLabels:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe [Text]
$sel:nextToken:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Text
$sel:maxRecords:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Natural
$sel:applicationName:DescribeApplicationVersions' :: DescribeApplicationVersions -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeApplicationVersions" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"ApplicationName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
applicationName,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxRecords,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"VersionLabels"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
versionLabels
            )
      ]

-- | Result message wrapping a list of application version descriptions.
--
-- /See:/ 'newDescribeApplicationVersionsResponse' smart constructor.
data DescribeApplicationVersionsResponse = DescribeApplicationVersionsResponse'
  { -- | List of @ApplicationVersionDescription@ objects sorted in order of
    -- creation.
    DescribeApplicationVersionsResponse
-> Maybe [ApplicationVersionDescription]
applicationVersions :: Prelude.Maybe [ApplicationVersionDescription],
    -- | In a paginated request, the token that you can pass in a subsequent
    -- request to get the next response page.
    DescribeApplicationVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeApplicationVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeApplicationVersionsResponse
-> DescribeApplicationVersionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeApplicationVersionsResponse
-> DescribeApplicationVersionsResponse -> Bool
$c/= :: DescribeApplicationVersionsResponse
-> DescribeApplicationVersionsResponse -> Bool
== :: DescribeApplicationVersionsResponse
-> DescribeApplicationVersionsResponse -> Bool
$c== :: DescribeApplicationVersionsResponse
-> DescribeApplicationVersionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeApplicationVersionsResponse]
ReadPrec DescribeApplicationVersionsResponse
Int -> ReadS DescribeApplicationVersionsResponse
ReadS [DescribeApplicationVersionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeApplicationVersionsResponse]
$creadListPrec :: ReadPrec [DescribeApplicationVersionsResponse]
readPrec :: ReadPrec DescribeApplicationVersionsResponse
$creadPrec :: ReadPrec DescribeApplicationVersionsResponse
readList :: ReadS [DescribeApplicationVersionsResponse]
$creadList :: ReadS [DescribeApplicationVersionsResponse]
readsPrec :: Int -> ReadS DescribeApplicationVersionsResponse
$creadsPrec :: Int -> ReadS DescribeApplicationVersionsResponse
Prelude.Read, Int -> DescribeApplicationVersionsResponse -> ShowS
[DescribeApplicationVersionsResponse] -> ShowS
DescribeApplicationVersionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeApplicationVersionsResponse] -> ShowS
$cshowList :: [DescribeApplicationVersionsResponse] -> ShowS
show :: DescribeApplicationVersionsResponse -> String
$cshow :: DescribeApplicationVersionsResponse -> String
showsPrec :: Int -> DescribeApplicationVersionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeApplicationVersionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeApplicationVersionsResponse x
-> DescribeApplicationVersionsResponse
forall x.
DescribeApplicationVersionsResponse
-> Rep DescribeApplicationVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeApplicationVersionsResponse x
-> DescribeApplicationVersionsResponse
$cfrom :: forall x.
DescribeApplicationVersionsResponse
-> Rep DescribeApplicationVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeApplicationVersionsResponse' 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:
--
-- 'applicationVersions', 'describeApplicationVersionsResponse_applicationVersions' - List of @ApplicationVersionDescription@ objects sorted in order of
-- creation.
--
-- 'nextToken', 'describeApplicationVersionsResponse_nextToken' - In a paginated request, the token that you can pass in a subsequent
-- request to get the next response page.
--
-- 'httpStatus', 'describeApplicationVersionsResponse_httpStatus' - The response's http status code.
newDescribeApplicationVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeApplicationVersionsResponse
newDescribeApplicationVersionsResponse :: Int -> DescribeApplicationVersionsResponse
newDescribeApplicationVersionsResponse Int
pHttpStatus_ =
  DescribeApplicationVersionsResponse'
    { $sel:applicationVersions:DescribeApplicationVersionsResponse' :: Maybe [ApplicationVersionDescription]
applicationVersions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeApplicationVersionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeApplicationVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | List of @ApplicationVersionDescription@ objects sorted in order of
-- creation.
describeApplicationVersionsResponse_applicationVersions :: Lens.Lens' DescribeApplicationVersionsResponse (Prelude.Maybe [ApplicationVersionDescription])
describeApplicationVersionsResponse_applicationVersions :: Lens'
  DescribeApplicationVersionsResponse
  (Maybe [ApplicationVersionDescription])
describeApplicationVersionsResponse_applicationVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplicationVersionsResponse' {Maybe [ApplicationVersionDescription]
applicationVersions :: Maybe [ApplicationVersionDescription]
$sel:applicationVersions:DescribeApplicationVersionsResponse' :: DescribeApplicationVersionsResponse
-> Maybe [ApplicationVersionDescription]
applicationVersions} -> Maybe [ApplicationVersionDescription]
applicationVersions) (\s :: DescribeApplicationVersionsResponse
s@DescribeApplicationVersionsResponse' {} Maybe [ApplicationVersionDescription]
a -> DescribeApplicationVersionsResponse
s {$sel:applicationVersions:DescribeApplicationVersionsResponse' :: Maybe [ApplicationVersionDescription]
applicationVersions = Maybe [ApplicationVersionDescription]
a} :: DescribeApplicationVersionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | In a paginated request, the token that you can pass in a subsequent
-- request to get the next response page.
describeApplicationVersionsResponse_nextToken :: Lens.Lens' DescribeApplicationVersionsResponse (Prelude.Maybe Prelude.Text)
describeApplicationVersionsResponse_nextToken :: Lens' DescribeApplicationVersionsResponse (Maybe Text)
describeApplicationVersionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApplicationVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeApplicationVersionsResponse' :: DescribeApplicationVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeApplicationVersionsResponse
s@DescribeApplicationVersionsResponse' {} Maybe Text
a -> DescribeApplicationVersionsResponse
s {$sel:nextToken:DescribeApplicationVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeApplicationVersionsResponse)

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

instance
  Prelude.NFData
    DescribeApplicationVersionsResponse
  where
  rnf :: DescribeApplicationVersionsResponse -> ()
rnf DescribeApplicationVersionsResponse' {Int
Maybe [ApplicationVersionDescription]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
applicationVersions :: Maybe [ApplicationVersionDescription]
$sel:httpStatus:DescribeApplicationVersionsResponse' :: DescribeApplicationVersionsResponse -> Int
$sel:nextToken:DescribeApplicationVersionsResponse' :: DescribeApplicationVersionsResponse -> Maybe Text
$sel:applicationVersions:DescribeApplicationVersionsResponse' :: DescribeApplicationVersionsResponse
-> Maybe [ApplicationVersionDescription]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ApplicationVersionDescription]
applicationVersions
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Int
httpStatus