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