{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SageMaker.Types.UiConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.UiConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provided configuration information for the worker UI for a labeling job.
-- Provide either @HumanTaskUiArn@ or @UiTemplateS3Uri@.
--
-- For named entity recognition, 3D point cloud and video frame labeling
-- jobs, use @HumanTaskUiArn@.
--
-- For all other Ground Truth built-in task types and custom task types,
-- use @UiTemplateS3Uri@ to specify the location of a worker task template
-- in Amazon S3.
--
-- /See:/ 'newUiConfig' smart constructor.
data UiConfig = UiConfig'
  { -- | The ARN of the worker task template used to render the worker UI and
    -- tools for labeling job tasks.
    --
    -- Use this parameter when you are creating a labeling job for named entity
    -- recognition, 3D point cloud and video frame labeling jobs. Use your
    -- labeling job task type to select one of the following ARNs and use it
    -- with this parameter when you create a labeling job. Replace @aws-region@
    -- with the Amazon Web Services Region you are creating your labeling job
    -- in. For example, replace @aws-region@ with @us-west-1@ if you create a
    -- labeling job in US West (N. California).
    --
    -- __Named Entity Recognition__
    --
    -- Use the following @HumanTaskUiArn@ for named entity recognition labeling
    -- jobs:
    --
    -- @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/NamedEntityRecognition@
    --
    -- __3D Point Cloud HumanTaskUiArns__
    --
    -- Use this @HumanTaskUiArn@ for 3D point cloud object detection and 3D
    -- point cloud object detection adjustment labeling jobs.
    --
    -- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudObjectDetection@
    --
    -- Use this @HumanTaskUiArn@ for 3D point cloud object tracking and 3D
    -- point cloud object tracking adjustment labeling jobs.
    --
    -- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudObjectTracking@
    --
    -- Use this @HumanTaskUiArn@ for 3D point cloud semantic segmentation and
    -- 3D point cloud semantic segmentation adjustment labeling jobs.
    --
    -- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudSemanticSegmentation@
    --
    -- __Video Frame HumanTaskUiArns__
    --
    -- Use this @HumanTaskUiArn@ for video frame object detection and video
    -- frame object detection adjustment labeling jobs.
    --
    -- -   @arn:aws:sagemaker:region:394669845002:human-task-ui\/VideoObjectDetection@
    --
    -- Use this @HumanTaskUiArn@ for video frame object tracking and video
    -- frame object tracking adjustment labeling jobs.
    --
    -- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/VideoObjectTracking@
    UiConfig -> Maybe Text
humanTaskUiArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 bucket location of the UI template, or worker task
    -- template. This is the template used to render the worker UI and tools
    -- for labeling job tasks. For more information about the contents of a UI
    -- template, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-custom-templates-step2.html Creating Your Custom Labeling Task Template>.
    UiConfig -> Maybe Text
uiTemplateS3Uri :: Prelude.Maybe Prelude.Text
  }
  deriving (UiConfig -> UiConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UiConfig -> UiConfig -> Bool
$c/= :: UiConfig -> UiConfig -> Bool
== :: UiConfig -> UiConfig -> Bool
$c== :: UiConfig -> UiConfig -> Bool
Prelude.Eq, ReadPrec [UiConfig]
ReadPrec UiConfig
Int -> ReadS UiConfig
ReadS [UiConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UiConfig]
$creadListPrec :: ReadPrec [UiConfig]
readPrec :: ReadPrec UiConfig
$creadPrec :: ReadPrec UiConfig
readList :: ReadS [UiConfig]
$creadList :: ReadS [UiConfig]
readsPrec :: Int -> ReadS UiConfig
$creadsPrec :: Int -> ReadS UiConfig
Prelude.Read, Int -> UiConfig -> ShowS
[UiConfig] -> ShowS
UiConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UiConfig] -> ShowS
$cshowList :: [UiConfig] -> ShowS
show :: UiConfig -> String
$cshow :: UiConfig -> String
showsPrec :: Int -> UiConfig -> ShowS
$cshowsPrec :: Int -> UiConfig -> ShowS
Prelude.Show, forall x. Rep UiConfig x -> UiConfig
forall x. UiConfig -> Rep UiConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UiConfig x -> UiConfig
$cfrom :: forall x. UiConfig -> Rep UiConfig x
Prelude.Generic)

