{-# 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.ApiGatewayV2.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 Model for an API.
module Amazonka.ApiGatewayV2.CreateModel
  ( -- * Creating a Request
    CreateModel (..),
    newCreateModel,

    -- * Request Lenses
    createModel_description,
    createModel_contentType,
    createModel_apiId,
    createModel_schema,
    createModel_name,

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

    -- * Response Lenses
    createModelResponse_modelId,
    createModelResponse_schema,
    createModelResponse_name,
    createModelResponse_description,
    createModelResponse_contentType,
    createModelResponse_httpStatus,
  )
where

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

-- | Creates a new Model.
--
-- /See:/ 'newCreateModel' smart constructor.
data CreateModel = CreateModel'
  { -- | The description of the model.
    CreateModel -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The content-type for the model, for example, \"application\/json\".
    CreateModel -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The API identifier.
    CreateModel -> Text
apiId :: Prelude.Text,
    -- | The schema for the model. For application\/json models, this should be
    -- JSON schema draft 4 model.
    CreateModel -> Text
schema :: Prelude.Text,
    -- | The name of the model. Must be alphanumeric.
    CreateModel -> Text
name :: 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:
--
-- 'description', 'createModel_description' - The description of the model.
--
-- 'contentType', 'createModel_contentType' - The content-type for the model, for example, \"application\/json\".
--
-- 'apiId', 'createModel_apiId' - The API identifier.
--
-- 'schema', 'createModel_schema' - The schema for the model. For application\/json models, this should be
-- JSON schema draft 4 model.
--
-- 'name', 'createModel_name' - The name of the model. Must be alphanumeric.
newCreateModel ::
  -- | 'apiId'
  Prelude.Text ->
  -- | 'schema'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  CreateModel
newCreateModel :: Text -> Text -> Text -> CreateModel
newCreateModel Text
pApiId_ Text
pSchema_ Text
pName_ =
  CreateModel' :: Maybe Text -> Maybe Text -> Text -> Text -> Text -> CreateModel
CreateModel'
    { $sel:description:CreateModel' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:CreateModel' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:CreateModel' :: Text
apiId = Text
pApiId_,
      $sel:schema:CreateModel' :: Text
schema = Text
pSchema_,
      $sel:name:CreateModel' :: Text
name = Text
pName_
    }

-- | The description 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)

-- | The content-type for the model, for example, \"application\/json\".
createModel_contentType :: Lens.Lens' CreateModel (Prelude.Maybe Prelude.Text)
createModel_contentType :: (Maybe Text -> f (Maybe Text)) -> CreateModel -> f CreateModel
createModel_contentType = (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
contentType :: Maybe Text
$sel:contentType:CreateModel' :: CreateModel -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: CreateModel
s@CreateModel' {} Maybe Text
a -> CreateModel
s {$sel:contentType:CreateModel' :: Maybe Text
contentType = Maybe Text
a} :: CreateModel)

-- | The API identifier.
createModel_apiId :: Lens.Lens' CreateModel Prelude.Text
createModel_apiId :: (Text -> f Text) -> CreateModel -> f CreateModel
createModel_apiId = (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
apiId :: Text
$sel:apiId:CreateModel' :: CreateModel -> Text
apiId} -> Text
apiId) (\s :: CreateModel
s@CreateModel' {} Text
a -> CreateModel
s {$sel:apiId:CreateModel' :: Text
apiId = Text
a} :: CreateModel)

-- | The schema for the model. For application\/json models, this should be
-- JSON schema draft 4 model.
createModel_schema :: Lens.Lens' CreateModel Prelude.Text
createModel_schema :: (Text -> f Text) -> CreateModel -> f CreateModel
createModel_schema = (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
schema :: Text
$sel:schema:CreateModel' :: CreateModel -> Text
schema} -> Text
schema) (\s :: CreateModel
s@CreateModel' {} Text
a -> CreateModel
s {$sel:schema:CreateModel' :: Text
schema = Text
a} :: CreateModel)

-- | The name of the model. Must be alphanumeric.
createModel_name :: Lens.Lens' CreateModel Prelude.Text
createModel_name :: (Text -> f Text) -> CreateModel -> f CreateModel
createModel_name = (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
name :: Text
$sel:name:CreateModel' :: CreateModel -> Text
name} -> Text
name) (\s :: CreateModel
s@CreateModel' {} Text
a -> CreateModel
s {$sel:name:CreateModel' :: Text
name = 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 Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateModelResponse
CreateModelResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateModelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateModelResponse)
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
"modelId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateModelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> 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
"schema")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Int -> CreateModelResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> 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
"name")
            Either
  String (Maybe Text -> Maybe Text -> Int -> CreateModelResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> 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
"description")
            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
"contentType")
            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
"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 Text
Text
name :: Text
schema :: Text
apiId :: Text
contentType :: Maybe Text
description :: Maybe Text
$sel:name:CreateModel' :: CreateModel -> Text
$sel:schema:CreateModel' :: CreateModel -> Text
$sel:apiId:CreateModel' :: CreateModel -> Text
$sel:contentType:CreateModel' :: CreateModel -> Maybe Text
$sel:description:CreateModel' :: CreateModel -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"contentType" 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
contentType,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"schema" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
schema),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

instance Core.ToPath CreateModel where
  toPath :: CreateModel -> ByteString
