{-# 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.ResumeWorkflowRun
(
ResumeWorkflowRun (..),
newResumeWorkflowRun,
resumeWorkflowRun_name,
resumeWorkflowRun_runId,
resumeWorkflowRun_nodeIds,
ResumeWorkflowRunResponse (..),
newResumeWorkflowRunResponse,
resumeWorkflowRunResponse_nodeIds,
resumeWorkflowRunResponse_runId,
resumeWorkflowRunResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ResumeWorkflowRun = ResumeWorkflowRun'
{
ResumeWorkflowRun -> Text
name :: Prelude.Text,
ResumeWorkflowRun -> Text
runId :: Prelude.Text,
ResumeWorkflowRun -> [Text]
nodeIds :: [Prelude.Text]
}
deriving (ResumeWorkflowRun -> ResumeWorkflowRun -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResumeWorkflowRun -> ResumeWorkflowRun -> Bool
$c/= :: ResumeWorkflowRun -> ResumeWorkflowRun -> Bool
== :: ResumeWorkflowRun -> ResumeWorkflowRun -> Bool
$c== :: ResumeWorkflowRun -> ResumeWorkflowRun -> Bool
Prelude.Eq, ReadPrec [ResumeWorkflowRun]
ReadPrec ResumeWorkflowRun
Int -> ReadS ResumeWorkflowRun
ReadS [ResumeWorkflowRun]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResumeWorkflowRun]
$creadListPrec :: ReadPrec [ResumeWorkflowRun]
readPrec :: ReadPrec ResumeWorkflowRun
$creadPrec :: ReadPrec ResumeWorkflowRun
readList :: ReadS [ResumeWorkflowRun]
$creadList :: ReadS [ResumeWorkflowRun]
readsPrec :: Int -> ReadS ResumeWorkflowRun
$creadsPrec :: Int -> ReadS ResumeWorkflowRun
Prelude.Read, Int -> ResumeWorkflowRun -> ShowS
[ResumeWorkflowRun] -> ShowS
ResumeWorkflowRun -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResumeWorkflowRun] -> ShowS
$cshowList :: [ResumeWorkflowRun] -> ShowS
show :: ResumeWorkflowRun -> String
$cshow :: ResumeWorkflowRun -> String
showsPrec :: Int -> ResumeWorkflowRun -> ShowS
$cshowsPrec :: Int -> ResumeWorkflowRun -> ShowS
Prelude.Show, forall x. Rep ResumeWorkflowRun x -> ResumeWorkflowRun
forall x. ResumeWorkflowRun -> Rep ResumeWorkflowRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResumeWorkflowRun x -> ResumeWorkflowRun
$cfrom :: forall x. ResumeWorkflowRun -> Rep ResumeWorkflowRun x
Prelude.Generic)
newResumeWorkflowRun ::
Prelude.Text ->
Prelude.Text ->
ResumeWorkflowRun
newResumeWorkflowRun :: Text -> Text -> ResumeWorkflowRun
newResumeWorkflowRun Text
pName_ Text
pRunId_ =
ResumeWorkflowRun'
{ $sel:name:ResumeWorkflowRun' :: Text
name = Text
pName_,
$sel:runId:ResumeWorkflowRun' :: Text
runId = Text
pRunId_,
$sel:nodeIds:ResumeWorkflowRun' :: [Text]
nodeIds = forall a. Monoid a => a
Prelude.mempty
}
resumeWorkflowRun_name :: Lens.Lens' ResumeWorkflowRun Prelude.Text
resumeWorkflowRun_name :: Lens' ResumeWorkflowRun Text
resumeWorkflowRun_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeWorkflowRun' {Text
name :: Text
$sel:name:ResumeWorkflowRun' :: ResumeWorkflowRun -> Text
name} -> Text
name) (\s :: ResumeWorkflowRun
s@ResumeWorkflowRun' {} Text
a -> ResumeWorkflowRun
s {$sel:name:ResumeWorkflowRun' :: Text
name = Text
a} :: ResumeWorkflowRun)
resumeWorkflowRun_runId :: Lens.Lens' ResumeWorkflowRun Prelude.Text
resumeWorkflowRun_runId :: Lens' ResumeWorkflowRun Text
resumeWorkflowRun_runId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeWorkflowRun' {Text
runId :: Text
$sel:runId:ResumeWorkflowRun' :: ResumeWorkflowRun -> Text
runId} -> Text
runId) (\s :: ResumeWorkflowRun
s@ResumeWorkflowRun' {} Text
a -> ResumeWorkflowRun
s {$sel:runId:ResumeWorkflowRun' :: Text
runId = Text
a} :: ResumeWorkflowRun)
resumeWorkflowRun_nodeIds :: Lens.Lens' ResumeWorkflowRun [Prelude.Text]
resumeWorkflowRun_nodeIds :: Lens' ResumeWorkflowRun [Text]
resumeWorkflowRun_nodeIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeWorkflowRun' {[Text]
nodeIds :: [Text]
$sel:nodeIds:ResumeWorkflowRun' :: ResumeWorkflowRun -> [Text]
nodeIds} -> [Text]
nodeIds) (\s :: ResumeWorkflowRun
s@ResumeWorkflowRun' {} [Text]
a -> ResumeWorkflowRun
s {$sel:nodeIds:ResumeWorkflowRun' :: [Text]
nodeIds = [Text]
a} :: ResumeWorkflowRun) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest ResumeWorkflowRun where
type
AWSResponse ResumeWorkflowRun =
ResumeWorkflowRunResponse
request :: (Service -> Service)
-> ResumeWorkflowRun -> Request ResumeWorkflowRun
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 ResumeWorkflowRun
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResumeWorkflowRun)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [Text] -> Maybe Text -> Int -> ResumeWorkflowRunResponse
ResumeWorkflowRunResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NodeIds" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RunId")
forall (f :: * -> *) a b. Applicative f => 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 ResumeWorkflowRun where
hashWithSalt :: Int -> ResumeWorkflowRun -> Int
hashWithSalt Int
_salt ResumeWorkflowRun' {[Text]
Text
nodeIds :: [Text]
runId :: Text
name :: Text
$sel:nodeIds:ResumeWorkflowRun' :: ResumeWorkflowRun -> [Text]
$sel:runId:ResumeWorkflowRun' :: ResumeWorkflowRun -> Text
$sel:name:ResumeWorkflowRun' :: ResumeWorkflowRun -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
runId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
nodeIds
instance Prelude.NFData ResumeWorkflowRun where
rnf :: ResumeWorkflowRun -> ()
rnf ResumeWorkflowRun' {[Text]
Text
nodeIds :: [Text]
runId :: Text
name :: Text
$sel:nodeIds:ResumeWorkflowRun' :: ResumeWorkflowRun -> [Text]
$sel:runId:ResumeWorkflowRun' :: ResumeWorkflowRun -> Text
$sel:name:ResumeWorkflowRun' :: ResumeWorkflowRun -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
runId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
nodeIds
instance Data.ToHeaders ResumeWorkflowRun where
toHeaders :: ResumeWorkflowRun -> 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
"AWSGlue.ResumeWorkflowRun" :: 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 ResumeWorkflowRun where
toJSON :: ResumeWorkflowRun -> Value
toJSON ResumeWorkflowRun' {[Text]
Text
nodeIds :: [Text]
runId :: Text
name :: Text
$sel:nodeIds:ResumeWorkflowRun' :: ResumeWorkflowRun -> [Text]
$sel:runId:ResumeWorkflowRun' :: ResumeWorkflowRun -> Text
$sel:name:ResumeWorkflowRun' :: ResumeWorkflowRun -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"RunId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
runId),
forall a. a -> Maybe a
Prelude.Just (Key
"NodeIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
nodeIds)
]
)
instance Data.ToPath ResumeWorkflowRun where
toPath :: ResumeWorkflowRun -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ResumeWorkflowRun where
toQuery :: ResumeWorkflowRun -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ResumeWorkflowRunResponse = ResumeWorkflowRunResponse'
{
ResumeWorkflowRunResponse -> Maybe [Text]
nodeIds :: Prelude.Maybe [Prelude.Text],
ResumeWorkflowRunResponse -> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
ResumeWorkflowRunResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ResumeWorkflowRunResponse -> ResumeWorkflowRunResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResumeWorkflowRunResponse -> ResumeWorkflowRunResponse -> Bool
$c/= :: ResumeWorkflowRunResponse -> ResumeWorkflowRunResponse -> Bool
== :: ResumeWorkflowRunResponse -> ResumeWorkflowRunResponse -> Bool
$c== :: ResumeWorkflowRunResponse -> ResumeWorkflowRunResponse -> Bool
Prelude.Eq, ReadPrec [ResumeWorkflowRunResponse]
ReadPrec ResumeWorkflowRunResponse
Int -> ReadS ResumeWorkflowRunResponse
ReadS [ResumeWorkflowRunResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResumeWorkflowRunResponse]
$creadListPrec :: ReadPrec [ResumeWorkflowRunResponse]
readPrec :: ReadPrec ResumeWorkflowRunResponse
$creadPrec :: ReadPrec ResumeWorkflowRunResponse
readList :: ReadS [ResumeWorkflowRunResponse]
$creadList :: ReadS [ResumeWorkflowRunResponse]
readsPrec :: Int -> ReadS ResumeWorkflowRunResponse
$creadsPrec :: Int -> ReadS ResumeWorkflowRunResponse
Prelude.Read, Int -> ResumeWorkflowRunResponse -> ShowS
[ResumeWorkflowRunResponse] -> ShowS
ResumeWorkflowRunResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResumeWorkflowRunResponse] -> ShowS
$cshowList :: [ResumeWorkflowRunResponse] -> ShowS
show :: ResumeWorkflowRunResponse -> String
$cshow :: ResumeWorkflowRunResponse -> String
showsPrec :: Int -> ResumeWorkflowRunResponse -> ShowS
$cshowsPrec :: Int -> ResumeWorkflowRunResponse -> ShowS
Prelude.Show, forall x.
Rep ResumeWorkflowRunResponse x -> ResumeWorkflowRunResponse
forall x.
ResumeWorkflowRunResponse -> Rep ResumeWorkflowRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResumeWorkflowRunResponse x -> ResumeWorkflowRunResponse
$cfrom :: forall x.
ResumeWorkflowRunResponse -> Rep ResumeWorkflowRunResponse x
Prelude.Generic)
newResumeWorkflowRunResponse ::
Prelude.Int ->
ResumeWorkflowRunResponse
newResumeWorkflowRunResponse :: Int -> ResumeWorkflowRunResponse
newResumeWorkflowRunResponse Int
pHttpStatus_ =
ResumeWorkflowRunResponse'
{ $sel:nodeIds:ResumeWorkflowRunResponse' :: Maybe [Text]
nodeIds =
forall a. Maybe a
Prelude.Nothing,
$sel:runId:ResumeWorkflowRunResponse' :: Maybe Text
runId = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ResumeWorkflowRunResponse' :: Int
httpStatus = Int
pHttpStatus_
}
resumeWorkflowRunResponse_nodeIds :: Lens.Lens' ResumeWorkflowRunResponse (Prelude.Maybe [Prelude.Text])
resumeWorkflowRunResponse_nodeIds :: Lens' ResumeWorkflowRunResponse (Maybe [Text])
resumeWorkflowRunResponse_nodeIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeWorkflowRunResponse' {Maybe [Text]
nodeIds :: Maybe [Text]
$sel:nodeIds:ResumeWorkflowRunResponse' :: ResumeWorkflowRunResponse -> Maybe [Text]
nodeIds} -> Maybe [Text]
nodeIds) (\s :: ResumeWorkflowRunResponse
s@ResumeWorkflowRunResponse' {} Maybe [Text]
a -> ResumeWorkflowRunResponse
s {$sel:nodeIds:ResumeWorkflowRunResponse' :: Maybe [Text]
nodeIds = Maybe [Text]
a} :: ResumeWorkflowRunResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
resumeWorkflowRunResponse_runId :: Lens.Lens' ResumeWorkflowRunResponse (Prelude.Maybe Prelude.Text)
resumeWorkflowRunResponse_runId :: Lens' ResumeWorkflowRunResponse (Maybe Text)
resumeWorkflowRunResponse_runId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeWorkflowRunResponse' {Maybe Text
runId :: Maybe Text
$sel:runId:ResumeWorkflowRunResponse' :: ResumeWorkflowRunResponse -> Maybe Text
runId} -> Maybe Text
runId) (\s :: ResumeWorkflowRunResponse
s@ResumeWorkflowRunResponse' {} Maybe Text
a -> ResumeWorkflowRunResponse
s {$sel:runId:ResumeWorkflowRunResponse' :: Maybe Text
runId = Maybe Text
a} :: ResumeWorkflowRunResponse)
resumeWorkflowRunResponse_httpStatus :: Lens.Lens' ResumeWorkflowRunResponse Prelude.Int
resumeWorkflowRunResponse_httpStatus :: Lens' ResumeWorkflowRunResponse Int
resumeWorkflowRunResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeWorkflowRunResponse' {Int
httpStatus :: Int
$sel:httpStatus:ResumeWorkflowRunResponse' :: ResumeWorkflowRunResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ResumeWorkflowRunResponse
s@ResumeWorkflowRunResponse' {} Int
a -> ResumeWorkflowRunResponse
s {$sel:httpStatus:ResumeWorkflowRunResponse' :: Int
httpStatus = Int
a} :: ResumeWorkflowRunResponse)
instance Prelude.NFData ResumeWorkflowRunResponse where
rnf :: ResumeWorkflowRunResponse -> ()
rnf ResumeWorkflowRunResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
runId :: Maybe Text
nodeIds :: Maybe [Text]
$sel:httpStatus:ResumeWorkflowRunResponse' :: ResumeWorkflowRunResponse -> Int
$sel:runId:ResumeWorkflowRunResponse' :: ResumeWorkflowRunResponse -> Maybe Text
$sel:nodeIds:ResumeWorkflowRunResponse' :: ResumeWorkflowRunResponse -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
nodeIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
runId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus