{-# 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.UpdateMLTransform
-- 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)
--
-- Updates an existing machine learning transform. Call this operation to
-- tune the algorithm parameters to achieve better results.
--
-- After calling this operation, you can call the
-- @StartMLEvaluationTaskRun@ operation to assess how well your new
-- parameters achieved your goals (such as improving the quality of your
-- machine learning transform, or making it more cost-effective).
module Amazonka.Glue.UpdateMLTransform
  ( -- * Creating a Request
    UpdateMLTransform (..),
    newUpdateMLTransform,

    -- * Request Lenses
    updateMLTransform_numberOfWorkers,
    updateMLTransform_workerType,
    updateMLTransform_glueVersion,
    updateMLTransform_role,
    updateMLTransform_name,
    updateMLTransform_parameters,
    updateMLTransform_maxRetries,
    updateMLTransform_maxCapacity,
    updateMLTransform_timeout,
    updateMLTransform_description,
    updateMLTransform_transformId,

    -- * Destructuring the Response
    UpdateMLTransformResponse (..),
    newUpdateMLTransformResponse,

    -- * Response Lenses
    updateMLTransformResponse_transformId,
    updateMLTransformResponse_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:/ 'newUpdateMLTransform' smart constructor.
data UpdateMLTransform = UpdateMLTransform'
  { -- | The number of workers of a defined @workerType@ that are allocated when
    -- this task runs.
    UpdateMLTransform -> 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.
    UpdateMLTransform -> 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.
    UpdateMLTransform -> Maybe Text
glueVersion :: Prelude.Maybe Prelude.Text,
    -- | The name or Amazon Resource Name (ARN) of the IAM role with the required
    -- permissions.
    UpdateMLTransform -> Maybe Text
role' :: Prelude.Maybe Prelude.Text,
    -- | The unique name that you gave the transform when you created it.
    UpdateMLTransform -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The configuration parameters that are specific to the transform type
    -- (algorithm) used. Conditionally dependent on the transform type.
    UpdateMLTransform -> Maybe TransformParameters
parameters :: Prelude.Maybe TransformParameters,
    -- | The maximum number of times to retry a task for this transform after a
    -- task run fails.
    UpdateMLTransform -> 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>.
    --
    -- When the @WorkerType@ field is set to a value other than @Standard@, the
    -- @MaxCapacity@ field is set automatically and becomes read-only.
    UpdateMLTransform -> Maybe Double
maxCapacity :: Prelude.Maybe Prelude.Double,
    -- | The timeout for a 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).
    UpdateMLTransform -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | A description of the transform. The default is an empty string.
    UpdateMLTransform -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier that was generated when the transform was created.
    UpdateMLTransform -> Text
transformId :: Prelude.Text
  }
  deriving (UpdateMLTransform -> UpdateMLTransform -> Bool
(UpdateMLTransform -> UpdateMLTransform -> Bool)
-> (UpdateMLTransform -> UpdateMLTransform -> Bool)
-> Eq UpdateMLTransform
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMLTransform -> UpdateMLTransform -> Bool
$c/= :: UpdateMLTransform -> UpdateMLTransform -> Bool
== :: UpdateMLTransform -> UpdateMLTransform -> Bool
$c== :: UpdateMLTransform -> UpdateMLTransform -> Bool
Prelude.Eq, ReadPrec [UpdateMLTransform]
ReadPrec UpdateMLTransform
Int -> ReadS UpdateMLTransform
ReadS [UpdateMLTransform]
(Int -> ReadS UpdateMLTransform)
-> ReadS [UpdateMLTransform]
-> ReadPrec UpdateMLTransform
-> ReadPrec [UpdateMLTransform]
-> Read UpdateMLTransform
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMLTransform]
$creadListPrec :: ReadPrec [UpdateMLTransform]
readPrec :: ReadPrec UpdateMLTransform
$creadPrec :: ReadPrec UpdateMLTransform
readList :: ReadS [UpdateMLTransform]
$creadList :: ReadS [UpdateMLTransform]
readsPrec :: Int -> ReadS UpdateMLTransform
$creadsPrec :: Int -> ReadS UpdateMLTransform
Prelude.Read, Int -> UpdateMLTransform -> ShowS
[UpdateMLTransform] -> ShowS
UpdateMLTransform -> String
(Int -> UpdateMLTransform -> ShowS)
-> (UpdateMLTransform -> String)
-> ([UpdateMLTransform] -> ShowS)
-> Show UpdateMLTransform
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMLTransform] -> ShowS
$cshowList :: [UpdateMLTransform] -> ShowS
show :: UpdateMLTransform -> String
$cshow :: UpdateMLTransform -> String
showsPrec :: Int -> UpdateMLTransform -> ShowS
$cshowsPrec :: Int -> UpdateMLTransform -> ShowS
Prelude.Show, (forall x. UpdateMLTransform -> Rep UpdateMLTransform x)
-> (forall x. Rep UpdateMLTransform x -> UpdateMLTransform)
-> Generic UpdateMLTransform
forall x. Rep UpdateMLTransform x -> UpdateMLTransform
forall x. UpdateMLTransform -> Rep UpdateMLTransform x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMLTransform x -> UpdateMLTransform
$cfrom :: forall x. UpdateMLTransform -> Rep UpdateMLTransform x
Prelude.Generic)

