{-# 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.ListPlatformVersions
-- 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 the platform versions available for your account in an AWS Region.
-- Provides summary information about each platform version. Compare to
-- DescribePlatformVersion, which provides full details about a single
-- platform version.
--
-- For definitions of platform version and other platform-related terms,
-- see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-glossary.html AWS Elastic Beanstalk Platforms Glossary>.
--
-- This operation returns paginated results.
module Amazonka.ElasticBeanstalk.ListPlatformVersions
  ( -- * Creating a Request
    ListPlatformVersions (..),
    newListPlatformVersions,

    -- * Request Lenses
    listPlatformVersions_filters,
    listPlatformVersions_nextToken,
    listPlatformVersions_maxRecords,

    -- * Destructuring the Response
    ListPlatformVersionsResponse (..),
    newListPlatformVersionsResponse,

    -- * Response Lenses
    listPlatformVersionsResponse_nextToken,
    listPlatformVersionsResponse_platformSummaryList,
    listPlatformVersionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListPlatformVersions' smart constructor.
data ListPlatformVersions = ListPlatformVersions'
  { -- | Criteria for restricting the resulting list of platform versions. The
    -- filter is interpreted as a logical conjunction (AND) of the separate
    -- @PlatformFilter@ terms.
    ListPlatformVersions -> Maybe [PlatformFilter]
filters :: Prelude.Maybe [PlatformFilter],
    -- | 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.
    ListPlatformVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of platform version values returned in one call.
    ListPlatformVersions -> Maybe Natural
maxRecords :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListPlatformVersions -> ListPlatformVersions -> Bool
(ListPlatformVersions -> ListPlatformVersions -> Bool)
-> (ListPlatformVersions -> ListPlatformVersions -> Bool)
-> Eq ListPlatformVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPlatformVersions -> ListPlatformVersions -> Bool
$c/= :: ListPlatformVersions -> ListPlatformVersions -> Bool
== :: ListPlatformVersions -> ListPlatformVersions -> Bool
$c== :: ListPlatformVersions -> ListPlatformVersions -> Bool
Prelude.Eq, ReadPrec [ListPlatformVersions]
ReadPrec ListPlatformVersions
Int -> ReadS ListPlatformVersions
ReadS [ListPlatformVersions]
(Int -> ReadS ListPlatformVersions)
-> ReadS [ListPlatformVersions]
-> ReadPrec ListPlatformVersions
-> ReadPrec [ListPlatformVersions]
-> Read ListPlatformVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPlatformVersions]
$creadListPrec :: ReadPrec [ListPlatformVersions]
readPrec :: ReadPrec ListPlatformVersions
$creadPrec :: ReadPrec ListPlatformVersions
readList :: ReadS [ListPlatformVersions]
$creadList :: ReadS [ListPlatformVersions]
readsPrec :: Int -> ReadS ListPlatformVersions
$creadsPrec :: Int -> ReadS ListPlatformVersions
Prelude.Read, Int -> ListPlatformVersions -> ShowS
[ListPlatformVersions] -> ShowS
ListPlatformVersions -> String
(Int -> ListPlatformVersions -> ShowS)
-> (ListPlatformVersions -> String)
-> ([ListPlatformVersions] -> ShowS)
-> Show ListPlatformVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPlatformVersions] -> ShowS
$cshowList :: [ListPlatformVersions] -> ShowS
show :: ListPlatformVersions -> String
$cshow :: ListPlatformVersions -> String
showsPrec :: Int -> ListPlatformVersions -> ShowS
$cshowsPrec :: Int -> ListPlatformVersions -> ShowS
Prelude.Show, (forall x. ListPlatformVersions -> Rep ListPlatformVersions x)
-> (forall x. Rep ListPlatformVersions x -> ListPlatformVersions)
-> Generic ListPlatformVersions
forall x. Rep ListPlatformVersions x -> ListPlatformVersions
forall x. ListPlatformVersions -> Rep ListPlatformVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPlatformVersions x -> ListPlatformVersions
$cfrom :: forall x. ListPlatformVersions -> Rep ListPlatformVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListPlatformVersions' 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:
--
-- 'filters', 'listPlatformVersions_filters' - Criteria for restricting the resulting list of platform versions. The
-- filter is interpreted as a logical conjunction (AND) of the separate
-- @PlatformFilter@ terms.
--
-- 'nextToken', 'listPlatformVersions_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.
--
-- 'maxRecords', 'listPlatformVersions_maxRecords' - The maximum number of platform version values returned in one call.
newListPlatformVersions ::
  ListPlatformVersions
newListPlatformVersions :: ListPlatformVersions
newListPlatformVersions =
  ListPlatformVersions' :: Maybe [PlatformFilter]
-> Maybe Text -> Maybe Natural -> ListPlatformVersions
ListPlatformVersions'
    { $sel:filters:ListPlatformVersions' :: Maybe [PlatformFilter]
filters = Maybe [PlatformFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPlatformVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:ListPlatformVersions' :: Maybe Natural
maxRecords = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Criteria for restricting the resulting list of platform versions. The
-- filter is interpreted as a logical conjunction (AND) of the separate
-- @PlatformFilter@ terms.
listPlatformVersions_filters :: Lens.Lens' ListPlatformVersions (Prelude.Maybe [PlatformFilter])
listPlatformVersions_filters :: (Maybe [PlatformFilter] -> f (Maybe [PlatformFilter]))
-> ListPlatformVersions -> f ListPlatformVersions
listPlatformVersions_filters = (ListPlatformVersions -> Maybe [PlatformFilter])
-> (ListPlatformVersions
    -> Maybe [PlatformFilter] -> ListPlatformVersions)
-> Lens
     ListPlatformVersions
     ListPlatformVersions
     (Maybe [PlatformFilter])
     (Maybe [PlatformFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlatformVersions' {Maybe [PlatformFilter]
filters :: Maybe [PlatformFilter]
$sel:filters:ListPlatformVersions' :: ListPlatformVersions -> Maybe [PlatformFilter]
filters} -> Maybe [PlatformFilter]
filters) (\s :: ListPlatformVersions
s@ListPlatformVersions' {} Maybe [PlatformFilter]
a -> ListPlatformVersions
s {$sel:filters:ListPlatformVersions' :: Maybe [PlatformFilter]
filters = Maybe [PlatformFilter]
a} :: ListPlatformVersions) ((Maybe [PlatformFilter] -> f (Maybe [PlatformFilter]))
 -> ListPlatformVersions -> f ListPlatformVersions)
-> ((Maybe [PlatformFilter] -> f (Maybe [PlatformFilter]))
    -> Maybe [PlatformFilter] -> f (Maybe [PlatformFilter]))
-> (Maybe [PlatformFilter] -> f (Maybe [PlatformFilter]))
-> ListPlatformVersions
-> f ListPlatformVersions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlatformFilter] [PlatformFilter] [PlatformFilter] [PlatformFilter]
-> Iso
     (Maybe [PlatformFilter])
     (Maybe [PlatformFilter])
     (Maybe [PlatformFilter])
     (Maybe [PlatformFilter])
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
  [PlatformFilter] [PlatformFilter] [PlatformFilter] [PlatformFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.
listPlatformVersions_nextToken :: Lens.Lens' ListPlatformVersions (Prelude.Maybe Prelude.Text)
listPlatformVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPlatformVersions -> f ListPlatformVersions
listPlatformVersions_nextToken = (ListPlatformVersions -> Maybe Text)
-> (ListPlatformVersions -> Maybe Text -> ListPlatformVersions)
-> Lens
     ListPlatformVersions ListPlatformVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlatformVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlatformVersions' :: ListPlatformVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlatformVersions
s@ListPlatformVersions' {} Maybe Text
a -> ListPlatformVersions
s {$sel:nextToken:ListPlatformVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListPlatformVersions)

-- | The maximum number of platform version values returned in one call.
listPlatformVersions_maxRecords :: Lens.Lens' ListPlatformVersions (Prelude.Maybe Prelude.Natural)
listPlatformVersions_maxRecords :: (Maybe Natural -> f (Maybe Natural))
-> ListPlatformVersions -> f ListPlatformVersions
listPlatformVersions_maxRecords = (ListPlatformVersions -> Maybe Natural)
-> (ListPlatformVersions -> Maybe Natural -> ListPlatformVersions)
-> Lens
     ListPlatformVersions
     ListPlatformVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlatformVersions' {Maybe Natural
maxRecords :: Maybe Natural
$sel:maxRecords:ListPlatformVersions' :: ListPlatformVersions -> Maybe Natural
maxRecords} -> Maybe Natural
maxRecords) (\s :: ListPlatformVersions
s@ListPlatformVersions' {} Maybe Natural
a -> ListPlatformVersions
s {$sel:maxRecords:ListPlatformVersions' :: Maybe Natural
maxRecords = Maybe Natural
a} :: ListPlatformVersions)

instance Core.AWSPager ListPlatformVersions where
  page :: ListPlatformVersions
-> AWSResponse ListPlatformVersions -> Maybe ListPlatformVersions
page ListPlatformVersions
rq AWSResponse ListPlatformVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPlatformVersions
ListPlatformVersionsResponse
rs
            ListPlatformVersionsResponse
-> Getting (First Text) ListPlatformVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlatformVersionsResponse
-> Const (First Text) ListPlatformVersionsResponse
Lens' ListPlatformVersionsResponse (Maybe Text)
listPlatformVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlatformVersionsResponse
 -> Const (First Text) ListPlatformVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlatformVersionsResponse 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 ListPlatformVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [PlatformSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPlatformVersions
ListPlatformVersionsResponse
rs
            ListPlatformVersionsResponse
-> Getting
     (First [PlatformSummary])
     ListPlatformVersionsResponse
     [PlatformSummary]
-> Maybe [PlatformSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PlatformSummary]
 -> Const (First [PlatformSummary]) (Maybe [PlatformSummary]))
-> ListPlatformVersionsResponse
-> Const (First [PlatformSummary]) ListPlatformVersionsResponse
Lens' ListPlatformVersionsResponse (Maybe [PlatformSummary])
listPlatformVersionsResponse_platformSummaryList
              ((Maybe [PlatformSummary]
  -> Const (First [PlatformSummary]) (Maybe [PlatformSummary]))
 -> ListPlatformVersionsResponse
 -> Const (First [PlatformSummary]) ListPlatformVersionsResponse)
-> (([PlatformSummary]
     -> Const (First [PlatformSummary]) [PlatformSummary])
    -> Maybe [PlatformSummary]
    -> Const (First [PlatformSummary]) (Maybe [PlatformSummary]))
-> Getting
     (First [PlatformSummary])
     ListPlatformVersionsResponse
     [PlatformSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PlatformSummary]
 -> Const (First [PlatformSummary]) [PlatformSummary])
