{-# 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 #-}

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

-- |
-- Module      : Amazonka.Glue.CreateMLTransform
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an Glue machine learning transform. This operation creates the
-- transform and all the necessary parameters to train it.
--
-- Call this operation as the first step in the process of using a machine
-- learning transform (such as the @FindMatches@ transform) for
-- deduplicating data. You can provide an optional @Description@, in
-- addition to the parameters that you want to use for your algorithm.
--
-- You must also specify certain parameters for the tasks that Glue runs on
-- your behalf as part of learning from your data and creating a
-- high-quality machine learning transform. These parameters include
-- @Role@, and optionally, @AllocatedCapacity@, @Timeout@, and
-- @MaxRetries@. For more information, see
-- <https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-job.html Jobs>.
module Amazonka.Glue.CreateMLTransform
  ( -- * Creating a Request
    CreateMLTransform (..),
    newCreateMLTransform,

    -- * Request Lenses
    createMLTransform_numberOfWorkers,
    createMLTransform_workerType,
    createMLTransform_glueVersion,
    createMLTransform_maxRetries,
    createMLTransform_maxCapacity,
    createMLTransform_timeout,
    createMLTransform_transformEncryption,
    createMLTransform_description,
    createMLTransform_tags,
    createMLTransform_name,
    createMLTransform_inputRecordTables,
    createMLTransform_parameters,
    createMLTransform_role,

    -- * Destructuring the Response
    CreateMLTransformResponse (..),
    newCreateMLTransformResponse,

    -- * Response Lenses
    createMLTransformResponse_transformId,
    createMLTransformResponse_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

-- | /See:/ 'newCreateMLTransform' smart constructor.
data CreateMLTransform = CreateMLTransform'
  { -- | The number of workers of a defined @workerType@ that are allocated when
    -- this task runs.
    --
    -- If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
    -- versa).
    CreateMLTransform -> Maybe Int
numberOfWorkers :: Prelude.Maybe Prelude.Int,
    -- | The type of predefined worker that is allocated when this task runs.
    -- Accepts a value of Standard, G.1X, or G.2X.
    --
    -- -   For the @Standard@ worker type, each worker provides 4 vCPU, 16 GB
    --     of memory and a 50GB disk, and 2 executors per worker.
    --
    -- -   For the @G.1X@ worker type, each worker provides 4 vCPU, 16 GB of
    --     memory and a 64GB disk, and 1 executor per worker.
    --
    -- -   For the @G.2X@ worker type, each worker provides 8 vCPU, 32 GB of
    --     memory and a 128GB disk, and 1 executor per worker.
    --
    -- @MaxCapacity@ is a mutually exclusive option with @NumberOfWorkers@ and
    -- @WorkerType@.
    --
    -- -   If either @NumberOfWorkers@ or @WorkerType@ is set, then
    --     @MaxCapacity@ cannot be set.
    --
    -- -   If @MaxCapacity@ is set then neither @NumberOfWorkers@ or
    --     @WorkerType@ can be set.
    --
    -- -   If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
    --     versa).
    --
    -- -   @MaxCapacity@ and @NumberOfWorkers@ must both be at least 1.
    CreateMLTransform -> Maybe WorkerType
workerType :: Prelude.Maybe WorkerType,
    -- | This value determines which version of Glue this machine learning
    -- transform is compatible with. Glue 1.0 is recommended for most
    -- customers. If the value is not set, the Glue compatibility defaults to
    -- Glue 0.9. For more information, see
    -- <https://docs.aws.amazon.com/glue/latest/dg/release-notes.html#release-notes-versions Glue Versions>
    -- in the developer guide.
    CreateMLTransform -> Maybe Text
glueVersion :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of times to retry a task for this transform after a
    -- task run fails.
    CreateMLTransform -> Maybe Int
maxRetries :: Prelude.Maybe Prelude.Int,
    -- | The number of Glue data processing units (DPUs) that are allocated to
    -- task runs for this transform. You can allocate from 2 to 100 DPUs; the
    -- default is 10. A DPU is a relative measure of processing power that
    -- consists of 4 vCPUs of compute capacity and 16 GB of memory. For more
    -- information, see the
    -- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
    --
    -- @MaxCapacity@ is a mutually exclusive option with @NumberOfWorkers@ and
    -- @WorkerType@.
    --
    -- -   If either @NumberOfWorkers@ or @WorkerType@ is set, then
    --     @MaxCapacity@ cannot be set.
    --
    -- -   If @MaxCapacity@ is set then neither @NumberOfWorkers@ or
    --     @WorkerType@ can be set.
    --
    -- -   If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
    --     versa).
    --
    -- -   @MaxCapacity@ and @NumberOfWorkers@ must both be at least 1.
    --
    -- When the @WorkerType@ field is set to a value other than @Standard@, the
    -- @MaxCapacity@ field is set automatically and becomes read-only.
    --
    -- When the @WorkerType@ field is set to a value other than @Standard@, the
    -- @MaxCapacity@ field is set automatically and becomes read-only.
    CreateMLTransform -> Maybe Double
