{-# 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.LookoutVision.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 a new version of a model within an an Amazon Lookout for Vision
-- project. @CreateModel@ is an asynchronous operation in which Amazon
-- Lookout for Vision trains, tests, and evaluates a new version of a
-- model.
--
-- To get the current status, check the @Status@ field returned in the
-- response from DescribeModel.
--
-- If the project has a single dataset, Amazon Lookout for Vision
-- internally splits the dataset to create a training and a test dataset.
-- If the project has a training and a test dataset, Lookout for Vision
-- uses the respective datasets to train and test the model.
--
-- After training completes, the evaluation metrics are stored at the
-- location specified in @OutputConfig@.
--
-- This operation requires permissions to perform the
-- @lookoutvision:CreateModel@ operation. If you want to tag your model,
-- you also require permission to the @lookoutvision:TagResource@
-- operation.
module Amazonka.LookoutVision.CreateModel
  ( -- * Creating a Request
    CreateModel (..),
    newCreateModel,

    -- * Request Lenses
    createModel_clientToken,
    createModel_kmsKeyId,
    createModel_description,
    createModel_tags,
    createModel_projectName,
    createModel_outputConfig,

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

    -- * Response Lenses
    createModelResponse_modelMetadata,
    createModelResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutVision.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'
  { -- | ClientToken is an idempotency token that ensures a call to @CreateModel@
    -- completes only once. You choose the value to pass. For example, An
    -- issue, such as an network outage, might prevent you from getting a
    -- response from @CreateModel@. In this case, safely retry your call to
    -- @CreateModel@ by using the same @ClientToken@ parameter value. An error
    -- occurs if the other input parameters are not the same as in the first
    -- request. Using a different value for @ClientToken@ is considered a new
    -- call to @CreateModel@. An idempotency token is active for 8 hours.
    CreateModel -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The identifier for your AWS Key Management Service (AWS KMS) customer
    -- master key (CMK). The key is used to encrypt training and test images
    -- copied into the service for model training. Your source images are
    -- unaffected. If this parameter is not specified, the copied images are
    -- encrypted by a key that AWS owns and manages.
    CreateModel -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | A description for the version of the model.
    CreateModel -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A set of tags (key-value pairs) that you want to attach to the model.
    CreateModel -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the project in which you want to create a model version.
    CreateModel -> Text
projectName :: Prelude.Text,
    -- | The location where Amazon Lookout for Vision saves the training results.
    CreateModel -> OutputConfig
outputConfig :: OutputConfig
  }
  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:
--
-- 'clientToken', 'createModel_clientToken' - ClientToken is an idempotency token that ensures a call to @CreateModel@
-- completes only once. You choose the value to pass. For example, An
-- issue, such as an network outage, might prevent you from getting a
-- response from @CreateModel@. In this case, safely retry your call to
-- @CreateModel@ by using the same @ClientToken@ parameter value. An error
-- occurs if the other input parameters are not the same as in the first
-- request. Using a different value for @ClientToken@ is considered a new
-- call to @CreateModel@. An idempotency token is active for 8 hours.
--
-- 'kmsKeyId', 'createModel_kmsKeyId' - The identifier for your AWS Key Management Service (AWS KMS) customer
-- master key (CMK). The key is used to encrypt training and test images
-- copied into the service for model training. Your source images are
-- unaffected. If this parameter is not specified, the copied images are
-- encrypted by a key that AWS owns and manages.
--
-- 'description', 'createModel_description' - A description for the version of the model.
--
-- 'tags', 'createModel_tags' - A set of tags (key-value pairs) that you want to attach to the model.
--
-- 'projectName', 'createModel_projectName' - The name of the project in which you want to create a model version.
--
-- 'outputConfig', 'createModel_outputConfig' - The location where Amazon Lookout for Vision saves the training results.
newCreateModel ::
  -- | 'projectName'
  Prelude.Text ->
  -- | 'outputConfig'
  OutputConfig ->
  CreateModel
newCreateModel :: Text -> OutputConfig -> CreateModel
newCreateModel Text
pProjectName_ OutputConfig
pOutputConfig_ =
  CreateModel' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> OutputConfig
-> CreateModel
CreateModel'
    { $sel:clientToken:CreateModel' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:CreateModel' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateModel' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateModel' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:projectName:CreateModel' :: Text
projectName = Text
pProjectName_,
      $sel:outputConfig:CreateModel' :: OutputConfig
outputConfig = OutputConfig
pOutputConfig_
    }

-- | ClientToken is an idempotency token that ensures a call to @CreateModel@
-- completes only once. You choose the value to pass. For example, An
-- issue, such as an network outage, might prevent you from getting a
-- response from @CreateModel@. In this case, safely retry your call to
-- @CreateModel@ by using the same @ClientToken@ parameter value. An error
-- occurs if the other input parameters are not the same as in the first
-- request. Using a different value for @ClientToken@ is considered a new
-- call to @CreateModel@. An idempotency token is active for 8 hours.
createModel_clientToken :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.Text)
createModel_clientToken :: (Maybe Text -> f (Maybe Text)) -> CreateModel -> f CreateModel
createModel_clientToken = (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
clientToken :: Maybe Text
$sel:clientToken:CreateModel' :: CreateModel -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateModel
s@CreateModel' {} Maybe Text
a -> CreateModel
s {$sel:clientToken:CreateModel' :: Maybe Text
clientToken = Maybe Text
a} :: CreateModel)

-- | The identifier for your AWS Key Management Service (AWS KMS) customer
-- master key (CMK). The key is used to encrypt training and test images
-- copied into the service for model training. Your source images are
-- unaffected. If this parameter is not specified, the copied images are
-- encrypted by a key that AWS owns and manages.
createModel_kmsKeyId :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.Text)
createModel_kmsKeyId :: (Maybe Text -> f (Maybe Text)) -> CreateModel -> f CreateModel
createModel_kmsKeyId = (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
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateModel' :: CreateModel -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateModel
s@CreateModel' {} Maybe Text
a -> CreateModel
s {$sel:kmsKeyId:CreateModel' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateModel)

-- | A description for the version of the model.
createModel_description :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.Text)
createModel_description :: (Maybe Text -> f (Maybe Text)) -> CreateModel -> f CreateModel
createModel_description = (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
description :: Maybe Text
$sel:description:CreateModel' :: CreateModel -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateModel
s@CreateModel' {} Maybe Text
a -> CreateModel
s {$sel:description:CreateModel' :: Maybe Text
description = Maybe Text
a} :: CreateModel)

-- | A set of tags (key-value pairs) that you want to attach to the model.
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

-- | The name of the project in which you want to create a model version.
createModel_projectName :: Lens.Lens' CreateModel Prelude.Text
createModel_projectName :: (Text -> f Text) -> CreateModel -> f CreateModel
createModel_projectName = (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
projectName :: Text
$sel:projectName:CreateModel' :: CreateModel -> Text
projectName} -> Text
projectName) (\s :: CreateModel
s@CreateModel' {} Text
a -> CreateModel
s {$sel:projectName:CreateModel' :: Text
projectName = Text
a} :: CreateModel)

