{-# 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.LookoutEquipment.CreateModel
-- 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 ML model for data inference.
--
-- A machine-learning (ML) model is a mathematical model that finds
-- patterns in your data. In Amazon Lookout for Equipment, the model learns
-- the patterns of normal behavior and detects abnormal behavior that could
-- be potential equipment failure (or maintenance events). The models are
-- made by analyzing normal data and abnormalities in machine behavior that
-- have already occurred.
--
-- Your model is trained using a portion of the data from your dataset and
-- uses that data to learn patterns of normal behavior and abnormal
-- patterns that lead to equipment failure. Another portion of the data is
-- used to evaluate the model\'s accuracy.
module Amazonka.LookoutEquipment.CreateModel
  ( -- * Creating a Request
    CreateModel (..),
    newCreateModel,

    -- * Request Lenses
    createModel_dataPreProcessingConfiguration,
    createModel_trainingDataEndTime,
    createModel_datasetSchema,
    createModel_evaluationDataStartTime,
    createModel_offCondition,
    createModel_evaluationDataEndTime,
    createModel_trainingDataStartTime,
    createModel_labelsInputConfiguration,
    createModel_tags,
    createModel_serverSideKmsKeyId,
    createModel_roleArn,
    createModel_modelName,
    createModel_datasetName,
    createModel_clientToken,

    -- * Destructuring the Response
    CreateModelResponse (..),
    newCreateModelResponse,

    -- * Response Lenses
    createModelResponse_status,
    createModelResponse_modelArn,
    createModelResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutEquipment.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateModel' smart constructor.
data CreateModel = CreateModel'
  { -- | The configuration is the @TargetSamplingRate@, which is the sampling
    -- rate of the data after post processing by Amazon Lookout for Equipment.
    -- For example, if you provide data that has been collected at a 1 second
    -- level and you want the system to resample the data at a 1 minute rate
    -- before training, the @TargetSamplingRate@ is 1 minute.
    --
    -- When providing a value for the @TargetSamplingRate@, you must attach the
    -- prefix \"PT\" to the rate you want. The value for a 1 second rate is
    -- therefore /PT1S/, the value for a 15 minute rate is /PT15M/, and the
    -- value for a 1 hour rate is /PT1H/
    CreateModel -> Maybe DataPreProcessingConfiguration
dataPreProcessingConfiguration :: Prelude.Maybe DataPreProcessingConfiguration,
    -- | Indicates the time reference in the dataset that should be used to end
    -- the subset of training data for the ML model.
    CreateModel -> Maybe POSIX
trainingDataEndTime :: Prelude.Maybe Core.POSIX,
    -- | The data schema for the ML model being created.
    CreateModel -> Maybe DatasetSchema
datasetSchema :: Prelude.Maybe DatasetSchema,
    -- | Indicates the time reference in the dataset that should be used to begin
    -- the subset of evaluation data for the ML model.
    CreateModel -> Maybe POSIX
evaluationDataStartTime :: Prelude.Maybe Core.POSIX,
    -- | Indicates that the asset associated with this sensor has been shut off.
    -- As long as this condition is met, Lookout for Equipment will not use
    -- data from this asset for training, evaluation, or inference.
    CreateModel -> Maybe Text
offCondition :: Prelude.Maybe Prelude.Text,
    -- | Indicates the time reference in the dataset that should be used to end
    -- the subset of evaluation data for the ML model.
    CreateModel -> Maybe POSIX
evaluationDataEndTime :: Prelude.Maybe Core.POSIX,
    -- | Indicates the time reference in the dataset that should be used to begin
    -- the subset of training data for the ML model.
    CreateModel -> Maybe POSIX
trainingDataStartTime :: Prelude.Maybe Core.POSIX,
    -- | The input configuration for the labels being used for the ML model
    -- that\'s being created.
    CreateModel -> Maybe LabelsInputConfiguration
labelsInputConfiguration :: Prelude.Maybe LabelsInputConfiguration,
    -- | Any tags associated with the ML model being created.
    CreateModel -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Provides the identifier of the KMS key used to encrypt model data by
    -- Amazon Lookout for Equipment.
    CreateModel -> Maybe Text
serverSideKmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of a role with permission to access the
    -- data source being used to create the ML model.
    CreateModel -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The name for the ML model to be created.
    CreateModel -> Text
modelName :: Prelude.Text,
    -- | The name of the dataset for the ML model being created.
    CreateModel -> Text
datasetName :: Prelude.Text,
    -- | A unique identifier for the request. If you do not set the client
    -- request token, Amazon Lookout for Equipment generates one.
    CreateModel -> Text
clientToken :: Prelude.Text
  }
  deriving (CreateModel -> CreateModel -> Bool
(CreateModel -> CreateModel -> Bool)
-> (CreateModel -> CreateModel -> Bool) -> Eq CreateModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateModel -> CreateModel -> Bool
$c/= :: CreateModel -> CreateModel -> Bool
== :: CreateModel -> CreateModel -> Bool
$c== :: CreateModel -> CreateModel -> Bool
Prelude.Eq, ReadPrec [CreateModel]
ReadPrec CreateModel
Int -> ReadS CreateModel
ReadS [CreateModel]
(Int -> ReadS CreateModel)
-> ReadS [CreateModel]
-> ReadPrec CreateModel
-> ReadPrec [CreateModel]
-> Read CreateModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateModel]
$creadListPrec :: ReadPrec [CreateModel]
readPrec :: ReadPrec CreateModel
$creadPrec :: ReadPrec CreateModel
readList :: ReadS [CreateModel]
$creadList :: ReadS [CreateModel]
readsPrec :: Int -> ReadS CreateModel
$creadsPrec :: Int -> ReadS CreateModel
Prelude.Read, Int -> CreateModel -> ShowS
[CreateModel] -> ShowS
CreateModel -> String
(Int -> CreateModel -> ShowS)
-> (CreateModel -> String)
-> ([CreateModel] -> ShowS)
-> Show CreateModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateModel] -> ShowS
$cshowList :: [CreateModel] -> ShowS
show :: CreateModel -> String
$cshow :: CreateModel -> String
showsPrec :: Int -> CreateModel -> ShowS
$cshowsPrec :: Int -> CreateModel -> ShowS
Prelude.Show, (forall x. CreateModel -> Rep CreateModel x)
-> (forall x. Rep CreateModel x -> CreateModel)
-> Generic CreateModel
forall x. Rep CreateModel x -> CreateModel
forall x. CreateModel -> Rep CreateModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateModel x -> CreateModel
$cfrom :: forall x. CreateModel -> Rep CreateModel x
Prelude.Generic)