maxCapacity :: Prelude.Maybe Prelude.Double,
    -- | The timeout of the task run for this transform in minutes. This is the
    -- maximum time that a task run for this transform can consume resources
    -- before it is terminated and enters @TIMEOUT@ status. The default is
    -- 2,880 minutes (48 hours).
    CreateMLTransform -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | The encryption-at-rest settings of the transform that apply to accessing
    -- user data. Machine learning transforms can access user data encrypted in
    -- Amazon S3 using KMS.
    CreateMLTransform -> Maybe TransformEncryption
transformEncryption :: Prelude.Maybe TransformEncryption,
    -- | A description of the machine learning transform that is being defined.
    -- The default is an empty string.
    CreateMLTransform -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags to use with this machine learning transform. You may use tags
    -- to limit access to the machine learning transform. For more information
    -- about tags in Glue, see
    -- <https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html Amazon Web Services Tags in Glue>
    -- in the developer guide.
    CreateMLTransform -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unique name that you give the transform when you create it.
    CreateMLTransform -> Text
name :: Prelude.Text,
    -- | A list of Glue table definitions used by the transform.
    CreateMLTransform -> [GlueTable]
inputRecordTables :: [GlueTable],
    -- | The algorithmic parameters that are specific to the transform type used.
    -- Conditionally dependent on the transform type.
    CreateMLTransform -> TransformParameters
parameters :: TransformParameters,
    -- | The name or Amazon Resource Name (ARN) of the IAM role with the required
    -- permissions. The required permissions include both Glue service role
    -- permissions to Glue resources, and Amazon S3 permissions required by the
    -- transform.
    --
    -- -   This role needs Glue service role permissions to allow access to
    --     resources in Glue. See
    --     <https://docs.aws.amazon.com/glue/latest/dg/attach-policy-iam-user.html Attach a Policy to IAM Users That Access Glue>.
    --
    -- -   This role needs permission to your Amazon Simple Storage Service
    --     (Amazon S3) sources, targets, temporary directory, scripts, and any
    --     libraries used by the task run for this transform.
    CreateMLTransform -> Text
role' :: Prelude.Text
  }
  deriving (CreateMLTransform -> CreateMLTransform -> Bool
(CreateMLTransform -> CreateMLTransform -> Bool)
-> (CreateMLTransform -> CreateMLTransform -> Bool)
-> Eq CreateMLTransform
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMLTransform -> CreateMLTransform -> Bool
$c/= :: CreateMLTransform -> CreateMLTransform -> Bool
== :: CreateMLTransform -> CreateMLTransform -> Bool
$c== :: CreateMLTransform -> CreateMLTransform -> Bool
Prelude.Eq, ReadPrec [CreateMLTransform]
ReadPrec CreateMLTransform
Int -> ReadS CreateMLTransform
ReadS [CreateMLTransform]
(Int -> ReadS CreateMLTransform)
-> ReadS [CreateMLTransform]
-> ReadPrec CreateMLTransform
-> ReadPrec [CreateMLTransform]
-> Read CreateMLTransform
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMLTransform]
$creadListPrec :: ReadPrec [CreateMLTransform]
readPrec :: ReadPrec CreateMLTransform
$creadPrec :: ReadPrec CreateMLTransform
readList :: ReadS [CreateMLTransform]
$creadList :: ReadS [CreateMLTransform]
readsPrec :: Int -> ReadS CreateMLTransform
$creadsPrec :: Int -> ReadS CreateMLTransform
Prelude.Read, Int -> CreateMLTransform -> ShowS
[CreateMLTransform] -> ShowS
CreateMLTransform -> String
(Int -> CreateMLTransform -> ShowS)
-> (CreateMLTransform -> String)
-> ([CreateMLTransform] -> ShowS)
-> Show CreateMLTransform
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMLTransform] -> ShowS
$cshowList :: [CreateMLTransform] -> ShowS
show :: CreateMLTransform -> String
$cshow :: CreateMLTransform -> String
showsPrec :: Int -> CreateMLTransform -> ShowS
$cshowsPrec :: Int -> CreateMLTransform -> ShowS
Prelude.Show, (forall x. CreateMLTransform -> Rep CreateMLTransform x)
-> (forall x. Rep CreateMLTransform x -> CreateMLTransform)
-> Generic CreateMLTransform
forall x. Rep CreateMLTransform x -> CreateMLTransform
forall x. CreateMLTransform -> Rep CreateMLTransform x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMLTransform x -> CreateMLTransform
$cfrom :: forall x. CreateMLTransform -> Rep CreateMLTransform x
Prelude.Generic)

