amazonka-apigatewayv2-2.0: gen/Amazonka/ApiGatewayV2/DeleteModel.hs
{-# 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.DeleteModel
-- Copyright : (c) 2013-2023 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a Model.
module Amazonka.ApiGatewayV2.DeleteModel
( -- * Creating a Request
DeleteModel (..),
newDeleteModel,
-- * Request Lenses
deleteModel_modelId,
deleteModel_apiId,
-- * Destructuring the Response
DeleteModelResponse (..),
newDeleteModelResponse,
)
where
import Amazonka.ApiGatewayV2.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
-- | /See:/ 'newDeleteModel' smart constructor.
data DeleteModel = DeleteModel'
{ -- | The model ID.
modelId :: Prelude.Text,
-- | The API identifier.
apiId :: Prelude.Text
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'DeleteModel' 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', 'deleteModel_modelId' - The model ID.
--
-- 'apiId', 'deleteModel_apiId' - The API identifier.
newDeleteModel ::
-- | 'modelId'
Prelude.Text ->
-- | 'apiId'
Prelude.Text ->
DeleteModel
newDeleteModel pModelId_ pApiId_ =
DeleteModel' {modelId = pModelId_, apiId = pApiId_}
-- | The model ID.
deleteModel_modelId :: Lens.Lens' DeleteModel Prelude.Text
deleteModel_modelId = Lens.lens (\DeleteModel' {modelId} -> modelId) (\s@DeleteModel' {} a -> s {modelId = a} :: DeleteModel)
-- | The API identifier.
deleteModel_apiId :: Lens.Lens' DeleteModel Prelude.Text
deleteModel_apiId = Lens.lens (\DeleteModel' {apiId} -> apiId) (\s@DeleteModel' {} a -> s {apiId = a} :: DeleteModel)
instance Core.AWSRequest DeleteModel where
type AWSResponse DeleteModel = DeleteModelResponse
request overrides =
Request.delete (overrides defaultService)
response = Response.receiveNull DeleteModelResponse'
instance Prelude.Hashable DeleteModel where
hashWithSalt _salt DeleteModel' {..} =
_salt
`Prelude.hashWithSalt` modelId
`Prelude.hashWithSalt` apiId
instance Prelude.NFData DeleteModel where
rnf DeleteModel' {..} =
Prelude.rnf modelId `Prelude.seq` Prelude.rnf apiId
instance Data.ToHeaders DeleteModel where
toHeaders =
Prelude.const
( Prelude.mconcat
[ "Content-Type"
Data.=# ( "application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteModel where
toPath DeleteModel' {..} =
Prelude.mconcat
[ "/v2/apis/",
Data.toBS apiId,
"/models/",
Data.toBS modelId
]
instance Data.ToQuery DeleteModel where
toQuery = Prelude.const Prelude.mempty
-- | /See:/ 'newDeleteModelResponse' smart constructor.
data DeleteModelResponse = DeleteModelResponse'
{
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'DeleteModelResponse' 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.
newDeleteModelResponse ::
DeleteModelResponse
newDeleteModelResponse = DeleteModelResponse'
instance Prelude.NFData DeleteModelResponse where
rnf _ = ()