{-# 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.SageMaker.CreateLabelingJob
(
CreateLabelingJob (..),
newCreateLabelingJob,
createLabelingJob_labelingJobAlgorithmsConfig,
createLabelingJob_labelCategoryConfigS3Uri,
createLabelingJob_stoppingConditions,
createLabelingJob_tags,
createLabelingJob_labelingJobName,
createLabelingJob_labelAttributeName,
createLabelingJob_inputConfig,
createLabelingJob_outputConfig,
createLabelingJob_roleArn,
createLabelingJob_humanTaskConfig,
CreateLabelingJobResponse (..),
newCreateLabelingJobResponse,
createLabelingJobResponse_httpStatus,
createLabelingJobResponse_labelingJobArn,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types
data CreateLabelingJob = CreateLabelingJob'
{
CreateLabelingJob -> Maybe LabelingJobAlgorithmsConfig
labelingJobAlgorithmsConfig :: Prelude.Maybe LabelingJobAlgorithmsConfig,
CreateLabelingJob -> Maybe Text
labelCategoryConfigS3Uri :: Prelude.Maybe Prelude.Text,
CreateLabelingJob -> Maybe LabelingJobStoppingConditions
stoppingConditions :: Prelude.Maybe LabelingJobStoppingConditions,
CreateLabelingJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateLabelingJob -> Text
labelingJobName :: Prelude.Text,
CreateLabelingJob -> Text
labelAttributeName :: Prelude.Text,
CreateLabelingJob -> LabelingJobInputConfig
inputConfig :: LabelingJobInputConfig,
CreateLabelingJob -> LabelingJobOutputConfig
outputConfig :: LabelingJobOutputConfig,
CreateLabelingJob -> Text
roleArn :: Prelude.Text,
CreateLabelingJob -> HumanTaskConfig
humanTaskConfig :: HumanTaskConfig
}
deriving (CreateLabelingJob -> CreateLabelingJob -> Bool
(CreateLabelingJob -> CreateLabelingJob -> Bool)
-> (CreateLabelingJob -> CreateLabelingJob -> Bool)
-> Eq CreateLabelingJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLabelingJob -> CreateLabelingJob -> Bool
$c/= :: CreateLabelingJob -> CreateLabelingJob -> Bool
== :: CreateLabelingJob -> CreateLabelingJob -> Bool
$c== :: CreateLabelingJob -> CreateLabelingJob -> Bool
Prelude.Eq, ReadPrec [CreateLabelingJob]
ReadPrec CreateLabelingJob
Int -> ReadS CreateLabelingJob
ReadS [CreateLabelingJob]
(Int -> ReadS CreateLabelingJob)
-> ReadS [CreateLabelingJob]
-> ReadPrec CreateLabelingJob
-> ReadPrec [CreateLabelingJob]
-> Read CreateLabelingJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLabelingJob]
$creadListPrec :: ReadPrec [CreateLabelingJob]
readPrec :: ReadPrec CreateLabelingJob
$creadPrec :: ReadPrec CreateLabelingJob
readList :: ReadS [CreateLabelingJob]
$creadList :: ReadS [CreateLabelingJob]
readsPrec :: Int -> ReadS CreateLabelingJob
$creadsPrec :: Int -> ReadS CreateLabelingJob
Prelude.Read, Int -> CreateLabelingJob -> ShowS
[CreateLabelingJob] -> ShowS
CreateLabelingJob -> String
(Int -> CreateLabelingJob -> ShowS)
-> (CreateLabelingJob -> String)
-> ([CreateLabelingJob] -> ShowS)
-> Show CreateLabelingJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLabelingJob] -> ShowS
$cshowList :: [CreateLabelingJob] -> ShowS
show :: CreateLabelingJob -> String
$cshow :: CreateLabelingJob -> String
showsPrec :: Int -> CreateLabelingJob -> ShowS
$cshowsPrec :: Int -> CreateLabelingJob -> ShowS
Prelude.Show, (forall x. CreateLabelingJob -> Rep CreateLabelingJob x)
-> (forall x. Rep CreateLabelingJob x -> CreateLabelingJob)
-> Generic CreateLabelingJob
forall x. Rep CreateLabelingJob x -> CreateLabelingJob
forall x. CreateLabelingJob -> Rep CreateLabelingJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLabelingJob x -> CreateLabelingJob
$cfrom :: forall x. CreateLabelingJob -> Rep CreateLabelingJob x
Prelude.Generic)
newCreateLabelingJob ::
Prelude.Text ->
Prelude.Text ->
LabelingJobInputConfig ->
LabelingJobOutputConfig ->
Prelude.Text ->
HumanTaskConfig ->
CreateLabelingJob
newCreateLabelingJob :: Text
-> Text
-> LabelingJobInputConfig
-> LabelingJobOutputConfig
-> Text
-> HumanTaskConfig
-> CreateLabelingJob
newCreateLabelingJob
Text
pLabelingJobName_
Text
pLabelAttributeName_
LabelingJobInputConfig
pInputConfig_
LabelingJobOutputConfig
pOutputConfig_
Text
pRoleArn_
HumanTaskConfig
pHumanTaskConfig_ =
CreateLabelingJob' :: Maybe LabelingJobAlgorithmsConfig
-> Maybe Text
-> Maybe LabelingJobStoppingConditions
-> Maybe [Tag]
-> Text
-> Text
-> LabelingJobInputConfig
-> LabelingJobOutputConfig
-> Text
-> HumanTaskConfig
-> CreateLabelingJob
CreateLabelingJob'
{ $sel:labelingJobAlgorithmsConfig:CreateLabelingJob' :: Maybe LabelingJobAlgorithmsConfig
labelingJobAlgorithmsConfig =
Maybe LabelingJobAlgorithmsConfig
forall a. Maybe a
Prelude.Nothing,
$sel:labelCategoryConfigS3Uri:CreateLabelingJob' :: Maybe Text
labelCategoryConfigS3Uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stoppingConditions:CreateLabelingJob' :: Maybe LabelingJobStoppingConditions
stoppingConditions = Maybe LabelingJobStoppingConditions
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateLabelingJob' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:labelingJobName:CreateLabelingJob' :: Text
labelingJobName = Text
pLabelingJobName_,
$sel:labelAttributeName:CreateLabelingJob' :: Text
labelAttributeName = Text
pLabelAttributeName_,
$sel:inputConfig:CreateLabelingJob' :: LabelingJobInputConfig
inputConfig = LabelingJobInputConfig
pInputConfig_,
$sel:outputConfig:CreateLabelingJob' :: LabelingJobOutputConfig
outputConfig = LabelingJobOutputConfig
pOutputConfig_,
$sel:roleArn:CreateLabelingJob' :: Text
roleArn = Text
pRoleArn_,
$sel:humanTaskConfig:CreateLabelingJob' :: HumanTaskConfig
humanTaskConfig = HumanTaskConfig
pHumanTaskConfig_
}
createLabelingJob_labelingJobAlgorithmsConfig :: Lens.Lens' CreateLabelingJob (Prelude.Maybe LabelingJobAlgorithmsConfig)
createLabelingJob_labelingJobAlgorithmsConfig :: (Maybe LabelingJobAlgorithmsConfig
-> f (Maybe LabelingJobAlgorithmsConfig))
-> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_labelingJobAlgorithmsConfig = (CreateLabelingJob -> Maybe LabelingJobAlgorithmsConfig)
-> (CreateLabelingJob
-> Maybe LabelingJobAlgorithmsConfig -> CreateLabelingJob)
-> Lens
CreateLabelingJob
CreateLabelingJob
(Maybe LabelingJobAlgorithmsConfig)
(Maybe LabelingJobAlgorithmsConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {Maybe LabelingJobAlgorithmsConfig
labelingJobAlgorithmsConfig :: Maybe LabelingJobAlgorithmsConfig
$sel:labelingJobAlgorithmsConfig:CreateLabelingJob' :: CreateLabelingJob -> Maybe LabelingJobAlgorithmsConfig
labelingJobAlgorithmsConfig} -> Maybe LabelingJobAlgorithmsConfig
labelingJobAlgorithmsConfig) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} Maybe LabelingJobAlgorithmsConfig
a -> CreateLabelingJob
s {$sel:labelingJobAlgorithmsConfig:CreateLabelingJob' :: Maybe LabelingJobAlgorithmsConfig
labelingJobAlgorithmsConfig = Maybe LabelingJobAlgorithmsConfig
a} :: CreateLabelingJob)
createLabelingJob_labelCategoryConfigS3Uri :: Lens.Lens' CreateLabelingJob (Prelude.Maybe Prelude.Text)
createLabelingJob_labelCategoryConfigS3Uri :: (Maybe Text -> f (Maybe Text))
-> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_labelCategoryConfigS3Uri = (CreateLabelingJob -> Maybe Text)
-> (CreateLabelingJob -> Maybe Text -> CreateLabelingJob)
-> Lens
CreateLabelingJob CreateLabelingJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {Maybe Text
labelCategoryConfigS3Uri :: Maybe Text
$sel:labelCategoryConfigS3Uri:CreateLabelingJob' :: CreateLabelingJob -> Maybe Text
labelCategoryConfigS3Uri} -> Maybe Text
labelCategoryConfigS3Uri) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} Maybe Text
a -> CreateLabelingJob
s {$sel:labelCategoryConfigS3Uri:CreateLabelingJob' :: Maybe Text
labelCategoryConfigS3Uri = Maybe Text
a} :: CreateLabelingJob)
createLabelingJob_stoppingConditions :: Lens.Lens' CreateLabelingJob (Prelude.Maybe LabelingJobStoppingConditions)
createLabelingJob_stoppingConditions :: (Maybe LabelingJobStoppingConditions
-> f (Maybe LabelingJobStoppingConditions))
-> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_stoppingConditions = (CreateLabelingJob -> Maybe LabelingJobStoppingConditions)
-> (CreateLabelingJob
-> Maybe LabelingJobStoppingConditions -> CreateLabelingJob)
-> Lens
CreateLabelingJob
CreateLabelingJob
(Maybe LabelingJobStoppingConditions)
(Maybe LabelingJobStoppingConditions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {Maybe LabelingJobStoppingConditions
stoppingConditions :: Maybe LabelingJobStoppingConditions
$sel:stoppingConditions:CreateLabelingJob' :: CreateLabelingJob -> Maybe LabelingJobStoppingConditions
stoppingConditions} -> Maybe LabelingJobStoppingConditions
stoppingConditions) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} Maybe LabelingJobStoppingConditions
a -> CreateLabelingJob
s {$sel:stoppingConditions:CreateLabelingJob' :: Maybe LabelingJobStoppingConditions
stoppingConditions = Maybe LabelingJobStoppingConditions
a} :: CreateLabelingJob)
createLabelingJob_tags :: Lens.Lens' CreateLabelingJob (Prelude.Maybe [Tag])
createLabelingJob_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_tags = (CreateLabelingJob -> Maybe [Tag])
-> (CreateLabelingJob -> Maybe [Tag] -> CreateLabelingJob)
-> Lens
CreateLabelingJob CreateLabelingJob (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateLabelingJob' :: CreateLabelingJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} Maybe [Tag]
a -> CreateLabelingJob
s {$sel:tags:CreateLabelingJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateLabelingJob) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateLabelingJob -> f CreateLabelingJob)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateLabelingJob
-> f CreateLabelingJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createLabelingJob_labelingJobName :: Lens.Lens' CreateLabelingJob Prelude.Text
createLabelingJob_labelingJobName :: (Text -> f Text) -> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_labelingJobName = (CreateLabelingJob -> Text)
-> (CreateLabelingJob -> Text -> CreateLabelingJob)
-> Lens CreateLabelingJob CreateLabelingJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {Text
labelingJobName :: Text
$sel:labelingJobName:CreateLabelingJob' :: CreateLabelingJob -> Text
labelingJobName} -> Text
labelingJobName) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} Text
a -> CreateLabelingJob
s {$sel:labelingJobName:CreateLabelingJob' :: Text
labelingJobName = Text
a} :: CreateLabelingJob)
createLabelingJob_labelAttributeName :: Lens.Lens' CreateLabelingJob Prelude.Text
createLabelingJob_labelAttributeName :: (Text -> f Text) -> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_labelAttributeName = (CreateLabelingJob -> Text)
-> (CreateLabelingJob -> Text -> CreateLabelingJob)
-> Lens CreateLabelingJob CreateLabelingJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {Text
labelAttributeName :: Text
$sel:labelAttributeName:CreateLabelingJob' :: CreateLabelingJob -> Text
labelAttributeName} -> Text
labelAttributeName) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} Text
a -> CreateLabelingJob
s {$sel:labelAttributeName:CreateLabelingJob' :: Text
labelAttributeName = Text
a} :: CreateLabelingJob)
createLabelingJob_inputConfig :: Lens.Lens' CreateLabelingJob LabelingJobInputConfig
createLabelingJob_inputConfig :: (LabelingJobInputConfig -> f LabelingJobInputConfig)
-> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_inputConfig = (CreateLabelingJob -> LabelingJobInputConfig)
-> (CreateLabelingJob
-> LabelingJobInputConfig -> CreateLabelingJob)
-> Lens
CreateLabelingJob
CreateLabelingJob
LabelingJobInputConfig
LabelingJobInputConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {LabelingJobInputConfig
inputConfig :: LabelingJobInputConfig
$sel:inputConfig:CreateLabelingJob' :: CreateLabelingJob -> LabelingJobInputConfig
inputConfig} -> LabelingJobInputConfig
inputConfig) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} LabelingJobInputConfig
a -> CreateLabelingJob
s {$sel:inputConfig:CreateLabelingJob' :: LabelingJobInputConfig
inputConfig = LabelingJobInputConfig
a} :: CreateLabelingJob)
createLabelingJob_outputConfig :: Lens.Lens' CreateLabelingJob LabelingJobOutputConfig
createLabelingJob_outputConfig :: (LabelingJobOutputConfig -> f LabelingJobOutputConfig)
-> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_outputConfig = (CreateLabelingJob -> LabelingJobOutputConfig)
-> (CreateLabelingJob
-> LabelingJobOutputConfig -> CreateLabelingJob)
-> Lens
CreateLabelingJob
CreateLabelingJob
LabelingJobOutputConfig
LabelingJobOutputConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {LabelingJobOutputConfig
outputConfig :: LabelingJobOutputConfig
$sel:outputConfig:CreateLabelingJob' :: CreateLabelingJob -> LabelingJobOutputConfig
outputConfig} -> LabelingJobOutputConfig
outputConfig) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} LabelingJobOutputConfig
a -> CreateLabelingJob
s {$sel:outputConfig:CreateLabelingJob' :: LabelingJobOutputConfig
outputConfig = LabelingJobOutputConfig
a} :: CreateLabelingJob)
createLabelingJob_roleArn :: Lens.Lens' CreateLabelingJob Prelude.Text
createLabelingJob_roleArn :: (Text -> f Text) -> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_roleArn = (CreateLabelingJob -> Text)
-> (CreateLabelingJob -> Text -> CreateLabelingJob)
-> Lens CreateLabelingJob CreateLabelingJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {Text
roleArn :: Text
$sel:roleArn:CreateLabelingJob' :: CreateLabelingJob -> Text
roleArn} -> Text
roleArn) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} Text
a -> CreateLabelingJob
s {$sel:roleArn:CreateLabelingJob' :: Text
roleArn = Text
a} :: CreateLabelingJob)
createLabelingJob_humanTaskConfig :: Lens.Lens' CreateLabelingJob HumanTaskConfig
createLabelingJob_humanTaskConfig :: (HumanTaskConfig -> f HumanTaskConfig)
-> CreateLabelingJob -> f CreateLabelingJob
createLabelingJob_humanTaskConfig = (CreateLabelingJob -> HumanTaskConfig)
-> (CreateLabelingJob -> HumanTaskConfig -> CreateLabelingJob)
-> Lens
CreateLabelingJob CreateLabelingJob HumanTaskConfig HumanTaskConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJob' {HumanTaskConfig
humanTaskConfig :: HumanTaskConfig
$sel:humanTaskConfig:CreateLabelingJob' :: CreateLabelingJob -> HumanTaskConfig
humanTaskConfig} -> HumanTaskConfig
humanTaskConfig) (\s :: CreateLabelingJob
s@CreateLabelingJob' {} HumanTaskConfig
a -> CreateLabelingJob
s {$sel:humanTaskConfig:CreateLabelingJob' :: HumanTaskConfig
humanTaskConfig = HumanTaskConfig
a} :: CreateLabelingJob)
instance Core.AWSRequest CreateLabelingJob where
type
AWSResponse CreateLabelingJob =
CreateLabelingJobResponse
request :: CreateLabelingJob -> Request CreateLabelingJob
request = Service -> CreateLabelingJob -> Request CreateLabelingJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateLabelingJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateLabelingJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateLabelingJob))
-> Logger
-> Service
-> Proxy CreateLabelingJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateLabelingJob)))
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 ->
Int -> Text -> CreateLabelingJobResponse
CreateLabelingJobResponse'
(Int -> Text -> CreateLabelingJobResponse)
-> Either String Int
-> Either String (Text -> CreateLabelingJobResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (Text -> CreateLabelingJobResponse)
-> Either String Text -> Either String CreateLabelingJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"LabelingJobArn")
)
instance Prelude.Hashable CreateLabelingJob
instance Prelude.NFData CreateLabelingJob
instance Core.ToHeaders CreateLabelingJob where
toHeaders :: CreateLabelingJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateLabelingJob -> 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
"SageMaker.CreateLabelingJob" ::
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 CreateLabelingJob where
toJSON :: CreateLabelingJob -> Value
toJSON CreateLabelingJob' {Maybe [Tag]
Maybe Text
Maybe LabelingJobAlgorithmsConfig
Maybe LabelingJobStoppingConditions
Text
LabelingJobOutputConfig
LabelingJobInputConfig
HumanTaskConfig
humanTaskConfig :: HumanTaskConfig
roleArn :: Text
outputConfig :: LabelingJobOutputConfig
inputConfig :: LabelingJobInputConfig
labelAttributeName :: Text
labelingJobName :: Text
tags :: Maybe [Tag]
stoppingConditions :: Maybe LabelingJobStoppingConditions
labelCategoryConfigS3Uri :: Maybe Text
labelingJobAlgorithmsConfig :: Maybe LabelingJobAlgorithmsConfig
$sel:humanTaskConfig:CreateLabelingJob' :: CreateLabelingJob -> HumanTaskConfig
$sel:roleArn:CreateLabelingJob' :: CreateLabelingJob -> Text
$sel:outputConfig:CreateLabelingJob' :: CreateLabelingJob -> LabelingJobOutputConfig
$sel:inputConfig:CreateLabelingJob' :: CreateLabelingJob -> LabelingJobInputConfig
$sel:labelAttributeName:CreateLabelingJob' :: CreateLabelingJob -> Text
$sel:labelingJobName:CreateLabelingJob' :: CreateLabelingJob -> Text
$sel:tags:CreateLabelingJob' :: CreateLabelingJob -> Maybe [Tag]
$sel:stoppingConditions:CreateLabelingJob' :: CreateLabelingJob -> Maybe LabelingJobStoppingConditions
$sel:labelCategoryConfigS3Uri:CreateLabelingJob' :: CreateLabelingJob -> Maybe Text
$sel:labelingJobAlgorithmsConfig:CreateLabelingJob' :: CreateLabelingJob -> Maybe LabelingJobAlgorithmsConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"LabelingJobAlgorithmsConfig" Text -> LabelingJobAlgorithmsConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(LabelingJobAlgorithmsConfig -> Pair)
-> Maybe LabelingJobAlgorithmsConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LabelingJobAlgorithmsConfig
labelingJobAlgorithmsConfig,
(Text
"LabelCategoryConfigS3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
labelCategoryConfigS3Uri,
(Text
"StoppingConditions" Text -> LabelingJobStoppingConditions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(LabelingJobStoppingConditions -> Pair)
-> Maybe LabelingJobStoppingConditions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LabelingJobStoppingConditions
stoppingConditions,
(Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"LabelingJobName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
labelingJobName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"LabelAttributeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
labelAttributeName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InputConfig" Text -> LabelingJobInputConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LabelingJobInputConfig
inputConfig),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OutputConfig" Text -> LabelingJobOutputConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LabelingJobOutputConfig
outputConfig),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"HumanTaskConfig" Text -> HumanTaskConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HumanTaskConfig
humanTaskConfig)
]
)
instance Core.ToPath CreateLabelingJob where
toPath :: CreateLabelingJob -> ByteString
toPath = ByteString -> CreateLabelingJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateLabelingJob where
toQuery :: CreateLabelingJob -> QueryString
toQuery = QueryString -> CreateLabelingJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateLabelingJobResponse = CreateLabelingJobResponse'
{
CreateLabelingJobResponse -> Int
httpStatus :: Prelude.Int,
CreateLabelingJobResponse -> Text
labelingJobArn :: Prelude.Text
}
deriving (CreateLabelingJobResponse -> CreateLabelingJobResponse -> Bool
(CreateLabelingJobResponse -> CreateLabelingJobResponse -> Bool)
-> (CreateLabelingJobResponse -> CreateLabelingJobResponse -> Bool)
-> Eq CreateLabelingJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLabelingJobResponse -> CreateLabelingJobResponse -> Bool
$c/= :: CreateLabelingJobResponse -> CreateLabelingJobResponse -> Bool
== :: CreateLabelingJobResponse -> CreateLabelingJobResponse -> Bool
$c== :: CreateLabelingJobResponse -> CreateLabelingJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateLabelingJobResponse]
ReadPrec CreateLabelingJobResponse
Int -> ReadS CreateLabelingJobResponse
ReadS [CreateLabelingJobResponse]
(Int -> ReadS CreateLabelingJobResponse)
-> ReadS [CreateLabelingJobResponse]
-> ReadPrec CreateLabelingJobResponse
-> ReadPrec [CreateLabelingJobResponse]
-> Read CreateLabelingJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLabelingJobResponse]
$creadListPrec :: ReadPrec [CreateLabelingJobResponse]
readPrec :: ReadPrec CreateLabelingJobResponse
$creadPrec :: ReadPrec CreateLabelingJobResponse
readList :: ReadS [CreateLabelingJobResponse]
$creadList :: ReadS [CreateLabelingJobResponse]
readsPrec :: Int -> ReadS CreateLabelingJobResponse
$creadsPrec :: Int -> ReadS CreateLabelingJobResponse
Prelude.Read, Int -> CreateLabelingJobResponse -> ShowS
[CreateLabelingJobResponse] -> ShowS
CreateLabelingJobResponse -> String
(Int -> CreateLabelingJobResponse -> ShowS)
-> (CreateLabelingJobResponse -> String)
-> ([CreateLabelingJobResponse] -> ShowS)
-> Show CreateLabelingJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLabelingJobResponse] -> ShowS
$cshowList :: [CreateLabelingJobResponse] -> ShowS
show :: CreateLabelingJobResponse -> String
$cshow :: CreateLabelingJobResponse -> String
showsPrec :: Int -> CreateLabelingJobResponse -> ShowS
$cshowsPrec :: Int -> CreateLabelingJobResponse -> ShowS
Prelude.Show, (forall x.
CreateLabelingJobResponse -> Rep CreateLabelingJobResponse x)
-> (forall x.
Rep CreateLabelingJobResponse x -> CreateLabelingJobResponse)
-> Generic CreateLabelingJobResponse
forall x.
Rep CreateLabelingJobResponse x -> CreateLabelingJobResponse
forall x.
CreateLabelingJobResponse -> Rep CreateLabelingJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLabelingJobResponse x -> CreateLabelingJobResponse
$cfrom :: forall x.
CreateLabelingJobResponse -> Rep CreateLabelingJobResponse x
Prelude.Generic)
newCreateLabelingJobResponse ::
Prelude.Int ->
Prelude.Text ->
CreateLabelingJobResponse
newCreateLabelingJobResponse :: Int -> Text -> CreateLabelingJobResponse
newCreateLabelingJobResponse
Int
pHttpStatus_
Text
pLabelingJobArn_ =
CreateLabelingJobResponse' :: Int -> Text -> CreateLabelingJobResponse
CreateLabelingJobResponse'
{ $sel:httpStatus:CreateLabelingJobResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:labelingJobArn:CreateLabelingJobResponse' :: Text
labelingJobArn = Text
pLabelingJobArn_
}
createLabelingJobResponse_httpStatus :: Lens.Lens' CreateLabelingJobResponse Prelude.Int
createLabelingJobResponse_httpStatus :: (Int -> f Int)
-> CreateLabelingJobResponse -> f CreateLabelingJobResponse
createLabelingJobResponse_httpStatus = (CreateLabelingJobResponse -> Int)
-> (CreateLabelingJobResponse -> Int -> CreateLabelingJobResponse)
-> Lens CreateLabelingJobResponse CreateLabelingJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateLabelingJobResponse' :: CreateLabelingJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateLabelingJobResponse
s@CreateLabelingJobResponse' {} Int
a -> CreateLabelingJobResponse
s {$sel:httpStatus:CreateLabelingJobResponse' :: Int
httpStatus = Int
a} :: CreateLabelingJobResponse)
createLabelingJobResponse_labelingJobArn :: Lens.Lens' CreateLabelingJobResponse Prelude.Text
createLabelingJobResponse_labelingJobArn :: (Text -> f Text)
-> CreateLabelingJobResponse -> f CreateLabelingJobResponse
createLabelingJobResponse_labelingJobArn = (CreateLabelingJobResponse -> Text)
-> (CreateLabelingJobResponse -> Text -> CreateLabelingJobResponse)
-> Lens
CreateLabelingJobResponse CreateLabelingJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLabelingJobResponse' {Text
labelingJobArn :: Text
$sel:labelingJobArn:CreateLabelingJobResponse' :: CreateLabelingJobResponse -> Text
labelingJobArn} -> Text
labelingJobArn) (\s :: CreateLabelingJobResponse
s@CreateLabelingJobResponse' {} Text
a -> CreateLabelingJobResponse
s {$sel:labelingJobArn:CreateLabelingJobResponse' :: Text
labelingJobArn = Text
a} :: CreateLabelingJobResponse)
instance Prelude.NFData CreateLabelingJobResponse