{-# 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.Glue.CancelMLTaskRun
(
CancelMLTaskRun (..),
newCancelMLTaskRun,
cancelMLTaskRun_transformId,
cancelMLTaskRun_taskRunId,
CancelMLTaskRunResponse (..),
newCancelMLTaskRunResponse,
cancelMLTaskRunResponse_status,
cancelMLTaskRunResponse_transformId,
cancelMLTaskRunResponse_taskRunId,
cancelMLTaskRunResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CancelMLTaskRun = CancelMLTaskRun'
{
CancelMLTaskRun -> Text
transformId :: Prelude.Text,
CancelMLTaskRun -> Text
taskRunId :: Prelude.Text
}
deriving (CancelMLTaskRun -> CancelMLTaskRun -> Bool
(CancelMLTaskRun -> CancelMLTaskRun -> Bool)
-> (CancelMLTaskRun -> CancelMLTaskRun -> Bool)
-> Eq CancelMLTaskRun
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelMLTaskRun -> CancelMLTaskRun -> Bool
$c/= :: CancelMLTaskRun -> CancelMLTaskRun -> Bool
== :: CancelMLTaskRun -> CancelMLTaskRun -> Bool
$c== :: CancelMLTaskRun -> CancelMLTaskRun -> Bool
Prelude.Eq, ReadPrec [CancelMLTaskRun]
ReadPrec CancelMLTaskRun
Int -> ReadS CancelMLTaskRun
ReadS [CancelMLTaskRun]
(Int -> ReadS CancelMLTaskRun)
-> ReadS [CancelMLTaskRun]
-> ReadPrec CancelMLTaskRun
-> ReadPrec [CancelMLTaskRun]
-> Read CancelMLTaskRun
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelMLTaskRun]
$creadListPrec :: ReadPrec [CancelMLTaskRun]
readPrec :: ReadPrec CancelMLTaskRun
$creadPrec :: ReadPrec CancelMLTaskRun
readList :: ReadS [CancelMLTaskRun]
$creadList :: ReadS [CancelMLTaskRun]
readsPrec :: Int -> ReadS CancelMLTaskRun
$creadsPrec :: Int -> ReadS CancelMLTaskRun
Prelude.Read, Int -> CancelMLTaskRun -> ShowS
[CancelMLTaskRun] -> ShowS
CancelMLTaskRun -> String
(Int -> CancelMLTaskRun -> ShowS)
-> (CancelMLTaskRun -> String)
-> ([CancelMLTaskRun] -> ShowS)
-> Show CancelMLTaskRun
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelMLTaskRun] -> ShowS
$cshowList :: [CancelMLTaskRun] -> ShowS
show :: CancelMLTaskRun -> String
$cshow :: CancelMLTaskRun -> String
showsPrec :: Int -> CancelMLTaskRun -> ShowS
$cshowsPrec :: Int -> CancelMLTaskRun -> ShowS
Prelude.Show, (forall x. CancelMLTaskRun -> Rep CancelMLTaskRun x)
-> (forall x. Rep CancelMLTaskRun x -> CancelMLTaskRun)
-> Generic CancelMLTaskRun
forall x. Rep CancelMLTaskRun x -> CancelMLTaskRun
forall x. CancelMLTaskRun -> Rep CancelMLTaskRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CancelMLTaskRun x -> CancelMLTaskRun
$cfrom :: forall x. CancelMLTaskRun -> Rep CancelMLTaskRun x
Prelude.Generic)
newCancelMLTaskRun ::
Prelude.Text ->
Prelude.Text ->
CancelMLTaskRun
newCancelMLTaskRun :: Text -> Text -> CancelMLTaskRun
newCancelMLTaskRun Text
pTransformId_ Text
pTaskRunId_ =
CancelMLTaskRun' :: Text -> Text -> CancelMLTaskRun
CancelMLTaskRun'
{ $sel:transformId:CancelMLTaskRun' :: Text
transformId = Text
pTransformId_,
$sel:taskRunId:CancelMLTaskRun' :: Text
taskRunId = Text
pTaskRunId_
}
cancelMLTaskRun_transformId :: Lens.Lens' CancelMLTaskRun Prelude.Text
cancelMLTaskRun_transformId :: (Text -> f Text) -> CancelMLTaskRun -> f CancelMLTaskRun
cancelMLTaskRun_transformId = (CancelMLTaskRun -> Text)
-> (CancelMLTaskRun -> Text -> CancelMLTaskRun)
-> Lens CancelMLTaskRun CancelMLTaskRun Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelMLTaskRun' {Text
transformId :: Text
$sel:transformId:CancelMLTaskRun' :: CancelMLTaskRun -> Text
transformId} -> Text
transformId) (\s :: CancelMLTaskRun
s@CancelMLTaskRun' {} Text
a -> CancelMLTaskRun
s {$sel:transformId:CancelMLTaskRun' :: Text
transformId = Text
a} :: CancelMLTaskRun)
cancelMLTaskRun_taskRunId :: Lens.Lens' CancelMLTaskRun Prelude.Text
cancelMLTaskRun_taskRunId :: (Text -> f Text) -> CancelMLTaskRun -> f CancelMLTaskRun
cancelMLTaskRun_taskRunId = (CancelMLTaskRun -> Text)
-> (CancelMLTaskRun -> Text -> CancelMLTaskRun)
-> Lens CancelMLTaskRun CancelMLTaskRun Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelMLTaskRun' {Text
taskRunId :: Text
$sel:taskRunId:CancelMLTaskRun' :: CancelMLTaskRun -> Text
taskRunId} -> Text
taskRunId) (\s :: CancelMLTaskRun
s@CancelMLTaskRun' {} Text
a -> CancelMLTaskRun
s {$sel:taskRunId:CancelMLTaskRun' :: Text
taskRunId = Text
a} :: CancelMLTaskRun)
instance Core.AWSRequest CancelMLTaskRun where
type
AWSResponse CancelMLTaskRun =
CancelMLTaskRunResponse
request :: CancelMLTaskRun -> Request CancelMLTaskRun
request = Service -> CancelMLTaskRun -> Request CancelMLTaskRun
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelMLTaskRun
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CancelMLTaskRun)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CancelMLTaskRun))
-> Logger
-> Service
-> Proxy CancelMLTaskRun
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CancelMLTaskRun)))
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 ->
Maybe TaskStatusType
-> Maybe Text -> Maybe Text -> Int -> CancelMLTaskRunResponse
CancelMLTaskRunResponse'
(Maybe TaskStatusType
-> Maybe Text -> Maybe Text -> Int -> CancelMLTaskRunResponse)
-> Either String (Maybe TaskStatusType)
-> Either
String (Maybe Text -> Maybe Text -> Int -> CancelMLTaskRunResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe TaskStatusType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
Either
String (Maybe Text -> Maybe Text -> Int -> CancelMLTaskRunResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CancelMLTaskRunResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TransformId")
Either String (Maybe Text -> Int -> CancelMLTaskRunResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CancelMLTaskRunResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TaskRunId")
Either String (Int -> CancelMLTaskRunResponse)
-> Either String Int -> Either String CancelMLTaskRunResponse
forall (f :: * -> *) a b. Applicative f => 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 CancelMLTaskRun
instance Prelude.NFData CancelMLTaskRun
instance Core.ToHeaders CancelMLTaskRun where
toHeaders :: CancelMLTaskRun -> ResponseHeaders
toHeaders =
ResponseHeaders -> CancelMLTaskRun -> 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
"AWSGlue.CancelMLTaskRun" :: 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 CancelMLTaskRun where
toJSON :: CancelMLTaskRun -> Value
toJSON CancelMLTaskRun' {Text
taskRunId :: Text
transformId :: Text
$sel:taskRunId:CancelMLTaskRun' :: CancelMLTaskRun -> Text
$sel:transformId:CancelMLTaskRun' :: CancelMLTaskRun -> 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
"TransformId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
transformId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TaskRunId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskRunId)
]
)
instance Core.ToPath CancelMLTaskRun where
toPath :: CancelMLTaskRun -> ByteString
toPath = ByteString -> CancelMLTaskRun -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CancelMLTaskRun where
toQuery :: CancelMLTaskRun -> QueryString
toQuery = QueryString -> CancelMLTaskRun -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelMLTaskRunResponse = CancelMLTaskRunResponse'
{
CancelMLTaskRunResponse -> Maybe TaskStatusType
status :: Prelude.Maybe TaskStatusType,
CancelMLTaskRunResponse -> Maybe Text
transformId :: Prelude.Maybe Prelude.Text,
CancelMLTaskRunResponse -> Maybe Text
taskRunId :: Prelude.Maybe Prelude.Text,
CancelMLTaskRunResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CancelMLTaskRunResponse -> CancelMLTaskRunResponse -> Bool
(CancelMLTaskRunResponse -> CancelMLTaskRunResponse -> Bool)
-> (CancelMLTaskRunResponse -> CancelMLTaskRunResponse -> Bool)
-> Eq CancelMLTaskRunResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelMLTaskRunResponse -> CancelMLTaskRunResponse -> Bool
$c/= :: CancelMLTaskRunResponse -> CancelMLTaskRunResponse -> Bool
== :: CancelMLTaskRunResponse -> CancelMLTaskRunResponse -> Bool
$c== :: CancelMLTaskRunResponse -> CancelMLTaskRunResponse -> Bool
Prelude.Eq, ReadPrec [CancelMLTaskRunResponse]
ReadPrec CancelMLTaskRunResponse
Int -> ReadS CancelMLTaskRunResponse
ReadS [CancelMLTaskRunResponse]
(Int -> ReadS CancelMLTaskRunResponse)
-> ReadS [CancelMLTaskRunResponse]
-> ReadPrec CancelMLTaskRunResponse
-> ReadPrec [CancelMLTaskRunResponse]
-> Read CancelMLTaskRunResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelMLTaskRunResponse]
$creadListPrec :: ReadPrec [CancelMLTaskRunResponse]
readPrec :: ReadPrec CancelMLTaskRunResponse
$creadPrec :: ReadPrec CancelMLTaskRunResponse
readList :: ReadS [CancelMLTaskRunResponse]
$creadList :: ReadS [CancelMLTaskRunResponse]
readsPrec :: Int -> ReadS CancelMLTaskRunResponse
$creadsPrec :: Int -> ReadS CancelMLTaskRunResponse
Prelude.Read, Int -> CancelMLTaskRunResponse -> ShowS
[CancelMLTaskRunResponse] -> ShowS
CancelMLTaskRunResponse -> String
(Int -> CancelMLTaskRunResponse -> ShowS)
-> (CancelMLTaskRunResponse -> String)
-> ([CancelMLTaskRunResponse] -> ShowS)
-> Show CancelMLTaskRunResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelMLTaskRunResponse] -> ShowS
$cshowList :: [CancelMLTaskRunResponse] -> ShowS
show :: CancelMLTaskRunResponse -> String
$cshow :: CancelMLTaskRunResponse -> String
showsPrec :: Int -> CancelMLTaskRunResponse -> ShowS
$cshowsPrec :: Int -> CancelMLTaskRunResponse -> ShowS
Prelude.Show, (forall x.
CancelMLTaskRunResponse -> Rep CancelMLTaskRunResponse x)
-> (forall x.
Rep CancelMLTaskRunResponse x -> CancelMLTaskRunResponse)
-> Generic CancelMLTaskRunResponse
forall x. Rep CancelMLTaskRunResponse x -> CancelMLTaskRunResponse
forall x. CancelMLTaskRunResponse -> Rep CancelMLTaskRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CancelMLTaskRunResponse x -> CancelMLTaskRunResponse
$cfrom :: forall x. CancelMLTaskRunResponse -> Rep CancelMLTaskRunResponse x
Prelude.Generic)
newCancelMLTaskRunResponse ::
Prelude.Int ->
CancelMLTaskRunResponse
newCancelMLTaskRunResponse :: Int -> CancelMLTaskRunResponse
newCancelMLTaskRunResponse Int
pHttpStatus_ =
CancelMLTaskRunResponse' :: Maybe TaskStatusType
-> Maybe Text -> Maybe Text -> Int -> CancelMLTaskRunResponse
CancelMLTaskRunResponse'
{ $sel:status:CancelMLTaskRunResponse' :: Maybe TaskStatusType
status = Maybe TaskStatusType
forall a. Maybe a
Prelude.Nothing,
$sel:transformId:CancelMLTaskRunResponse' :: Maybe Text
transformId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taskRunId:CancelMLTaskRunResponse' :: Maybe Text
taskRunId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CancelMLTaskRunResponse' :: Int
httpStatus = Int
pHttpStatus_
}
cancelMLTaskRunResponse_status :: Lens.Lens' CancelMLTaskRunResponse (Prelude.Maybe TaskStatusType)
cancelMLTaskRunResponse_status :: (Maybe TaskStatusType -> f (Maybe TaskStatusType))
-> CancelMLTaskRunResponse -> f CancelMLTaskRunResponse
cancelMLTaskRunResponse_status = (CancelMLTaskRunResponse -> Maybe TaskStatusType)
-> (CancelMLTaskRunResponse
-> Maybe TaskStatusType -> CancelMLTaskRunResponse)
-> Lens
CancelMLTaskRunResponse
CancelMLTaskRunResponse
(Maybe TaskStatusType)
(Maybe TaskStatusType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelMLTaskRunResponse' {Maybe TaskStatusType
status :: Maybe TaskStatusType
$sel:status:CancelMLTaskRunResponse' :: CancelMLTaskRunResponse -> Maybe TaskStatusType
status} -> Maybe TaskStatusType
status) (\s :: CancelMLTaskRunResponse
s@CancelMLTaskRunResponse' {} Maybe TaskStatusType
a -> CancelMLTaskRunResponse
s {$sel:status:CancelMLTaskRunResponse' :: Maybe TaskStatusType
status = Maybe TaskStatusType
a} :: CancelMLTaskRunResponse)
cancelMLTaskRunResponse_transformId :: Lens.Lens' CancelMLTaskRunResponse (Prelude.Maybe Prelude.Text)
cancelMLTaskRunResponse_transformId :: (Maybe Text -> f (Maybe Text))
-> CancelMLTaskRunResponse -> f CancelMLTaskRunResponse
cancelMLTaskRunResponse_transformId = (CancelMLTaskRunResponse -> Maybe Text)
-> (CancelMLTaskRunResponse
-> Maybe Text -> CancelMLTaskRunResponse)
-> Lens
CancelMLTaskRunResponse
CancelMLTaskRunResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelMLTaskRunResponse' {Maybe Text
transformId :: Maybe Text
$sel:transformId:CancelMLTaskRunResponse' :: CancelMLTaskRunResponse -> Maybe Text
transformId} -> Maybe Text
transformId) (\s :: CancelMLTaskRunResponse
s@CancelMLTaskRunResponse' {} Maybe Text
a -> CancelMLTaskRunResponse
s {$sel:transformId:CancelMLTaskRunResponse' :: Maybe Text
transformId = Maybe Text
a} :: CancelMLTaskRunResponse)
cancelMLTaskRunResponse_taskRunId :: Lens.Lens' CancelMLTaskRunResponse (Prelude.Maybe Prelude.Text)
cancelMLTaskRunResponse_taskRunId :: (Maybe Text -> f (Maybe Text))
-> CancelMLTaskRunResponse -> f CancelMLTaskRunResponse
cancelMLTaskRunResponse_taskRunId = (CancelMLTaskRunResponse -> Maybe Text)
-> (CancelMLTaskRunResponse
-> Maybe Text -> CancelMLTaskRunResponse)
-> Lens
CancelMLTaskRunResponse
CancelMLTaskRunResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelMLTaskRunResponse' {Maybe Text
taskRunId :: Maybe Text
$sel:taskRunId:CancelMLTaskRunResponse' :: CancelMLTaskRunResponse -> Maybe Text
taskRunId} -> Maybe Text
taskRunId) (\s :: CancelMLTaskRunResponse
s@CancelMLTaskRunResponse' {} Maybe Text
a -> CancelMLTaskRunResponse
s {$sel:taskRunId:CancelMLTaskRunResponse' :: Maybe Text
taskRunId = Maybe Text
a} :: CancelMLTaskRunResponse)
cancelMLTaskRunResponse_httpStatus :: Lens.Lens' CancelMLTaskRunResponse Prelude.Int
cancelMLTaskRunResponse_httpStatus :: (Int -> f Int)
-> CancelMLTaskRunResponse -> f CancelMLTaskRunResponse
cancelMLTaskRunResponse_httpStatus = (CancelMLTaskRunResponse -> Int)
-> (CancelMLTaskRunResponse -> Int -> CancelMLTaskRunResponse)
-> Lens CancelMLTaskRunResponse CancelMLTaskRunResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelMLTaskRunResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelMLTaskRunResponse' :: CancelMLTaskRunResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelMLTaskRunResponse
s@CancelMLTaskRunResponse' {} Int
a -> CancelMLTaskRunResponse
s {$sel:httpStatus:CancelMLTaskRunResponse' :: Int
httpStatus = Int
a} :: CancelMLTaskRunResponse)
instance Prelude.NFData CancelMLTaskRunResponse