{-# 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.StartExportLabelsTaskRun
(
StartExportLabelsTaskRun (..),
newStartExportLabelsTaskRun,
startExportLabelsTaskRun_transformId,
startExportLabelsTaskRun_outputS3Path,
StartExportLabelsTaskRunResponse (..),
newStartExportLabelsTaskRunResponse,
startExportLabelsTaskRunResponse_taskRunId,
startExportLabelsTaskRunResponse_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 StartExportLabelsTaskRun = StartExportLabelsTaskRun'
{
StartExportLabelsTaskRun -> Text
transformId :: Prelude.Text,
StartExportLabelsTaskRun -> Text
outputS3Path :: Prelude.Text
}
deriving (StartExportLabelsTaskRun -> StartExportLabelsTaskRun -> Bool
(StartExportLabelsTaskRun -> StartExportLabelsTaskRun -> Bool)
-> (StartExportLabelsTaskRun -> StartExportLabelsTaskRun -> Bool)
-> Eq StartExportLabelsTaskRun
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartExportLabelsTaskRun -> StartExportLabelsTaskRun -> Bool
$c/= :: StartExportLabelsTaskRun -> StartExportLabelsTaskRun -> Bool
== :: StartExportLabelsTaskRun -> StartExportLabelsTaskRun -> Bool
$c== :: StartExportLabelsTaskRun -> StartExportLabelsTaskRun -> Bool
Prelude.Eq, ReadPrec [StartExportLabelsTaskRun]
ReadPrec StartExportLabelsTaskRun
Int -> ReadS StartExportLabelsTaskRun
ReadS [StartExportLabelsTaskRun]
(Int -> ReadS StartExportLabelsTaskRun)
-> ReadS [StartExportLabelsTaskRun]
-> ReadPrec StartExportLabelsTaskRun
-> ReadPrec [StartExportLabelsTaskRun]
-> Read StartExportLabelsTaskRun
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartExportLabelsTaskRun]
$creadListPrec :: ReadPrec [StartExportLabelsTaskRun]
readPrec :: ReadPrec StartExportLabelsTaskRun
$creadPrec :: ReadPrec StartExportLabelsTaskRun
readList :: ReadS [StartExportLabelsTaskRun]
$creadList :: ReadS [StartExportLabelsTaskRun]
readsPrec :: Int -> ReadS StartExportLabelsTaskRun
$creadsPrec :: Int -> ReadS StartExportLabelsTaskRun
Prelude.Read, Int -> StartExportLabelsTaskRun -> ShowS
[StartExportLabelsTaskRun] -> ShowS
StartExportLabelsTaskRun -> String
(Int -> StartExportLabelsTaskRun -> ShowS)
-> (StartExportLabelsTaskRun -> String)
-> ([StartExportLabelsTaskRun] -> ShowS)
-> Show StartExportLabelsTaskRun
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartExportLabelsTaskRun] -> ShowS
$cshowList :: [StartExportLabelsTaskRun] -> ShowS
show :: StartExportLabelsTaskRun -> String
$cshow :: StartExportLabelsTaskRun -> String
showsPrec :: Int -> StartExportLabelsTaskRun -> ShowS
$cshowsPrec :: Int -> StartExportLabelsTaskRun -> ShowS
Prelude.Show, (forall x.
StartExportLabelsTaskRun -> Rep StartExportLabelsTaskRun x)
-> (forall x.
Rep StartExportLabelsTaskRun x -> StartExportLabelsTaskRun)
-> Generic StartExportLabelsTaskRun
forall x.
Rep StartExportLabelsTaskRun x -> StartExportLabelsTaskRun
forall x.
StartExportLabelsTaskRun -> Rep StartExportLabelsTaskRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartExportLabelsTaskRun x -> StartExportLabelsTaskRun
$cfrom :: forall x.
StartExportLabelsTaskRun -> Rep StartExportLabelsTaskRun x
Prelude.Generic)
newStartExportLabelsTaskRun ::
Prelude.Text ->
Prelude.Text ->
StartExportLabelsTaskRun
newStartExportLabelsTaskRun :: Text -> Text -> StartExportLabelsTaskRun
newStartExportLabelsTaskRun
Text
pTransformId_
Text
pOutputS3Path_ =
StartExportLabelsTaskRun' :: Text -> Text -> StartExportLabelsTaskRun
StartExportLabelsTaskRun'
{ $sel:transformId:StartExportLabelsTaskRun' :: Text
transformId =
Text
pTransformId_,
$sel:outputS3Path:StartExportLabelsTaskRun' :: Text
outputS3Path = Text
pOutputS3Path_
}
startExportLabelsTaskRun_transformId :: Lens.Lens' StartExportLabelsTaskRun Prelude.Text
startExportLabelsTaskRun_transformId :: (Text -> f Text)
-> StartExportLabelsTaskRun -> f StartExportLabelsTaskRun
startExportLabelsTaskRun_transformId = (StartExportLabelsTaskRun -> Text)
-> (StartExportLabelsTaskRun -> Text -> StartExportLabelsTaskRun)
-> Lens StartExportLabelsTaskRun StartExportLabelsTaskRun Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportLabelsTaskRun' {Text
transformId :: Text
$sel:transformId:StartExportLabelsTaskRun' :: StartExportLabelsTaskRun -> Text
transformId} -> Text
transformId) (\s :: StartExportLabelsTaskRun
s@StartExportLabelsTaskRun' {} Text
a -> StartExportLabelsTaskRun
s {$sel:transformId:StartExportLabelsTaskRun' :: Text
transformId = Text
a} :: StartExportLabelsTaskRun)
startExportLabelsTaskRun_outputS3Path :: Lens.Lens' StartExportLabelsTaskRun Prelude.Text
startExportLabelsTaskRun_outputS3Path :: (Text -> f Text)
-> StartExportLabelsTaskRun -> f StartExportLabelsTaskRun
startExportLabelsTaskRun_outputS3Path = (StartExportLabelsTaskRun -> Text)
-> (StartExportLabelsTaskRun -> Text -> StartExportLabelsTaskRun)
-> Lens StartExportLabelsTaskRun StartExportLabelsTaskRun Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportLabelsTaskRun' {Text
outputS3Path :: Text
$sel:outputS3Path:StartExportLabelsTaskRun' :: StartExportLabelsTaskRun -> Text
outputS3Path} -> Text
outputS3Path) (\s :: StartExportLabelsTaskRun
s@StartExportLabelsTaskRun' {} Text
a -> StartExportLabelsTaskRun
s {$sel:outputS3Path:StartExportLabelsTaskRun' :: Text
outputS3Path = Text
a} :: StartExportLabelsTaskRun)
instance Core.AWSRequest StartExportLabelsTaskRun where
type
AWSResponse StartExportLabelsTaskRun =
StartExportLabelsTaskRunResponse
request :: StartExportLabelsTaskRun -> Request StartExportLabelsTaskRun
request = Service
-> StartExportLabelsTaskRun -> Request StartExportLabelsTaskRun
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartExportLabelsTaskRun
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartExportLabelsTaskRun)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartExportLabelsTaskRun))
-> Logger
-> Service
-> Proxy StartExportLabelsTaskRun
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartExportLabelsTaskRun)))
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 Text -> Int -> StartExportLabelsTaskRunResponse
StartExportLabelsTaskRunResponse'
(Maybe Text -> Int -> StartExportLabelsTaskRunResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartExportLabelsTaskRunResponse)
forall (f :: * -> *) a b. Functor 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 -> StartExportLabelsTaskRunResponse)
-> Either String Int
-> Either String StartExportLabelsTaskRunResponse
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 StartExportLabelsTaskRun
instance Prelude.NFData StartExportLabelsTaskRun
instance Core.ToHeaders StartExportLabelsTaskRun where
toHeaders :: StartExportLabelsTaskRun -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartExportLabelsTaskRun -> 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.StartExportLabelsTaskRun" ::
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 StartExportLabelsTaskRun where
toJSON :: StartExportLabelsTaskRun -> Value
toJSON StartExportLabelsTaskRun' {Text
outputS3Path :: Text
transformId :: Text
$sel:outputS3Path:StartExportLabelsTaskRun' :: StartExportLabelsTaskRun -> Text
$sel:transformId:StartExportLabelsTaskRun' :: StartExportLabelsTaskRun -> 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
"OutputS3Path" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
outputS3Path)
]
)
instance Core.ToPath StartExportLabelsTaskRun where
toPath :: StartExportLabelsTaskRun -> ByteString
toPath = ByteString -> StartExportLabelsTaskRun -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartExportLabelsTaskRun where
toQuery :: StartExportLabelsTaskRun -> QueryString
toQuery = QueryString -> StartExportLabelsTaskRun -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartExportLabelsTaskRunResponse = StartExportLabelsTaskRunResponse'
{
StartExportLabelsTaskRunResponse -> Maybe Text
taskRunId :: Prelude.Maybe Prelude.Text,
StartExportLabelsTaskRunResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartExportLabelsTaskRunResponse
-> StartExportLabelsTaskRunResponse -> Bool
(StartExportLabelsTaskRunResponse
-> StartExportLabelsTaskRunResponse -> Bool)
-> (StartExportLabelsTaskRunResponse
-> StartExportLabelsTaskRunResponse -> Bool)
-> Eq StartExportLabelsTaskRunResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartExportLabelsTaskRunResponse
-> StartExportLabelsTaskRunResponse -> Bool
$c/= :: StartExportLabelsTaskRunResponse
-> StartExportLabelsTaskRunResponse -> Bool
== :: StartExportLabelsTaskRunResponse
-> StartExportLabelsTaskRunResponse -> Bool
$c== :: StartExportLabelsTaskRunResponse
-> StartExportLabelsTaskRunResponse -> Bool
Prelude.Eq, ReadPrec [StartExportLabelsTaskRunResponse]
ReadPrec StartExportLabelsTaskRunResponse
Int -> ReadS StartExportLabelsTaskRunResponse
ReadS [StartExportLabelsTaskRunResponse]
(Int -> ReadS StartExportLabelsTaskRunResponse)
-> ReadS [StartExportLabelsTaskRunResponse]
-> ReadPrec StartExportLabelsTaskRunResponse
-> ReadPrec [StartExportLabelsTaskRunResponse]
-> Read StartExportLabelsTaskRunResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartExportLabelsTaskRunResponse]
$creadListPrec :: ReadPrec [StartExportLabelsTaskRunResponse]
readPrec :: ReadPrec StartExportLabelsTaskRunResponse
$creadPrec :: ReadPrec StartExportLabelsTaskRunResponse
readList :: ReadS [StartExportLabelsTaskRunResponse]
$creadList :: ReadS [StartExportLabelsTaskRunResponse]
readsPrec :: Int -> ReadS StartExportLabelsTaskRunResponse
$creadsPrec :: Int -> ReadS StartExportLabelsTaskRunResponse
Prelude.Read, Int -> StartExportLabelsTaskRunResponse -> ShowS
[StartExportLabelsTaskRunResponse] -> ShowS
StartExportLabelsTaskRunResponse -> String
(Int -> StartExportLabelsTaskRunResponse -> ShowS)
-> (StartExportLabelsTaskRunResponse -> String)
-> ([StartExportLabelsTaskRunResponse] -> ShowS)
-> Show StartExportLabelsTaskRunResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartExportLabelsTaskRunResponse] -> ShowS
$cshowList :: [StartExportLabelsTaskRunResponse] -> ShowS
show :: StartExportLabelsTaskRunResponse -> String
$cshow :: StartExportLabelsTaskRunResponse -> String
showsPrec :: Int -> StartExportLabelsTaskRunResponse -> ShowS
$cshowsPrec :: Int -> StartExportLabelsTaskRunResponse -> ShowS
Prelude.Show, (forall x.
StartExportLabelsTaskRunResponse
-> Rep StartExportLabelsTaskRunResponse x)
-> (forall x.
Rep StartExportLabelsTaskRunResponse x
-> StartExportLabelsTaskRunResponse)
-> Generic StartExportLabelsTaskRunResponse
forall x.
Rep StartExportLabelsTaskRunResponse x
-> StartExportLabelsTaskRunResponse
forall x.
StartExportLabelsTaskRunResponse
-> Rep StartExportLabelsTaskRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartExportLabelsTaskRunResponse x
-> StartExportLabelsTaskRunResponse
$cfrom :: forall x.
StartExportLabelsTaskRunResponse
-> Rep StartExportLabelsTaskRunResponse x
Prelude.Generic)
newStartExportLabelsTaskRunResponse ::
Prelude.Int ->
StartExportLabelsTaskRunResponse
newStartExportLabelsTaskRunResponse :: Int -> StartExportLabelsTaskRunResponse
newStartExportLabelsTaskRunResponse Int
pHttpStatus_ =
StartExportLabelsTaskRunResponse' :: Maybe Text -> Int -> StartExportLabelsTaskRunResponse
StartExportLabelsTaskRunResponse'
{ $sel:taskRunId:StartExportLabelsTaskRunResponse' :: Maybe Text
taskRunId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartExportLabelsTaskRunResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startExportLabelsTaskRunResponse_taskRunId :: Lens.Lens' StartExportLabelsTaskRunResponse (Prelude.Maybe Prelude.Text)
startExportLabelsTaskRunResponse_taskRunId :: (Maybe Text -> f (Maybe Text))
-> StartExportLabelsTaskRunResponse
-> f StartExportLabelsTaskRunResponse
startExportLabelsTaskRunResponse_taskRunId = (StartExportLabelsTaskRunResponse -> Maybe Text)
-> (StartExportLabelsTaskRunResponse
-> Maybe Text -> StartExportLabelsTaskRunResponse)
-> Lens
StartExportLabelsTaskRunResponse
StartExportLabelsTaskRunResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportLabelsTaskRunResponse' {Maybe Text
taskRunId :: Maybe Text
$sel:taskRunId:StartExportLabelsTaskRunResponse' :: StartExportLabelsTaskRunResponse -> Maybe Text
taskRunId} -> Maybe Text
taskRunId) (\s :: StartExportLabelsTaskRunResponse
s@StartExportLabelsTaskRunResponse' {} Maybe Text
a -> StartExportLabelsTaskRunResponse
s {$sel:taskRunId:StartExportLabelsTaskRunResponse' :: Maybe Text
taskRunId = Maybe Text
a} :: StartExportLabelsTaskRunResponse)
startExportLabelsTaskRunResponse_httpStatus :: Lens.Lens' StartExportLabelsTaskRunResponse Prelude.Int
startExportLabelsTaskRunResponse_httpStatus :: (Int -> f Int)
-> StartExportLabelsTaskRunResponse
-> f StartExportLabelsTaskRunResponse
startExportLabelsTaskRunResponse_httpStatus = (StartExportLabelsTaskRunResponse -> Int)
-> (StartExportLabelsTaskRunResponse
-> Int -> StartExportLabelsTaskRunResponse)
-> Lens
StartExportLabelsTaskRunResponse
StartExportLabelsTaskRunResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartExportLabelsTaskRunResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartExportLabelsTaskRunResponse' :: StartExportLabelsTaskRunResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartExportLabelsTaskRunResponse
s@StartExportLabelsTaskRunResponse' {} Int
a -> StartExportLabelsTaskRunResponse
s {$sel:httpStatus:StartExportLabelsTaskRunResponse' :: Int
httpStatus = Int
a} :: StartExportLabelsTaskRunResponse)
instance
Prelude.NFData
StartExportLabelsTaskRunResponse