-- |
-- Create a value of 'CreateMLTransform' 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:
--
-- 'numberOfWorkers', 'createMLTransform_numberOfWorkers' - The number of workers of a defined @workerType@ that are allocated when
-- this task runs.
--
-- If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
-- versa).
--
-- 'workerType', 'createMLTransform_workerType' - The type of predefined worker that is allocated when this task runs.
-- Accepts a value of Standard, G.1X, or G.2X.
--
-- -   For the @Standard@ worker type, each worker provides 4 vCPU, 16 GB
--     of memory and a 50GB disk, and 2 executors per worker.
--
-- -   For the @G.1X@ worker type, each worker provides 4 vCPU, 16 GB of
--     memory and a 64GB disk, and 1 executor per worker.
--
-- -   For the @G.2X@ worker type, each worker provides 8 vCPU, 32 GB of
--     memory and a 128GB disk, and 1 executor per worker.
--
-- @MaxCapacity@ is a mutually exclusive option with @NumberOfWorkers@ and
-- @WorkerType@.
--
-- -   If either @NumberOfWorkers@ or @WorkerType@ is set, then
--     @MaxCapacity@ cannot be set.
--
-- -   If @MaxCapacity@ is set then neither @NumberOfWorkers@ or
--     @WorkerType@ can be set.
--
-- -   If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
--     versa).
--
-- -   @MaxCapacity@ and @NumberOfWorkers@ must both be at least 1.
--
-- 'glueVersion', 'createMLTransform_glueVersion' - This value determines which version of Glue this machine learning
-- transform is compatible with. Glue 1.0 is recommended for most
-- customers. If the value is not set, the Glue compatibility defaults to
-- Glue 0.9. For more information, see
-- <https://docs.aws.amazon.com/glue/latest/dg/release-notes.html#release-notes-versions Glue Versions>
-- in the developer guide.
--
-- 'maxRetries', 'createMLTransform_maxRetries' - The maximum number of times to retry a task for this transform after a
-- task run fails.
--
-- 'maxCapacity', 'createMLTransform_maxCapacity' - The number of Glue data processing units (DPUs) that are allocated to
-- task runs for this transform. You can allocate from 2 to 100 DPUs; the
-- default is 10. A DPU is a relative measure of processing power that
-- consists of 4 vCPUs of compute capacity and 16 GB of memory. For more
-- information, see the
-- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
--
-- @MaxCapacity@ is a mutually exclusive option with @NumberOfWorkers@ and
-- @WorkerType@.
--
-- -   If either @NumberOfWorkers@ or @WorkerType@ is set, then
--     @MaxCapacity@ cannot be set.
--
-- -   If @MaxCapacity@ is set then neither @NumberOfWorkers@ or
--     @WorkerType@ can be set.
--
-- -   If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
--     versa).
--
-- -   @MaxCapacity@ and @NumberOfWorkers@ must both be at least 1.
--
-- When the @WorkerType@ field is set to a value other than @Standard@, the
-- @MaxCapacity@ field is set automatically and becomes read-only.
--
-- When the @WorkerType@ field is set to a value other than @Standard@, the
-- @MaxCapacity@ field is set automatically and becomes read-only.
--
-- 'timeout', 'createMLTransform_timeout' - The timeout of the task run for this transform in minutes. This is the
-- maximum time that a task run for this transform can consume resources
-- before it is terminated and enters @TIMEOUT@ status. The default is
-- 2,880 minutes (48 hours).
--
-- 'transformEncryption', 'createMLTransform_transformEncryption' - The encryption-at-rest settings of the transform that apply to accessing
-- user data. Machine learning transforms can access user data encrypted in
-- Amazon S3 using KMS.
--
-- 'description', 'createMLTransform_description' - A description of the machine learning transform that is being defined.
-- The default is an empty string.
--
-- 'tags', 'createMLTransform_tags' - The tags to use with this machine learning transform. You may use tags
-- to limit access to the machine learning transform. For more information
-- about tags in Glue, see
-- <https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html Amazon Web Services Tags in Glue>
-- in the developer guide.
--
-- 'name', 'createMLTransform_name' - The unique name that you give the transform when you create it.
--
-- 'inputRecordTables', 'createMLTransform_inputRecordTables' - A list of Glue table definitions used by the transform.
--
-- 'parameters', 'createMLTransform_parameters' - The algorithmic parameters that are specific to the transform type used.
-- Conditionally dependent on the transform type.
--
-- 'role'', 'createMLTransform_role' - The name or Amazon Resource Name (ARN) of the IAM role with the required
-- permissions. The required permissions include both Glue service role
-- permissions to Glue resources, and Amazon S3 permissions required by the
-- transform.
--
-- -   This role needs Glue service role permissions to allow access to
--     resources in Glue. See
--     <https://docs.aws.amazon.com/glue/latest/dg/attach-policy-iam-user.html Attach a Policy to IAM Users That Access Glue>.
--
-- -   This role needs permission to your Amazon Simple Storage Service
--     (Amazon S3) sources, targets, temporary directory, scripts, and any
--     libraries used by the task run for this transform.
newCreateMLTransform ::
  -- | 'name'
  Prelude.Text ->
  -- | 'parameters'
  TransformParameters ->
  -- | 'role''
  Prelude.Text ->
  CreateMLTransform
newCreateMLTransform :: Text -> TransformParameters -> Text -> CreateMLTransform
newCreateMLTransform Text
pName_ TransformParameters
pParameters_ Text
pRole_ =
  CreateMLTransform' :: Maybe Int
