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