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