{-# 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.UpdateModel
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a Model.
module Amazonka.ApiGatewayV2.UpdateModel
  ( -- * Creating a Request
    UpdateModel (..),
    newUpdateModel,

    -- * Request Lenses
    updateModel_schema,
    updateModel_name,
    updateModel_description,
    updateModel_contentType,
    updateModel_modelId,
    updateModel_apiId,

    -- * Destructuring the Response
    UpdateModelResponse (..),
    newUpdateModelResponse,

    -- * Response Lenses
    updateModelResponse_modelId,
    updateModelResponse_schema,
    updateModelResponse_name,
    updateModelResponse_description,
    updateModelResponse_contentType,
    updateModelResponse_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

-- | Updates a Model.
--
-- /See:/ 'newUpdateModel' smart constructor.
data UpdateModel = UpdateModel'
  { -- | The schema for the model. For application\/json models, this should be
    -- JSON schema draft 4 model.
    UpdateModel -> Maybe Text
schema :: Prelude.Maybe Prelude.Text,
    -- | The name of the model.
    UpdateModel -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The description of the model.
    UpdateModel -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The content-type for the model, for example, \"application\/json\".
    UpdateModel -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The model ID.
    UpdateModel -> Text
modelId :: Prelude.Text,
    -- | The API identifier.
    UpdateModel -> Text
apiId :: Prelude.Text
  }
  deriving (UpdateModel -> UpdateModel -> Bool
(UpdateModel -> UpdateModel -> Bool)
-> (UpdateModel -> UpdateModel -> Bool) -> Eq UpdateModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateModel -> UpdateModel -> Bool
$c/= :: UpdateModel -> UpdateModel -> Bool
== :: UpdateModel -> UpdateModel -> Bool
$c== :: UpdateModel -> UpdateModel -> Bool
Prelude.Eq, ReadPrec [UpdateModel]
ReadPrec UpdateModel
Int -> ReadS UpdateModel
ReadS [UpdateModel]
(Int -> ReadS UpdateModel)
-> ReadS [UpdateModel]
-> ReadPrec UpdateModel
-> ReadPrec [UpdateModel]
-> Read UpdateModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateModel]
$creadListPrec :: ReadPrec [UpdateModel]
readPrec :: ReadPrec UpdateModel
$creadPrec :: ReadPrec UpdateModel
readList :: ReadS [UpdateModel]
$creadList :: ReadS [UpdateModel]
readsPrec :: Int -> ReadS UpdateModel
$creadsPrec :: Int -> ReadS UpdateModel
Prelude.Read, Int -> UpdateModel -> ShowS
[UpdateModel] -> ShowS
UpdateModel -> String
(Int -> UpdateModel -> ShowS)
-> (UpdateModel -> String)
-> ([UpdateModel] -> ShowS)
-> Show UpdateModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateModel] -> ShowS
$cshowList :: [UpdateModel] -> ShowS
show :: UpdateModel -> String
$cshow :: UpdateModel -> String
showsPrec :: Int -> UpdateModel -> ShowS
$cshowsPrec :: Int -> UpdateModel -> ShowS
Prelude.Show, (forall x. UpdateModel -> Rep UpdateModel x)
-> (forall x. Rep UpdateModel x -> UpdateModel)
-> Generic UpdateModel
forall x. Rep UpdateModel x -> UpdateModel
forall x. UpdateModel -> Rep UpdateModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateModel x -> UpdateModel
$cfrom :: forall x. UpdateModel -> Rep UpdateModel x
Prelude.Generic)

-- |
-- Create a value of 'UpdateModel' 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:
--
-- 'schema', 'updateModel_schema' - The schema for the model. For application\/json models, this should be
-- JSON schema draft 4 model.
--
-- 'name', 'updateModel_name' - The name of the model.
--
-- 'description', 'updateModel_description' - The description of the model.
--
-- 'contentType', 'updateModel_contentType' - The content-type for the model, for example, \"application\/json\".
--
-- 'modelId', 'updateModel_modelId' - The model ID.
--
-- 'apiId', 'updateModel_apiId' - The API identifier.
newUpdateModel ::
  -- | 'modelId'
  Prelude.Text ->
  -- | 'apiId'
  Prelude.Text ->
  UpdateModel