-- |
-- Create a value of 'UpdateMLTransform' 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', 'updateMLTransform_numberOfWorkers' - The number of workers of a defined @workerType@ that are allocated when
-- this task runs.
--
-- 'workerType', 'updateMLTransform_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.
--
-- 'glueVersion', 'updateMLTransform_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.
--
-- 'role'', 'updateMLTransform_role' - The name or Amazon Resource Name (ARN) of the IAM role with the required
-- permissions.
--
-- 'name', 'updateMLTransform_name' - The unique name that you gave the transform when you created it.
--
-- 'parameters', 'updateMLTransform_parameters' - The configuration parameters that are specific to the transform type
-- (algorithm) used. Conditionally dependent on the transform type.
--
-- 'maxRetries', 'updateMLTransform_maxRetries' - The maximum number of times to retry a task for this transform after a
-- task run fails.
--
-- 'maxCapacity', 'updateMLTransform_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>.
--
-- When the @WorkerType@ field is set to a value other than @Standard@, the
-- @MaxCapacity@ field is set automatically and becomes read-only.
--
-- 'timeout', 'updateMLTransform_timeout' - The timeout for a 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).
--
-- 'description', 'updateMLTransform_description' - A description of the transform. The default is an empty string.
--
-- 'transformId', 'updateMLTransform_transformId' - A unique identifier that was generated when the transform was created.
newUpdateMLTransform ::
  -- | 'transformId'
  Prelude.Text ->
  UpdateMLTransform
newUpdateMLTransform :: Text -> UpdateMLTransform
newUpdateMLTransform Text
pTransformId_ =
  UpdateMLTransform' :: Maybe Int
-> Maybe WorkerType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe TransformParameters
-> Maybe Int
-> Maybe Double
-> Maybe Natural
-> Maybe Text
-> Text
-> UpdateMLTransform
UpdateMLTransform'
    { $sel:numberOfWorkers:UpdateMLTransform' :: Maybe Int
numberOfWorkers =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:workerType:UpdateMLTransform' :: Maybe WorkerType
workerType = Maybe WorkerType
forall a. Maybe a
Prelude.Nothing,
      $sel:glueVersion:UpdateMLTransform' :: Maybe Text
glueVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:role':UpdateMLTransform' :: Maybe Text
role' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateMLTransform' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:UpdateMLTransform' :: Maybe TransformParameters
parameters = Maybe TransformParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRetries:UpdateMLTransform' :: Maybe Int
maxRetries = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:maxCapacity:UpdateMLTransform' :: Maybe Double
maxCapacity = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:UpdateMLTransform' :: Maybe Natural
timeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateMLTransform' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:transformId:UpdateMLTransform' :: Text
transformId = Text
pTransformId_
    }