-- |
-- Create a value of 'CreateModel' 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:
--
-- 'dataPreProcessingConfiguration', 'createModel_dataPreProcessingConfiguration' - The configuration is the @TargetSamplingRate@, which is the sampling
-- rate of the data after post processing by Amazon Lookout for Equipment.
-- For example, if you provide data that has been collected at a 1 second
-- level and you want the system to resample the data at a 1 minute rate
-- before training, the @TargetSamplingRate@ is 1 minute.
--
-- When providing a value for the @TargetSamplingRate@, you must attach the
-- prefix \"PT\" to the rate you want. The value for a 1 second rate is
-- therefore /PT1S/, the value for a 15 minute rate is /PT15M/, and the
-- value for a 1 hour rate is /PT1H/
--
-- 'trainingDataEndTime', 'createModel_trainingDataEndTime' - Indicates the time reference in the dataset that should be used to end
-- the subset of training data for the ML model.
--
-- 'datasetSchema', 'createModel_datasetSchema' - The data schema for the ML model being created.
--
-- 'evaluationDataStartTime', 'createModel_evaluationDataStartTime' - Indicates the time reference in the dataset that should be used to begin
-- the subset of evaluation data for the ML model.
--
-- 'offCondition', 'createModel_offCondition' - Indicates that the asset associated with this sensor has been shut off.
-- As long as this condition is met, Lookout for Equipment will not use
-- data from this asset for training, evaluation, or inference.
--
-- 'evaluationDataEndTime', 'createModel_evaluationDataEndTime' - Indicates the time reference in the dataset that should be used to end
-- the subset of evaluation data for the ML model.
--
-- 'trainingDataStartTime', 'createModel_trainingDataStartTime' - Indicates the time reference in the dataset that should be used to begin
-- the subset of training data for the ML model.
--
-- 'labelsInputConfiguration', 'createModel_labelsInputConfiguration' - The input configuration for the labels being used for the ML model
-- that\'s being created.
--
-- 'tags', 'createModel_tags' - Any tags associated with the ML model being created.
--
-- 'serverSideKmsKeyId', 'createModel_serverSideKmsKeyId' - Provides the identifier of the KMS key used to encrypt model data by
-- Amazon Lookout for Equipment.
--
-- 'roleArn', 'createModel_roleArn' - The Amazon Resource Name (ARN) of a role with permission to access the
-- data source being used to create the ML model.
--
-- 'modelName', 'createModel_modelName' - The name for the ML model to be created.
--
-- 'datasetName', 'createModel_datasetName' - The name of the dataset for the ML model being created.
--
-- 'clientToken', 'createModel_clientToken' - A unique identifier for the request. If you do not set the client
-- request token, Amazon Lookout for Equipment generates one.
newCreateModel ::
  -- | 'modelName'
  Prelude.Text ->
  -- | 'datasetName'
  Prelude.Text ->
  -- | 'clientToken'
  Prelude.Text ->
  CreateModel