-> Maybe WorkerType
-> Maybe Text
-> Maybe Int
-> Maybe Double
-> Maybe Natural
-> Maybe TransformEncryption
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> [GlueTable]
-> TransformParameters
-> Text
-> CreateMLTransform
CreateMLTransform'
    { $sel:numberOfWorkers:CreateMLTransform' :: Maybe Int
numberOfWorkers =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:workerType:CreateMLTransform' :: Maybe WorkerType
workerType = Maybe WorkerType
forall a. Maybe a
Prelude.Nothing,
      $sel:glueVersion:CreateMLTransform' :: Maybe Text
glueVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRetries:CreateMLTransform' :: Maybe Int
maxRetries = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:maxCapacity:CreateMLTransform' :: Maybe Double
maxCapacity = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:CreateMLTransform' :: Maybe Natural
timeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:transformEncryption:CreateMLTransform' :: Maybe TransformEncryption
transformEncryption = Maybe TransformEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateMLTransform' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateMLTransform' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateMLTransform' :: Text
name = Text
pName_,
      $sel:inputRecordTables:CreateMLTransform' :: [GlueTable]
inputRecordTables = [GlueTable]
forall a. Monoid a => a
Prelude.mempty,
      $sel:parameters:CreateMLTransform' :: TransformParameters
parameters = TransformParameters
pParameters_,
      $sel:role':CreateMLTransform' :: Text
role' = Text
pRole_
    }

-- | The number of workers of a defined @workerType@ that are allocated when
-- this task runs.
--
-- If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
-- versa).
createMLTransform_numberOfWorkers :: Lens.Lens' CreateMLTransform (Prelude.Maybe Prelude.Int)
createMLTransform_numberOfWorkers :: (Maybe Int -> f (Maybe Int))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_numberOfWorkers = (CreateMLTransform -> Maybe Int)
-> (CreateMLTransform -> Maybe Int -> CreateMLTransform)
-> Lens CreateMLTransform CreateMLTransform (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe Int
numberOfWorkers :: Maybe Int
$sel:numberOfWorkers:CreateMLTransform' :: CreateMLTransform -> Maybe Int
numberOfWorkers} -> Maybe Int
numberOfWorkers) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe Int
a -> CreateMLTransform
s {$sel:numberOfWorkers:CreateMLTransform' :: Maybe Int
numberOfWorkers = Maybe Int
a} :: CreateMLTransform)

-- | The type of predefined worker that is allocated when this task runs.
-- Accepts a value of Standard, G.1X, or G.2X.
--
-- -   For the @Standard@ worker type, each worker provides 4 vCPU, 16 GB
--     of memory and a 50GB disk, and 2 executors per worker.
--
-- -   For the @G.1X@ worker type, each worker provides 4 vCPU, 16 GB of
--     memory and a 64GB disk, and 1 executor per worker.
--
-- -   For the @G.2X@ worker type, each worker provides 8 vCPU, 32 GB of
--     memory and a 128GB disk, and 1 executor per worker.
--
-- @MaxCapacity@ is a mutually exclusive option with @NumberOfWorkers@ and
-- @WorkerType@.
--
-- -   If either @NumberOfWorkers@ or @WorkerType@ is set, then
--     @MaxCapacity@ cannot be set.
--
-- -   If @MaxCapacity@ is set then neither @NumberOfWorkers@ or
--     @WorkerType@ can be set.
--
-- -   If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
--     versa).
--
-- -   @MaxCapacity@ and @NumberOfWorkers@ must both be at least 1.
createMLTransform_workerType :: Lens.Lens' CreateMLTransform (Prelude.Maybe WorkerType)
createMLTransform_workerType :: (Maybe WorkerType -> f (Maybe WorkerType))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_workerType = (CreateMLTransform -> Maybe WorkerType)
-> (CreateMLTransform -> Maybe WorkerType -> CreateMLTransform)
-> Lens
     CreateMLTransform
     CreateMLTransform
     (Maybe WorkerType)
     (Maybe WorkerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe WorkerType
workerType :: Maybe WorkerType
$sel:workerType:CreateMLTransform' :: CreateMLTransform -> Maybe WorkerType
workerType} -> Maybe WorkerType
workerType) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe WorkerType
a -> CreateMLTransform
s {$sel:workerType:CreateMLTransform' :: Maybe WorkerType
workerType = Maybe WorkerType
a} :: CreateMLTransform)

-- | This value determines which version of Glue this machine learning
-- transform is compatible with. Glue 1.0 is recommended for most
-- customers. If the value is not set, the Glue compatibility defaults to
-- Glue 0.9. For more information, see
-- <https://docs.aws.amazon.com/glue/latest/dg/release-notes.html#release-notes-versions Glue Versions>
-- in the developer guide.
createMLTransform_glueVersion :: Lens.Lens' CreateMLTransform (Prelude.Maybe Prelude.Text)
createMLTransform_glueVersion :: (Maybe Text -> f (Maybe Text))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_glueVersion = (CreateMLTransform -> Maybe Text)
-> (CreateMLTransform -> Maybe Text -> CreateMLTransform)
-> Lens
     CreateMLTransform CreateMLTransform (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe Text
glueVersion :: Maybe Text
$sel:glueVersion:CreateMLTransform' :: CreateMLTransform -> Maybe Text
glueVersion} -> Maybe Text
glueVersion) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe Text
a -> CreateMLTransform
s {$sel:glueVersion:CreateMLTransform' :: Maybe Text
glueVersion = Maybe Text
a} :: CreateMLTransform)

