{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ElasticBeanstalk.ListPlatformVersions
(
ListPlatformVersions (..),
newListPlatformVersions,
listPlatformVersions_filters,
listPlatformVersions_maxRecords,
listPlatformVersions_nextToken,
ListPlatformVersionsResponse (..),
newListPlatformVersionsResponse,
listPlatformVersionsResponse_nextToken,
listPlatformVersionsResponse_platformSummaryList,
listPlatformVersionsResponse_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
data ListPlatformVersions = ListPlatformVersions'
{
ListPlatformVersions -> Maybe [PlatformFilter]
filters :: Prelude.Maybe [PlatformFilter],
ListPlatformVersions -> Maybe Natural
maxRecords :: Prelude.Maybe Prelude.Natural,
ListPlatformVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListPlatformVersions -> ListPlatformVersions -> Bool
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]
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
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. 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)
newListPlatformVersions ::
ListPlatformVersions
newListPlatformVersions :: ListPlatformVersions
newListPlatformVersions =
ListPlatformVersions'
{ $sel:filters:ListPlatformVersions' :: Maybe [PlatformFilter]
filters = forall a. Maybe a
Prelude.Nothing,
$sel:maxRecords:ListPlatformVersions' :: Maybe Natural
maxRecords = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListPlatformVersions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listPlatformVersions_filters :: Lens.Lens' ListPlatformVersions (Prelude.Maybe [PlatformFilter])
listPlatformVersions_filters :: Lens' ListPlatformVersions (Maybe [PlatformFilter])
listPlatformVersions_filters = 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) 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
listPlatformVersions_maxRecords :: Lens.Lens' ListPlatformVersions (Prelude.Maybe Prelude.Natural)
listPlatformVersions_maxRecords :: Lens' ListPlatformVersions (Maybe Natural)
listPlatformVersions_maxRecords = 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)
listPlatformVersions_nextToken :: Lens.Lens' ListPlatformVersions (Prelude.Maybe Prelude.Text)
listPlatformVersions_nextToken :: Lens' ListPlatformVersions (Maybe Text)
listPlatformVersions_nextToken = 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)
instance Core.AWSPager ListPlatformVersions where
page :: ListPlatformVersions
-> AWSResponse ListPlatformVersions -> Maybe ListPlatformVersions
page ListPlatformVersions
rq AWSResponse ListPlatformVersions
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPlatformVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPlatformVersionsResponse (Maybe Text)
listPlatformVersionsResponse_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 ListPlatformVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPlatformVersionsResponse (Maybe [PlatformSummary])
listPlatformVersionsResponse_platformSummaryList
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.$ ListPlatformVersions
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListPlatformVersions (Maybe Text)
listPlatformVersions_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPlatformVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPlatformVersionsResponse (Maybe Text)
listPlatformVersionsResponse_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 ListPlatformVersions where
type
AWSResponse ListPlatformVersions =
ListPlatformVersionsResponse
request :: (Service -> Service)
-> ListPlatformVersions -> Request ListPlatformVersions
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 ListPlatformVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPlatformVersions)))
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
"ListPlatformVersionsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe [PlatformSummary] -> Int -> ListPlatformVersionsResponse
ListPlatformVersionsResponse'
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
"NextToken")
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
"PlatformSummaryList"
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListPlatformVersions where
hashWithSalt :: Int -> ListPlatformVersions -> Int
hashWithSalt Int
_salt ListPlatformVersions' {Maybe Natural
Maybe [PlatformFilter]
Maybe Text
nextToken :: Maybe Text
maxRecords :: Maybe Natural
filters :: Maybe [PlatformFilter]
$sel:nextToken:ListPlatformVersions' :: ListPlatformVersions -> Maybe Text
$sel:maxRecords:ListPlatformVersions' :: ListPlatformVersions -> Maybe Natural
$sel:filters:ListPlatformVersions' :: ListPlatformVersions -> Maybe [PlatformFilter]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PlatformFilter]
filters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxRecords
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListPlatformVersions where
rnf :: ListPlatformVersions -> ()
rnf ListPlatformVersions' {Maybe Natural
Maybe [PlatformFilter]
Maybe Text
nextToken :: Maybe Text
maxRecords :: Maybe Natural
filters :: Maybe [PlatformFilter]
$sel:nextToken:ListPlatformVersions' :: ListPlatformVersions -> Maybe Text
$sel:maxRecords:ListPlatformVersions' :: ListPlatformVersions -> Maybe Natural
$sel:filters:ListPlatformVersions' :: ListPlatformVersions -> Maybe [PlatformFilter]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [PlatformFilter]
filters
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
instance Data.ToHeaders ListPlatformVersions where
toHeaders :: ListPlatformVersions -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListPlatformVersions where
toPath :: ListPlatformVersions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListPlatformVersions where
toQuery :: ListPlatformVersions -> QueryString
toQuery ListPlatformVersions' {Maybe Natural
Maybe [PlatformFilter]
Maybe Text
nextToken :: Maybe Text
maxRecords :: Maybe Natural
filters :: Maybe [PlatformFilter]
$sel:nextToken:ListPlatformVersions' :: ListPlatformVersions -> Maybe Text
$sel:maxRecords:ListPlatformVersions' :: ListPlatformVersions -> Maybe Natural
$sel:filters:ListPlatformVersions' :: ListPlatformVersions -> Maybe [PlatformFilter]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListPlatformVersions" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"Filters"
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 [PlatformFilter]
filters),
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
]
data ListPlatformVersionsResponse = ListPlatformVersionsResponse'
{
ListPlatformVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPlatformVersionsResponse -> Maybe [PlatformSummary]
platformSummaryList :: Prelude.Maybe [PlatformSummary],
ListPlatformVersionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListPlatformVersionsResponse
-> ListPlatformVersionsResponse -> Bool
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]
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
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.
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)
newListPlatformVersionsResponse ::
Prelude.Int ->
ListPlatformVersionsResponse
newListPlatformVersionsResponse :: Int -> ListPlatformVersionsResponse
newListPlatformVersionsResponse Int
pHttpStatus_ =
ListPlatformVersionsResponse'
{ $sel:nextToken:ListPlatformVersionsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:platformSummaryList:ListPlatformVersionsResponse' :: Maybe [PlatformSummary]
platformSummaryList = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPlatformVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listPlatformVersionsResponse_nextToken :: Lens.Lens' ListPlatformVersionsResponse (Prelude.Maybe Prelude.Text)
listPlatformVersionsResponse_nextToken :: Lens' ListPlatformVersionsResponse (Maybe Text)
listPlatformVersionsResponse_nextToken = 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)
listPlatformVersionsResponse_platformSummaryList :: Lens.Lens' ListPlatformVersionsResponse (Prelude.Maybe [PlatformSummary])
listPlatformVersionsResponse_platformSummaryList :: Lens' ListPlatformVersionsResponse (Maybe [PlatformSummary])
listPlatformVersionsResponse_platformSummaryList = 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) 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
listPlatformVersionsResponse_httpStatus :: Lens.Lens' ListPlatformVersionsResponse Prelude.Int
listPlatformVersionsResponse_httpStatus :: Lens' ListPlatformVersionsResponse Int
listPlatformVersionsResponse_httpStatus = 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 where
rnf :: ListPlatformVersionsResponse -> ()
rnf ListPlatformVersionsResponse' {Int
Maybe [PlatformSummary]
Maybe Text
httpStatus :: Int
platformSummaryList :: Maybe [PlatformSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListPlatformVersionsResponse' :: ListPlatformVersionsResponse -> Int
$sel:platformSummaryList:ListPlatformVersionsResponse' :: ListPlatformVersionsResponse -> Maybe [PlatformSummary]
$sel:nextToken:ListPlatformVersionsResponse' :: ListPlatformVersionsResponse -> Maybe Text
..} =
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 [PlatformSummary]
platformSummaryList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus