{-# 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.ListAppComponentRecommendations
(
ListAppComponentRecommendations (..),
newListAppComponentRecommendations,
listAppComponentRecommendations_maxResults,
listAppComponentRecommendations_nextToken,
listAppComponentRecommendations_assessmentArn,
ListAppComponentRecommendationsResponse (..),
newListAppComponentRecommendationsResponse,
listAppComponentRecommendationsResponse_nextToken,
listAppComponentRecommendationsResponse_httpStatus,
listAppComponentRecommendationsResponse_componentRecommendations,
)
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 ListAppComponentRecommendations = ListAppComponentRecommendations'
{
ListAppComponentRecommendations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAppComponentRecommendations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAppComponentRecommendations -> Text
assessmentArn :: Prelude.Text
}
deriving (ListAppComponentRecommendations
-> ListAppComponentRecommendations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppComponentRecommendations
-> ListAppComponentRecommendations -> Bool
$c/= :: ListAppComponentRecommendations
-> ListAppComponentRecommendations -> Bool
== :: ListAppComponentRecommendations
-> ListAppComponentRecommendations -> Bool
$c== :: ListAppComponentRecommendations
-> ListAppComponentRecommendations -> Bool
Prelude.Eq, ReadPrec [ListAppComponentRecommendations]
ReadPrec ListAppComponentRecommendations
Int -> ReadS ListAppComponentRecommendations
ReadS [ListAppComponentRecommendations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppComponentRecommendations]
$creadListPrec :: ReadPrec [ListAppComponentRecommendations]
readPrec :: ReadPrec ListAppComponentRecommendations
$creadPrec :: ReadPrec ListAppComponentRecommendations
readList :: ReadS [ListAppComponentRecommendations]
$creadList :: ReadS [ListAppComponentRecommendations]
readsPrec :: Int -> ReadS ListAppComponentRecommendations
$creadsPrec :: Int -> ReadS ListAppComponentRecommendations
Prelude.Read, Int -> ListAppComponentRecommendations -> ShowS
[ListAppComponentRecommendations] -> ShowS
ListAppComponentRecommendations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppComponentRecommendations] -> ShowS
$cshowList :: [ListAppComponentRecommendations] -> ShowS
show :: ListAppComponentRecommendations -> String
$cshow :: ListAppComponentRecommendations -> String
showsPrec :: Int -> ListAppComponentRecommendations -> ShowS
$cshowsPrec :: Int -> ListAppComponentRecommendations -> ShowS
Prelude.Show, forall x.
Rep ListAppComponentRecommendations x
-> ListAppComponentRecommendations
forall x.
ListAppComponentRecommendations
-> Rep ListAppComponentRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAppComponentRecommendations x
-> ListAppComponentRecommendations
$cfrom :: forall x.
ListAppComponentRecommendations
-> Rep ListAppComponentRecommendations x
Prelude.Generic)
newListAppComponentRecommendations ::
Prelude.Text ->
ListAppComponentRecommendations
newListAppComponentRecommendations :: Text -> ListAppComponentRecommendations
newListAppComponentRecommendations Text
pAssessmentArn_ =
ListAppComponentRecommendations'
{ $sel:maxResults:ListAppComponentRecommendations' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAppComponentRecommendations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:assessmentArn:ListAppComponentRecommendations' :: Text
assessmentArn = Text
pAssessmentArn_
}
listAppComponentRecommendations_maxResults :: Lens.Lens' ListAppComponentRecommendations (Prelude.Maybe Prelude.Natural)
listAppComponentRecommendations_maxResults :: Lens' ListAppComponentRecommendations (Maybe Natural)
listAppComponentRecommendations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppComponentRecommendations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAppComponentRecommendations
s@ListAppComponentRecommendations' {} Maybe Natural
a -> ListAppComponentRecommendations
s {$sel:maxResults:ListAppComponentRecommendations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAppComponentRecommendations)
listAppComponentRecommendations_nextToken :: Lens.Lens' ListAppComponentRecommendations (Prelude.Maybe Prelude.Text)
listAppComponentRecommendations_nextToken :: Lens' ListAppComponentRecommendations (Maybe Text)
listAppComponentRecommendations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppComponentRecommendations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppComponentRecommendations
s@ListAppComponentRecommendations' {} Maybe Text
a -> ListAppComponentRecommendations
s {$sel:nextToken:ListAppComponentRecommendations' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppComponentRecommendations)
listAppComponentRecommendations_assessmentArn :: Lens.Lens' ListAppComponentRecommendations Prelude.Text
listAppComponentRecommendations_assessmentArn :: Lens' ListAppComponentRecommendations Text
listAppComponentRecommendations_assessmentArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppComponentRecommendations' {Text
assessmentArn :: Text
$sel:assessmentArn:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Text
assessmentArn} -> Text
assessmentArn) (\s :: ListAppComponentRecommendations
s@ListAppComponentRecommendations' {} Text
a -> ListAppComponentRecommendations
s {$sel:assessmentArn:ListAppComponentRecommendations' :: Text
assessmentArn = Text
a} :: ListAppComponentRecommendations)
instance
Core.AWSRequest
ListAppComponentRecommendations
where
type
AWSResponse ListAppComponentRecommendations =
ListAppComponentRecommendationsResponse
request :: (Service -> Service)
-> ListAppComponentRecommendations
-> Request ListAppComponentRecommendations
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 ListAppComponentRecommendations
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ListAppComponentRecommendations)))
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
-> [ComponentRecommendation]
-> ListAppComponentRecommendationsResponse
ListAppComponentRecommendationsResponse'
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
"componentRecommendations"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance
Prelude.Hashable
ListAppComponentRecommendations
where
hashWithSalt :: Int -> ListAppComponentRecommendations -> Int
hashWithSalt
Int
_salt
ListAppComponentRecommendations' {Maybe Natural
Maybe Text
Text
assessmentArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:assessmentArn:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Text
$sel:nextToken:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Maybe Text
$sel:maxResults:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> 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
ListAppComponentRecommendations
where
rnf :: ListAppComponentRecommendations -> ()
rnf ListAppComponentRecommendations' {Maybe Natural
Maybe Text
Text
assessmentArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:assessmentArn:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Text
$sel:nextToken:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Maybe Text
$sel:maxResults:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> 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
ListAppComponentRecommendations
where
toHeaders :: ListAppComponentRecommendations -> 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 ListAppComponentRecommendations where
toJSON :: ListAppComponentRecommendations -> Value
toJSON ListAppComponentRecommendations' {Maybe Natural
Maybe Text
Text
assessmentArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:assessmentArn:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Text
$sel:nextToken:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> Maybe Text
$sel:maxResults:ListAppComponentRecommendations' :: ListAppComponentRecommendations -> 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 ListAppComponentRecommendations where
toPath :: ListAppComponentRecommendations -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const ByteString
"/list-app-component-recommendations"
instance Data.ToQuery ListAppComponentRecommendations where
toQuery :: ListAppComponentRecommendations -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListAppComponentRecommendationsResponse = ListAppComponentRecommendationsResponse'
{
ListAppComponentRecommendationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAppComponentRecommendationsResponse -> Int
httpStatus :: Prelude.Int,
ListAppComponentRecommendationsResponse
-> [ComponentRecommendation]
componentRecommendations :: [ComponentRecommendation]
}
deriving (ListAppComponentRecommendationsResponse
-> ListAppComponentRecommendationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppComponentRecommendationsResponse
-> ListAppComponentRecommendationsResponse -> Bool
$c/= :: ListAppComponentRecommendationsResponse
-> ListAppComponentRecommendationsResponse -> Bool
== :: ListAppComponentRecommendationsResponse
-> ListAppComponentRecommendationsResponse -> Bool
$c== :: ListAppComponentRecommendationsResponse
-> ListAppComponentRecommendationsResponse -> Bool
Prelude.Eq, ReadPrec [ListAppComponentRecommendationsResponse]
ReadPrec ListAppComponentRecommendationsResponse
Int -> ReadS ListAppComponentRecommendationsResponse
ReadS [ListAppComponentRecommendationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppComponentRecommendationsResponse]
$creadListPrec :: ReadPrec [ListAppComponentRecommendationsResponse]
readPrec :: ReadPrec ListAppComponentRecommendationsResponse
$creadPrec :: ReadPrec ListAppComponentRecommendationsResponse
readList :: ReadS [ListAppComponentRecommendationsResponse]
$creadList :: ReadS [ListAppComponentRecommendationsResponse]
readsPrec :: Int -> ReadS ListAppComponentRecommendationsResponse
$creadsPrec :: Int -> ReadS ListAppComponentRecommendationsResponse
Prelude.Read, Int -> ListAppComponentRecommendationsResponse -> ShowS
[ListAppComponentRecommendationsResponse] -> ShowS
ListAppComponentRecommendationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppComponentRecommendationsResponse] -> ShowS
$cshowList :: [ListAppComponentRecommendationsResponse] -> ShowS
show :: ListAppComponentRecommendationsResponse -> String
$cshow :: ListAppComponentRecommendationsResponse -> String
showsPrec :: Int -> ListAppComponentRecommendationsResponse -> ShowS
$cshowsPrec :: Int -> ListAppComponentRecommendationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListAppComponentRecommendationsResponse x
-> ListAppComponentRecommendationsResponse
forall x.
ListAppComponentRecommendationsResponse
-> Rep ListAppComponentRecommendationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAppComponentRecommendationsResponse x
-> ListAppComponentRecommendationsResponse
$cfrom :: forall x.
ListAppComponentRecommendationsResponse
-> Rep ListAppComponentRecommendationsResponse x
Prelude.Generic)
newListAppComponentRecommendationsResponse ::
Prelude.Int ->
ListAppComponentRecommendationsResponse
newListAppComponentRecommendationsResponse :: Int -> ListAppComponentRecommendationsResponse
newListAppComponentRecommendationsResponse
Int
pHttpStatus_ =
ListAppComponentRecommendationsResponse'
{ $sel:nextToken:ListAppComponentRecommendationsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAppComponentRecommendationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:componentRecommendations:ListAppComponentRecommendationsResponse' :: [ComponentRecommendation]
componentRecommendations =
forall a. Monoid a => a
Prelude.mempty
}
listAppComponentRecommendationsResponse_nextToken :: Lens.Lens' ListAppComponentRecommendationsResponse (Prelude.Maybe Prelude.Text)
listAppComponentRecommendationsResponse_nextToken :: Lens' ListAppComponentRecommendationsResponse (Maybe Text)
listAppComponentRecommendationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppComponentRecommendationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppComponentRecommendationsResponse' :: ListAppComponentRecommendationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppComponentRecommendationsResponse
s@ListAppComponentRecommendationsResponse' {} Maybe Text
a -> ListAppComponentRecommendationsResponse
s {$sel:nextToken:ListAppComponentRecommendationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppComponentRecommendationsResponse)
listAppComponentRecommendationsResponse_httpStatus :: Lens.Lens' ListAppComponentRecommendationsResponse Prelude.Int
listAppComponentRecommendationsResponse_httpStatus :: Lens' ListAppComponentRecommendationsResponse Int
listAppComponentRecommendationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppComponentRecommendationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAppComponentRecommendationsResponse' :: ListAppComponentRecommendationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAppComponentRecommendationsResponse
s@ListAppComponentRecommendationsResponse' {} Int
a -> ListAppComponentRecommendationsResponse
s {$sel:httpStatus:ListAppComponentRecommendationsResponse' :: Int
httpStatus = Int
a} :: ListAppComponentRecommendationsResponse)
listAppComponentRecommendationsResponse_componentRecommendations :: Lens.Lens' ListAppComponentRecommendationsResponse [ComponentRecommendation]
listAppComponentRecommendationsResponse_componentRecommendations :: Lens'
ListAppComponentRecommendationsResponse [ComponentRecommendation]
listAppComponentRecommendationsResponse_componentRecommendations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppComponentRecommendationsResponse' {[ComponentRecommendation]
componentRecommendations :: [ComponentRecommendation]
$sel:componentRecommendations:ListAppComponentRecommendationsResponse' :: ListAppComponentRecommendationsResponse
-> [ComponentRecommendation]
componentRecommendations} -> [ComponentRecommendation]
componentRecommendations) (\s :: ListAppComponentRecommendationsResponse
s@ListAppComponentRecommendationsResponse' {} [ComponentRecommendation]
a -> ListAppComponentRecommendationsResponse
s {$sel:componentRecommendations:ListAppComponentRecommendationsResponse' :: [ComponentRecommendation]
componentRecommendations = [ComponentRecommendation]
a} :: ListAppComponentRecommendationsResponse) 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
ListAppComponentRecommendationsResponse
where
rnf :: ListAppComponentRecommendationsResponse -> ()
rnf ListAppComponentRecommendationsResponse' {Int
[ComponentRecommendation]
Maybe Text
componentRecommendations :: [ComponentRecommendation]
httpStatus :: Int
nextToken :: Maybe Text
$sel:componentRecommendations:ListAppComponentRecommendationsResponse' :: ListAppComponentRecommendationsResponse
-> [ComponentRecommendation]
$sel:httpStatus:ListAppComponentRecommendationsResponse' :: ListAppComponentRecommendationsResponse -> Int
$sel:nextToken:ListAppComponentRecommendationsResponse' :: ListAppComponentRecommendationsResponse -> 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 [ComponentRecommendation]
componentRecommendations