newUpdateModel :: Text -> Text -> UpdateModel
newUpdateModel Text
pModelId_ Text
pApiId_ =
  UpdateModel' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> UpdateModel
UpdateModel'
    { $sel:schema:UpdateModel' :: Maybe Text
schema = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateModel' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateModel' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:UpdateModel' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:modelId:UpdateModel' :: Text
modelId = Text
pModelId_,
      $sel:apiId:UpdateModel' :: Text
apiId = Text
pApiId_
    }

-- | The schema for the model. For application\/json models, this should be
-- JSON schema draft 4 model.
updateModel_schema :: Lens.Lens' UpdateModel (Prelude.Maybe Prelude.Text)
updateModel_schema :: (Maybe Text -> f (Maybe Text)) -> UpdateModel -> f UpdateModel
updateModel_schema = (UpdateModel -> Maybe Text)
-> (UpdateModel -> Maybe Text -> UpdateModel)
-> Lens UpdateModel UpdateModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModel' {Maybe Text
schema :: Maybe Text
$sel:schema:UpdateModel' :: UpdateModel -> Maybe Text
schema} -> Maybe Text
schema) (\s :: UpdateModel
s@UpdateModel' {} Maybe Text
a -> UpdateModel
s {$sel:schema:UpdateModel' :: Maybe Text
schema = Maybe Text
a} :: UpdateModel)

-- | The name of the model.
updateModel_name :: Lens.Lens' UpdateModel (Prelude.Maybe Prelude.Text)
updateModel_name :: (Maybe Text -> f (Maybe Text)) -> UpdateModel -> f UpdateModel
updateModel_name = (UpdateModel -> Maybe Text)
-> (UpdateModel -> Maybe Text -> UpdateModel)
-> Lens UpdateModel UpdateModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModel' {Maybe Text
name :: Maybe Text
$sel:name:UpdateModel' :: UpdateModel -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateModel
s@UpdateModel' {} Maybe Text
a -> UpdateModel
s {$sel:name:UpdateModel' :: Maybe Text
name = Maybe Text
a} :: UpdateModel)

-- | The description of the model.
updateModel_description :: Lens.Lens' UpdateModel (Prelude.Maybe Prelude.Text)
updateModel_description :: (Maybe Text -> f (Maybe Text)) -> UpdateModel -> f UpdateModel
updateModel_description = (UpdateModel -> Maybe Text)
-> (UpdateModel -> Maybe Text -> UpdateModel)
-> Lens UpdateModel UpdateModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModel' {Maybe Text
description :: Maybe Text
$sel:description:UpdateModel' :: UpdateModel -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateModel
s@UpdateModel' {} Maybe Text
a -> UpdateModel
s {$sel:description:UpdateModel' :: Maybe Text
description = Maybe Text
a} :: UpdateModel)

-- | The content-type for the model, for example, \"application\/json\".
updateModel_contentType :: Lens.Lens' UpdateModel (Prelude.Maybe Prelude.Text)
updateModel_contentType :: (Maybe Text -> f (Maybe Text)) -> UpdateModel -> f UpdateModel
updateModel_contentType = (UpdateModel -> Maybe Text)
-> (UpdateModel -> Maybe Text -> UpdateModel)
-> Lens UpdateModel UpdateModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModel' {Maybe Text
contentType :: Maybe Text
$sel:contentType:UpdateModel' :: UpdateModel -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: UpdateModel
s@UpdateModel' {} Maybe Text
a -> UpdateModel
s {$sel:contentType:UpdateModel' :: Maybe Text
contentType = Maybe Text
a} :: UpdateModel)

-- | The model ID.
updateModel_modelId :: Lens.Lens' UpdateModel Prelude.Text
updateModel_modelId :: (Text -> f Text) -> UpdateModel -> f UpdateModel
updateModel_modelId = (UpdateModel -> Text)
-> (UpdateModel -> Text -> UpdateModel)
-> Lens UpdateModel UpdateModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModel' {Text
modelId :: Text
$sel:modelId:UpdateModel' :: UpdateModel -> Text
modelId} -> Text
modelId) (\s :: UpdateModel
s@UpdateModel' {} Text
a -> UpdateModel
s {$sel:modelId:UpdateModel' :: Text
modelId = Text
a} :: UpdateModel)

-- | The API identifier.
updateModel_apiId :: Lens.Lens' UpdateModel Prelude.Text
updateModel_apiId :: (Text -> f Text) -> UpdateModel -> f UpdateModel
updateModel_apiId = (UpdateModel -> Text)
-> (UpdateModel -> Text -> UpdateModel)
-> Lens UpdateModel UpdateModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModel' {Text
apiId :: Text
$sel:apiId:UpdateModel' :: UpdateModel -> Text
apiId} -> Text
apiId) (\s :: UpdateModel
s@UpdateModel' {} Text
a -> UpdateModel
s {$sel:apiId:UpdateModel' :: Text
apiId = Text
a} :: UpdateModel)

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

instance Prelude.NFData UpdateModel

instance Core.ToHeaders UpdateModel where
  toHeaders :: UpdateModel -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateModel -> 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 UpdateModel where
  toJSON :: UpdateModel -> Value
toJSON UpdateModel' {Maybe Text
Text
apiId :: Text
modelId :: Text
contentType :: Maybe Text
description :: Maybe Text
name :: Maybe Text
schema :: Maybe Text
$sel:apiId:UpdateModel' :: UpdateModel -> Text
$sel:modelId:UpdateModel' :: UpdateModel -> Text
$sel:contentType:UpdateModel' :: UpdateModel -> Maybe Text
$sel:description:UpdateModel' :: UpdateModel -> Maybe Text
$sel:name:UpdateModel' :: UpdateModel -> Maybe Text
$sel:schema:UpdateModel' :: UpdateModel -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"schema" 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
schema,
            (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"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
          ]
      )

instance Core.ToPath UpdateModel where
  toPath :: UpdateModel -> ByteString
toPath UpdateModel' {Maybe Text
Text
apiId :: Text
modelId :: Text
contentType :: Maybe Text
description :: Maybe Text
name :: Maybe Text
schema :: Maybe Text
$sel:apiId:UpdateModel' :: UpdateModel -> Text
$sel:modelId:UpdateModel' :: UpdateModel -> Text
$sel:contentType:UpdateModel' :: UpdateModel -> Maybe Text
$sel:description:UpdateModel' :: UpdateModel -> Maybe Text
$sel:name:UpdateModel' :: UpdateModel -> Maybe Text
$sel:schema:UpdateModel' :: UpdateModel -> 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/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
modelId
      ]

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