-- | The maximum number of times to retry a task for this transform after a
-- task run fails.
createMLTransform_maxRetries :: Lens.Lens' CreateMLTransform (Prelude.Maybe Prelude.Int)
createMLTransform_maxRetries :: (Maybe Int -> f (Maybe Int))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_maxRetries = (CreateMLTransform -> Maybe Int)
-> (CreateMLTransform -> Maybe Int -> CreateMLTransform)
-> Lens CreateMLTransform CreateMLTransform (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe Int
maxRetries :: Maybe Int
$sel:maxRetries:CreateMLTransform' :: CreateMLTransform -> Maybe Int
maxRetries} -> Maybe Int
maxRetries) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe Int
a -> CreateMLTransform
s {$sel:maxRetries:CreateMLTransform' :: Maybe Int
maxRetries = Maybe Int
a} :: CreateMLTransform)

-- | The number of Glue data processing units (DPUs) that are allocated to
-- task runs for this transform. You can allocate from 2 to 100 DPUs; the
-- default is 10. A DPU is a relative measure of processing power that
-- consists of 4 vCPUs of compute capacity and 16 GB of memory. For more
-- information, see the
-- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
--
-- @MaxCapacity@ is a mutually exclusive option with @NumberOfWorkers@ and
-- @WorkerType@.
--
-- -   If either @NumberOfWorkers@ or @WorkerType@ is set, then
--     @MaxCapacity@ cannot be set.
--
-- -   If @MaxCapacity@ is set then neither @NumberOfWorkers@ or
--     @WorkerType@ can be set.
--
-- -   If @WorkerType@ is set, then @NumberOfWorkers@ is required (and vice
--     versa).
--
-- -   @MaxCapacity@ and @NumberOfWorkers@ must both be at least 1.
--
-- When the @WorkerType@ field is set to a value other than @Standard@, the
-- @MaxCapacity@ field is set automatically and becomes read-only.
--
-- When the @WorkerType@ field is set to a value other than @Standard@, the
-- @MaxCapacity@ field is set automatically and becomes read-only.
createMLTransform_maxCapacity :: Lens.Lens' CreateMLTransform (Prelude.Maybe Prelude.Double)
createMLTransform_maxCapacity :: (Maybe Double -> f (Maybe Double))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_maxCapacity = (CreateMLTransform -> Maybe Double)
-> (CreateMLTransform -> Maybe Double -> CreateMLTransform)
-> Lens
     CreateMLTransform CreateMLTransform (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe Double
maxCapacity :: Maybe Double
$sel:maxCapacity:CreateMLTransform' :: CreateMLTransform -> Maybe Double
maxCapacity} -> Maybe Double
maxCapacity) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe Double
a -> CreateMLTransform
s {$sel:maxCapacity:CreateMLTransform' :: Maybe Double
maxCapacity = Maybe Double
a} :: CreateMLTransform)

-- | The timeout of the task run for this transform in minutes. This is the
-- maximum time that a task run for this transform can consume resources
-- before it is terminated and enters @TIMEOUT@ status. The default is
-- 2,880 minutes (48 hours).
createMLTransform_timeout :: Lens.Lens' CreateMLTransform (Prelude.Maybe Prelude.Natural)
createMLTransform_timeout :: (Maybe Natural -> f (Maybe Natural))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_timeout = (CreateMLTransform -> Maybe Natural)
-> (CreateMLTransform -> Maybe Natural -> CreateMLTransform)
-> Lens
     CreateMLTransform CreateMLTransform (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:CreateMLTransform' :: CreateMLTransform -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe Natural
a -> CreateMLTransform
s {$sel:timeout:CreateMLTransform' :: Maybe Natural
timeout = Maybe Natural
a} :: CreateMLTransform)

-- | The encryption-at-rest settings of the transform that apply to accessing
-- user data. Machine learning transforms can access user data encrypted in
-- Amazon S3 using KMS.
createMLTransform_transformEncryption :: Lens.Lens' CreateMLTransform (Prelude.Maybe TransformEncryption)
createMLTransform_transformEncryption :: (Maybe TransformEncryption -> f (Maybe TransformEncryption))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_transformEncryption = (CreateMLTransform -> Maybe TransformEncryption)
-> (CreateMLTransform
    -> Maybe TransformEncryption -> CreateMLTransform)
-> Lens
     CreateMLTransform
     CreateMLTransform
     (Maybe TransformEncryption)
     (Maybe TransformEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe TransformEncryption
transformEncryption :: Maybe TransformEncryption
$sel:transformEncryption:CreateMLTransform' :: CreateMLTransform -> Maybe TransformEncryption
transformEncryption} -> Maybe TransformEncryption
transformEncryption) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe TransformEncryption
a -> CreateMLTransform
s {$sel:transformEncryption:CreateMLTransform' :: Maybe TransformEncryption
transformEncryption = Maybe TransformEncryption
a} :: CreateMLTransform)

