{-# 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.MacieV2.UpdateClassificationJob
(
UpdateClassificationJob (..),
newUpdateClassificationJob,
updateClassificationJob_jobId,
updateClassificationJob_jobStatus,
UpdateClassificationJobResponse (..),
newUpdateClassificationJobResponse,
updateClassificationJobResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateClassificationJob = UpdateClassificationJob'
{
UpdateClassificationJob -> Text
jobId :: Prelude.Text,
UpdateClassificationJob -> JobStatus
jobStatus :: JobStatus
}
deriving (UpdateClassificationJob -> UpdateClassificationJob -> Bool
(UpdateClassificationJob -> UpdateClassificationJob -> Bool)
-> (UpdateClassificationJob -> UpdateClassificationJob -> Bool)
-> Eq UpdateClassificationJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateClassificationJob -> UpdateClassificationJob -> Bool
$c/= :: UpdateClassificationJob -> UpdateClassificationJob -> Bool
== :: UpdateClassificationJob -> UpdateClassificationJob -> Bool
$c== :: UpdateClassificationJob -> UpdateClassificationJob -> Bool
Prelude.Eq, ReadPrec [UpdateClassificationJob]
ReadPrec UpdateClassificationJob
Int -> ReadS UpdateClassificationJob
ReadS [UpdateClassificationJob]
(Int -> ReadS UpdateClassificationJob)
-> ReadS [UpdateClassificationJob]
-> ReadPrec UpdateClassificationJob
-> ReadPrec [UpdateClassificationJob]
-> Read UpdateClassificationJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateClassificationJob]
$creadListPrec :: ReadPrec [UpdateClassificationJob]
readPrec :: ReadPrec UpdateClassificationJob
$creadPrec :: ReadPrec UpdateClassificationJob
readList :: ReadS [UpdateClassificationJob]
$creadList :: ReadS [UpdateClassificationJob]
readsPrec :: Int -> ReadS UpdateClassificationJob
$creadsPrec :: Int -> ReadS UpdateClassificationJob
Prelude.Read, Int -> UpdateClassificationJob -> ShowS
[UpdateClassificationJob] -> ShowS
UpdateClassificationJob -> String
(Int -> UpdateClassificationJob -> ShowS)
-> (UpdateClassificationJob -> String)
-> ([UpdateClassificationJob] -> ShowS)
-> Show UpdateClassificationJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateClassificationJob] -> ShowS
$cshowList :: [UpdateClassificationJob] -> ShowS
show :: UpdateClassificationJob -> String
$cshow :: UpdateClassificationJob -> String
showsPrec :: Int -> UpdateClassificationJob -> ShowS
$cshowsPrec :: Int -> UpdateClassificationJob -> ShowS
Prelude.Show, (forall x.
UpdateClassificationJob -> Rep UpdateClassificationJob x)
-> (forall x.
Rep UpdateClassificationJob x -> UpdateClassificationJob)
-> Generic UpdateClassificationJob
forall x. Rep UpdateClassificationJob x -> UpdateClassificationJob
forall x. UpdateClassificationJob -> Rep UpdateClassificationJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateClassificationJob x -> UpdateClassificationJob
$cfrom :: forall x. UpdateClassificationJob -> Rep UpdateClassificationJob x
Prelude.Generic)
newUpdateClassificationJob ::
Prelude.Text ->
JobStatus ->
UpdateClassificationJob
newUpdateClassificationJob :: Text -> JobStatus -> UpdateClassificationJob
newUpdateClassificationJob Text
pJobId_ JobStatus
pJobStatus_ =
UpdateClassificationJob' :: Text -> JobStatus -> UpdateClassificationJob
UpdateClassificationJob'
{ $sel:jobId:UpdateClassificationJob' :: Text
jobId = Text
pJobId_,
$sel:jobStatus:UpdateClassificationJob' :: JobStatus
jobStatus = JobStatus
pJobStatus_
}
updateClassificationJob_jobId :: Lens.Lens' UpdateClassificationJob Prelude.Text
updateClassificationJob_jobId :: (Text -> f Text)
-> UpdateClassificationJob -> f UpdateClassificationJob
updateClassificationJob_jobId = (UpdateClassificationJob -> Text)
-> (UpdateClassificationJob -> Text -> UpdateClassificationJob)
-> Lens UpdateClassificationJob UpdateClassificationJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClassificationJob' {Text
jobId :: Text
$sel:jobId:UpdateClassificationJob' :: UpdateClassificationJob -> Text
jobId} -> Text
jobId) (\s :: UpdateClassificationJob
s@UpdateClassificationJob' {} Text
a -> UpdateClassificationJob
s {$sel:jobId:UpdateClassificationJob' :: Text
jobId = Text
a} :: UpdateClassificationJob)
updateClassificationJob_jobStatus :: Lens.Lens' UpdateClassificationJob JobStatus
updateClassificationJob_jobStatus :: (JobStatus -> f JobStatus)
-> UpdateClassificationJob -> f UpdateClassificationJob
updateClassificationJob_jobStatus = (UpdateClassificationJob -> JobStatus)
-> (UpdateClassificationJob
-> JobStatus -> UpdateClassificationJob)
-> Lens
UpdateClassificationJob UpdateClassificationJob JobStatus JobStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClassificationJob' {JobStatus
jobStatus :: JobStatus
$sel:jobStatus:UpdateClassificationJob' :: UpdateClassificationJob -> JobStatus
jobStatus} -> JobStatus
jobStatus) (\s :: UpdateClassificationJob
s@UpdateClassificationJob' {} JobStatus
a -> UpdateClassificationJob
s {$sel:jobStatus:UpdateClassificationJob' :: JobStatus
jobStatus = JobStatus
a} :: UpdateClassificationJob)
instance Core.AWSRequest UpdateClassificationJob where
type
AWSResponse UpdateClassificationJob =
UpdateClassificationJobResponse
request :: UpdateClassificationJob -> Request UpdateClassificationJob
request = Service
-> UpdateClassificationJob -> Request UpdateClassificationJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateClassificationJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateClassificationJob)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateClassificationJob))
-> Logger
-> Service
-> Proxy UpdateClassificationJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateClassificationJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateClassificationJobResponse
UpdateClassificationJobResponse'
(Int -> UpdateClassificationJobResponse)
-> Either String Int
-> Either String UpdateClassificationJobResponse
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))
)
instance Prelude.Hashable UpdateClassificationJob
instance Prelude.NFData UpdateClassificationJob
instance Core.ToHeaders UpdateClassificationJob where
toHeaders :: UpdateClassificationJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateClassificationJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 UpdateClassificationJob where
toJSON :: UpdateClassificationJob -> Value
toJSON UpdateClassificationJob' {Text
JobStatus
jobStatus :: JobStatus
jobId :: Text
$sel:jobStatus:UpdateClassificationJob' :: UpdateClassificationJob -> JobStatus
$sel:jobId:UpdateClassificationJob' :: UpdateClassificationJob -> 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
"jobStatus" Text -> JobStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobStatus
jobStatus)]
)
instance Core.ToPath UpdateClassificationJob where
toPath :: UpdateClassificationJob -> ByteString
toPath UpdateClassificationJob' {Text
JobStatus
jobStatus :: JobStatus
jobId :: Text
$sel:jobStatus:UpdateClassificationJob' :: UpdateClassificationJob -> JobStatus
$sel:jobId:UpdateClassificationJob' :: UpdateClassificationJob -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/jobs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobId]
instance Core.ToQuery UpdateClassificationJob where
toQuery :: UpdateClassificationJob -> QueryString
toQuery = QueryString -> UpdateClassificationJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateClassificationJobResponse = UpdateClassificationJobResponse'
{
UpdateClassificationJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateClassificationJobResponse
-> UpdateClassificationJobResponse -> Bool
(UpdateClassificationJobResponse
-> UpdateClassificationJobResponse -> Bool)
-> (UpdateClassificationJobResponse
-> UpdateClassificationJobResponse -> Bool)
-> Eq UpdateClassificationJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateClassificationJobResponse
-> UpdateClassificationJobResponse -> Bool
$c/= :: UpdateClassificationJobResponse
-> UpdateClassificationJobResponse -> Bool
== :: UpdateClassificationJobResponse
-> UpdateClassificationJobResponse -> Bool
$c== :: UpdateClassificationJobResponse
-> UpdateClassificationJobResponse -> Bool
Prelude.Eq, ReadPrec [UpdateClassificationJobResponse]
ReadPrec UpdateClassificationJobResponse
Int -> ReadS UpdateClassificationJobResponse
ReadS [UpdateClassificationJobResponse]
(Int -> ReadS UpdateClassificationJobResponse)
-> ReadS [UpdateClassificationJobResponse]
-> ReadPrec UpdateClassificationJobResponse
-> ReadPrec [UpdateClassificationJobResponse]
-> Read UpdateClassificationJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateClassificationJobResponse]
$creadListPrec :: ReadPrec [UpdateClassificationJobResponse]
readPrec :: ReadPrec UpdateClassificationJobResponse
$creadPrec :: ReadPrec UpdateClassificationJobResponse
readList :: ReadS [UpdateClassificationJobResponse]
$creadList :: ReadS [UpdateClassificationJobResponse]
readsPrec :: Int -> ReadS UpdateClassificationJobResponse
$creadsPrec :: Int -> ReadS UpdateClassificationJobResponse
Prelude.Read, Int -> UpdateClassificationJobResponse -> ShowS
[UpdateClassificationJobResponse] -> ShowS
UpdateClassificationJobResponse -> String
(Int -> UpdateClassificationJobResponse -> ShowS)
-> (UpdateClassificationJobResponse -> String)
-> ([UpdateClassificationJobResponse] -> ShowS)
-> Show UpdateClassificationJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateClassificationJobResponse] -> ShowS
$cshowList :: [UpdateClassificationJobResponse] -> ShowS
show :: UpdateClassificationJobResponse -> String
$cshow :: UpdateClassificationJobResponse -> String
showsPrec :: Int -> UpdateClassificationJobResponse -> ShowS
$cshowsPrec :: Int -> UpdateClassificationJobResponse -> ShowS
Prelude.Show, (forall x.
UpdateClassificationJobResponse
-> Rep UpdateClassificationJobResponse x)
-> (forall x.
Rep UpdateClassificationJobResponse x
-> UpdateClassificationJobResponse)
-> Generic UpdateClassificationJobResponse
forall x.
Rep UpdateClassificationJobResponse x
-> UpdateClassificationJobResponse
forall x.
UpdateClassificationJobResponse
-> Rep UpdateClassificationJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateClassificationJobResponse x
-> UpdateClassificationJobResponse
$cfrom :: forall x.
UpdateClassificationJobResponse
-> Rep UpdateClassificationJobResponse x
Prelude.Generic)
newUpdateClassificationJobResponse ::
Prelude.Int ->
UpdateClassificationJobResponse
newUpdateClassificationJobResponse :: Int -> UpdateClassificationJobResponse
newUpdateClassificationJobResponse Int
pHttpStatus_ =
UpdateClassificationJobResponse' :: Int -> UpdateClassificationJobResponse
UpdateClassificationJobResponse'
{ $sel:httpStatus:UpdateClassificationJobResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateClassificationJobResponse_httpStatus :: Lens.Lens' UpdateClassificationJobResponse Prelude.Int
updateClassificationJobResponse_httpStatus :: (Int -> f Int)
-> UpdateClassificationJobResponse
-> f UpdateClassificationJobResponse
updateClassificationJobResponse_httpStatus = (UpdateClassificationJobResponse -> Int)
-> (UpdateClassificationJobResponse
-> Int -> UpdateClassificationJobResponse)
-> Lens
UpdateClassificationJobResponse
UpdateClassificationJobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClassificationJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateClassificationJobResponse' :: UpdateClassificationJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateClassificationJobResponse
s@UpdateClassificationJobResponse' {} Int
a -> UpdateClassificationJobResponse
s {$sel:httpStatus:UpdateClassificationJobResponse' :: Int
httpStatus = Int
a} :: UpdateClassificationJobResponse)
instance
Prelude.NFData
UpdateClassificationJobResponse