-- | The number of workers of a defined @workerType@ that are allocated when
-- this task runs.
updateMLTransform_numberOfWorkers :: Lens.Lens' UpdateMLTransform (Prelude.Maybe Prelude.Int)
updateMLTransform_numberOfWorkers :: (Maybe Int -> f (Maybe Int))
-> UpdateMLTransform -> f UpdateMLTransform
updateMLTransform_numberOfWorkers = (UpdateMLTransform -> Maybe Int)
-> (UpdateMLTransform -> Maybe Int -> UpdateMLTransform)
-> Lens UpdateMLTransform UpdateMLTransform (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransform' {Maybe Int
numberOfWorkers :: Maybe Int
$sel:numberOfWorkers:UpdateMLTransform' :: UpdateMLTransform -> Maybe Int
numberOfWorkers} -> Maybe Int
numberOfWorkers) (\s :: UpdateMLTransform
s@UpdateMLTransform' {} Maybe Int
a -> UpdateMLTransform
s {$sel:numberOfWorkers:UpdateMLTransform' :: Maybe Int
numberOfWorkers = Maybe Int
a} :: UpdateMLTransform)

-- | 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.
updateMLTransform_workerType :: Lens.Lens' UpdateMLTransform (Prelude.Maybe WorkerType)
updateMLTransform_workerType :: (Maybe WorkerType -> f (Maybe WorkerType))
-> UpdateMLTransform -> f UpdateMLTransform
updateMLTransform_workerType = (UpdateMLTransform -> Maybe WorkerType)
-> (UpdateMLTransform -> Maybe WorkerType -> UpdateMLTransform)
-> Lens
     UpdateMLTransform
     UpdateMLTransform
     (Maybe WorkerType)
     (Maybe WorkerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransform' {Maybe WorkerType
workerType :: Maybe WorkerType
$sel:workerType:UpdateMLTransform' :: UpdateMLTransform -> Maybe WorkerType
workerType} -> Maybe WorkerType
workerType) (\s :: UpdateMLTransform
s@UpdateMLTransform' {} Maybe WorkerType
a -> UpdateMLTransform
s {$sel:workerType:UpdateMLTransform' :: Maybe WorkerType
workerType = Maybe WorkerType
a} :: UpdateMLTransform)

-- | 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.
updateMLTransform_glueVersion :: Lens.Lens' UpdateMLTransform (Prelude.Maybe Prelude.Text)
updateMLTransform_glueVersion :: (Maybe Text -> f (Maybe Text))
-> UpdateMLTransform -> f UpdateMLTransform
updateMLTransform_glueVersion = (UpdateMLTransform -> Maybe Text)
-> (UpdateMLTransform -> Maybe Text -> UpdateMLTransform)
-> Lens
     UpdateMLTransform UpdateMLTransform (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransform' {Maybe Text
glueVersion :: Maybe Text
$sel:glueVersion:UpdateMLTransform' :: UpdateMLTransform -> Maybe Text
glueVersion} -> Maybe Text
glueVersion) (\s :: UpdateMLTransform
s@UpdateMLTransform' {} Maybe Text
a -> UpdateMLTransform
s {$sel:glueVersion:UpdateMLTransform' :: Maybe Text
glueVersion = Maybe Text
a} :: UpdateMLTransform)

-- | The name or Amazon Resource Name (ARN) of the IAM role with the required
-- permissions.
updateMLTransform_role :: Lens.Lens' UpdateMLTransform (Prelude.Maybe Prelude.Text)
updateMLTransform_role :: (Maybe Text -> f (Maybe Text))
-> UpdateMLTransform -> f UpdateMLTransform
updateMLTransform_role = (UpdateMLTransform -> Maybe Text)
-> (UpdateMLTransform -> Maybe Text -> UpdateMLTransform)
-> Lens
     UpdateMLTransform UpdateMLTransform (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransform' {Maybe Text
role' :: Maybe Text
$sel:role':UpdateMLTransform' :: UpdateMLTransform -> Maybe Text
role'} -> Maybe Text
role') (\s :: UpdateMLTransform
s@UpdateMLTransform' {} Maybe Text
a -> UpdateMLTransform
s {$sel:role':UpdateMLTransform' :: Maybe Text
role' = Maybe Text
a} :: UpdateMLTransform)