-- | A description of the machine learning transform that is being defined.
-- The default is an empty string.
createMLTransform_description :: Lens.Lens' CreateMLTransform (Prelude.Maybe Prelude.Text)
createMLTransform_description :: (Maybe Text -> f (Maybe Text))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_description = (CreateMLTransform -> Maybe Text)
-> (CreateMLTransform -> Maybe Text -> CreateMLTransform)
-> Lens
     CreateMLTransform CreateMLTransform (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe Text
description :: Maybe Text
$sel:description:CreateMLTransform' :: CreateMLTransform -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe Text
a -> CreateMLTransform
s {$sel:description:CreateMLTransform' :: Maybe Text
description = Maybe Text
a} :: CreateMLTransform)

-- | The tags to use with this machine learning transform. You may use tags
-- to limit access to the machine learning transform. For more information
-- about tags in Glue, see
-- <https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html Amazon Web Services Tags in Glue>
-- in the developer guide.
createMLTransform_tags :: Lens.Lens' CreateMLTransform (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createMLTransform_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_tags = (CreateMLTransform -> Maybe (HashMap Text Text))
-> (CreateMLTransform
    -> Maybe (HashMap Text Text) -> CreateMLTransform)
-> Lens
     CreateMLTransform
     CreateMLTransform
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateMLTransform' :: CreateMLTransform -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateMLTransform
s@CreateMLTransform' {} Maybe (HashMap Text Text)
a -> CreateMLTransform
s {$sel:tags:CreateMLTransform' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateMLTransform) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateMLTransform -> f CreateMLTransform)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateMLTransform
-> f CreateMLTransform
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique name that you give the transform when you create it.
createMLTransform_name :: Lens.Lens' CreateMLTransform Prelude.Text
createMLTransform_name :: (Text -> f Text) -> CreateMLTransform -> f CreateMLTransform
createMLTransform_name = (CreateMLTransform -> Text)
-> (CreateMLTransform -> Text -> CreateMLTransform)
-> Lens CreateMLTransform CreateMLTransform Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Text
name :: Text
$sel:name:CreateMLTransform' :: CreateMLTransform -> Text
name} -> Text
name) (\s :: CreateMLTransform
s@CreateMLTransform' {} Text
a -> CreateMLTransform
s {$sel:name:CreateMLTransform' :: Text
name = Text
a} :: CreateMLTransform)

-- | A list of Glue table definitions used by the transform.
createMLTransform_inputRecordTables :: Lens.Lens' CreateMLTransform [GlueTable]
createMLTransform_inputRecordTables :: ([GlueTable] -> f [GlueTable])
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_inputRecordTables = (CreateMLTransform -> [GlueTable])
-> (CreateMLTransform -> [GlueTable] -> CreateMLTransform)
-> Lens CreateMLTransform CreateMLTransform [GlueTable] [GlueTable]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {[GlueTable]
inputRecordTables :: [GlueTable]
$sel:inputRecordTables:CreateMLTransform' :: CreateMLTransform -> [GlueTable]
inputRecordTables} -> [GlueTable]
inputRecordTables) (\s :: CreateMLTransform
s@CreateMLTransform' {} [GlueTable]
a -> CreateMLTransform
s {$sel:inputRecordTables:CreateMLTransform' :: [GlueTable]
inputRecordTables = [GlueTable]
a} :: CreateMLTransform) (([GlueTable] -> f [GlueTable])
 -> CreateMLTransform -> f CreateMLTransform)
-> (([GlueTable] -> f [GlueTable]) -> [GlueTable] -> f [GlueTable])
-> ([GlueTable] -> f [GlueTable])
-> CreateMLTransform
-> f CreateMLTransform
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GlueTable] -> f [GlueTable]) -> [GlueTable] -> f [GlueTable]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The algorithmic parameters that are specific to the transform type used.
-- Conditionally dependent on the transform type.
createMLTransform_parameters :: Lens.Lens' CreateMLTransform TransformParameters
createMLTransform_parameters :: (TransformParameters -> f TransformParameters)
-> CreateMLTransform -> f CreateMLTransform
createMLTransform_parameters = (CreateMLTransform -> TransformParameters)
-> (CreateMLTransform -> TransformParameters -> CreateMLTransform)
-> Lens
     CreateMLTransform
     CreateMLTransform
     TransformParameters
     TransformParameters
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {TransformParameters
parameters :: TransformParameters
$sel:parameters:CreateMLTransform' :: CreateMLTransform -> TransformParameters
parameters} -> TransformParameters
parameters) (\s :: CreateMLTransform
s@CreateMLTransform' {} TransformParameters
a -> CreateMLTransform
s {$sel:parameters:CreateMLTransform' :: TransformParameters
parameters = TransformParameters
a} :: CreateMLTransform)