newCreateModel :: Text -> Text -> Text -> CreateModel
newCreateModel
  Text
pModelName_
  Text
pDatasetName_
  Text
pClientToken_ =
    CreateModel' :: Maybe DataPreProcessingConfiguration
-> Maybe POSIX
-> Maybe DatasetSchema
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe LabelsInputConfiguration
-> Maybe [Tag]
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> Text
-> CreateModel
CreateModel'
      { $sel:dataPreProcessingConfiguration:CreateModel' :: Maybe DataPreProcessingConfiguration
dataPreProcessingConfiguration =
          Maybe DataPreProcessingConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:trainingDataEndTime:CreateModel' :: Maybe POSIX
trainingDataEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:datasetSchema:CreateModel' :: Maybe DatasetSchema
datasetSchema = Maybe DatasetSchema
forall a. Maybe a
Prelude.Nothing,
        $sel:evaluationDataStartTime:CreateModel' :: Maybe POSIX
evaluationDataStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:offCondition:CreateModel' :: Maybe Text
offCondition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:evaluationDataEndTime:CreateModel' :: Maybe POSIX
evaluationDataEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:trainingDataStartTime:CreateModel' :: Maybe POSIX
trainingDataStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:labelsInputConfiguration:CreateModel' :: Maybe LabelsInputConfiguration
labelsInputConfiguration = Maybe LabelsInputConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateModel' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:serverSideKmsKeyId:CreateModel' :: Maybe Text
serverSideKmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:roleArn:CreateModel' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:modelName:CreateModel' :: Text
modelName = Text
pModelName_,
        $sel:datasetName:CreateModel' :: Text
datasetName = Text
pDatasetName_,
        $sel:clientToken:CreateModel' :: Text
clientToken = Text
pClientToken_
      }

-- | The configuration is the @TargetSamplingRate@, which is the sampling
-- rate of the data after post processing by Amazon Lookout for Equipment.
-- For example, if you provide data that has been collected at a 1 second
-- level and you want the system to resample the data at a 1 minute rate
-- before training, the @TargetSamplingRate@ is 1 minute.
--
-- When providing a value for the @TargetSamplingRate@, you must attach the
-- prefix \"PT\" to the rate you want. The value for a 1 second rate is
-- therefore /PT1S/, the value for a 15 minute rate is /PT15M/, and the
-- value for a 1 hour rate is /PT1H/
createModel_dataPreProcessingConfiguration :: Lens.Lens' CreateModel (Prelude.Maybe DataPreProcessingConfiguration)
createModel_dataPreProcessingConfiguration :: (Maybe DataPreProcessingConfiguration
 -> f (Maybe DataPreProcessingConfiguration))
-> CreateModel -> f CreateModel
createModel_dataPreProcessingConfiguration = (CreateModel -> Maybe DataPreProcessingConfiguration)
-> (CreateModel
    -> Maybe DataPreProcessingConfiguration -> CreateModel)
-> Lens
     CreateModel
     CreateModel
     (Maybe DataPreProcessingConfiguration)
     (Maybe DataPreProcessingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe DataPreProcessingConfiguration
dataPreProcessingConfiguration :: Maybe DataPreProcessingConfiguration
$sel:dataPreProcessingConfiguration:CreateModel' :: CreateModel -> Maybe DataPreProcessingConfiguration
dataPreProcessingConfiguration} -> Maybe DataPreProcessingConfiguration
dataPreProcessingConfiguration) (\s :: CreateModel
s@CreateModel' {} Maybe DataPreProcessingConfiguration
a -> CreateModel
s {$sel:dataPreProcessingConfiguration:CreateModel' :: Maybe DataPreProcessingConfiguration
dataPreProcessingConfiguration = Maybe DataPreProcessingConfiguration
a} :: CreateModel)

-- | Indicates the time reference in the dataset that should be used to end
-- the subset of training data for the ML model.
createModel_trainingDataEndTime :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.UTCTime)
createModel_trainingDataEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateModel -> f CreateModel
createModel_trainingDataEndTime = (CreateModel -> Maybe POSIX)
-> (CreateModel -> Maybe POSIX -> CreateModel)
-> Lens CreateModel CreateModel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe POSIX
trainingDataEndTime :: Maybe POSIX
$sel:trainingDataEndTime:CreateModel' :: CreateModel -> Maybe POSIX
trainingDataEndTime} -> Maybe POSIX
trainingDataEndTime) (\s :: CreateModel
s@CreateModel' {} Maybe POSIX
a -> CreateModel
s {$sel:trainingDataEndTime:CreateModel' :: Maybe POSIX
trainingDataEndTime = Maybe POSIX
a} :: CreateModel) ((Maybe POSIX -> f (Maybe POSIX)) -> CreateModel -> f CreateModel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateModel
-> f CreateModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The data schema for the ML model being created.
createModel_datasetSchema :: Lens.Lens' CreateModel (Prelude.Maybe DatasetSchema)
createModel_datasetSchema :: (Maybe DatasetSchema -> f (Maybe DatasetSchema))
-> CreateModel -> f CreateModel
createModel_datasetSchema = (CreateModel -> Maybe DatasetSchema)
-> (CreateModel -> Maybe DatasetSchema -> CreateModel)
-> Lens
     CreateModel CreateModel (Maybe DatasetSchema) (Maybe DatasetSchema)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe DatasetSchema
datasetSchema :: Maybe DatasetSchema
$sel:datasetSchema:CreateModel' :: CreateModel -> Maybe DatasetSchema
datasetSchema} -> Maybe DatasetSchema
datasetSchema) (\s :: CreateModel
s@CreateModel' {} Maybe DatasetSchema
a -> CreateModel
s {$sel:datasetSchema:CreateModel' :: Maybe DatasetSchema
datasetSchema = Maybe DatasetSchema
a} :: CreateModel)

-- | Indicates the time reference in the dataset that should be used to begin
-- the subset of evaluation data for the ML model.
createModel_evaluationDataStartTime :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.UTCTime)
createModel_evaluationDataStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateModel -> f CreateModel
createModel_evaluationDataStartTime = (CreateModel -> Maybe POSIX)
-> (CreateModel -> Maybe POSIX -> CreateModel)
-> Lens CreateModel CreateModel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe POSIX
evaluationDataStartTime :: Maybe POSIX
$sel:evaluationDataStartTime:CreateModel' :: CreateModel -> Maybe POSIX
evaluationDataStartTime} -> Maybe POSIX
evaluationDataStartTime) (\s :: CreateModel
s@CreateModel' {} Maybe POSIX
a -> CreateModel
s {$sel:evaluationDataStartTime:CreateModel' :: Maybe POSIX
evaluationDataStartTime = Maybe POSIX
a} :: CreateModel) ((Maybe POSIX -> f (Maybe POSIX)) -> CreateModel -> f CreateModel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateModel
-> f CreateModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Indicates that the asset associated with this sensor has been shut off.
-- As long as this condition is met, Lookout for Equipment will not use
-- data from this asset for training, evaluation, or inference.
createModel_offCondition :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.Text)
createModel_offCondition :: (Maybe Text -> f (Maybe Text)) -> CreateModel -> f CreateModel
createModel_offCondition = (CreateModel -> Maybe Text)
-> (CreateModel -> Maybe Text -> CreateModel)
-> Lens CreateModel CreateModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe Text
offCondition :: Maybe Text
$sel:offCondition:CreateModel' :: CreateModel -> Maybe Text
offCondition} -> Maybe Text
offCondition) (\s :: CreateModel
s@CreateModel' {} Maybe Text
a -> CreateModel
s {$sel:offCondition:CreateModel' :: Maybe Text
offCondition = Maybe Text
a} :: CreateModel)