-- | The unique name that you gave the transform when you created it.
updateMLTransform_name :: Lens.Lens' UpdateMLTransform (Prelude.Maybe Prelude.Text)
updateMLTransform_name :: (Maybe Text -> f (Maybe Text))
-> UpdateMLTransform -> f UpdateMLTransform
updateMLTransform_name = (UpdateMLTransform -> Maybe Text)
-> (UpdateMLTransform -> Maybe Text -> UpdateMLTransform)
-> Lens
     UpdateMLTransform UpdateMLTransform (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransform' {Maybe Text
name :: Maybe Text
$sel:name:UpdateMLTransform' :: UpdateMLTransform -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateMLTransform
s@UpdateMLTransform' {} Maybe Text
a -> UpdateMLTransform
s {$sel:name:UpdateMLTransform' :: Maybe Text
name = Maybe Text
a} :: UpdateMLTransform)

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

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

-- | 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>.
--
-- When the @WorkerType@ field is set to a value other than @Standard@, the
-- @MaxCapacity@ field is set automatically and becomes read-only.
updateMLTransform_maxCapacity :: Lens.Lens' UpdateMLTransform (Prelude.Maybe Prelude.Double)
updateMLTransform_maxCapacity :: (Maybe Double -> f (Maybe Double))
-> UpdateMLTransform -> f UpdateMLTransform
updateMLTransform_maxCapacity = (UpdateMLTransform -> Maybe Double)
-> (UpdateMLTransform -> Maybe Double -> UpdateMLTransform)
-> Lens
     UpdateMLTransform UpdateMLTransform (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransform' {Maybe Double
maxCapacity :: Maybe Double
$sel:maxCapacity:UpdateMLTransform' :: UpdateMLTransform -> Maybe Double
maxCapacity} -> Maybe Double
maxCapacity) (\s :: UpdateMLTransform
s@UpdateMLTransform' {} Maybe Double
a -> UpdateMLTransform
s {$sel:maxCapacity:UpdateMLTransform' :: Maybe Double
maxCapacity = Maybe Double
a} :: UpdateMLTransform)

-- | The timeout for a 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).
updateMLTransform_timeout :: Lens.Lens' UpdateMLTransform (Prelude.Maybe Prelude.Natural)
updateMLTransform_timeout :: (Maybe Natural -> f (Maybe Natural))
-> UpdateMLTransform -> f UpdateMLTransform
updateMLTransform_timeout = (UpdateMLTransform -> Maybe Natural)
-> (UpdateMLTransform -> Maybe Natural -> UpdateMLTransform)
-> Lens
     UpdateMLTransform UpdateMLTransform (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransform' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:UpdateMLTransform' :: UpdateMLTransform -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: UpdateMLTransform
s@UpdateMLTransform' {} Maybe Natural
a -> UpdateMLTransform
s {$sel:timeout:UpdateMLTransform' :: Maybe Natural
timeout = Maybe Natural
a} :: UpdateMLTransform)

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

-- | A unique identifier that was generated when the transform was created.
updateMLTransform_transformId :: Lens.Lens' UpdateMLTransform Prelude.Text
updateMLTransform_transformId :: (Text -> f Text) -> UpdateMLTransform -> f UpdateMLTransform
updateMLTransform_transformId = (UpdateMLTransform -> Text)
-> (UpdateMLTransform -> Text -> UpdateMLTransform)
-> Lens UpdateMLTransform UpdateMLTransform Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransform' {Text
transformId :: Text
$sel:transformId:UpdateMLTransform' :: UpdateMLTransform -> Text
transformId} -> Text
transformId) (\s :: UpdateMLTransform
s@UpdateMLTransform' {} Text
a -> UpdateMLTransform
s {$sel:transformId:UpdateMLTransform' :: Text
transformId = Text
a} :: UpdateMLTransform)

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