-- | The location where Amazon Lookout for Vision saves the training results.
createModel_outputConfig :: Lens.Lens' CreateModel OutputConfig
createModel_outputConfig :: (OutputConfig -> f OutputConfig) -> CreateModel -> f CreateModel
createModel_outputConfig = (CreateModel -> OutputConfig)
-> (CreateModel -> OutputConfig -> CreateModel)
-> Lens CreateModel CreateModel OutputConfig OutputConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModel' {OutputConfig
outputConfig :: OutputConfig
$sel:outputConfig:CreateModel' :: CreateModel -> OutputConfig
outputConfig} -> OutputConfig
outputConfig) (\s :: CreateModel
s@CreateModel' {} OutputConfig
a -> CreateModel
s {$sel:outputConfig:CreateModel' :: OutputConfig
outputConfig = OutputConfig
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 ModelMetadata -> Int -> CreateModelResponse
CreateModelResponse'
            (Maybe ModelMetadata -> Int -> CreateModelResponse)
-> Either String (Maybe ModelMetadata)
-> Either String (Int -> CreateModelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ModelMetadata)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ModelMetadata")
            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 CreateModel' {Maybe [Tag]
Maybe Text
Text
OutputConfig
outputConfig :: OutputConfig
projectName :: Text
tags :: Maybe [Tag]
description :: Maybe Text
kmsKeyId :: Maybe Text
clientToken :: Maybe Text
$sel:outputConfig:CreateModel' :: CreateModel -> OutputConfig
$sel:projectName:CreateModel' :: CreateModel -> Text
$sel:tags:CreateModel' :: CreateModel -> Maybe [Tag]
$sel:description:CreateModel' :: CreateModel -> Maybe Text
$sel:kmsKeyId:CreateModel' :: CreateModel -> Maybe Text
$sel:clientToken:CreateModel' :: CreateModel -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amzn-Client-Token" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
clientToken,
        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 CreateModel where
  toJSON :: CreateModel -> Value
toJSON CreateModel' {Maybe [Tag]
Maybe Text
Text
OutputConfig
outputConfig :: OutputConfig
projectName :: Text
tags :: Maybe [Tag]
description :: Maybe Text
kmsKeyId :: Maybe Text
clientToken :: Maybe Text
$sel:outputConfig:CreateModel' :: CreateModel -> OutputConfig
$sel:projectName:CreateModel' :: CreateModel -> Text
$sel:tags:CreateModel' :: CreateModel -> Maybe [Tag]
$sel:description:CreateModel' :: CreateModel -> Maybe Text
$sel:kmsKeyId:CreateModel' :: CreateModel -> Maybe Text
$sel:clientToken:CreateModel' :: CreateModel -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"KmsKeyId" 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
kmsKeyId,
            (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 -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OutputConfig" Text -> OutputConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OutputConfig
outputConfig)
          ]
      )