-- | The name or Amazon Resource Name (ARN) of the IAM role with the required
-- permissions. The required permissions include both Glue service role
-- permissions to Glue resources, and Amazon S3 permissions required by the
-- transform.
--
-- -   This role needs Glue service role permissions to allow access to
--     resources in Glue. See
--     <https://docs.aws.amazon.com/glue/latest/dg/attach-policy-iam-user.html Attach a Policy to IAM Users That Access Glue>.
--
-- -   This role needs permission to your Amazon Simple Storage Service
--     (Amazon S3) sources, targets, temporary directory, scripts, and any
--     libraries used by the task run for this transform.
createMLTransform_role :: Lens.Lens' CreateMLTransform Prelude.Text
createMLTransform_role :: (Text -> f Text) -> CreateMLTransform -> f CreateMLTransform
createMLTransform_role = (CreateMLTransform -> Text)
-> (CreateMLTransform -> Text -> CreateMLTransform)
-> Lens CreateMLTransform CreateMLTransform Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransform' {Text
role' :: Text
$sel:role':CreateMLTransform' :: CreateMLTransform -> Text
role'} -> Text
role') (\s :: CreateMLTransform
s@CreateMLTransform' {} Text
a -> CreateMLTransform
s {$sel:role':CreateMLTransform' :: Text
role' = Text
a} :: CreateMLTransform)

instance Core.AWSRequest CreateMLTransform where
  type
    AWSResponse CreateMLTransform =
      CreateMLTransformResponse
  request :: CreateMLTransform -> Request CreateMLTransform
request = Service -> CreateMLTransform -> Request CreateMLTransform
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateMLTransform
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateMLTransform)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateMLTransform))
-> Logger
-> Service
-> Proxy CreateMLTransform
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateMLTransform)))
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 -> CreateMLTransformResponse
CreateMLTransformResponse'
            (Maybe Text -> Int -> CreateMLTransformResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateMLTransformResponse)
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
"TransformId")
            Either String (Int -> CreateMLTransformResponse)
-> Either String Int -> Either String CreateMLTransformResponse
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 CreateMLTransform

instance Prelude.NFData CreateMLTransform

instance Core.ToHeaders CreateMLTransform where
  toHeaders :: CreateMLTransform -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateMLTransform -> 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.CreateMLTransform" :: 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 CreateMLTransform where
  toJSON :: CreateMLTransform -> Value