instance Prelude.NFData UpdateMLTransform

instance Core.ToHeaders UpdateMLTransform where
  toHeaders :: UpdateMLTransform -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateMLTransform -> 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.UpdateMLTransform" :: 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 UpdateMLTransform where
  toJSON :: UpdateMLTransform -> Value
toJSON UpdateMLTransform' {Maybe Double
Maybe Int
Maybe Natural
Maybe Text
Maybe TransformParameters
Maybe WorkerType
Text
transformId :: Text
description :: Maybe Text
timeout :: Maybe Natural
maxCapacity :: Maybe Double
maxRetries :: Maybe Int
parameters :: Maybe TransformParameters
name :: Maybe Text
role' :: Maybe Text
glueVersion :: Maybe Text
workerType :: Maybe WorkerType
numberOfWorkers :: Maybe Int
$sel:transformId:UpdateMLTransform' :: UpdateMLTransform -> Text
$sel:description:UpdateMLTransform' :: UpdateMLTransform -> Maybe Text
$sel:timeout:UpdateMLTransform' :: UpdateMLTransform -> Maybe Natural
$sel:maxCapacity:UpdateMLTransform' :: UpdateMLTransform -> Maybe Double
$sel:maxRetries:UpdateMLTransform' :: UpdateMLTransform -> Maybe Int
$sel:parameters:UpdateMLTransform' :: UpdateMLTransform -> Maybe TransformParameters
$sel:name:UpdateMLTransform' :: UpdateMLTransform -> Maybe Text
$sel:role':UpdateMLTransform' :: UpdateMLTransform -> Maybe Text
$sel:glueVersion:UpdateMLTransform' :: UpdateMLTransform -> Maybe Text
$sel:workerType:UpdateMLTransform' :: UpdateMLTransform -> Maybe WorkerType
$sel:numberOfWorkers:UpdateMLTransform' :: UpdateMLTransform -> 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
"Role" 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
role',
            (Text
"Name" 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
name,
            (Text
"Parameters" Text -> TransformParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TransformParameters -> Pair)
-> Maybe TransformParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TransformParameters
parameters,
            (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
"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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TransformId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
transformId)
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateMLTransformResponse' 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', 'updateMLTransformResponse_transformId' - The unique identifier for the transform that was updated.
--
-- 'httpStatus', 'updateMLTransformResponse_httpStatus' - The response's http status code.
newUpdateMLTransformResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateMLTransformResponse
newUpdateMLTransformResponse :: Int -> UpdateMLTransformResponse
newUpdateMLTransformResponse Int
pHttpStatus_ =
  UpdateMLTransformResponse' :: Maybe Text -> Int -> UpdateMLTransformResponse
UpdateMLTransformResponse'
    { $sel:transformId:UpdateMLTransformResponse' :: Maybe Text
transformId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateMLTransformResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier for the transform that was updated.
updateMLTransformResponse_transformId :: Lens.Lens' UpdateMLTransformResponse (Prelude.Maybe Prelude.Text)
updateMLTransformResponse_transformId :: (Maybe Text -> f (Maybe Text))
-> UpdateMLTransformResponse -> f UpdateMLTransformResponse
updateMLTransformResponse_transformId = (UpdateMLTransformResponse -> Maybe Text)
-> (UpdateMLTransformResponse
    -> Maybe Text -> UpdateMLTransformResponse)
-> Lens
     UpdateMLTransformResponse
     UpdateMLTransformResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMLTransformResponse' {Maybe Text
transformId :: Maybe Text
$sel:transformId:UpdateMLTransformResponse' :: UpdateMLTransformResponse -> Maybe Text
transformId} -> Maybe Text
transformId) (\s :: UpdateMLTransformResponse
s@UpdateMLTransformResponse' {} Maybe Text
a -> UpdateMLTransformResponse
s {$sel:transformId:UpdateMLTransformResponse' :: Maybe Text
transformId = Maybe Text
a} :: UpdateMLTransformResponse)

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

instance Prelude.NFData UpdateMLTransformResponse