{-# 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.ListTestRecommendations
(
ListTestRecommendations (..),
newListTestRecommendations,
listTestRecommendations_maxResults,
listTestRecommendations_nextToken,
listTestRecommendations_assessmentArn,
ListTestRecommendationsResponse (..),
newListTestRecommendationsResponse,
listTestRecommendationsResponse_nextToken,
listTestRecommendationsResponse_httpStatus,
listTestRecommendationsResponse_testRecommendations,
)
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 ListTestRecommendations = ListTestRecommendations'
{
ListTestRecommendations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListTestRecommendations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTestRecommendations -> Text
assessmentArn :: Prelude.Text
}
deriving (ListTestRecommendations -> ListTestRecommendations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTestRecommendations -> ListTestRecommendations -> Bool
$c/= :: ListTestRecommendations -> ListTestRecommendations -> Bool
== :: ListTestRecommendations -> ListTestRecommendations -> Bool
$c== :: ListTestRecommendations -> ListTestRecommendations -> Bool
Prelude.Eq, ReadPrec [ListTestRecommendations]
ReadPrec ListTestRecommendations
Int -> ReadS ListTestRecommendations
ReadS [ListTestRecommendations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTestRecommendations]
$creadListPrec :: ReadPrec [ListTestRecommendations]
readPrec :: ReadPrec ListTestRecommendations
$creadPrec :: ReadPrec ListTestRecommendations
readList :: ReadS [ListTestRecommendations]
$creadList :: ReadS [ListTestRecommendations]
readsPrec :: Int -> ReadS ListTestRecommendations
$creadsPrec :: Int -> ReadS ListTestRecommendations
Prelude.Read, Int -> ListTestRecommendations -> ShowS
[ListTestRecommendations] -> ShowS
ListTestRecommendations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTestRecommendations] -> ShowS
$cshowList :: [ListTestRecommendations] -> ShowS
show :: ListTestRecommendations -> String
$cshow :: ListTestRecommendations -> String
showsPrec :: Int -> ListTestRecommendations -> ShowS
$cshowsPrec :: Int -> ListTestRecommendations -> ShowS
Prelude.Show, forall x. Rep ListTestRecommendations x -> ListTestRecommendations
forall x. ListTestRecommendations -> Rep ListTestRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTestRecommendations x -> ListTestRecommendations
$cfrom :: forall x. ListTestRecommendations -> Rep ListTestRecommendations x
Prelude.Generic)
newListTestRecommendations ::
Prelude.Text ->
ListTestRecommendations
newListTestRecommendations :: Text -> ListTestRecommendations
newListTestRecommendations Text
pAssessmentArn_ =
ListTestRecommendations'
{ $sel:maxResults:ListTestRecommendations' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListTestRecommendations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:assessmentArn:ListTestRecommendations' :: Text
assessmentArn = Text
pAssessmentArn_
}
listTestRecommendations_maxResults :: Lens.Lens' ListTestRecommendations (Prelude.Maybe Prelude.Natural)
listTestRecommendations_maxResults :: Lens' ListTestRecommendations (Maybe Natural)
listTestRecommendations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestRecommendations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTestRecommendations' :: ListTestRecommendations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTestRecommendations
s@ListTestRecommendations' {} Maybe Natural
a -> ListTestRecommendations
s {$sel:maxResults:ListTestRecommendations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTestRecommendations)
listTestRecommendations_nextToken :: Lens.Lens' ListTestRecommendations (Prelude.Maybe Prelude.Text)
listTestRecommendations_nextToken :: Lens' ListTestRecommendations (Maybe Text)
listTestRecommendations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestRecommendations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTestRecommendations' :: ListTestRecommendations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTestRecommendations
s@ListTestRecommendations' {} Maybe Text
a -> ListTestRecommendations
s {$sel:nextToken:ListTestRecommendations' :: Maybe Text
nextToken = Maybe Text
a} :: ListTestRecommendations)
listTestRecommendations_assessmentArn :: Lens.Lens' ListTestRecommendations Prelude.Text
listTestRecommendations_assessmentArn :: Lens' ListTestRecommendations Text
listTestRecommendations_assessmentArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestRecommendations' {Text
assessmentArn :: Text
$sel:assessmentArn:ListTestRecommendations' :: ListTestRecommendations -> Text
assessmentArn} -> Text
assessmentArn) (\s :: ListTestRecommendations
s@ListTestRecommendations' {} Text
a -> ListTestRecommendations
s {$sel:assessmentArn:ListTestRecommendations' :: Text
assessmentArn = Text
a} :: ListTestRecommendations)
instance Core.AWSRequest ListTestRecommendations where
type
AWSResponse ListTestRecommendations =
ListTestRecommendationsResponse
request :: (Service -> Service)
-> ListTestRecommendations -> Request ListTestRecommendations
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 ListTestRecommendations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTestRecommendations)))
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 -> [TestRecommendation] -> ListTestRecommendationsResponse
ListTestRecommendationsResponse'
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
"testRecommendations"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListTestRecommendations where
hashWithSalt :: Int -> ListTestRecommendations -> Int
hashWithSalt Int
_salt ListTestRecommendations' {Maybe Natural
Maybe Text
Text
assessmentArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:assessmentArn:ListTestRecommendations' :: ListTestRecommendations -> Text
$sel:nextToken:ListTestRecommendations' :: ListTestRecommendations -> Maybe Text
$sel:maxResults:ListTestRecommendations' :: ListTestRecommendations -> 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
assessmentArn
instance Prelude.NFData ListTestRecommendations where
rnf :: ListTestRecommendations -> ()
rnf ListTestRecommendations' {Maybe Natural
Maybe Text
Text
assessmentArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:assessmentArn:ListTestRecommendations' :: ListTestRecommendations -> Text
$sel:nextToken:ListTestRecommendations' :: ListTestRecommendations -> Maybe Text
$sel:maxResults:ListTestRecommendations' :: ListTestRecommendations -> 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
assessmentArn
instance Data.ToHeaders ListTestRecommendations where
toHeaders :: ListTestRecommendations -> 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 ListTestRecommendations where
toJSON :: ListTestRecommendations -> Value
toJSON ListTestRecommendations' {Maybe Natural
Maybe Text
Text
assessmentArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:assessmentArn:ListTestRecommendations' :: ListTestRecommendations -> Text
$sel:nextToken:ListTestRecommendations' :: ListTestRecommendations -> Maybe Text
$sel:maxResults:ListTestRecommendations' :: ListTestRecommendations -> 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
"assessmentArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
assessmentArn)
]
)
instance Data.ToPath ListTestRecommendations where
toPath :: ListTestRecommendations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/list-test-recommendations"
instance Data.ToQuery ListTestRecommendations where
toQuery :: ListTestRecommendations -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListTestRecommendationsResponse = ListTestRecommendationsResponse'
{
ListTestRecommendationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTestRecommendationsResponse -> Int
httpStatus :: Prelude.Int,
ListTestRecommendationsResponse -> [TestRecommendation]
testRecommendations :: [TestRecommendation]
}
deriving (ListTestRecommendationsResponse
-> ListTestRecommendationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTestRecommendationsResponse
-> ListTestRecommendationsResponse -> Bool
$c/= :: ListTestRecommendationsResponse
-> ListTestRecommendationsResponse -> Bool
== :: ListTestRecommendationsResponse
-> ListTestRecommendationsResponse -> Bool
$c== :: ListTestRecommendationsResponse
-> ListTestRecommendationsResponse -> Bool
Prelude.Eq, ReadPrec [ListTestRecommendationsResponse]
ReadPrec ListTestRecommendationsResponse
Int -> ReadS ListTestRecommendationsResponse
ReadS [ListTestRecommendationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTestRecommendationsResponse]
$creadListPrec :: ReadPrec [ListTestRecommendationsResponse]
readPrec :: ReadPrec ListTestRecommendationsResponse
$creadPrec :: ReadPrec ListTestRecommendationsResponse
readList :: ReadS [ListTestRecommendationsResponse]
$creadList :: ReadS [ListTestRecommendationsResponse]
readsPrec :: Int -> ReadS ListTestRecommendationsResponse
$creadsPrec :: Int -> ReadS ListTestRecommendationsResponse
Prelude.Read, Int -> ListTestRecommendationsResponse -> ShowS
[ListTestRecommendationsResponse] -> ShowS
ListTestRecommendationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTestRecommendationsResponse] -> ShowS
$cshowList :: [ListTestRecommendationsResponse] -> ShowS
show :: ListTestRecommendationsResponse -> String
$cshow :: ListTestRecommendationsResponse -> String
showsPrec :: Int -> ListTestRecommendationsResponse -> ShowS
$cshowsPrec :: Int -> ListTestRecommendationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListTestRecommendationsResponse x
-> ListTestRecommendationsResponse
forall x.
ListTestRecommendationsResponse
-> Rep ListTestRecommendationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTestRecommendationsResponse x
-> ListTestRecommendationsResponse
$cfrom :: forall x.
ListTestRecommendationsResponse
-> Rep ListTestRecommendationsResponse x
Prelude.Generic)
newListTestRecommendationsResponse ::
Prelude.Int ->
ListTestRecommendationsResponse
newListTestRecommendationsResponse :: Int -> ListTestRecommendationsResponse
newListTestRecommendationsResponse Int
pHttpStatus_ =
ListTestRecommendationsResponse'
{ $sel:nextToken:ListTestRecommendationsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTestRecommendationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:testRecommendations:ListTestRecommendationsResponse' :: [TestRecommendation]
testRecommendations = forall a. Monoid a => a
Prelude.mempty
}
listTestRecommendationsResponse_nextToken :: Lens.Lens' ListTestRecommendationsResponse (Prelude.Maybe Prelude.Text)
listTestRecommendationsResponse_nextToken :: Lens' ListTestRecommendationsResponse (Maybe Text)
listTestRecommendationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestRecommendationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTestRecommendationsResponse' :: ListTestRecommendationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTestRecommendationsResponse
s@ListTestRecommendationsResponse' {} Maybe Text
a -> ListTestRecommendationsResponse
s {$sel:nextToken:ListTestRecommendationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTestRecommendationsResponse)
listTestRecommendationsResponse_httpStatus :: Lens.Lens' ListTestRecommendationsResponse Prelude.Int
listTestRecommendationsResponse_httpStatus :: Lens' ListTestRecommendationsResponse Int
listTestRecommendationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestRecommendationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTestRecommendationsResponse' :: ListTestRecommendationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTestRecommendationsResponse
s@ListTestRecommendationsResponse' {} Int
a -> ListTestRecommendationsResponse
s {$sel:httpStatus:ListTestRecommendationsResponse' :: Int
httpStatus = Int
a} :: ListTestRecommendationsResponse)
listTestRecommendationsResponse_testRecommendations :: Lens.Lens' ListTestRecommendationsResponse [TestRecommendation]
listTestRecommendationsResponse_testRecommendations :: Lens' ListTestRecommendationsResponse [TestRecommendation]
listTestRecommendationsResponse_testRecommendations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestRecommendationsResponse' {[TestRecommendation]
testRecommendations :: [TestRecommendation]
$sel:testRecommendations:ListTestRecommendationsResponse' :: ListTestRecommendationsResponse -> [TestRecommendation]
testRecommendations} -> [TestRecommendation]
testRecommendations) (\s :: ListTestRecommendationsResponse
s@ListTestRecommendationsResponse' {} [TestRecommendation]
a -> ListTestRecommendationsResponse
s {$sel:testRecommendations:ListTestRecommendationsResponse' :: [TestRecommendation]
testRecommendations = [TestRecommendation]
a} :: ListTestRecommendationsResponse) 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
ListTestRecommendationsResponse
where
rnf :: ListTestRecommendationsResponse -> ()
rnf ListTestRecommendationsResponse' {Int
[TestRecommendation]
Maybe Text
testRecommendations :: [TestRecommendation]
httpStatus :: Int
nextToken :: Maybe Text
$sel:testRecommendations:ListTestRecommendationsResponse' :: ListTestRecommendationsResponse -> [TestRecommendation]
$sel:httpStatus:ListTestRecommendationsResponse' :: ListTestRecommendationsResponse -> Int
$sel:nextToken:ListTestRecommendationsResponse' :: ListTestRecommendationsResponse -> 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 [TestRecommendation]
testRecommendations