toJSON CreateMLTransform' {[GlueTable]
Maybe Double
Maybe Int
Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe TransformEncryption
Maybe WorkerType
Text
TransformParameters
role' :: Text
parameters :: TransformParameters
inputRecordTables :: [GlueTable]
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
transformEncryption :: Maybe TransformEncryption
timeout :: Maybe Natural
maxCapacity :: Maybe Double
maxRetries :: Maybe Int
glueVersion :: Maybe Text
workerType :: Maybe WorkerType
numberOfWorkers :: Maybe Int
$sel:role':CreateMLTransform' :: CreateMLTransform -> Text
$sel:parameters:CreateMLTransform' :: CreateMLTransform -> TransformParameters
$sel:inputRecordTables:CreateMLTransform' :: CreateMLTransform -> [GlueTable]
$sel:name:CreateMLTransform' :: CreateMLTransform -> Text
$sel:tags:CreateMLTransform' :: CreateMLTransform -> Maybe (HashMap Text Text)
$sel:description:CreateMLTransform' :: CreateMLTransform -> Maybe Text
$sel:transformEncryption:CreateMLTransform' :: CreateMLTransform -> Maybe TransformEncryption
$sel:timeout:CreateMLTransform' :: CreateMLTransform -> Maybe Natural
$sel:maxCapacity:CreateMLTransform' :: CreateMLTransform -> Maybe Double
$sel:maxRetries:CreateMLTransform' :: CreateMLTransform -> Maybe Int
$sel:glueVersion:CreateMLTransform' :: CreateMLTransform -> Maybe Text
$sel:workerType:CreateMLTransform' :: CreateMLTransform -> Maybe WorkerType
$sel:numberOfWorkers:CreateMLTransform' :: CreateMLTransform -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NumberOfWorkers" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
numberOfWorkers,
            (Text
"WorkerType" Text -> WorkerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (WorkerType -> Pair) -> Maybe WorkerType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WorkerType
workerType,
            (Text
"GlueVersion" 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
glueVersion,
            (Text
"MaxRetries" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxRetries,
            (Text
"MaxCapacity" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
maxCapacity,
            (Text
"Timeout" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeout,
            (Text
"TransformEncryption" Text -> TransformEncryption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TransformEncryption -> Pair)
-> Maybe TransformEncryption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TransformEncryption
transformEncryption,
            (Text
"Description" 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
description,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"InputRecordTables" Text -> [GlueTable] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [GlueTable]
inputRecordTables),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Parameters" Text -> TransformParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TransformParameters
parameters),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Role" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
role')
          ]
      )

instance Core.ToPath CreateMLTransform where
  toPath :: CreateMLTransform -> ByteString
toPath = ByteString -> CreateMLTransform -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery CreateMLTransform where
  toQuery :: CreateMLTransform -> QueryString
toQuery = QueryString -> CreateMLTransform -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateMLTransformResponse' smart constructor.
data CreateMLTransformResponse = CreateMLTransformResponse'
  { -- | A unique identifier that is generated for the transform.
    CreateMLTransformResponse -> Maybe Text
transformId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateMLTransformResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateMLTransformResponse -> CreateMLTransformResponse -> Bool
(CreateMLTransformResponse -> CreateMLTransformResponse -> Bool)
-> (CreateMLTransformResponse -> CreateMLTransformResponse -> Bool)
-> Eq CreateMLTransformResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMLTransformResponse -> CreateMLTransformResponse -> Bool
$c/= :: CreateMLTransformResponse -> CreateMLTransformResponse -> Bool
== :: CreateMLTransformResponse -> CreateMLTransformResponse -> Bool
$c== :: CreateMLTransformResponse -> CreateMLTransformResponse -> Bool
Prelude.Eq, ReadPrec [CreateMLTransformResponse]
ReadPrec CreateMLTransformResponse
Int -> ReadS CreateMLTransformResponse
ReadS [CreateMLTransformResponse]
(Int -> ReadS CreateMLTransformResponse)
-> ReadS [CreateMLTransformResponse]
-> ReadPrec CreateMLTransformResponse
-> ReadPrec [CreateMLTransformResponse]
-> Read CreateMLTransformResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMLTransformResponse]
$creadListPrec :: ReadPrec [CreateMLTransformResponse]
readPrec :: ReadPrec CreateMLTransformResponse
$creadPrec :: ReadPrec CreateMLTransformResponse
readList :: ReadS [CreateMLTransformResponse]
$creadList :: ReadS [CreateMLTransformResponse]
readsPrec :: Int -> ReadS CreateMLTransformResponse
$creadsPrec :: Int -> ReadS CreateMLTransformResponse
Prelude.Read, Int -> CreateMLTransformResponse -> ShowS
[CreateMLTransformResponse] -> ShowS
CreateMLTransformResponse -> String
(Int -> CreateMLTransformResponse -> ShowS)
-> (CreateMLTransformResponse -> String)
-> ([CreateMLTransformResponse] -> ShowS)
-> Show CreateMLTransformResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMLTransformResponse] -> ShowS
$cshowList :: [CreateMLTransformResponse] -> ShowS
show :: CreateMLTransformResponse -> String
$cshow :: CreateMLTransformResponse -> String
showsPrec :: Int -> CreateMLTransformResponse -> ShowS
$cshowsPrec :: Int -> CreateMLTransformResponse -> ShowS
Prelude.Show, (forall x.
 CreateMLTransformResponse -> Rep CreateMLTransformResponse x)
-> (forall x.
    Rep CreateMLTransformResponse x -> CreateMLTransformResponse)
-> Generic CreateMLTransformResponse
forall x.
Rep CreateMLTransformResponse x -> CreateMLTransformResponse
forall x.
CreateMLTransformResponse -> Rep CreateMLTransformResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateMLTransformResponse x -> CreateMLTransformResponse
$cfrom :: forall x.
CreateMLTransformResponse -> Rep CreateMLTransformResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateMLTransformResponse' 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:
--
-- 'transformId', 'createMLTransformResponse_transformId' - A unique identifier that is generated for the transform.
--
-- 'httpStatus', 'createMLTransformResponse_httpStatus' - The response's http status code.
newCreateMLTransformResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateMLTransformResponse
newCreateMLTransformResponse :: Int -> CreateMLTransformResponse
newCreateMLTransformResponse Int
pHttpStatus_ =
  CreateMLTransformResponse' :: Maybe Text -> Int -> CreateMLTransformResponse
CreateMLTransformResponse'
    { $sel:transformId:CreateMLTransformResponse' :: Maybe Text
transformId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateMLTransformResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A unique identifier that is generated for the transform.
createMLTransformResponse_transformId :: Lens.Lens' CreateMLTransformResponse (Prelude.Maybe Prelude.Text)
createMLTransformResponse_transformId :: (Maybe Text -> f (Maybe Text))
-> CreateMLTransformResponse -> f CreateMLTransformResponse
createMLTransformResponse_transformId = (CreateMLTransformResponse -> Maybe Text)
-> (CreateMLTransformResponse
    -> Maybe Text -> CreateMLTransformResponse)
-> Lens
     CreateMLTransformResponse
     CreateMLTransformResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransformResponse' {Maybe Text
transformId :: Maybe Text
$sel:transformId:CreateMLTransformResponse' :: CreateMLTransformResponse -> Maybe Text
transformId} -> Maybe Text
transformId) (\s :: CreateMLTransformResponse
s@CreateMLTransformResponse' {} Maybe Text
a -> CreateMLTransformResponse
s {$sel:transformId:CreateMLTransformResponse' :: Maybe Text
transformId = Maybe Text
a} :: CreateMLTransformResponse)

-- | The response's http status code.
createMLTransformResponse_httpStatus :: Lens.Lens' CreateMLTransformResponse Prelude.Int
createMLTransformResponse_httpStatus :: (Int -> f Int)
-> CreateMLTransformResponse -> f CreateMLTransformResponse
createMLTransformResponse_httpStatus = (CreateMLTransformResponse -> Int)
-> (CreateMLTransformResponse -> Int -> CreateMLTransformResponse)
-> Lens CreateMLTransformResponse CreateMLTransformResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMLTransformResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateMLTransformResponse' :: CreateMLTransformResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateMLTransformResponse
s@CreateMLTransformResponse' {} Int
a -> CreateMLTransformResponse
s {$sel:httpStatus:CreateMLTransformResponse' :: Int
httpStatus = Int
a} :: CreateMLTransformResponse)

instance Prelude.NFData CreateMLTransformResponse