{-# 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.BatchStopJobRun
(
BatchStopJobRun (..),
newBatchStopJobRun,
batchStopJobRun_jobName,
batchStopJobRun_jobRunIds,
BatchStopJobRunResponse (..),
newBatchStopJobRunResponse,
batchStopJobRunResponse_errors,
batchStopJobRunResponse_successfulSubmissions,
batchStopJobRunResponse_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 BatchStopJobRun = BatchStopJobRun'
{
BatchStopJobRun -> Text
jobName :: Prelude.Text,
BatchStopJobRun -> NonEmpty Text
jobRunIds :: Prelude.NonEmpty Prelude.Text
}
deriving (BatchStopJobRun -> BatchStopJobRun -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchStopJobRun -> BatchStopJobRun -> Bool
$c/= :: BatchStopJobRun -> BatchStopJobRun -> Bool
== :: BatchStopJobRun -> BatchStopJobRun -> Bool
$c== :: BatchStopJobRun -> BatchStopJobRun -> Bool
Prelude.Eq, ReadPrec [BatchStopJobRun]
ReadPrec BatchStopJobRun
Int -> ReadS BatchStopJobRun
ReadS [BatchStopJobRun]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchStopJobRun]
$creadListPrec :: ReadPrec [BatchStopJobRun]
readPrec :: ReadPrec BatchStopJobRun
$creadPrec :: ReadPrec BatchStopJobRun
readList :: ReadS [BatchStopJobRun]
$creadList :: ReadS [BatchStopJobRun]
readsPrec :: Int -> ReadS BatchStopJobRun
$creadsPrec :: Int -> ReadS BatchStopJobRun
Prelude.Read, Int -> BatchStopJobRun -> ShowS
[BatchStopJobRun] -> ShowS
BatchStopJobRun -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchStopJobRun] -> ShowS
$cshowList :: [BatchStopJobRun] -> ShowS
show :: BatchStopJobRun -> String
$cshow :: BatchStopJobRun -> String
showsPrec :: Int -> BatchStopJobRun -> ShowS
$cshowsPrec :: Int -> BatchStopJobRun -> ShowS
Prelude.Show, forall x. Rep BatchStopJobRun x -> BatchStopJobRun
forall x. BatchStopJobRun -> Rep BatchStopJobRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchStopJobRun x -> BatchStopJobRun
$cfrom :: forall x. BatchStopJobRun -> Rep BatchStopJobRun x
Prelude.Generic)
newBatchStopJobRun ::
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
BatchStopJobRun
newBatchStopJobRun :: Text -> NonEmpty Text -> BatchStopJobRun
newBatchStopJobRun Text
pJobName_ NonEmpty Text
pJobRunIds_ =
BatchStopJobRun'
{ $sel:jobName:BatchStopJobRun' :: Text
jobName = Text
pJobName_,
$sel:jobRunIds:BatchStopJobRun' :: NonEmpty Text
jobRunIds = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pJobRunIds_
}
batchStopJobRun_jobName :: Lens.Lens' BatchStopJobRun Prelude.Text
batchStopJobRun_jobName :: Lens' BatchStopJobRun Text
batchStopJobRun_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStopJobRun' {Text
jobName :: Text
$sel:jobName:BatchStopJobRun' :: BatchStopJobRun -> Text
jobName} -> Text
jobName) (\s :: BatchStopJobRun
s@BatchStopJobRun' {} Text
a -> BatchStopJobRun
s {$sel:jobName:BatchStopJobRun' :: Text
jobName = Text
a} :: BatchStopJobRun)
batchStopJobRun_jobRunIds :: Lens.Lens' BatchStopJobRun (Prelude.NonEmpty Prelude.Text)
batchStopJobRun_jobRunIds :: Lens' BatchStopJobRun (NonEmpty Text)
batchStopJobRun_jobRunIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStopJobRun' {NonEmpty Text
jobRunIds :: NonEmpty Text
$sel:jobRunIds:BatchStopJobRun' :: BatchStopJobRun -> NonEmpty Text
jobRunIds} -> NonEmpty Text
jobRunIds) (\s :: BatchStopJobRun
s@BatchStopJobRun' {} NonEmpty Text
a -> BatchStopJobRun
s {$sel:jobRunIds:BatchStopJobRun' :: NonEmpty Text
jobRunIds = NonEmpty Text
a} :: BatchStopJobRun) 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 BatchStopJobRun where
type
AWSResponse BatchStopJobRun =
BatchStopJobRunResponse
request :: (Service -> Service) -> BatchStopJobRun -> Request BatchStopJobRun
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 BatchStopJobRun
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchStopJobRun)))
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 [BatchStopJobRunError]
-> Maybe [BatchStopJobRunSuccessfulSubmission]
-> Int
-> BatchStopJobRunResponse
BatchStopJobRunResponse'
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
"Errors" 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
"SuccessfulSubmissions"
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable BatchStopJobRun where
hashWithSalt :: Int -> BatchStopJobRun -> Int
hashWithSalt Int
_salt BatchStopJobRun' {NonEmpty Text
Text
jobRunIds :: NonEmpty Text
jobName :: Text
$sel:jobRunIds:BatchStopJobRun' :: BatchStopJobRun -> NonEmpty Text
$sel:jobName:BatchStopJobRun' :: BatchStopJobRun -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
jobRunIds
instance Prelude.NFData BatchStopJobRun where
rnf :: BatchStopJobRun -> ()
rnf BatchStopJobRun' {NonEmpty Text
Text
jobRunIds :: NonEmpty Text
jobName :: Text
$sel:jobRunIds:BatchStopJobRun' :: BatchStopJobRun -> NonEmpty Text
$sel:jobName:BatchStopJobRun' :: BatchStopJobRun -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
jobName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
jobRunIds
instance Data.ToHeaders BatchStopJobRun where
toHeaders :: BatchStopJobRun -> 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.BatchStopJobRun" :: 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 BatchStopJobRun where
toJSON :: BatchStopJobRun -> Value
toJSON BatchStopJobRun' {NonEmpty Text
Text
jobRunIds :: NonEmpty Text
jobName :: Text
$sel:jobRunIds:BatchStopJobRun' :: BatchStopJobRun -> NonEmpty Text
$sel:jobName:BatchStopJobRun' :: BatchStopJobRun -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"JobName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobName),
forall a. a -> Maybe a
Prelude.Just (Key
"JobRunIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
jobRunIds)
]
)
instance Data.ToPath BatchStopJobRun where
toPath :: BatchStopJobRun -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery BatchStopJobRun where
toQuery :: BatchStopJobRun -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data BatchStopJobRunResponse = BatchStopJobRunResponse'
{
BatchStopJobRunResponse -> Maybe [BatchStopJobRunError]
errors :: Prelude.Maybe [BatchStopJobRunError],
BatchStopJobRunResponse
-> Maybe [BatchStopJobRunSuccessfulSubmission]
successfulSubmissions :: Prelude.Maybe [BatchStopJobRunSuccessfulSubmission],
BatchStopJobRunResponse -> Int
httpStatus :: Prelude.Int
}
deriving (BatchStopJobRunResponse -> BatchStopJobRunResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchStopJobRunResponse -> BatchStopJobRunResponse -> Bool
$c/= :: BatchStopJobRunResponse -> BatchStopJobRunResponse -> Bool
== :: BatchStopJobRunResponse -> BatchStopJobRunResponse -> Bool
$c== :: BatchStopJobRunResponse -> BatchStopJobRunResponse -> Bool
Prelude.Eq, ReadPrec [BatchStopJobRunResponse]
ReadPrec BatchStopJobRunResponse
Int -> ReadS BatchStopJobRunResponse
ReadS [BatchStopJobRunResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchStopJobRunResponse]
$creadListPrec :: ReadPrec [BatchStopJobRunResponse]
readPrec :: ReadPrec BatchStopJobRunResponse
$creadPrec :: ReadPrec BatchStopJobRunResponse
readList :: ReadS [BatchStopJobRunResponse]
$creadList :: ReadS [BatchStopJobRunResponse]
readsPrec :: Int -> ReadS BatchStopJobRunResponse
$creadsPrec :: Int -> ReadS BatchStopJobRunResponse
Prelude.Read, Int -> BatchStopJobRunResponse -> ShowS
[BatchStopJobRunResponse] -> ShowS
BatchStopJobRunResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchStopJobRunResponse] -> ShowS
$cshowList :: [BatchStopJobRunResponse] -> ShowS
show :: BatchStopJobRunResponse -> String
$cshow :: BatchStopJobRunResponse -> String
showsPrec :: Int -> BatchStopJobRunResponse -> ShowS
$cshowsPrec :: Int -> BatchStopJobRunResponse -> ShowS
Prelude.Show, forall x. Rep BatchStopJobRunResponse x -> BatchStopJobRunResponse
forall x. BatchStopJobRunResponse -> Rep BatchStopJobRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchStopJobRunResponse x -> BatchStopJobRunResponse
$cfrom :: forall x. BatchStopJobRunResponse -> Rep BatchStopJobRunResponse x
Prelude.Generic)
newBatchStopJobRunResponse ::
Prelude.Int ->
BatchStopJobRunResponse
newBatchStopJobRunResponse :: Int -> BatchStopJobRunResponse
newBatchStopJobRunResponse Int
pHttpStatus_ =
BatchStopJobRunResponse'
{ $sel:errors:BatchStopJobRunResponse' :: Maybe [BatchStopJobRunError]
errors = forall a. Maybe a
Prelude.Nothing,
$sel:successfulSubmissions:BatchStopJobRunResponse' :: Maybe [BatchStopJobRunSuccessfulSubmission]
successfulSubmissions = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:BatchStopJobRunResponse' :: Int
httpStatus = Int
pHttpStatus_
}
batchStopJobRunResponse_errors :: Lens.Lens' BatchStopJobRunResponse (Prelude.Maybe [BatchStopJobRunError])
batchStopJobRunResponse_errors :: Lens' BatchStopJobRunResponse (Maybe [BatchStopJobRunError])
batchStopJobRunResponse_errors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStopJobRunResponse' {Maybe [BatchStopJobRunError]
errors :: Maybe [BatchStopJobRunError]
$sel:errors:BatchStopJobRunResponse' :: BatchStopJobRunResponse -> Maybe [BatchStopJobRunError]
errors} -> Maybe [BatchStopJobRunError]
errors) (\s :: BatchStopJobRunResponse
s@BatchStopJobRunResponse' {} Maybe [BatchStopJobRunError]
a -> BatchStopJobRunResponse
s {$sel:errors:BatchStopJobRunResponse' :: Maybe [BatchStopJobRunError]
errors = Maybe [BatchStopJobRunError]
a} :: BatchStopJobRunResponse) 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
batchStopJobRunResponse_successfulSubmissions :: Lens.Lens' BatchStopJobRunResponse (Prelude.Maybe [BatchStopJobRunSuccessfulSubmission])
batchStopJobRunResponse_successfulSubmissions :: Lens'
BatchStopJobRunResponse
(Maybe [BatchStopJobRunSuccessfulSubmission])
batchStopJobRunResponse_successfulSubmissions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStopJobRunResponse' {Maybe [BatchStopJobRunSuccessfulSubmission]
successfulSubmissions :: Maybe [BatchStopJobRunSuccessfulSubmission]
$sel:successfulSubmissions:BatchStopJobRunResponse' :: BatchStopJobRunResponse
-> Maybe [BatchStopJobRunSuccessfulSubmission]
successfulSubmissions} -> Maybe [BatchStopJobRunSuccessfulSubmission]
successfulSubmissions) (\s :: BatchStopJobRunResponse
s@BatchStopJobRunResponse' {} Maybe [BatchStopJobRunSuccessfulSubmission]
a -> BatchStopJobRunResponse
s {$sel:successfulSubmissions:BatchStopJobRunResponse' :: Maybe [BatchStopJobRunSuccessfulSubmission]
successfulSubmissions = Maybe [BatchStopJobRunSuccessfulSubmission]
a} :: BatchStopJobRunResponse) 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
batchStopJobRunResponse_httpStatus :: Lens.Lens' BatchStopJobRunResponse Prelude.Int
batchStopJobRunResponse_httpStatus :: Lens' BatchStopJobRunResponse Int
batchStopJobRunResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStopJobRunResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchStopJobRunResponse' :: BatchStopJobRunResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchStopJobRunResponse
s@BatchStopJobRunResponse' {} Int
a -> BatchStopJobRunResponse
s {$sel:httpStatus:BatchStopJobRunResponse' :: Int
httpStatus = Int
a} :: BatchStopJobRunResponse)
instance Prelude.NFData BatchStopJobRunResponse where
rnf :: BatchStopJobRunResponse -> ()
rnf BatchStopJobRunResponse' {Int
Maybe [BatchStopJobRunSuccessfulSubmission]
Maybe [BatchStopJobRunError]
httpStatus :: Int
successfulSubmissions :: Maybe [BatchStopJobRunSuccessfulSubmission]
errors :: Maybe [BatchStopJobRunError]
$sel:httpStatus:BatchStopJobRunResponse' :: BatchStopJobRunResponse -> Int
$sel:successfulSubmissions:BatchStopJobRunResponse' :: BatchStopJobRunResponse
-> Maybe [BatchStopJobRunSuccessfulSubmission]
$sel:errors:BatchStopJobRunResponse' :: BatchStopJobRunResponse -> Maybe [BatchStopJobRunError]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [BatchStopJobRunError]
errors
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [BatchStopJobRunSuccessfulSubmission]
successfulSubmissions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus