{-# 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.SageMaker.DeleteModelPackage
-- 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)
--
-- Deletes a model package.
--
-- A model package is used to create Amazon SageMaker models or list on
-- Amazon Web Services Marketplace. Buyers can subscribe to model packages
-- listed on Amazon Web Services Marketplace to create models in Amazon
-- SageMaker.
module Amazonka.SageMaker.DeleteModelPackage
  ( -- * Creating a Request
    DeleteModelPackage (..),
    newDeleteModelPackage,

    -- * Request Lenses
    deleteModelPackage_modelPackageName,

    -- * Destructuring the Response
    DeleteModelPackageResponse (..),
    newDeleteModelPackageResponse,
  )
where

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
import Amazonka.SageMaker.Types

-- | /See:/ 'newDeleteModelPackage' smart constructor.
data DeleteModelPackage = DeleteModelPackage'
  { -- | The name or Amazon Resource Name (ARN) of the model package to delete.
    --
    -- When you specify a name, the name must have 1 to 63 characters. Valid
    -- characters are a-z, A-Z, 0-9, and - (hyphen).
    DeleteModelPackage -> Text
modelPackageName :: Prelude.Text
  }
  deriving (DeleteModelPackage -> DeleteModelPackage -> Bool
(DeleteModelPackage -> DeleteModelPackage -> Bool)
-> (DeleteModelPackage -> DeleteModelPackage -> Bool)
-> Eq DeleteModelPackage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteModelPackage -> DeleteModelPackage -> Bool
$c/= :: DeleteModelPackage -> DeleteModelPackage -> Bool
== :: DeleteModelPackage -> DeleteModelPackage -> Bool
$c== :: DeleteModelPackage -> DeleteModelPackage -> Bool
Prelude.Eq, ReadPrec [DeleteModelPackage]
ReadPrec DeleteModelPackage
Int -> ReadS DeleteModelPackage
ReadS [DeleteModelPackage]
(Int -> ReadS DeleteModelPackage)
-> ReadS [DeleteModelPackage]
-> ReadPrec DeleteModelPackage
-> ReadPrec [DeleteModelPackage]
-> Read DeleteModelPackage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteModelPackage]
$creadListPrec :: ReadPrec [DeleteModelPackage]
readPrec :: ReadPrec DeleteModelPackage
$creadPrec :: ReadPrec DeleteModelPackage
readList :: ReadS [DeleteModelPackage]
$creadList :: ReadS [DeleteModelPackage]
readsPrec :: Int -> ReadS DeleteModelPackage
$creadsPrec :: Int -> ReadS DeleteModelPackage
Prelude.Read, Int -> DeleteModelPackage -> ShowS
[DeleteModelPackage] -> ShowS
DeleteModelPackage -> String
(Int -> DeleteModelPackage -> ShowS)
-> (DeleteModelPackage -> String)
-> ([DeleteModelPackage] -> ShowS)
-> Show DeleteModelPackage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteModelPackage] -> ShowS
$cshowList :: [DeleteModelPackage] -> ShowS
show :: DeleteModelPackage -> String
$cshow :: DeleteModelPackage -> String
showsPrec :: Int -> DeleteModelPackage -> ShowS
$cshowsPrec :: Int -> DeleteModelPackage -> ShowS
Prelude.Show, (forall x. DeleteModelPackage -> Rep DeleteModelPackage x)
-> (forall x. Rep DeleteModelPackage x -> DeleteModelPackage)
-> Generic DeleteModelPackage
forall x. Rep DeleteModelPackage x -> DeleteModelPackage
forall x. DeleteModelPackage -> Rep DeleteModelPackage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteModelPackage x -> DeleteModelPackage
$cfrom :: forall x. DeleteModelPackage -> Rep DeleteModelPackage x
Prelude.Generic)

-- |
-- Create a value of 'DeleteModelPackage' 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:
--
-- 'modelPackageName', 'deleteModelPackage_modelPackageName' - The name or Amazon Resource Name (ARN) of the model package to delete.
--
-- When you specify a name, the name must have 1 to 63 characters. Valid
-- characters are a-z, A-Z, 0-9, and - (hyphen).
newDeleteModelPackage ::
  -- | 'modelPackageName'
  Prelude.Text ->
  DeleteModelPackage
newDeleteModelPackage :: Text -> DeleteModelPackage
newDeleteModelPackage Text
pModelPackageName_ =
  DeleteModelPackage' :: Text -> DeleteModelPackage
DeleteModelPackage'
    { $sel:modelPackageName:DeleteModelPackage' :: Text
modelPackageName =
        Text
pModelPackageName_
    }

-- | The name or Amazon Resource Name (ARN) of the model package to delete.
--
-- When you specify a name, the name must have 1 to 63 characters. Valid
-- characters are a-z, A-Z, 0-9, and - (hyphen).
deleteModelPackage_modelPackageName :: Lens.Lens' DeleteModelPackage Prelude.Text
deleteModelPackage_modelPackageName :: (Text -> f Text) -> DeleteModelPackage -> f DeleteModelPackage
deleteModelPackage_modelPackageName = (DeleteModelPackage -> Text)
-> (DeleteModelPackage -> Text -> DeleteModelPackage)
-> Lens DeleteModelPackage DeleteModelPackage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteModelPackage' {Text
modelPackageName :: Text
$sel:modelPackageName:DeleteModelPackage' :: DeleteModelPackage -> Text
modelPackageName} -> Text
modelPackageName) (\s :: DeleteModelPackage
s@DeleteModelPackage' {} Text
a -> DeleteModelPackage
s {$sel:modelPackageName:DeleteModelPackage' :: Text
modelPackageName = Text
a} :: DeleteModelPackage)