-- | /See:/ 'newUpdateModelResponse' smart constructor.
data UpdateModelResponse = UpdateModelResponse'
  { -- | The model identifier.
    UpdateModelResponse -> Maybe Text
modelId :: Prelude.Maybe Prelude.Text,
    -- | The schema for the model. For application\/json models, this should be
    -- JSON schema draft 4 model.
    UpdateModelResponse -> Maybe Text
schema :: Prelude.Maybe Prelude.Text,
    -- | The name of the model. Must be alphanumeric.
    UpdateModelResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The description of the model.
    UpdateModelResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The content-type for the model, for example, \"application\/json\".
    UpdateModelResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateModelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateModelResponse -> UpdateModelResponse -> Bool
(UpdateModelResponse -> UpdateModelResponse -> Bool)
-> (UpdateModelResponse -> UpdateModelResponse -> Bool)
-> Eq UpdateModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateModelResponse -> UpdateModelResponse -> Bool
$c/= :: UpdateModelResponse -> UpdateModelResponse -> Bool
== :: UpdateModelResponse -> UpdateModelResponse -> Bool
$c== :: UpdateModelResponse -> UpdateModelResponse -> Bool
Prelude.Eq, ReadPrec [UpdateModelResponse]
ReadPrec UpdateModelResponse
Int -> ReadS UpdateModelResponse
ReadS [UpdateModelResponse]
(Int -> ReadS UpdateModelResponse)
-> ReadS [UpdateModelResponse]
-> ReadPrec UpdateModelResponse
-> ReadPrec [UpdateModelResponse]
-> Read UpdateModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateModelResponse]
$creadListPrec :: ReadPrec [UpdateModelResponse]
readPrec :: ReadPrec UpdateModelResponse
$creadPrec :: ReadPrec UpdateModelResponse
readList :: ReadS [UpdateModelResponse]
$creadList :: ReadS [UpdateModelResponse]
readsPrec :: Int -> ReadS UpdateModelResponse
$creadsPrec :: Int -> ReadS UpdateModelResponse
Prelude.Read, Int -> UpdateModelResponse -> ShowS
[UpdateModelResponse] -> ShowS
UpdateModelResponse -> String
(Int -> UpdateModelResponse -> ShowS)
-> (UpdateModelResponse -> String)
-> ([UpdateModelResponse] -> ShowS)
-> Show UpdateModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateModelResponse] -> ShowS
$cshowList :: [UpdateModelResponse] -> ShowS
show :: UpdateModelResponse -> String
$cshow :: UpdateModelResponse -> String
showsPrec :: Int -> UpdateModelResponse -> ShowS
$cshowsPrec :: Int -> UpdateModelResponse -> ShowS
Prelude.Show, (forall x. UpdateModelResponse -> Rep UpdateModelResponse x)
-> (forall x. Rep UpdateModelResponse x -> UpdateModelResponse)
-> Generic UpdateModelResponse
forall x. Rep UpdateModelResponse x -> UpdateModelResponse
forall x. UpdateModelResponse -> Rep UpdateModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateModelResponse x -> UpdateModelResponse
$cfrom :: forall x. UpdateModelResponse -> Rep UpdateModelResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateModelResponse' 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', 'updateModelResponse_modelId' - The model identifier.
--
-- 'schema', 'updateModelResponse_schema' - The schema for the model. For application\/json models, this should be
-- JSON schema draft 4 model.
--
-- 'name', 'updateModelResponse_name' - The name of the model. Must be alphanumeric.
--
-- 'description', 'updateModelResponse_description' - The description of the model.
--
-- 'contentType', 'updateModelResponse_contentType' - The content-type for the model, for example, \"application\/json\".
--
-- 'httpStatus', 'updateModelResponse_httpStatus' - The response's http status code.
newUpdateModelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateModelResponse
newUpdateModelResponse :: Int -> UpdateModelResponse
newUpdateModelResponse Int
pHttpStatus_ =
  UpdateModelResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateModelResponse
UpdateModelResponse'
    { $sel:modelId:UpdateModelResponse' :: Maybe Text
modelId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schema:UpdateModelResponse' :: Maybe Text
schema = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateModelResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateModelResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:UpdateModelResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateModelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The model identifier.
updateModelResponse_modelId :: Lens.Lens' UpdateModelResponse (Prelude.Maybe Prelude.Text)
updateModelResponse_modelId :: (Maybe Text -> f (Maybe Text))
-> UpdateModelResponse -> f UpdateModelResponse
updateModelResponse_modelId = (UpdateModelResponse -> Maybe Text)
-> (UpdateModelResponse -> Maybe Text -> UpdateModelResponse)
-> Lens
     UpdateModelResponse UpdateModelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModelResponse' {Maybe Text
modelId :: Maybe Text
$sel:modelId:UpdateModelResponse' :: UpdateModelResponse -> Maybe Text
modelId} -> Maybe Text
modelId) (\s :: UpdateModelResponse
s@UpdateModelResponse' {} Maybe Text
a -> UpdateModelResponse
s {$sel:modelId:UpdateModelResponse' :: Maybe Text
modelId = Maybe Text
a} :: UpdateModelResponse)

