{-# 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.RefreshTrustedAdvisorCheck
(
RefreshTrustedAdvisorCheck (..),
newRefreshTrustedAdvisorCheck,
refreshTrustedAdvisorCheck_checkId,
RefreshTrustedAdvisorCheckResponse (..),
newRefreshTrustedAdvisorCheckResponse,
refreshTrustedAdvisorCheckResponse_httpStatus,
refreshTrustedAdvisorCheckResponse_status,
)
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 RefreshTrustedAdvisorCheck = RefreshTrustedAdvisorCheck'
{
RefreshTrustedAdvisorCheck -> Text
checkId :: Prelude.Text
}
deriving (RefreshTrustedAdvisorCheck -> RefreshTrustedAdvisorCheck -> Bool
(RefreshTrustedAdvisorCheck -> RefreshTrustedAdvisorCheck -> Bool)
-> (RefreshTrustedAdvisorCheck
-> RefreshTrustedAdvisorCheck -> Bool)
-> Eq RefreshTrustedAdvisorCheck
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RefreshTrustedAdvisorCheck -> RefreshTrustedAdvisorCheck -> Bool
$c/= :: RefreshTrustedAdvisorCheck -> RefreshTrustedAdvisorCheck -> Bool
== :: RefreshTrustedAdvisorCheck -> RefreshTrustedAdvisorCheck -> Bool
$c== :: RefreshTrustedAdvisorCheck -> RefreshTrustedAdvisorCheck -> Bool
Prelude.Eq, ReadPrec [RefreshTrustedAdvisorCheck]
ReadPrec RefreshTrustedAdvisorCheck
Int -> ReadS RefreshTrustedAdvisorCheck
ReadS [RefreshTrustedAdvisorCheck]
(Int -> ReadS RefreshTrustedAdvisorCheck)
-> ReadS [RefreshTrustedAdvisorCheck]
-> ReadPrec RefreshTrustedAdvisorCheck
-> ReadPrec [RefreshTrustedAdvisorCheck]
-> Read RefreshTrustedAdvisorCheck
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RefreshTrustedAdvisorCheck]
$creadListPrec :: ReadPrec [RefreshTrustedAdvisorCheck]
readPrec :: ReadPrec RefreshTrustedAdvisorCheck
$creadPrec :: ReadPrec RefreshTrustedAdvisorCheck
readList :: ReadS [RefreshTrustedAdvisorCheck]
$creadList :: ReadS [RefreshTrustedAdvisorCheck]
readsPrec :: Int -> ReadS RefreshTrustedAdvisorCheck
$creadsPrec :: Int -> ReadS RefreshTrustedAdvisorCheck
Prelude.Read, Int -> RefreshTrustedAdvisorCheck -> ShowS
[RefreshTrustedAdvisorCheck] -> ShowS
RefreshTrustedAdvisorCheck -> String
(Int -> RefreshTrustedAdvisorCheck -> ShowS)
-> (RefreshTrustedAdvisorCheck -> String)
-> ([RefreshTrustedAdvisorCheck] -> ShowS)
-> Show RefreshTrustedAdvisorCheck
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RefreshTrustedAdvisorCheck] -> ShowS
$cshowList :: [RefreshTrustedAdvisorCheck] -> ShowS
show :: RefreshTrustedAdvisorCheck -> String
$cshow :: RefreshTrustedAdvisorCheck -> String
showsPrec :: Int -> RefreshTrustedAdvisorCheck -> ShowS
$cshowsPrec :: Int -> RefreshTrustedAdvisorCheck -> ShowS
Prelude.Show, (forall x.
RefreshTrustedAdvisorCheck -> Rep RefreshTrustedAdvisorCheck x)
-> (forall x.
Rep RefreshTrustedAdvisorCheck x -> RefreshTrustedAdvisorCheck)
-> Generic RefreshTrustedAdvisorCheck
forall x.
Rep RefreshTrustedAdvisorCheck x -> RefreshTrustedAdvisorCheck
forall x.
RefreshTrustedAdvisorCheck -> Rep RefreshTrustedAdvisorCheck x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RefreshTrustedAdvisorCheck x -> RefreshTrustedAdvisorCheck
$cfrom :: forall x.
RefreshTrustedAdvisorCheck -> Rep RefreshTrustedAdvisorCheck x
Prelude.Generic)
newRefreshTrustedAdvisorCheck ::
Prelude.Text ->
RefreshTrustedAdvisorCheck
newRefreshTrustedAdvisorCheck :: Text -> RefreshTrustedAdvisorCheck
newRefreshTrustedAdvisorCheck Text
pCheckId_ =
RefreshTrustedAdvisorCheck' :: Text -> RefreshTrustedAdvisorCheck
RefreshTrustedAdvisorCheck' {$sel:checkId:RefreshTrustedAdvisorCheck' :: Text
checkId = Text
pCheckId_}
refreshTrustedAdvisorCheck_checkId :: Lens.Lens' RefreshTrustedAdvisorCheck Prelude.Text
refreshTrustedAdvisorCheck_checkId :: (Text -> f Text)
-> RefreshTrustedAdvisorCheck -> f RefreshTrustedAdvisorCheck
refreshTrustedAdvisorCheck_checkId = (RefreshTrustedAdvisorCheck -> Text)
-> (RefreshTrustedAdvisorCheck
-> Text -> RefreshTrustedAdvisorCheck)
-> Lens
RefreshTrustedAdvisorCheck RefreshTrustedAdvisorCheck Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshTrustedAdvisorCheck' {Text
checkId :: Text
$sel:checkId:RefreshTrustedAdvisorCheck' :: RefreshTrustedAdvisorCheck -> Text
checkId} -> Text
checkId) (\s :: RefreshTrustedAdvisorCheck
s@RefreshTrustedAdvisorCheck' {} Text
a -> RefreshTrustedAdvisorCheck
s {$sel:checkId:RefreshTrustedAdvisorCheck' :: Text
checkId = Text
a} :: RefreshTrustedAdvisorCheck)
instance Core.AWSRequest RefreshTrustedAdvisorCheck where
type
AWSResponse RefreshTrustedAdvisorCheck =
RefreshTrustedAdvisorCheckResponse
request :: RefreshTrustedAdvisorCheck -> Request RefreshTrustedAdvisorCheck
request = Service
-> RefreshTrustedAdvisorCheck -> Request RefreshTrustedAdvisorCheck
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RefreshTrustedAdvisorCheck
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RefreshTrustedAdvisorCheck)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RefreshTrustedAdvisorCheck))
-> Logger
-> Service
-> Proxy RefreshTrustedAdvisorCheck
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RefreshTrustedAdvisorCheck)))
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
-> TrustedAdvisorCheckRefreshStatus
-> RefreshTrustedAdvisorCheckResponse
RefreshTrustedAdvisorCheckResponse'
(Int
-> TrustedAdvisorCheckRefreshStatus
-> RefreshTrustedAdvisorCheckResponse)
-> Either String Int
-> Either
String
(TrustedAdvisorCheckRefreshStatus
-> RefreshTrustedAdvisorCheckResponse)
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
(TrustedAdvisorCheckRefreshStatus
-> RefreshTrustedAdvisorCheckResponse)
-> Either String TrustedAdvisorCheckRefreshStatus
-> Either String RefreshTrustedAdvisorCheckResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String TrustedAdvisorCheckRefreshStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"status")
)
instance Prelude.Hashable RefreshTrustedAdvisorCheck
instance Prelude.NFData RefreshTrustedAdvisorCheck
instance Core.ToHeaders RefreshTrustedAdvisorCheck where
toHeaders :: RefreshTrustedAdvisorCheck -> ResponseHeaders
toHeaders =
ResponseHeaders -> RefreshTrustedAdvisorCheck -> 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.RefreshTrustedAdvisorCheck" ::
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 RefreshTrustedAdvisorCheck where
toJSON :: RefreshTrustedAdvisorCheck -> Value
toJSON RefreshTrustedAdvisorCheck' {Text
checkId :: Text
$sel:checkId:RefreshTrustedAdvisorCheck' :: RefreshTrustedAdvisorCheck -> 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
"checkId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
checkId)]
)
instance Core.ToPath RefreshTrustedAdvisorCheck where
toPath :: RefreshTrustedAdvisorCheck -> ByteString
toPath = ByteString -> RefreshTrustedAdvisorCheck -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RefreshTrustedAdvisorCheck where
toQuery :: RefreshTrustedAdvisorCheck -> QueryString
toQuery = QueryString -> RefreshTrustedAdvisorCheck -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RefreshTrustedAdvisorCheckResponse = RefreshTrustedAdvisorCheckResponse'
{
RefreshTrustedAdvisorCheckResponse -> Int
httpStatus :: Prelude.Int,
RefreshTrustedAdvisorCheckResponse
-> TrustedAdvisorCheckRefreshStatus
status :: TrustedAdvisorCheckRefreshStatus
}
deriving (RefreshTrustedAdvisorCheckResponse
-> RefreshTrustedAdvisorCheckResponse -> Bool
(RefreshTrustedAdvisorCheckResponse
-> RefreshTrustedAdvisorCheckResponse -> Bool)
-> (RefreshTrustedAdvisorCheckResponse
-> RefreshTrustedAdvisorCheckResponse -> Bool)
-> Eq RefreshTrustedAdvisorCheckResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RefreshTrustedAdvisorCheckResponse
-> RefreshTrustedAdvisorCheckResponse -> Bool
$c/= :: RefreshTrustedAdvisorCheckResponse
-> RefreshTrustedAdvisorCheckResponse -> Bool
== :: RefreshTrustedAdvisorCheckResponse
-> RefreshTrustedAdvisorCheckResponse -> Bool
$c== :: RefreshTrustedAdvisorCheckResponse
-> RefreshTrustedAdvisorCheckResponse -> Bool
Prelude.Eq, ReadPrec [RefreshTrustedAdvisorCheckResponse]
ReadPrec RefreshTrustedAdvisorCheckResponse
Int -> ReadS RefreshTrustedAdvisorCheckResponse
ReadS [RefreshTrustedAdvisorCheckResponse]
(Int -> ReadS RefreshTrustedAdvisorCheckResponse)
-> ReadS [RefreshTrustedAdvisorCheckResponse]
-> ReadPrec RefreshTrustedAdvisorCheckResponse
-> ReadPrec [RefreshTrustedAdvisorCheckResponse]
-> Read RefreshTrustedAdvisorCheckResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RefreshTrustedAdvisorCheckResponse]
$creadListPrec :: ReadPrec [RefreshTrustedAdvisorCheckResponse]
readPrec :: ReadPrec RefreshTrustedAdvisorCheckResponse
$creadPrec :: ReadPrec RefreshTrustedAdvisorCheckResponse
readList :: ReadS [RefreshTrustedAdvisorCheckResponse]
$creadList :: ReadS [RefreshTrustedAdvisorCheckResponse]
readsPrec :: Int -> ReadS RefreshTrustedAdvisorCheckResponse
$creadsPrec :: Int -> ReadS RefreshTrustedAdvisorCheckResponse
Prelude.Read, Int -> RefreshTrustedAdvisorCheckResponse -> ShowS
[RefreshTrustedAdvisorCheckResponse] -> ShowS
RefreshTrustedAdvisorCheckResponse -> String
(Int -> RefreshTrustedAdvisorCheckResponse -> ShowS)
-> (RefreshTrustedAdvisorCheckResponse -> String)
-> ([RefreshTrustedAdvisorCheckResponse] -> ShowS)
-> Show RefreshTrustedAdvisorCheckResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RefreshTrustedAdvisorCheckResponse] -> ShowS
$cshowList :: [RefreshTrustedAdvisorCheckResponse] -> ShowS
show :: RefreshTrustedAdvisorCheckResponse -> String
$cshow :: RefreshTrustedAdvisorCheckResponse -> String
showsPrec :: Int -> RefreshTrustedAdvisorCheckResponse -> ShowS
$cshowsPrec :: Int -> RefreshTrustedAdvisorCheckResponse -> ShowS
Prelude.Show, (forall x.
RefreshTrustedAdvisorCheckResponse
-> Rep RefreshTrustedAdvisorCheckResponse x)
-> (forall x.
Rep RefreshTrustedAdvisorCheckResponse x
-> RefreshTrustedAdvisorCheckResponse)
-> Generic RefreshTrustedAdvisorCheckResponse
forall x.
Rep RefreshTrustedAdvisorCheckResponse x
-> RefreshTrustedAdvisorCheckResponse
forall x.
RefreshTrustedAdvisorCheckResponse
-> Rep RefreshTrustedAdvisorCheckResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RefreshTrustedAdvisorCheckResponse x
-> RefreshTrustedAdvisorCheckResponse
$cfrom :: forall x.
RefreshTrustedAdvisorCheckResponse
-> Rep RefreshTrustedAdvisorCheckResponse x
Prelude.Generic)
newRefreshTrustedAdvisorCheckResponse ::
Prelude.Int ->
TrustedAdvisorCheckRefreshStatus ->
RefreshTrustedAdvisorCheckResponse
newRefreshTrustedAdvisorCheckResponse :: Int
-> TrustedAdvisorCheckRefreshStatus
-> RefreshTrustedAdvisorCheckResponse
newRefreshTrustedAdvisorCheckResponse
Int
pHttpStatus_
TrustedAdvisorCheckRefreshStatus
pStatus_ =
RefreshTrustedAdvisorCheckResponse' :: Int
-> TrustedAdvisorCheckRefreshStatus
-> RefreshTrustedAdvisorCheckResponse
RefreshTrustedAdvisorCheckResponse'
{ $sel:httpStatus:RefreshTrustedAdvisorCheckResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:status:RefreshTrustedAdvisorCheckResponse' :: TrustedAdvisorCheckRefreshStatus
status = TrustedAdvisorCheckRefreshStatus
pStatus_
}
refreshTrustedAdvisorCheckResponse_httpStatus :: Lens.Lens' RefreshTrustedAdvisorCheckResponse Prelude.Int
refreshTrustedAdvisorCheckResponse_httpStatus :: (Int -> f Int)
-> RefreshTrustedAdvisorCheckResponse
-> f RefreshTrustedAdvisorCheckResponse
refreshTrustedAdvisorCheckResponse_httpStatus = (RefreshTrustedAdvisorCheckResponse -> Int)
-> (RefreshTrustedAdvisorCheckResponse
-> Int -> RefreshTrustedAdvisorCheckResponse)
-> Lens
RefreshTrustedAdvisorCheckResponse
RefreshTrustedAdvisorCheckResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshTrustedAdvisorCheckResponse' {Int
httpStatus :: Int
$sel:httpStatus:RefreshTrustedAdvisorCheckResponse' :: RefreshTrustedAdvisorCheckResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RefreshTrustedAdvisorCheckResponse
s@RefreshTrustedAdvisorCheckResponse' {} Int
a -> RefreshTrustedAdvisorCheckResponse
s {$sel:httpStatus:RefreshTrustedAdvisorCheckResponse' :: Int
httpStatus = Int
a} :: RefreshTrustedAdvisorCheckResponse)
refreshTrustedAdvisorCheckResponse_status :: Lens.Lens' RefreshTrustedAdvisorCheckResponse TrustedAdvisorCheckRefreshStatus
refreshTrustedAdvisorCheckResponse_status :: (TrustedAdvisorCheckRefreshStatus
-> f TrustedAdvisorCheckRefreshStatus)
-> RefreshTrustedAdvisorCheckResponse
-> f RefreshTrustedAdvisorCheckResponse
refreshTrustedAdvisorCheckResponse_status = (RefreshTrustedAdvisorCheckResponse
-> TrustedAdvisorCheckRefreshStatus)
-> (RefreshTrustedAdvisorCheckResponse
-> TrustedAdvisorCheckRefreshStatus
-> RefreshTrustedAdvisorCheckResponse)
-> Lens
RefreshTrustedAdvisorCheckResponse
RefreshTrustedAdvisorCheckResponse
TrustedAdvisorCheckRefreshStatus
TrustedAdvisorCheckRefreshStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshTrustedAdvisorCheckResponse' {TrustedAdvisorCheckRefreshStatus
status :: TrustedAdvisorCheckRefreshStatus
$sel:status:RefreshTrustedAdvisorCheckResponse' :: RefreshTrustedAdvisorCheckResponse
-> TrustedAdvisorCheckRefreshStatus
status} -> TrustedAdvisorCheckRefreshStatus
status) (\s :: RefreshTrustedAdvisorCheckResponse
s@RefreshTrustedAdvisorCheckResponse' {} TrustedAdvisorCheckRefreshStatus
a -> RefreshTrustedAdvisorCheckResponse
s {$sel:status:RefreshTrustedAdvisorCheckResponse' :: TrustedAdvisorCheckRefreshStatus
status = TrustedAdvisorCheckRefreshStatus
a} :: RefreshTrustedAdvisorCheckResponse)
instance
Prelude.NFData
RefreshTrustedAdvisorCheckResponse