-> Maybe [PlatformSummary]
-> Const (First [PlatformSummary]) (Maybe [PlatformSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListPlatformVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPlatformVersions -> Maybe ListPlatformVersions
forall a. a -> Maybe a
Prelude.Just (ListPlatformVersions -> Maybe ListPlatformVersions)
-> ListPlatformVersions -> Maybe ListPlatformVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPlatformVersions
rq
          ListPlatformVersions
-> (ListPlatformVersions -> ListPlatformVersions)
-> ListPlatformVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPlatformVersions -> Identity ListPlatformVersions
Lens
  ListPlatformVersions ListPlatformVersions (Maybe Text) (Maybe Text)
listPlatformVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPlatformVersions -> Identity ListPlatformVersions)
-> Maybe Text -> ListPlatformVersions -> ListPlatformVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPlatformVersions
ListPlatformVersionsResponse
rs
          ListPlatformVersionsResponse
-> Getting (First Text) ListPlatformVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlatformVersionsResponse
-> Const (First Text) ListPlatformVersionsResponse
Lens' ListPlatformVersionsResponse (Maybe Text)
listPlatformVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlatformVersionsResponse
 -> Const (First Text) ListPlatformVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlatformVersionsResponse 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 ListPlatformVersions where
  type
    AWSResponse ListPlatformVersions =
      ListPlatformVersionsResponse
  request :: ListPlatformVersions -> Request ListPlatformVersions
request = Service -> ListPlatformVersions -> Request ListPlatformVersions
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPlatformVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlatformVersions)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListPlatformVersions))
-> Logger
-> Service
-> Proxy ListPlatformVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlatformVersions)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListPlatformVersionsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [PlatformSummary] -> Int -> ListPlatformVersionsResponse
ListPlatformVersionsResponse'
            (Maybe Text
 -> Maybe [PlatformSummary] -> Int -> ListPlatformVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [PlatformSummary] -> Int -> ListPlatformVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either
  String
  (Maybe [PlatformSummary] -> Int -> ListPlatformVersionsResponse)
-> Either String (Maybe [PlatformSummary])
-> Either String (Int -> ListPlatformVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PlatformSummaryList"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [PlatformSummary]))
-> Either String (Maybe [PlatformSummary])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PlatformSummary])
-> [Node] -> Either String (Maybe [PlatformSummary])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [PlatformSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> ListPlatformVersionsResponse)
-> Either String Int -> Either String ListPlatformVersionsResponse
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 ListPlatformVersions