-- | Indicates the time reference in the dataset that should be used to end
-- the subset of evaluation data for the ML model.
createModel_evaluationDataEndTime :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.UTCTime)
createModel_evaluationDataEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateModel -> f CreateModel
createModel_evaluationDataEndTime = (CreateModel -> Maybe POSIX)
-> (CreateModel -> Maybe POSIX -> CreateModel)
-> Lens CreateModel CreateModel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe POSIX
evaluationDataEndTime :: Maybe POSIX
$sel:evaluationDataEndTime:CreateModel' :: CreateModel -> Maybe POSIX
evaluationDataEndTime} -> Maybe POSIX
evaluationDataEndTime) (\s :: CreateModel
s@CreateModel' {} Maybe POSIX
a -> CreateModel
s {$sel:evaluationDataEndTime:CreateModel' :: Maybe POSIX
evaluationDataEndTime = Maybe POSIX
a} :: CreateModel) ((Maybe POSIX -> f (Maybe POSIX)) -> CreateModel -> f CreateModel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateModel
-> f CreateModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Indicates the time reference in the dataset that should be used to begin
-- the subset of training data for the ML model.
createModel_trainingDataStartTime :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.UTCTime)
createModel_trainingDataStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateModel -> f CreateModel
createModel_trainingDataStartTime = (CreateModel -> Maybe POSIX)
-> (CreateModel -> Maybe POSIX -> CreateModel)
-> Lens CreateModel CreateModel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe POSIX
trainingDataStartTime :: Maybe POSIX
$sel:trainingDataStartTime:CreateModel' :: CreateModel -> Maybe POSIX
trainingDataStartTime} -> Maybe POSIX
trainingDataStartTime) (\s :: CreateModel
s@CreateModel' {} Maybe POSIX
a -> CreateModel
s {$sel:trainingDataStartTime:CreateModel' :: Maybe POSIX
trainingDataStartTime = Maybe POSIX
a} :: CreateModel) ((Maybe POSIX -> f (Maybe POSIX)) -> CreateModel -> f CreateModel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateModel
-> f CreateModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The input configuration for the labels being used for the ML model
-- that\'s being created.
createModel_labelsInputConfiguration :: Lens.Lens' CreateModel (Prelude.Maybe LabelsInputConfiguration)
createModel_labelsInputConfiguration :: (Maybe LabelsInputConfiguration
 -> f (Maybe LabelsInputConfiguration))
-> CreateModel -> f CreateModel
createModel_labelsInputConfiguration = (CreateModel -> Maybe LabelsInputConfiguration)
-> (CreateModel -> Maybe LabelsInputConfiguration -> CreateModel)
-> Lens
     CreateModel
     CreateModel
     (Maybe LabelsInputConfiguration)
     (Maybe LabelsInputConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe LabelsInputConfiguration
labelsInputConfiguration :: Maybe LabelsInputConfiguration
$sel:labelsInputConfiguration:CreateModel' :: CreateModel -> Maybe LabelsInputConfiguration
labelsInputConfiguration} -> Maybe LabelsInputConfiguration
labelsInputConfiguration) (\s :: CreateModel
s@CreateModel' {} Maybe LabelsInputConfiguration
a -> CreateModel
s {$sel:labelsInputConfiguration:CreateModel' :: Maybe LabelsInputConfiguration
labelsInputConfiguration = Maybe LabelsInputConfiguration
a} :: CreateModel)

-- | Any tags associated with the ML model being created.
createModel_tags :: Lens.Lens' CreateModel (Prelude.Maybe [Tag])
createModel_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateModel -> f CreateModel
createModel_tags = (CreateModel -> Maybe [Tag])
-> (CreateModel -> Maybe [Tag] -> CreateModel)
-> Lens CreateModel CreateModel (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateModel' :: CreateModel -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateModel
s@CreateModel' {} Maybe [Tag]
a -> CreateModel
s {$sel:tags:CreateModel' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateModel) ((Maybe [Tag] -> f (Maybe [Tag])) -> CreateModel -> f CreateModel)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateModel
-> f CreateModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Provides the identifier of the KMS key used to encrypt model data by
-- Amazon Lookout for Equipment.
createModel_serverSideKmsKeyId :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.Text)
createModel_serverSideKmsKeyId :: (Maybe Text -> f (Maybe Text)) -> CreateModel -> f CreateModel
createModel_serverSideKmsKeyId = (CreateModel -> Maybe Text)
-> (CreateModel -> Maybe Text -> CreateModel)
-> Lens CreateModel CreateModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe Text
serverSideKmsKeyId :: Maybe Text
$sel:serverSideKmsKeyId:CreateModel' :: CreateModel -> Maybe Text
serverSideKmsKeyId} -> Maybe Text
serverSideKmsKeyId) (\s :: CreateModel
s@CreateModel' {} Maybe Text
a -> CreateModel
s {$sel:serverSideKmsKeyId:CreateModel' :: Maybe Text
serverSideKmsKeyId = Maybe Text
a} :: CreateModel)