-- |
-- Create a value of 'UiConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'humanTaskUiArn', 'uiConfig_humanTaskUiArn' - The ARN of the worker task template used to render the worker UI and
-- tools for labeling job tasks.
--
-- Use this parameter when you are creating a labeling job for named entity
-- recognition, 3D point cloud and video frame labeling jobs. Use your
-- labeling job task type to select one of the following ARNs and use it
-- with this parameter when you create a labeling job. Replace @aws-region@
-- with the Amazon Web Services Region you are creating your labeling job
-- in. For example, replace @aws-region@ with @us-west-1@ if you create a
-- labeling job in US West (N. California).
--
-- __Named Entity Recognition__
--
-- Use the following @HumanTaskUiArn@ for named entity recognition labeling
-- jobs:
--
-- @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/NamedEntityRecognition@
--
-- __3D Point Cloud HumanTaskUiArns__
--
-- Use this @HumanTaskUiArn@ for 3D point cloud object detection and 3D
-- point cloud object detection adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudObjectDetection@
--
-- Use this @HumanTaskUiArn@ for 3D point cloud object tracking and 3D
-- point cloud object tracking adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudObjectTracking@
--
-- Use this @HumanTaskUiArn@ for 3D point cloud semantic segmentation and
-- 3D point cloud semantic segmentation adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudSemanticSegmentation@
--
-- __Video Frame HumanTaskUiArns__
--
-- Use this @HumanTaskUiArn@ for video frame object detection and video
-- frame object detection adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:region:394669845002:human-task-ui\/VideoObjectDetection@
--
-- Use this @HumanTaskUiArn@ for video frame object tracking and video
-- frame object tracking adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/VideoObjectTracking@
--
-- 'uiTemplateS3Uri', 'uiConfig_uiTemplateS3Uri' - The Amazon S3 bucket location of the UI template, or worker task
-- template. This is the template used to render the worker UI and tools
-- for labeling job tasks. For more information about the contents of a UI
-- template, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-custom-templates-step2.html Creating Your Custom Labeling Task Template>.
newUiConfig ::
  UiConfig
newUiConfig :: UiConfig
newUiConfig =
  UiConfig'
    { $sel:humanTaskUiArn:UiConfig' :: Maybe Text
humanTaskUiArn = forall a. Maybe a
Prelude.Nothing,
      $sel:uiTemplateS3Uri:UiConfig' :: Maybe Text
uiTemplateS3Uri = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the worker task template used to render the worker UI and
-- tools for labeling job tasks.
--
-- Use this parameter when you are creating a labeling job for named entity
-- recognition, 3D point cloud and video frame labeling jobs. Use your
-- labeling job task type to select one of the following ARNs and use it
-- with this parameter when you create a labeling job. Replace @aws-region@
-- with the Amazon Web Services Region you are creating your labeling job
-- in. For example, replace @aws-region@ with @us-west-1@ if you create a
-- labeling job in US West (N. California).
--
-- __Named Entity Recognition__
--
-- Use the following @HumanTaskUiArn@ for named entity recognition labeling
-- jobs:
--
-- @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/NamedEntityRecognition@
--
-- __3D Point Cloud HumanTaskUiArns__
--
-- Use this @HumanTaskUiArn@ for 3D point cloud object detection and 3D
-- point cloud object detection adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudObjectDetection@
--
-- Use this @HumanTaskUiArn@ for 3D point cloud object tracking and 3D
-- point cloud object tracking adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudObjectTracking@
--
-- Use this @HumanTaskUiArn@ for 3D point cloud semantic segmentation and
-- 3D point cloud semantic segmentation adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/PointCloudSemanticSegmentation@
--
-- __Video Frame HumanTaskUiArns__
--
-- Use this @HumanTaskUiArn@ for video frame object detection and video
-- frame object detection adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:region:394669845002:human-task-ui\/VideoObjectDetection@
--
-- Use this @HumanTaskUiArn@ for video frame object tracking and video
-- frame object tracking adjustment labeling jobs.
--
-- -   @arn:aws:sagemaker:aws-region:394669845002:human-task-ui\/VideoObjectTracking@
uiConfig_humanTaskUiArn :: Lens.Lens' UiConfig (Prelude.Maybe Prelude.Text)
uiConfig_humanTaskUiArn :: Lens' UiConfig (Maybe Text)
uiConfig_humanTaskUiArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UiConfig' {Maybe Text
humanTaskUiArn :: Maybe Text
$sel:humanTaskUiArn:UiConfig' :: UiConfig -> Maybe Text
humanTaskUiArn} -> Maybe Text
humanTaskUiArn) (\s :: UiConfig
s@UiConfig' {} Maybe Text
a -> UiConfig
s {$sel:humanTaskUiArn:UiConfig' :: Maybe Text
humanTaskUiArn = Maybe Text
a} :: UiConfig)

