{-# 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.ResilienceHub.ListAppVersions
(
ListAppVersions (..),
newListAppVersions,
listAppVersions_maxResults,
listAppVersions_nextToken,
listAppVersions_appArn,
ListAppVersionsResponse (..),
newListAppVersionsResponse,
listAppVersionsResponse_nextToken,
listAppVersionsResponse_httpStatus,
listAppVersionsResponse_appVersions,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import Amazonka.ResilienceHub.Types
import qualified Amazonka.Response as Response
data ListAppVersions = ListAppVersions'
{
ListAppVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAppVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAppVersions -> Text
appArn :: Prelude.Text
}
deriving (ListAppVersions -> ListAppVersions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppVersions -> ListAppVersions -> Bool
$c/= :: ListAppVersions -> ListAppVersions -> Bool
== :: ListAppVersions -> ListAppVersions -> Bool
$c== :: ListAppVersions -> ListAppVersions -> Bool
Prelude.Eq, ReadPrec [ListAppVersions]
ReadPrec ListAppVersions
Int -> ReadS ListAppVersions
ReadS [ListAppVersions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppVersions]
$creadListPrec :: ReadPrec [ListAppVersions]
readPrec :: ReadPrec ListAppVersions
$creadPrec :: ReadPrec ListAppVersions
readList :: ReadS [ListAppVersions]
$creadList :: ReadS [ListAppVersions]
readsPrec :: Int -> ReadS ListAppVersions
$creadsPrec :: Int -> ReadS ListAppVersions
Prelude.Read, Int -> ListAppVersions -> ShowS
[ListAppVersions] -> ShowS
ListAppVersions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppVersions] -> ShowS
$cshowList :: [ListAppVersions] -> ShowS
show :: ListAppVersions -> String
$cshow :: ListAppVersions -> String
showsPrec :: Int -> ListAppVersions -> ShowS
$cshowsPrec :: Int -> ListAppVersions -> ShowS
Prelude.Show, forall x. Rep ListAppVersions x -> ListAppVersions
forall x. ListAppVersions -> Rep ListAppVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAppVersions x -> ListAppVersions
$cfrom :: forall x. ListAppVersions -> Rep ListAppVersions x
Prelude.Generic)
newListAppVersions ::
Prelude.Text ->
ListAppVersions
newListAppVersions :: Text -> ListAppVersions
newListAppVersions Text
pAppArn_ =
ListAppVersions'
{ $sel:maxResults:ListAppVersions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAppVersions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:appArn:ListAppVersions' :: Text
appArn = Text
pAppArn_
}
listAppVersions_maxResults :: Lens.Lens' ListAppVersions (Prelude.Maybe Prelude.Natural)
listAppVersions_maxResults :: Lens' ListAppVersions (Maybe Natural)
listAppVersions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAppVersions' :: ListAppVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAppVersions
s@ListAppVersions' {} Maybe Natural
a -> ListAppVersions
s {$sel:maxResults:ListAppVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAppVersions)
listAppVersions_nextToken :: Lens.Lens' ListAppVersions (Prelude.Maybe Prelude.Text)
listAppVersions_nextToken :: Lens' ListAppVersions (Maybe Text)
listAppVersions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppVersions' :: ListAppVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppVersions
s@ListAppVersions' {} Maybe Text
a -> ListAppVersions
s {$sel:nextToken:ListAppVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppVersions)
listAppVersions_appArn :: Lens.Lens' ListAppVersions Prelude.Text
listAppVersions_appArn :: Lens' ListAppVersions Text
listAppVersions_appArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppVersions' {Text
appArn :: Text
$sel:appArn:ListAppVersions' :: ListAppVersions -> Text
appArn} -> Text
appArn) (\s :: ListAppVersions
s@ListAppVersions' {} Text
a -> ListAppVersions
s {$sel:appArn:ListAppVersions' :: Text
appArn = Text
a} :: ListAppVersions)
instance Core.AWSRequest ListAppVersions where
type
AWSResponse ListAppVersions =
ListAppVersionsResponse
request :: (Service -> Service) -> ListAppVersions -> Request ListAppVersions
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAppVersions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAppVersions)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> [AppVersionSummary] -> ListAppVersionsResponse
ListAppVersionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"appVersions" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListAppVersions where
hashWithSalt :: Int -> ListAppVersions -> Int
hashWithSalt Int
_salt ListAppVersions' {Maybe Natural
Maybe Text
Text
appArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:appArn:ListAppVersions' :: ListAppVersions -> Text
$sel:nextToken:ListAppVersions' :: ListAppVersions -> Maybe Text
$sel:maxResults:ListAppVersions' :: ListAppVersions -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appArn
instance Prelude.NFData ListAppVersions where
rnf :: ListAppVersions -> ()
rnf ListAppVersions' {Maybe Natural
Maybe Text
Text
appArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:appArn:ListAppVersions' :: ListAppVersions -> Text
$sel:nextToken:ListAppVersions' :: ListAppVersions -> Maybe Text
$sel:maxResults:ListAppVersions' :: ListAppVersions -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
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 Text
appArn
instance Data.ToHeaders ListAppVersions where
toHeaders :: ListAppVersions -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListAppVersions where
toJSON :: ListAppVersions -> Value
toJSON ListAppVersions' {Maybe Natural
Maybe Text
Text
appArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:appArn:ListAppVersions' :: ListAppVersions -> Text
$sel:nextToken:ListAppVersions' :: ListAppVersions -> Maybe Text
$sel:maxResults:ListAppVersions' :: ListAppVersions -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
forall a. a -> Maybe a
Prelude.Just (Key
"appArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
appArn)
]
)
instance Data.ToPath ListAppVersions where
toPath :: ListAppVersions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/list-app-versions"
instance Data.ToQuery ListAppVersions where
toQuery :: ListAppVersions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListAppVersionsResponse = ListAppVersionsResponse'
{
ListAppVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAppVersionsResponse -> Int
httpStatus :: Prelude.Int,
ListAppVersionsResponse -> [AppVersionSummary]
appVersions :: [AppVersionSummary]
}
deriving (ListAppVersionsResponse -> ListAppVersionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppVersionsResponse -> ListAppVersionsResponse -> Bool
$c/= :: ListAppVersionsResponse -> ListAppVersionsResponse -> Bool
== :: ListAppVersionsResponse -> ListAppVersionsResponse -> Bool
$c== :: ListAppVersionsResponse -> ListAppVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListAppVersionsResponse]
ReadPrec ListAppVersionsResponse
Int -> ReadS ListAppVersionsResponse
ReadS [ListAppVersionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppVersionsResponse]
$creadListPrec :: ReadPrec [ListAppVersionsResponse]
readPrec :: ReadPrec ListAppVersionsResponse
$creadPrec :: ReadPrec ListAppVersionsResponse
readList :: ReadS [ListAppVersionsResponse]
$creadList :: ReadS [ListAppVersionsResponse]
readsPrec :: Int -> ReadS ListAppVersionsResponse
$creadsPrec :: Int -> ReadS ListAppVersionsResponse
Prelude.Read, Int -> ListAppVersionsResponse -> ShowS
[ListAppVersionsResponse] -> ShowS
ListAppVersionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppVersionsResponse] -> ShowS
$cshowList :: [ListAppVersionsResponse] -> ShowS
show :: ListAppVersionsResponse -> String
$cshow :: ListAppVersionsResponse -> String
showsPrec :: Int -> ListAppVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListAppVersionsResponse -> ShowS
Prelude.Show, forall x. Rep ListAppVersionsResponse x -> ListAppVersionsResponse
forall x. ListAppVersionsResponse -> Rep ListAppVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAppVersionsResponse x -> ListAppVersionsResponse
$cfrom :: forall x. ListAppVersionsResponse -> Rep ListAppVersionsResponse x
Prelude.Generic)
newListAppVersionsResponse ::
Prelude.Int ->
ListAppVersionsResponse
newListAppVersionsResponse :: Int -> ListAppVersionsResponse
newListAppVersionsResponse Int
pHttpStatus_ =
ListAppVersionsResponse'
{ $sel:nextToken:ListAppVersionsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAppVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:appVersions:ListAppVersionsResponse' :: [AppVersionSummary]
appVersions = forall a. Monoid a => a
Prelude.mempty
}
listAppVersionsResponse_nextToken :: Lens.Lens' ListAppVersionsResponse (Prelude.Maybe Prelude.Text)
listAppVersionsResponse_nextToken :: Lens' ListAppVersionsResponse (Maybe Text)
listAppVersionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppVersionsResponse' :: ListAppVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppVersionsResponse
s@ListAppVersionsResponse' {} Maybe Text
a -> ListAppVersionsResponse
s {$sel:nextToken:ListAppVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppVersionsResponse)
listAppVersionsResponse_httpStatus :: Lens.Lens' ListAppVersionsResponse Prelude.Int
listAppVersionsResponse_httpStatus :: Lens' ListAppVersionsResponse Int
listAppVersionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAppVersionsResponse' :: ListAppVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAppVersionsResponse
s@ListAppVersionsResponse' {} Int
a -> ListAppVersionsResponse
s {$sel:httpStatus:ListAppVersionsResponse' :: Int
httpStatus = Int
a} :: ListAppVersionsResponse)
listAppVersionsResponse_appVersions :: Lens.Lens' ListAppVersionsResponse [AppVersionSummary]
listAppVersionsResponse_appVersions :: Lens' ListAppVersionsResponse [AppVersionSummary]
listAppVersionsResponse_appVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppVersionsResponse' {[AppVersionSummary]
appVersions :: [AppVersionSummary]
$sel:appVersions:ListAppVersionsResponse' :: ListAppVersionsResponse -> [AppVersionSummary]
appVersions} -> [AppVersionSummary]
appVersions) (\s :: ListAppVersionsResponse
s@ListAppVersionsResponse' {} [AppVersionSummary]
a -> ListAppVersionsResponse
s {$sel:appVersions:ListAppVersionsResponse' :: [AppVersionSummary]
appVersions = [AppVersionSummary]
a} :: ListAppVersionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListAppVersionsResponse where
rnf :: ListAppVersionsResponse -> ()
rnf ListAppVersionsResponse' {Int
[AppVersionSummary]
Maybe Text
appVersions :: [AppVersionSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:appVersions:ListAppVersionsResponse' :: ListAppVersionsResponse -> [AppVersionSummary]
$sel:httpStatus:ListAppVersionsResponse' :: ListAppVersionsResponse -> Int
$sel:nextToken:ListAppVersionsResponse' :: ListAppVersionsResponse -> 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 Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [AppVersionSummary]
appVersions