-- | The Amazon Resource Name (ARN) of a role with permission to access the
-- data source being used to create the ML model.
createModel_roleArn :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.Text)
createModel_roleArn :: (Maybe Text -> f (Maybe Text)) -> CreateModel -> f CreateModel
createModel_roleArn = (CreateModel -> Maybe Text)
-> (CreateModel -> Maybe Text -> CreateModel)
-> Lens CreateModel CreateModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:CreateModel' :: CreateModel -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: CreateModel
s@CreateModel' {} Maybe Text
a -> CreateModel
s {$sel:roleArn:CreateModel' :: Maybe Text
roleArn = Maybe Text
a} :: CreateModel)

-- | The name for the ML model to be created.
createModel_modelName :: Lens.Lens' CreateModel Prelude.Text
createModel_modelName :: (Text -> f Text) -> CreateModel -> f CreateModel
createModel_modelName = (CreateModel -> Text)
-> (CreateModel -> Text -> CreateModel)
-> Lens CreateModel CreateModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Text
modelName :: Text
$sel:modelName:CreateModel' :: CreateModel -> Text
modelName} -> Text
modelName) (\s :: CreateModel
s@CreateModel' {} Text
a -> CreateModel
s {$sel:modelName:CreateModel' :: Text
modelName = Text
a} :: CreateModel)

-- | The name of the dataset for the ML model being created.
createModel_datasetName :: Lens.Lens' CreateModel Prelude.Text
createModel_datasetName :: (Text -> f Text) -> CreateModel -> f CreateModel
createModel_datasetName = (CreateModel -> Text)
-> (CreateModel -> Text -> CreateModel)
-> Lens CreateModel CreateModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Text
datasetName :: Text
$sel:datasetName:CreateModel' :: CreateModel -> Text
datasetName} -> Text
datasetName) (\s :: CreateModel
s@CreateModel' {} Text
a -> CreateModel
s {$sel:datasetName:CreateModel' :: Text
datasetName = Text
a} :: CreateModel)

-- | A unique identifier for the request. If you do not set the client
-- request token, Amazon Lookout for Equipment generates one.
createModel_clientToken :: Lens.Lens' CreateModel Prelude.Text
createModel_clientToken :: (Text -> f Text) -> CreateModel -> f CreateModel
createModel_clientToken = (CreateModel -> Text)
-> (CreateModel -> Text -> CreateModel)
-> Lens CreateModel CreateModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {Text
clientToken :: Text
$sel:clientToken:CreateModel' :: CreateModel -> Text
clientToken} -> Text
clientToken) (\s :: CreateModel
s@CreateModel' {} Text
a -> CreateModel
s {$sel:clientToken:CreateModel' :: Text
clientToken = Text
a} :: CreateModel)

instance Core.AWSRequest CreateModel where
  type AWSResponse CreateModel = CreateModelResponse
  request :: CreateModel -> Request CreateModel
request = Service -> CreateModel -> Request CreateModel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateModel)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateModel))
-> Logger
-> Service
-> Proxy CreateModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateModel)))
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 ModelStatus -> Maybe Text -> Int -> CreateModelResponse
CreateModelResponse'
            (Maybe ModelStatus -> Maybe Text -> Int -> CreateModelResponse)
-> Either String (Maybe ModelStatus)
-> Either String (Maybe Text -> Int -> CreateModelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ModelStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either String (Maybe Text -> Int -> CreateModelResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateModelResponse)
forall (f :: * -> *) a b. Applicative f => 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
"ModelArn")
            Either String (Int -> CreateModelResponse)
-> Either String Int -> Either String CreateModelResponse
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 CreateModel

instance Prelude.NFData CreateModel

instance Core.ToHeaders CreateModel where
  toHeaders :: CreateModel -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateModel -> 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
"AWSLookoutEquipmentFrontendService.CreateModel" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateModel where
  toJSON :: CreateModel -> Value