instance Core.ToPath CreateModel where
  toPath :: CreateModel -> ByteString
toPath CreateModel' {Maybe [Tag]
Maybe Text
Text
OutputConfig
outputConfig :: OutputConfig
projectName :: Text
tags :: Maybe [Tag]
description :: Maybe Text
kmsKeyId :: Maybe Text
clientToken :: Maybe Text
$sel:outputConfig:CreateModel' :: CreateModel -> OutputConfig
$sel:projectName:CreateModel' :: CreateModel -> Text
$sel:tags:CreateModel' :: CreateModel -> Maybe [Tag]
$sel:description:CreateModel' :: CreateModel -> Maybe Text
$sel:kmsKeyId:CreateModel' :: CreateModel -> Maybe Text
$sel:clientToken:CreateModel' :: CreateModel -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-11-20/projects/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
projectName,
        ByteString
"/models"
      ]

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'
  { -- | The response from a call to @CreateModel@.
    CreateModelResponse -> Maybe ModelMetadata
modelMetadata :: Prelude.Maybe ModelMetadata,
    -- | 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:
--
-- 'modelMetadata', 'createModelResponse_modelMetadata' - The response from a call to @CreateModel@.
--
-- 'httpStatus', 'createModelResponse_httpStatus' - The response's http status code.
newCreateModelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateModelResponse
newCreateModelResponse :: Int -> CreateModelResponse
newCreateModelResponse Int
pHttpStatus_ =
  CreateModelResponse' :: Maybe ModelMetadata -> Int -> CreateModelResponse
CreateModelResponse'
    { $sel:modelMetadata:CreateModelResponse' :: Maybe ModelMetadata
modelMetadata =
        Maybe ModelMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateModelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The response from a call to @CreateModel@.
createModelResponse_modelMetadata :: Lens.Lens' CreateModelResponse (Prelude.Maybe ModelMetadata)
createModelResponse_modelMetadata :: (Maybe ModelMetadata -> f (Maybe ModelMetadata))
-> CreateModelResponse -> f CreateModelResponse
createModelResponse_modelMetadata = (CreateModelResponse -> Maybe ModelMetadata)
-> (CreateModelResponse
    -> Maybe ModelMetadata -> CreateModelResponse)
-> Lens
     CreateModelResponse
     CreateModelResponse
     (Maybe ModelMetadata)
     (Maybe ModelMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModelResponse' {Maybe ModelMetadata
modelMetadata :: Maybe ModelMetadata
$sel:modelMetadata:CreateModelResponse' :: CreateModelResponse -> Maybe ModelMetadata
modelMetadata} -> Maybe ModelMetadata
modelMetadata) (\s :: CreateModelResponse
s@CreateModelResponse' {} Maybe ModelMetadata
a -> CreateModelResponse
s {$sel:modelMetadata:CreateModelResponse' :: Maybe ModelMetadata
modelMetadata = Maybe ModelMetadata
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