instance Core.AWSRequest DeleteModelPackage where
  type
    AWSResponse DeleteModelPackage =
      DeleteModelPackageResponse
  request :: DeleteModelPackage -> Request DeleteModelPackage
request = Service -> DeleteModelPackage -> Request DeleteModelPackage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteModelPackage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteModelPackage)))
response =
    AWSResponse DeleteModelPackage
-> Logger
-> Service
-> Proxy DeleteModelPackage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteModelPackage)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteModelPackage
DeleteModelPackageResponse
DeleteModelPackageResponse'

instance Prelude.Hashable DeleteModelPackage

instance Prelude.NFData DeleteModelPackage

instance Core.ToHeaders DeleteModelPackage where
  toHeaders :: DeleteModelPackage -> [Header]
toHeaders =
    [Header] -> DeleteModelPackage -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"SageMaker.DeleteModelPackage" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteModelPackage where
  toJSON :: DeleteModelPackage -> Value
toJSON DeleteModelPackage' {Text
modelPackageName :: Text
$sel:modelPackageName:DeleteModelPackage' :: DeleteModelPackage -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ModelPackageName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelPackageName)
          ]
      )

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

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

-- | /See:/ 'newDeleteModelPackageResponse' smart constructor.
data DeleteModelPackageResponse = DeleteModelPackageResponse'
  {
  }
  deriving (DeleteModelPackageResponse -> DeleteModelPackageResponse -> Bool
(DeleteModelPackageResponse -> DeleteModelPackageResponse -> Bool)
-> (DeleteModelPackageResponse
    -> DeleteModelPackageResponse -> Bool)
-> Eq DeleteModelPackageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteModelPackageResponse -> DeleteModelPackageResponse -> Bool
$c/= :: DeleteModelPackageResponse -> DeleteModelPackageResponse -> Bool
== :: DeleteModelPackageResponse -> DeleteModelPackageResponse -> Bool
$c== :: DeleteModelPackageResponse -> DeleteModelPackageResponse -> Bool
Prelude.Eq, ReadPrec [DeleteModelPackageResponse]
ReadPrec DeleteModelPackageResponse
Int -> ReadS DeleteModelPackageResponse
ReadS [DeleteModelPackageResponse]
(Int -> ReadS DeleteModelPackageResponse)
-> ReadS [DeleteModelPackageResponse]
-> ReadPrec DeleteModelPackageResponse
-> ReadPrec [DeleteModelPackageResponse]
-> Read DeleteModelPackageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteModelPackageResponse]
$creadListPrec :: ReadPrec [DeleteModelPackageResponse]
readPrec :: ReadPrec DeleteModelPackageResponse
$creadPrec :: ReadPrec DeleteModelPackageResponse
readList :: ReadS [DeleteModelPackageResponse]
$creadList :: ReadS [DeleteModelPackageResponse]
readsPrec :: Int -> ReadS DeleteModelPackageResponse
$creadsPrec :: Int -> ReadS DeleteModelPackageResponse
Prelude.Read, Int -> DeleteModelPackageResponse -> ShowS
[DeleteModelPackageResponse] -> ShowS
DeleteModelPackageResponse -> String
(Int -> DeleteModelPackageResponse -> ShowS)
-> (DeleteModelPackageResponse -> String)
-> ([DeleteModelPackageResponse] -> ShowS)
-> Show DeleteModelPackageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteModelPackageResponse] -> ShowS
$cshowList :: [DeleteModelPackageResponse] -> ShowS
show :: DeleteModelPackageResponse -> String
$cshow :: DeleteModelPackageResponse -> String
showsPrec :: Int -> DeleteModelPackageResponse -> ShowS
$cshowsPrec :: Int -> DeleteModelPackageResponse -> ShowS
Prelude.Show, (forall x.
 DeleteModelPackageResponse -> Rep DeleteModelPackageResponse x)
-> (forall x.
    Rep DeleteModelPackageResponse x -> DeleteModelPackageResponse)
-> Generic DeleteModelPackageResponse
forall x.
Rep DeleteModelPackageResponse x -> DeleteModelPackageResponse
forall x.
DeleteModelPackageResponse -> Rep DeleteModelPackageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteModelPackageResponse x -> DeleteModelPackageResponse
$cfrom :: forall x.
DeleteModelPackageResponse -> Rep DeleteModelPackageResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteModelPackageResponse' 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.
newDeleteModelPackageResponse ::
  DeleteModelPackageResponse
newDeleteModelPackageResponse :: DeleteModelPackageResponse
newDeleteModelPackageResponse =
  DeleteModelPackageResponse
DeleteModelPackageResponse'

instance Prelude.NFData DeleteModelPackageResponse