{-# 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.FraudDetector.CancelBatchPredictionJob
(
CancelBatchPredictionJob (..),
newCancelBatchPredictionJob,
cancelBatchPredictionJob_jobId,
CancelBatchPredictionJobResponse (..),
newCancelBatchPredictionJobResponse,
cancelBatchPredictionJobResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FraudDetector.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CancelBatchPredictionJob = CancelBatchPredictionJob'
{
CancelBatchPredictionJob -> Text
jobId :: Prelude.Text
}
deriving (CancelBatchPredictionJob -> CancelBatchPredictionJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelBatchPredictionJob -> CancelBatchPredictionJob -> Bool
$c/= :: CancelBatchPredictionJob -> CancelBatchPredictionJob -> Bool
== :: CancelBatchPredictionJob -> CancelBatchPredictionJob -> Bool
$c== :: CancelBatchPredictionJob -> CancelBatchPredictionJob -> Bool
Prelude.Eq, ReadPrec [CancelBatchPredictionJob]
ReadPrec CancelBatchPredictionJob
Int -> ReadS CancelBatchPredictionJob
ReadS [CancelBatchPredictionJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelBatchPredictionJob]
$creadListPrec :: ReadPrec [CancelBatchPredictionJob]
readPrec :: ReadPrec CancelBatchPredictionJob
$creadPrec :: ReadPrec CancelBatchPredictionJob
readList :: ReadS [CancelBatchPredictionJob]
$creadList :: ReadS [CancelBatchPredictionJob]
readsPrec :: Int -> ReadS CancelBatchPredictionJob
$creadsPrec :: Int -> ReadS CancelBatchPredictionJob
Prelude.Read, Int -> CancelBatchPredictionJob -> ShowS
[CancelBatchPredictionJob] -> ShowS
CancelBatchPredictionJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelBatchPredictionJob] -> ShowS
$cshowList :: [CancelBatchPredictionJob] -> ShowS
show :: CancelBatchPredictionJob -> String
$cshow :: CancelBatchPredictionJob -> String
showsPrec :: Int -> CancelBatchPredictionJob -> ShowS
$cshowsPrec :: Int -> CancelBatchPredictionJob -> ShowS
Prelude.Show, forall x.
Rep CancelBatchPredictionJob x -> CancelBatchPredictionJob
forall x.
CancelBatchPredictionJob -> Rep CancelBatchPredictionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelBatchPredictionJob x -> CancelBatchPredictionJob
$cfrom :: forall x.
CancelBatchPredictionJob -> Rep CancelBatchPredictionJob x
Prelude.Generic)
newCancelBatchPredictionJob ::
Prelude.Text ->
CancelBatchPredictionJob
newCancelBatchPredictionJob :: Text -> CancelBatchPredictionJob
newCancelBatchPredictionJob Text
pJobId_ =
CancelBatchPredictionJob' {$sel:jobId:CancelBatchPredictionJob' :: Text
jobId = Text
pJobId_}
cancelBatchPredictionJob_jobId :: Lens.Lens' CancelBatchPredictionJob Prelude.Text
cancelBatchPredictionJob_jobId :: Lens' CancelBatchPredictionJob Text
cancelBatchPredictionJob_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelBatchPredictionJob' {Text
jobId :: Text
$sel:jobId:CancelBatchPredictionJob' :: CancelBatchPredictionJob -> Text
jobId} -> Text
jobId) (\s :: CancelBatchPredictionJob
s@CancelBatchPredictionJob' {} Text
a -> CancelBatchPredictionJob
s {$sel:jobId:CancelBatchPredictionJob' :: Text
jobId = Text
a} :: CancelBatchPredictionJob)
instance Core.AWSRequest CancelBatchPredictionJob where
type
AWSResponse CancelBatchPredictionJob =
CancelBatchPredictionJobResponse
request :: (Service -> Service)
-> CancelBatchPredictionJob -> Request CancelBatchPredictionJob
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 CancelBatchPredictionJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelBatchPredictionJob)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> CancelBatchPredictionJobResponse
CancelBatchPredictionJobResponse'
forall (f :: * -> *) a b. Functor 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))
)
instance Prelude.Hashable CancelBatchPredictionJob where
hashWithSalt :: Int -> CancelBatchPredictionJob -> Int
hashWithSalt Int
_salt CancelBatchPredictionJob' {Text
jobId :: Text
$sel:jobId:CancelBatchPredictionJob' :: CancelBatchPredictionJob -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
instance Prelude.NFData CancelBatchPredictionJob where
rnf :: CancelBatchPredictionJob -> ()
rnf CancelBatchPredictionJob' {Text
jobId :: Text
$sel:jobId:CancelBatchPredictionJob' :: CancelBatchPredictionJob -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
instance Data.ToHeaders CancelBatchPredictionJob where
toHeaders :: CancelBatchPredictionJob -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSHawksNestServiceFacade.CancelBatchPredictionJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CancelBatchPredictionJob where
toJSON :: CancelBatchPredictionJob -> Value
toJSON CancelBatchPredictionJob' {Text
jobId :: Text
$sel:jobId:CancelBatchPredictionJob' :: CancelBatchPredictionJob -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"jobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId)]
)
instance Data.ToPath CancelBatchPredictionJob where
toPath :: CancelBatchPredictionJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CancelBatchPredictionJob where
toQuery :: CancelBatchPredictionJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CancelBatchPredictionJobResponse = CancelBatchPredictionJobResponse'
{
CancelBatchPredictionJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CancelBatchPredictionJobResponse
-> CancelBatchPredictionJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelBatchPredictionJobResponse
-> CancelBatchPredictionJobResponse -> Bool
$c/= :: CancelBatchPredictionJobResponse
-> CancelBatchPredictionJobResponse -> Bool
== :: CancelBatchPredictionJobResponse
-> CancelBatchPredictionJobResponse -> Bool
$c== :: CancelBatchPredictionJobResponse
-> CancelBatchPredictionJobResponse -> Bool
Prelude.Eq, ReadPrec [CancelBatchPredictionJobResponse]
ReadPrec CancelBatchPredictionJobResponse
Int -> ReadS CancelBatchPredictionJobResponse
ReadS [CancelBatchPredictionJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelBatchPredictionJobResponse]
$creadListPrec :: ReadPrec [CancelBatchPredictionJobResponse]
readPrec :: ReadPrec CancelBatchPredictionJobResponse
$creadPrec :: ReadPrec CancelBatchPredictionJobResponse
readList :: ReadS [CancelBatchPredictionJobResponse]
$creadList :: ReadS [CancelBatchPredictionJobResponse]
readsPrec :: Int -> ReadS CancelBatchPredictionJobResponse
$creadsPrec :: Int -> ReadS CancelBatchPredictionJobResponse
Prelude.Read, Int -> CancelBatchPredictionJobResponse -> ShowS
[CancelBatchPredictionJobResponse] -> ShowS
CancelBatchPredictionJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelBatchPredictionJobResponse] -> ShowS
$cshowList :: [CancelBatchPredictionJobResponse] -> ShowS
show :: CancelBatchPredictionJobResponse -> String
$cshow :: CancelBatchPredictionJobResponse -> String
showsPrec :: Int -> CancelBatchPredictionJobResponse -> ShowS
$cshowsPrec :: Int -> CancelBatchPredictionJobResponse -> ShowS
Prelude.Show, forall x.
Rep CancelBatchPredictionJobResponse x
-> CancelBatchPredictionJobResponse
forall x.
CancelBatchPredictionJobResponse
-> Rep CancelBatchPredictionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelBatchPredictionJobResponse x
-> CancelBatchPredictionJobResponse
$cfrom :: forall x.
CancelBatchPredictionJobResponse
-> Rep CancelBatchPredictionJobResponse x
Prelude.Generic)
newCancelBatchPredictionJobResponse ::
Prelude.Int ->
CancelBatchPredictionJobResponse
newCancelBatchPredictionJobResponse :: Int -> CancelBatchPredictionJobResponse
newCancelBatchPredictionJobResponse Int
pHttpStatus_ =
CancelBatchPredictionJobResponse'
{ $sel:httpStatus:CancelBatchPredictionJobResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
cancelBatchPredictionJobResponse_httpStatus :: Lens.Lens' CancelBatchPredictionJobResponse Prelude.Int
cancelBatchPredictionJobResponse_httpStatus :: Lens' CancelBatchPredictionJobResponse Int
cancelBatchPredictionJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelBatchPredictionJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelBatchPredictionJobResponse' :: CancelBatchPredictionJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelBatchPredictionJobResponse
s@CancelBatchPredictionJobResponse' {} Int
a -> CancelBatchPredictionJobResponse
s {$sel:httpStatus:CancelBatchPredictionJobResponse' :: Int
httpStatus = Int
a} :: CancelBatchPredictionJobResponse)
instance
Prelude.NFData
CancelBatchPredictionJobResponse
where
rnf :: CancelBatchPredictionJobResponse -> ()
rnf CancelBatchPredictionJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelBatchPredictionJobResponse' :: CancelBatchPredictionJobResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus