{-# 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.Support.DescribeTrustedAdvisorChecks
(
DescribeTrustedAdvisorChecks (..),
newDescribeTrustedAdvisorChecks,
describeTrustedAdvisorChecks_language,
DescribeTrustedAdvisorChecksResponse (..),
newDescribeTrustedAdvisorChecksResponse,
describeTrustedAdvisorChecksResponse_httpStatus,
describeTrustedAdvisorChecksResponse_checks,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Support.Types
data DescribeTrustedAdvisorChecks = DescribeTrustedAdvisorChecks'
{
DescribeTrustedAdvisorChecks -> Text
language :: Prelude.Text
}
deriving (DescribeTrustedAdvisorChecks
-> DescribeTrustedAdvisorChecks -> Bool
(DescribeTrustedAdvisorChecks
-> DescribeTrustedAdvisorChecks -> Bool)
-> (DescribeTrustedAdvisorChecks
-> DescribeTrustedAdvisorChecks -> Bool)
-> Eq DescribeTrustedAdvisorChecks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTrustedAdvisorChecks
-> DescribeTrustedAdvisorChecks -> Bool
$c/= :: DescribeTrustedAdvisorChecks
-> DescribeTrustedAdvisorChecks -> Bool
== :: DescribeTrustedAdvisorChecks
-> DescribeTrustedAdvisorChecks -> Bool
$c== :: DescribeTrustedAdvisorChecks
-> DescribeTrustedAdvisorChecks -> Bool
Prelude.Eq, ReadPrec [DescribeTrustedAdvisorChecks]
ReadPrec DescribeTrustedAdvisorChecks
Int -> ReadS DescribeTrustedAdvisorChecks
ReadS [DescribeTrustedAdvisorChecks]
(Int -> ReadS DescribeTrustedAdvisorChecks)
-> ReadS [DescribeTrustedAdvisorChecks]
-> ReadPrec DescribeTrustedAdvisorChecks
-> ReadPrec [DescribeTrustedAdvisorChecks]
-> Read DescribeTrustedAdvisorChecks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTrustedAdvisorChecks]
$creadListPrec :: ReadPrec [DescribeTrustedAdvisorChecks]
readPrec :: ReadPrec DescribeTrustedAdvisorChecks
$creadPrec :: ReadPrec DescribeTrustedAdvisorChecks
readList :: ReadS [DescribeTrustedAdvisorChecks]
$creadList :: ReadS [DescribeTrustedAdvisorChecks]
readsPrec :: Int -> ReadS DescribeTrustedAdvisorChecks
$creadsPrec :: Int -> ReadS DescribeTrustedAdvisorChecks
Prelude.Read, Int -> DescribeTrustedAdvisorChecks -> ShowS
[DescribeTrustedAdvisorChecks] -> ShowS
DescribeTrustedAdvisorChecks -> String
(Int -> DescribeTrustedAdvisorChecks -> ShowS)
-> (DescribeTrustedAdvisorChecks -> String)
-> ([DescribeTrustedAdvisorChecks] -> ShowS)
-> Show DescribeTrustedAdvisorChecks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTrustedAdvisorChecks] -> ShowS
$cshowList :: [DescribeTrustedAdvisorChecks] -> ShowS
show :: DescribeTrustedAdvisorChecks -> String
$cshow :: DescribeTrustedAdvisorChecks -> String
showsPrec :: Int -> DescribeTrustedAdvisorChecks -> ShowS
$cshowsPrec :: Int -> DescribeTrustedAdvisorChecks -> ShowS
Prelude.Show, (forall x.
DescribeTrustedAdvisorChecks -> Rep DescribeTrustedAdvisorChecks x)
-> (forall x.
Rep DescribeTrustedAdvisorChecks x -> DescribeTrustedAdvisorChecks)
-> Generic DescribeTrustedAdvisorChecks
forall x.
Rep DescribeTrustedAdvisorChecks x -> DescribeTrustedAdvisorChecks
forall x.
DescribeTrustedAdvisorChecks -> Rep DescribeTrustedAdvisorChecks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTrustedAdvisorChecks x -> DescribeTrustedAdvisorChecks
$cfrom :: forall x.
DescribeTrustedAdvisorChecks -> Rep DescribeTrustedAdvisorChecks x
Prelude.Generic)
newDescribeTrustedAdvisorChecks ::
Prelude.Text ->
DescribeTrustedAdvisorChecks
newDescribeTrustedAdvisorChecks :: Text -> DescribeTrustedAdvisorChecks
newDescribeTrustedAdvisorChecks Text
pLanguage_ =
DescribeTrustedAdvisorChecks' :: Text -> DescribeTrustedAdvisorChecks
DescribeTrustedAdvisorChecks'
{ $sel:language:DescribeTrustedAdvisorChecks' :: Text
language =
Text
pLanguage_
}
describeTrustedAdvisorChecks_language :: Lens.Lens' DescribeTrustedAdvisorChecks Prelude.Text
describeTrustedAdvisorChecks_language :: (Text -> f Text)
-> DescribeTrustedAdvisorChecks -> f DescribeTrustedAdvisorChecks
describeTrustedAdvisorChecks_language = (DescribeTrustedAdvisorChecks -> Text)
-> (DescribeTrustedAdvisorChecks
-> Text -> DescribeTrustedAdvisorChecks)
-> Lens
DescribeTrustedAdvisorChecks DescribeTrustedAdvisorChecks Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrustedAdvisorChecks' {Text
language :: Text
$sel:language:DescribeTrustedAdvisorChecks' :: DescribeTrustedAdvisorChecks -> Text
language} -> Text
language) (\s :: DescribeTrustedAdvisorChecks
s@DescribeTrustedAdvisorChecks' {} Text
a -> DescribeTrustedAdvisorChecks
s {$sel:language:DescribeTrustedAdvisorChecks' :: Text
language = Text
a} :: DescribeTrustedAdvisorChecks)
instance Core.AWSRequest DescribeTrustedAdvisorChecks where
type
AWSResponse DescribeTrustedAdvisorChecks =
DescribeTrustedAdvisorChecksResponse
request :: DescribeTrustedAdvisorChecks
-> Request DescribeTrustedAdvisorChecks
request = Service
-> DescribeTrustedAdvisorChecks
-> Request DescribeTrustedAdvisorChecks
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeTrustedAdvisorChecks
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeTrustedAdvisorChecks)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeTrustedAdvisorChecks))
-> Logger
-> Service
-> Proxy DescribeTrustedAdvisorChecks
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeTrustedAdvisorChecks)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int
-> [TrustedAdvisorCheckDescription]
-> DescribeTrustedAdvisorChecksResponse
DescribeTrustedAdvisorChecksResponse'
(Int
-> [TrustedAdvisorCheckDescription]
-> DescribeTrustedAdvisorChecksResponse)
-> Either String Int
-> Either
String
([TrustedAdvisorCheckDescription]
-> DescribeTrustedAdvisorChecksResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either
String
([TrustedAdvisorCheckDescription]
-> DescribeTrustedAdvisorChecksResponse)
-> Either String [TrustedAdvisorCheckDescription]
-> Either String DescribeTrustedAdvisorChecksResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe [TrustedAdvisorCheckDescription])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"checks" Either String (Maybe [TrustedAdvisorCheckDescription])
-> [TrustedAdvisorCheckDescription]
-> Either String [TrustedAdvisorCheckDescription]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [TrustedAdvisorCheckDescription]
forall a. Monoid a => a
Prelude.mempty)
)
instance
Prelude.Hashable
DescribeTrustedAdvisorChecks
instance Prelude.NFData DescribeTrustedAdvisorChecks
instance Core.ToHeaders DescribeTrustedAdvisorChecks where
toHeaders :: DescribeTrustedAdvisorChecks -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeTrustedAdvisorChecks -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSSupport_20130415.DescribeTrustedAdvisorChecks" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeTrustedAdvisorChecks where
toJSON :: DescribeTrustedAdvisorChecks -> Value
toJSON DescribeTrustedAdvisorChecks' {Text
language :: Text
$sel:language:DescribeTrustedAdvisorChecks' :: DescribeTrustedAdvisorChecks -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"language" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
language)]
)
instance Core.ToPath DescribeTrustedAdvisorChecks where
toPath :: DescribeTrustedAdvisorChecks -> ByteString
toPath = ByteString -> DescribeTrustedAdvisorChecks -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeTrustedAdvisorChecks where
toQuery :: DescribeTrustedAdvisorChecks -> QueryString
toQuery = QueryString -> DescribeTrustedAdvisorChecks -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeTrustedAdvisorChecksResponse = DescribeTrustedAdvisorChecksResponse'
{
DescribeTrustedAdvisorChecksResponse -> Int
httpStatus :: Prelude.Int,
DescribeTrustedAdvisorChecksResponse
-> [TrustedAdvisorCheckDescription]
checks :: [TrustedAdvisorCheckDescription]
}
deriving (DescribeTrustedAdvisorChecksResponse
-> DescribeTrustedAdvisorChecksResponse -> Bool
(DescribeTrustedAdvisorChecksResponse
-> DescribeTrustedAdvisorChecksResponse -> Bool)
-> (DescribeTrustedAdvisorChecksResponse
-> DescribeTrustedAdvisorChecksResponse -> Bool)
-> Eq DescribeTrustedAdvisorChecksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTrustedAdvisorChecksResponse
-> DescribeTrustedAdvisorChecksResponse -> Bool
$c/= :: DescribeTrustedAdvisorChecksResponse
-> DescribeTrustedAdvisorChecksResponse -> Bool
== :: DescribeTrustedAdvisorChecksResponse
-> DescribeTrustedAdvisorChecksResponse -> Bool
$c== :: DescribeTrustedAdvisorChecksResponse
-> DescribeTrustedAdvisorChecksResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTrustedAdvisorChecksResponse]
ReadPrec DescribeTrustedAdvisorChecksResponse
Int -> ReadS DescribeTrustedAdvisorChecksResponse
ReadS [DescribeTrustedAdvisorChecksResponse]
(Int -> ReadS DescribeTrustedAdvisorChecksResponse)
-> ReadS [DescribeTrustedAdvisorChecksResponse]
-> ReadPrec DescribeTrustedAdvisorChecksResponse
-> ReadPrec [DescribeTrustedAdvisorChecksResponse]
-> Read DescribeTrustedAdvisorChecksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTrustedAdvisorChecksResponse]
$creadListPrec :: ReadPrec [DescribeTrustedAdvisorChecksResponse]
readPrec :: ReadPrec DescribeTrustedAdvisorChecksResponse
$creadPrec :: ReadPrec DescribeTrustedAdvisorChecksResponse
readList :: ReadS [DescribeTrustedAdvisorChecksResponse]
$creadList :: ReadS [DescribeTrustedAdvisorChecksResponse]
readsPrec :: Int -> ReadS DescribeTrustedAdvisorChecksResponse
$creadsPrec :: Int -> ReadS DescribeTrustedAdvisorChecksResponse
Prelude.Read, Int -> DescribeTrustedAdvisorChecksResponse -> ShowS
[DescribeTrustedAdvisorChecksResponse] -> ShowS
DescribeTrustedAdvisorChecksResponse -> String
(Int -> DescribeTrustedAdvisorChecksResponse -> ShowS)
-> (DescribeTrustedAdvisorChecksResponse -> String)
-> ([DescribeTrustedAdvisorChecksResponse] -> ShowS)
-> Show DescribeTrustedAdvisorChecksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTrustedAdvisorChecksResponse] -> ShowS
$cshowList :: [DescribeTrustedAdvisorChecksResponse] -> ShowS
show :: DescribeTrustedAdvisorChecksResponse -> String
$cshow :: DescribeTrustedAdvisorChecksResponse -> String
showsPrec :: Int -> DescribeTrustedAdvisorChecksResponse -> ShowS
$cshowsPrec :: Int -> DescribeTrustedAdvisorChecksResponse -> ShowS
Prelude.Show, (forall x.
DescribeTrustedAdvisorChecksResponse
-> Rep DescribeTrustedAdvisorChecksResponse x)
-> (forall x.
Rep DescribeTrustedAdvisorChecksResponse x
-> DescribeTrustedAdvisorChecksResponse)
-> Generic DescribeTrustedAdvisorChecksResponse
forall x.
Rep DescribeTrustedAdvisorChecksResponse x
-> DescribeTrustedAdvisorChecksResponse
forall x.
DescribeTrustedAdvisorChecksResponse
-> Rep DescribeTrustedAdvisorChecksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTrustedAdvisorChecksResponse x
-> DescribeTrustedAdvisorChecksResponse
$cfrom :: forall x.
DescribeTrustedAdvisorChecksResponse
-> Rep DescribeTrustedAdvisorChecksResponse x
Prelude.Generic)
newDescribeTrustedAdvisorChecksResponse ::
Prelude.Int ->
DescribeTrustedAdvisorChecksResponse
newDescribeTrustedAdvisorChecksResponse :: Int -> DescribeTrustedAdvisorChecksResponse
newDescribeTrustedAdvisorChecksResponse Int
pHttpStatus_ =
DescribeTrustedAdvisorChecksResponse' :: Int
-> [TrustedAdvisorCheckDescription]
-> DescribeTrustedAdvisorChecksResponse
DescribeTrustedAdvisorChecksResponse'
{ $sel:httpStatus:DescribeTrustedAdvisorChecksResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:checks:DescribeTrustedAdvisorChecksResponse' :: [TrustedAdvisorCheckDescription]
checks = [TrustedAdvisorCheckDescription]
forall a. Monoid a => a
Prelude.mempty
}
describeTrustedAdvisorChecksResponse_httpStatus :: Lens.Lens' DescribeTrustedAdvisorChecksResponse Prelude.Int
describeTrustedAdvisorChecksResponse_httpStatus :: (Int -> f Int)
-> DescribeTrustedAdvisorChecksResponse
-> f DescribeTrustedAdvisorChecksResponse
describeTrustedAdvisorChecksResponse_httpStatus = (DescribeTrustedAdvisorChecksResponse -> Int)
-> (DescribeTrustedAdvisorChecksResponse
-> Int -> DescribeTrustedAdvisorChecksResponse)
-> Lens
DescribeTrustedAdvisorChecksResponse
DescribeTrustedAdvisorChecksResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrustedAdvisorChecksResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeTrustedAdvisorChecksResponse' :: DescribeTrustedAdvisorChecksResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeTrustedAdvisorChecksResponse
s@DescribeTrustedAdvisorChecksResponse' {} Int
a -> DescribeTrustedAdvisorChecksResponse
s {$sel:httpStatus:DescribeTrustedAdvisorChecksResponse' :: Int
httpStatus = Int
a} :: DescribeTrustedAdvisorChecksResponse)
describeTrustedAdvisorChecksResponse_checks :: Lens.Lens' DescribeTrustedAdvisorChecksResponse [TrustedAdvisorCheckDescription]
describeTrustedAdvisorChecksResponse_checks :: ([TrustedAdvisorCheckDescription]
-> f [TrustedAdvisorCheckDescription])
-> DescribeTrustedAdvisorChecksResponse
-> f DescribeTrustedAdvisorChecksResponse
describeTrustedAdvisorChecksResponse_checks = (DescribeTrustedAdvisorChecksResponse
-> [TrustedAdvisorCheckDescription])
-> (DescribeTrustedAdvisorChecksResponse
-> [TrustedAdvisorCheckDescription]
-> DescribeTrustedAdvisorChecksResponse)
-> Lens
DescribeTrustedAdvisorChecksResponse
DescribeTrustedAdvisorChecksResponse
[TrustedAdvisorCheckDescription]
[TrustedAdvisorCheckDescription]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrustedAdvisorChecksResponse' {[TrustedAdvisorCheckDescription]
checks :: [TrustedAdvisorCheckDescription]
$sel:checks:DescribeTrustedAdvisorChecksResponse' :: DescribeTrustedAdvisorChecksResponse
-> [TrustedAdvisorCheckDescription]
checks} -> [TrustedAdvisorCheckDescription]
checks) (\s :: DescribeTrustedAdvisorChecksResponse
s@DescribeTrustedAdvisorChecksResponse' {} [TrustedAdvisorCheckDescription]
a -> DescribeTrustedAdvisorChecksResponse
s {$sel:checks:DescribeTrustedAdvisorChecksResponse' :: [TrustedAdvisorCheckDescription]
checks = [TrustedAdvisorCheckDescription]
a} :: DescribeTrustedAdvisorChecksResponse) (([TrustedAdvisorCheckDescription]
-> f [TrustedAdvisorCheckDescription])
-> DescribeTrustedAdvisorChecksResponse
-> f DescribeTrustedAdvisorChecksResponse)
-> (([TrustedAdvisorCheckDescription]
-> f [TrustedAdvisorCheckDescription])
-> [TrustedAdvisorCheckDescription]
-> f [TrustedAdvisorCheckDescription])
-> ([TrustedAdvisorCheckDescription]
-> f [TrustedAdvisorCheckDescription])
-> DescribeTrustedAdvisorChecksResponse
-> f DescribeTrustedAdvisorChecksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TrustedAdvisorCheckDescription]
-> f [TrustedAdvisorCheckDescription])
-> [TrustedAdvisorCheckDescription]
-> f [TrustedAdvisorCheckDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
DescribeTrustedAdvisorChecksResponse