toPath CreateModel' {Maybe Text
Text
name :: Text
schema :: Text
apiId :: Text
contentType :: Maybe Text
description :: Maybe Text
$sel:name:CreateModel' :: CreateModel -> Text
$sel:schema:CreateModel' :: CreateModel -> Text
$sel:apiId:CreateModel' :: CreateModel -> Text
$sel:contentType:CreateModel' :: CreateModel -> Maybe Text
$sel:description:CreateModel' :: CreateModel -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v2/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, 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 model identifier.
    CreateModelResponse -> Maybe Text
modelId :: Prelude.Maybe Prelude.Text,
    -- | The schema for the model. For application\/json models, this should be
    -- JSON schema draft 4 model.
    CreateModelResponse -> Maybe Text
schema :: Prelude.Maybe Prelude.Text,
    -- | The name of the model. Must be alphanumeric.
    CreateModelResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The description of the model.
    CreateModelResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The content-type for the model, for example, \"application\/json\".
    CreateModelResponse -> Maybe Text
contentType :: 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:
--
-- 'modelId', 'createModelResponse_modelId' - The model identifier.
--
-- 'schema', 'createModelResponse_schema' - The schema for the model. For application\/json models, this should be
-- JSON schema draft 4 model.
--
-- 'name', 'createModelResponse_name' - The name of the model. Must be alphanumeric.
--
-- 'description', 'createModelResponse_description' - The description of the model.
--
-- 'contentType', 'createModelResponse_contentType' - The content-type for the model, for example, \"application\/json\".
--
-- 'httpStatus', 'createModelResponse_httpStatus' - The response's http status code.
newCreateModelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateModelResponse
newCreateModelResponse :: Int -> CreateModelResponse
newCreateModelResponse Int
pHttpStatus_ =
  CreateModelResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateModelResponse
CreateModelResponse'
    { $sel:modelId:CreateModelResponse' :: Maybe Text
modelId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schema:CreateModelResponse' :: Maybe Text
schema = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateModelResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateModelResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:CreateModelResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateModelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The model identifier.
createModelResponse_modelId :: Lens.Lens' CreateModelResponse (Prelude.Maybe Prelude.Text)
createModelResponse_modelId :: (Maybe Text -> f (Maybe Text))
-> CreateModelResponse -> f CreateModelResponse
createModelResponse_modelId = (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
modelId :: Maybe Text
$sel:modelId:CreateModelResponse' :: CreateModelResponse -> Maybe Text
modelId} -> Maybe Text
modelId) (\s :: CreateModelResponse
s@CreateModelResponse' {} Maybe Text
a -> CreateModelResponse
s {$sel:modelId:CreateModelResponse' :: Maybe Text
modelId = Maybe Text
a} :: CreateModelResponse)

-- | The schema for the model. For application\/json models, this should be
-- JSON schema draft 4 model.
createModelResponse_schema :: Lens.Lens' CreateModelResponse (Prelude.Maybe Prelude.Text)
createModelResponse_schema :: (Maybe Text -> f (Maybe Text))
-> CreateModelResponse -> f CreateModelResponse
createModelResponse_schema = (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
schema :: Maybe Text
$sel:schema:CreateModelResponse' :: CreateModelResponse -> Maybe Text
schema} -> Maybe Text
schema) (\s :: CreateModelResponse
s@CreateModelResponse' {} Maybe Text
a -> CreateModelResponse
s {$sel:schema:CreateModelResponse' :: Maybe Text
schema = Maybe Text
a} :: CreateModelResponse)

-- | The name of the model. Must be alphanumeric.
createModelResponse_name :: Lens.Lens' CreateModelResponse (Prelude.Maybe Prelude.Text)
createModelResponse_name :: (Maybe Text -> f (Maybe Text))
-> CreateModelResponse -> f CreateModelResponse
createModelResponse_name = (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
name :: Maybe Text
$sel:name:CreateModelResponse' :: CreateModelResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateModelResponse
s@CreateModelResponse' {} Maybe Text
a -> CreateModelResponse
s {$sel:name:CreateModelResponse' :: Maybe Text
name = Maybe Text
a} :: CreateModelResponse)

-- | The description of the model.
createModelResponse_description :: Lens.Lens' CreateModelResponse (Prelude.Maybe Prelude.Text)
createModelResponse_description :: (Maybe Text -> f (Maybe Text))
-> CreateModelResponse -> f CreateModelResponse
createModelResponse_description = (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
description :: Maybe Text
$sel:description:CreateModelResponse' :: CreateModelResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateModelResponse
s@CreateModelResponse' {} Maybe Text
a -> CreateModelResponse
s {$sel:description:CreateModelResponse' :: Maybe Text
description = Maybe Text
a} :: CreateModelResponse)

-- | The content-type for the model, for example, \"application\/json\".
createModelResponse_contentType :: Lens.Lens' CreateModelResponse (Prelude.Maybe Prelude.Text)
createModelResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> CreateModelResponse -> f CreateModelResponse
createModelResponse_contentType = (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
contentType :: Maybe Text
$sel:contentType:CreateModelResponse' :: CreateModelResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: CreateModelResponse
s@CreateModelResponse' {} Maybe Text
a -> CreateModelResponse
s {$sel:contentType:CreateModelResponse' :: Maybe Text
contentType = 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