instance Prelude.NFData ListPlatformVersions

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

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

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

-- | /See:/ 'newListPlatformVersionsResponse' smart constructor.
data ListPlatformVersionsResponse = ListPlatformVersionsResponse'
  { -- | In a paginated request, if this value isn\'t @null@, it\'s the token
    -- that you can pass in a subsequent request to get the next response page.
    ListPlatformVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Summary information about the platform versions.
    ListPlatformVersionsResponse -> Maybe [PlatformSummary]
platformSummaryList :: Prelude.Maybe [PlatformSummary],
    -- | The response's http status code.
    ListPlatformVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPlatformVersionsResponse
-> ListPlatformVersionsResponse -> Bool
(ListPlatformVersionsResponse
 -> ListPlatformVersionsResponse -> Bool)
-> (ListPlatformVersionsResponse
    -> ListPlatformVersionsResponse -> Bool)
-> Eq ListPlatformVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPlatformVersionsResponse
-> ListPlatformVersionsResponse -> Bool
$c/= :: ListPlatformVersionsResponse
-> ListPlatformVersionsResponse -> Bool
== :: ListPlatformVersionsResponse
-> ListPlatformVersionsResponse -> Bool
$c== :: ListPlatformVersionsResponse
-> ListPlatformVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListPlatformVersionsResponse]
ReadPrec ListPlatformVersionsResponse
Int -> ReadS ListPlatformVersionsResponse
ReadS [ListPlatformVersionsResponse]
(Int -> ReadS ListPlatformVersionsResponse)
-> ReadS [ListPlatformVersionsResponse]
-> ReadPrec ListPlatformVersionsResponse
-> ReadPrec [ListPlatformVersionsResponse]
-> Read ListPlatformVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPlatformVersionsResponse]
$creadListPrec :: ReadPrec [ListPlatformVersionsResponse]
readPrec :: ReadPrec ListPlatformVersionsResponse
$creadPrec :: ReadPrec ListPlatformVersionsResponse
readList :: ReadS [ListPlatformVersionsResponse]
$creadList :: ReadS [ListPlatformVersionsResponse]
readsPrec :: Int -> ReadS ListPlatformVersionsResponse
$creadsPrec :: Int -> ReadS ListPlatformVersionsResponse
Prelude.Read, Int -> ListPlatformVersionsResponse -> ShowS
[ListPlatformVersionsResponse] -> ShowS
ListPlatformVersionsResponse -> String
(Int -> ListPlatformVersionsResponse -> ShowS)
-> (ListPlatformVersionsResponse -> String)
-> ([ListPlatformVersionsResponse] -> ShowS)
-> Show ListPlatformVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPlatformVersionsResponse] -> ShowS
$cshowList :: [ListPlatformVersionsResponse] -> ShowS
show :: ListPlatformVersionsResponse -> String
$cshow :: ListPlatformVersionsResponse -> String
showsPrec :: Int -> ListPlatformVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListPlatformVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListPlatformVersionsResponse -> Rep ListPlatformVersionsResponse x)
-> (forall x.
    Rep ListPlatformVersionsResponse x -> ListPlatformVersionsResponse)