toJSON CreateModel' {Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe DatasetSchema
Maybe LabelsInputConfiguration
Maybe DataPreProcessingConfiguration
Text
clientToken :: Text
datasetName :: Text
modelName :: Text
roleArn :: Maybe Text
serverSideKmsKeyId :: Maybe Text
tags :: Maybe [Tag]
labelsInputConfiguration :: Maybe LabelsInputConfiguration
trainingDataStartTime :: Maybe POSIX
evaluationDataEndTime :: Maybe POSIX
offCondition :: Maybe Text
evaluationDataStartTime :: Maybe POSIX
datasetSchema :: Maybe DatasetSchema
trainingDataEndTime :: Maybe POSIX
dataPreProcessingConfiguration :: Maybe DataPreProcessingConfiguration
$sel:clientToken:CreateModel' :: CreateModel -> Text
$sel:datasetName:CreateModel' :: CreateModel -> Text
$sel:modelName:CreateModel' :: CreateModel -> Text
$sel:roleArn:CreateModel' :: CreateModel -> Maybe Text
$sel:serverSideKmsKeyId:CreateModel' :: CreateModel -> Maybe Text
$sel:tags:CreateModel' :: CreateModel -> Maybe [Tag]
$sel:labelsInputConfiguration:CreateModel' :: CreateModel -> Maybe LabelsInputConfiguration
$sel:trainingDataStartTime:CreateModel' :: CreateModel -> Maybe POSIX
$sel:evaluationDataEndTime:CreateModel' :: CreateModel -> Maybe POSIX
$sel:offCondition:CreateModel' :: CreateModel -> Maybe Text
$sel:evaluationDataStartTime:CreateModel' :: CreateModel -> Maybe POSIX
$sel:datasetSchema:CreateModel' :: CreateModel -> Maybe DatasetSchema
$sel:trainingDataEndTime:CreateModel' :: CreateModel -> Maybe POSIX
$sel:dataPreProcessingConfiguration:CreateModel' :: CreateModel -> Maybe DataPreProcessingConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DataPreProcessingConfiguration" Text -> DataPreProcessingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DataPreProcessingConfiguration -> Pair)
-> Maybe DataPreProcessingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DataPreProcessingConfiguration
dataPreProcessingConfiguration,
            (Text
"TrainingDataEndTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
trainingDataEndTime,
            (Text
"DatasetSchema" Text -> DatasetSchema -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DatasetSchema -> Pair) -> Maybe DatasetSchema -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DatasetSchema
datasetSchema,
            (Text
"EvaluationDataStartTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
evaluationDataStartTime,
            (Text
"OffCondition" 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
offCondition,
            (Text
"EvaluationDataEndTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
evaluationDataEndTime,
            (Text
"TrainingDataStartTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
trainingDataStartTime,
            (Text
"LabelsInputConfiguration" Text -> LabelsInputConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LabelsInputConfiguration -> Pair)
-> Maybe LabelsInputConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LabelsInputConfiguration
labelsInputConfiguration,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Text
"ServerSideKmsKeyId" 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
serverSideKmsKeyId,
            (Text
"RoleArn" 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
roleArn,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ModelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatasetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

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

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

-- | /See:/ 'newCreateModelResponse' smart constructor.
data CreateModelResponse = CreateModelResponse'
  { -- | Indicates the status of the @CreateModel@ operation.
    CreateModelResponse -> Maybe ModelStatus
status :: Prelude.Maybe ModelStatus,
    -- | The Amazon Resource Name (ARN) of the model being created.
    CreateModelResponse -> Maybe Text
modelArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateModelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateModelResponse -> CreateModelResponse -> Bool
(CreateModelResponse -> CreateModelResponse -> Bool)
-> (CreateModelResponse -> CreateModelResponse -> Bool)
-> Eq CreateModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateModelResponse -> CreateModelResponse -> Bool
$c/= :: CreateModelResponse -> CreateModelResponse -> Bool
== :: CreateModelResponse -> CreateModelResponse -> Bool
$c== :: CreateModelResponse -> CreateModelResponse -> Bool
Prelude.Eq, ReadPrec [CreateModelResponse]
ReadPrec CreateModelResponse
Int -> ReadS CreateModelResponse
ReadS [CreateModelResponse]
(Int -> ReadS CreateModelResponse)
-> ReadS [CreateModelResponse]
-> ReadPrec CreateModelResponse
-> ReadPrec [CreateModelResponse]
-> Read CreateModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateModelResponse]
$creadListPrec :: ReadPrec [CreateModelResponse]
readPrec :: ReadPrec CreateModelResponse
$creadPrec :: ReadPrec CreateModelResponse
readList :: ReadS [CreateModelResponse]
$creadList :: ReadS [CreateModelResponse]
readsPrec :: Int -> ReadS CreateModelResponse
$creadsPrec :: Int -> ReadS CreateModelResponse
Prelude.Read, Int -> CreateModelResponse -> ShowS
[CreateModelResponse] -> ShowS
CreateModelResponse -> String
(Int -> CreateModelResponse -> ShowS)
-> (CreateModelResponse -> String)
-> ([CreateModelResponse] -> ShowS)
-> Show CreateModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateModelResponse] -> ShowS
$cshowList :: [CreateModelResponse] -> ShowS
show :: CreateModelResponse -> String
$cshow :: CreateModelResponse -> String
showsPrec :: Int -> CreateModelResponse -> ShowS
$cshowsPrec :: Int -> CreateModelResponse -> ShowS
Prelude.Show, (forall x. CreateModelResponse -> Rep CreateModelResponse x)
-> (forall x. Rep CreateModelResponse x -> CreateModelResponse)
-> Generic CreateModelResponse
forall x. Rep CreateModelResponse x -> CreateModelResponse
forall x. CreateModelResponse -> Rep CreateModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateModelResponse x -> CreateModelResponse
$cfrom :: forall x. CreateModelResponse -> Rep CreateModelResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateModelResponse' 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:
--
-- 'status', 'createModelResponse_status' - Indicates the status of the @CreateModel@ operation.
--
-- 'modelArn', 'createModelResponse_modelArn' - The Amazon Resource Name (ARN) of the model being created.
--
-- 'httpStatus', 'createModelResponse_httpStatus' - The response's http status code.
newCreateModelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateModelResponse
newCreateModelResponse :: Int -> CreateModelResponse
newCreateModelResponse Int
pHttpStatus_ =
  CreateModelResponse' :: Maybe ModelStatus -> Maybe Text -> Int -> CreateModelResponse
CreateModelResponse'
    { $sel:status:CreateModelResponse' :: Maybe ModelStatus
status = Maybe ModelStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:modelArn:CreateModelResponse' :: Maybe Text
modelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateModelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Indicates the status of the @CreateModel@ operation.
createModelResponse_status :: Lens.Lens' CreateModelResponse (Prelude.Maybe ModelStatus)
createModelResponse_status :: (Maybe ModelStatus -> f (Maybe ModelStatus))
-> CreateModelResponse -> f CreateModelResponse
createModelResponse_status = (CreateModelResponse -> Maybe ModelStatus)
-> (CreateModelResponse
    -> Maybe ModelStatus -> CreateModelResponse)
-> Lens
     CreateModelResponse
     CreateModelResponse
     (Maybe ModelStatus)
     (Maybe ModelStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModelResponse' {Maybe ModelStatus
status :: Maybe ModelStatus
$sel:status:CreateModelResponse' :: CreateModelResponse -> Maybe ModelStatus
status} -> Maybe ModelStatus
status) (\s :: CreateModelResponse
s@CreateModelResponse' {} Maybe ModelStatus
a -> CreateModelResponse
s {$sel:status:CreateModelResponse' :: Maybe ModelStatus
status = Maybe ModelStatus
a} :: CreateModelResponse)

-- | The Amazon Resource Name (ARN) of the model being created.
createModelResponse_modelArn :: Lens.Lens' CreateModelResponse (Prelude.Maybe Prelude.Text)
createModelResponse_modelArn :: (Maybe Text -> f (Maybe Text))
-> CreateModelResponse -> f CreateModelResponse
createModelResponse_modelArn = (CreateModelResponse -> Maybe Text)
-> (CreateModelResponse -> Maybe Text -> CreateModelResponse)
-> Lens
     CreateModelResponse CreateModelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModelResponse' {Maybe Text
modelArn :: Maybe Text
$sel:modelArn:CreateModelResponse' :: CreateModelResponse -> Maybe Text
modelArn} -> Maybe Text
modelArn) (\s :: CreateModelResponse
s@CreateModelResponse' {} Maybe Text
a -> CreateModelResponse
s {$sel:modelArn:CreateModelResponse' :: Maybe Text
modelArn = Maybe Text
a} :: CreateModelResponse)

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

instance Prelude.NFData CreateModelResponse