-- | The Amazon S3 bucket location of the UI template, or worker task
-- template. This is the template used to render the worker UI and tools
-- for labeling job tasks. For more information about the contents of a UI
-- template, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-custom-templates-step2.html Creating Your Custom Labeling Task Template>.
uiConfig_uiTemplateS3Uri :: Lens.Lens' UiConfig (Prelude.Maybe Prelude.Text)
uiConfig_uiTemplateS3Uri :: Lens' UiConfig (Maybe Text)
uiConfig_uiTemplateS3Uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UiConfig' {Maybe Text
uiTemplateS3Uri :: Maybe Text
$sel:uiTemplateS3Uri:UiConfig' :: UiConfig -> Maybe Text
uiTemplateS3Uri} -> Maybe Text
uiTemplateS3Uri) (\s :: UiConfig
s@UiConfig' {} Maybe Text
a -> UiConfig
s {$sel:uiTemplateS3Uri:UiConfig' :: Maybe Text
uiTemplateS3Uri = Maybe Text
a} :: UiConfig)

instance Data.FromJSON UiConfig where
  parseJSON :: Value -> Parser UiConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"UiConfig"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> UiConfig
UiConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HumanTaskUiArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UiTemplateS3Uri")
      )

instance Prelude.Hashable UiConfig where
  hashWithSalt :: Int -> UiConfig -> Int
hashWithSalt Int
_salt UiConfig' {Maybe Text
uiTemplateS3Uri :: Maybe Text
humanTaskUiArn :: Maybe Text
$sel:uiTemplateS3Uri:UiConfig' :: UiConfig -> Maybe Text
$sel:humanTaskUiArn:UiConfig' :: UiConfig -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
humanTaskUiArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
uiTemplateS3Uri

instance Prelude.NFData UiConfig where
  rnf :: UiConfig -> ()
rnf UiConfig' {Maybe Text
uiTemplateS3Uri :: Maybe Text
humanTaskUiArn :: Maybe Text
$sel:uiTemplateS3Uri:UiConfig' :: UiConfig -> Maybe Text
$sel:humanTaskUiArn:UiConfig' :: UiConfig -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
humanTaskUiArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
uiTemplateS3Uri

instance Data.ToJSON UiConfig where
  toJSON :: UiConfig -> Value
toJSON UiConfig' {Maybe Text
uiTemplateS3Uri :: Maybe Text
humanTaskUiArn :: Maybe Text
$sel:uiTemplateS3Uri:UiConfig' :: UiConfig -> Maybe Text
$sel:humanTaskUiArn:UiConfig' :: UiConfig -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"HumanTaskUiArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
humanTaskUiArn,
            (Key
"UiTemplateS3Uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
uiTemplateS3Uri
          ]
      )