-- | The schema for the model. For application\/json models, this should be
-- JSON schema draft 4 model.
updateModelResponse_schema :: Lens.Lens' UpdateModelResponse (Prelude.Maybe Prelude.Text)
updateModelResponse_schema :: (Maybe Text -> f (Maybe Text))
-> UpdateModelResponse -> f UpdateModelResponse
updateModelResponse_schema = (UpdateModelResponse -> Maybe Text)
-> (UpdateModelResponse -> Maybe Text -> UpdateModelResponse)
-> Lens
     UpdateModelResponse UpdateModelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModelResponse' {Maybe Text
schema :: Maybe Text
$sel:schema:UpdateModelResponse' :: UpdateModelResponse -> Maybe Text
schema} -> Maybe Text
schema) (\s :: UpdateModelResponse
s@UpdateModelResponse' {} Maybe Text
a -> UpdateModelResponse
s {$sel:schema:UpdateModelResponse' :: Maybe Text
schema = Maybe Text
a} :: UpdateModelResponse)

-- | The name of the model. Must be alphanumeric.
updateModelResponse_name :: Lens.Lens' UpdateModelResponse (Prelude.Maybe Prelude.Text)
updateModelResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateModelResponse -> f UpdateModelResponse
updateModelResponse_name = (UpdateModelResponse -> Maybe Text)
-> (UpdateModelResponse -> Maybe Text -> UpdateModelResponse)
-> Lens
     UpdateModelResponse UpdateModelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModelResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateModelResponse' :: UpdateModelResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateModelResponse
s@UpdateModelResponse' {} Maybe Text
a -> UpdateModelResponse
s {$sel:name:UpdateModelResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateModelResponse)

-- | The description of the model.
updateModelResponse_description :: Lens.Lens' UpdateModelResponse (Prelude.Maybe Prelude.Text)
updateModelResponse_description :: (Maybe Text -> f (Maybe Text))
-> UpdateModelResponse -> f UpdateModelResponse
updateModelResponse_description = (UpdateModelResponse -> Maybe Text)
-> (UpdateModelResponse -> Maybe Text -> UpdateModelResponse)
-> Lens
     UpdateModelResponse UpdateModelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModelResponse' {Maybe Text
description :: Maybe Text
$sel:description:UpdateModelResponse' :: UpdateModelResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateModelResponse
s@UpdateModelResponse' {} Maybe Text
a -> UpdateModelResponse
s {$sel:description:UpdateModelResponse' :: Maybe Text
description = Maybe Text
a} :: UpdateModelResponse)

-- | The content-type for the model, for example, \"application\/json\".
updateModelResponse_contentType :: Lens.Lens' UpdateModelResponse (Prelude.Maybe Prelude.Text)
updateModelResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> UpdateModelResponse -> f UpdateModelResponse
updateModelResponse_contentType = (UpdateModelResponse -> Maybe Text)
-> (UpdateModelResponse -> Maybe Text -> UpdateModelResponse)
-> Lens
     UpdateModelResponse UpdateModelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateModelResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:UpdateModelResponse' :: UpdateModelResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: UpdateModelResponse
s@UpdateModelResponse' {} Maybe Text
a -> UpdateModelResponse
s {$sel:contentType:UpdateModelResponse' :: Maybe Text
contentType = Maybe Text
a} :: UpdateModelResponse)

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

instance Prelude.NFData UpdateModelResponse