-> Generic ListPlatformVersionsResponse
forall x.
Rep ListPlatformVersionsResponse x -> ListPlatformVersionsResponse
forall x.
ListPlatformVersionsResponse -> Rep ListPlatformVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPlatformVersionsResponse x -> ListPlatformVersionsResponse
$cfrom :: forall x.
ListPlatformVersionsResponse -> Rep ListPlatformVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPlatformVersionsResponse' 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', 'listPlatformVersionsResponse_nextToken' - In a paginated request, if this value isn\'t @null@, it\'s the token
-- that you can pass in a subsequent request to get the next response page.
--
-- 'platformSummaryList', 'listPlatformVersionsResponse_platformSummaryList' - Summary information about the platform versions.
--
-- 'httpStatus', 'listPlatformVersionsResponse_httpStatus' - The response's http status code.
newListPlatformVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPlatformVersionsResponse
newListPlatformVersionsResponse :: Int -> ListPlatformVersionsResponse
newListPlatformVersionsResponse Int
pHttpStatus_ =
  ListPlatformVersionsResponse' :: Maybe Text
-> Maybe [PlatformSummary] -> Int -> ListPlatformVersionsResponse
ListPlatformVersionsResponse'
    { $sel:nextToken:ListPlatformVersionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:platformSummaryList:ListPlatformVersionsResponse' :: Maybe [PlatformSummary]
platformSummaryList = Maybe [PlatformSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPlatformVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | In a paginated request, if this value isn\'t @null@, it\'s the token
-- that you can pass in a subsequent request to get the next response page.
listPlatformVersionsResponse_nextToken :: Lens.Lens' ListPlatformVersionsResponse (Prelude.Maybe Prelude.Text)
listPlatformVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPlatformVersionsResponse -> f ListPlatformVersionsResponse
listPlatformVersionsResponse_nextToken = (ListPlatformVersionsResponse -> Maybe Text)
-> (ListPlatformVersionsResponse
    -> Maybe Text -> ListPlatformVersionsResponse)
-> Lens' ListPlatformVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlatformVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlatformVersionsResponse' :: ListPlatformVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlatformVersionsResponse
s@ListPlatformVersionsResponse' {} Maybe Text
a -> ListPlatformVersionsResponse
s {$sel:nextToken:ListPlatformVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPlatformVersionsResponse)

-- | Summary information about the platform versions.
listPlatformVersionsResponse_platformSummaryList :: Lens.Lens' ListPlatformVersionsResponse (Prelude.Maybe [PlatformSummary])
listPlatformVersionsResponse_platformSummaryList :: (Maybe [PlatformSummary] -> f (Maybe [PlatformSummary]))
-> ListPlatformVersionsResponse -> f ListPlatformVersionsResponse
listPlatformVersionsResponse_platformSummaryList = (ListPlatformVersionsResponse -> Maybe [PlatformSummary])
-> (ListPlatformVersionsResponse
    -> Maybe [PlatformSummary] -> ListPlatformVersionsResponse)
-> Lens' ListPlatformVersionsResponse (Maybe [PlatformSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlatformVersionsResponse' {Maybe [PlatformSummary]
platformSummaryList :: Maybe [PlatformSummary]
$sel:platformSummaryList:ListPlatformVersionsResponse' :: ListPlatformVersionsResponse -> Maybe [PlatformSummary]
platformSummaryList} -> Maybe [PlatformSummary]
platformSummaryList) (\s :: ListPlatformVersionsResponse
s@ListPlatformVersionsResponse' {} Maybe [PlatformSummary]
a -> ListPlatformVersionsResponse
s {$sel:platformSummaryList:ListPlatformVersionsResponse' :: Maybe [PlatformSummary]
platformSummaryList = Maybe [PlatformSummary]
a} :: ListPlatformVersionsResponse) ((Maybe [PlatformSummary] -> f (Maybe [PlatformSummary]))
 -> ListPlatformVersionsResponse -> f ListPlatformVersionsResponse)
-> ((Maybe [PlatformSummary] -> f (Maybe [PlatformSummary]))
    -> Maybe [PlatformSummary] -> f (Maybe [PlatformSummary]))
-> (Maybe [PlatformSummary] -> f (Maybe [PlatformSummary]))
-> ListPlatformVersionsResponse
-> f ListPlatformVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlatformSummary]
  [PlatformSummary]
  [PlatformSummary]
  [PlatformSummary]
-> Iso
     (Maybe [PlatformSummary])
     (Maybe [PlatformSummary])
     (Maybe [PlatformSummary])
     (Maybe [PlatformSummary])
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
  [PlatformSummary]
  [PlatformSummary]
  [PlatformSummary]
  [PlatformSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListPlatformVersionsResponse