{-# 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.DeleteModelPackageGroup
-- 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 the specified model group.
module Amazonka.SageMaker.DeleteModelPackageGroup
  ( -- * Creating a Request
    DeleteModelPackageGroup (..),
    newDeleteModelPackageGroup,

    -- * Request Lenses
    deleteModelPackageGroup_modelPackageGroupName,

    -- * Destructuring the Response
    DeleteModelPackageGroupResponse (..),
    newDeleteModelPackageGroupResponse,
  )
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:/ 'newDeleteModelPackageGroup' smart constructor.
data DeleteModelPackageGroup = DeleteModelPackageGroup'
  { -- | The name of the model group to delete.
    DeleteModelPackageGroup -> Text
modelPackageGroupName :: Prelude.Text
  }
  deriving (DeleteModelPackageGroup -> DeleteModelPackageGroup -> Bool
(DeleteModelPackageGroup -> DeleteModelPackageGroup -> Bool)
-> (DeleteModelPackageGroup -> DeleteModelPackageGroup -> Bool)
-> Eq DeleteModelPackageGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteModelPackageGroup -> DeleteModelPackageGroup -> Bool
$c/= :: DeleteModelPackageGroup -> DeleteModelPackageGroup -> Bool
== :: DeleteModelPackageGroup -> DeleteModelPackageGroup -> Bool
$c== :: DeleteModelPackageGroup -> DeleteModelPackageGroup -> Bool
Prelude.Eq, ReadPrec [DeleteModelPackageGroup]
ReadPrec DeleteModelPackageGroup
Int -> ReadS DeleteModelPackageGroup
ReadS [DeleteModelPackageGroup]
(Int -> ReadS DeleteModelPackageGroup)
-> ReadS [DeleteModelPackageGroup]
-> ReadPrec DeleteModelPackageGroup
-> ReadPrec [DeleteModelPackageGroup]
-> Read DeleteModelPackageGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteModelPackageGroup]
$creadListPrec :: ReadPrec [DeleteModelPackageGroup]
readPrec :: ReadPrec DeleteModelPackageGroup
$creadPrec :: ReadPrec DeleteModelPackageGroup
readList :: ReadS [DeleteModelPackageGroup]
$creadList :: ReadS [DeleteModelPackageGroup]
readsPrec :: Int -> ReadS DeleteModelPackageGroup
$creadsPrec :: Int -> ReadS DeleteModelPackageGroup
Prelude.Read, Int -> DeleteModelPackageGroup -> ShowS
[DeleteModelPackageGroup] -> ShowS
DeleteModelPackageGroup -> String
(Int -> DeleteModelPackageGroup -> ShowS)
-> (DeleteModelPackageGroup -> String)
-> ([DeleteModelPackageGroup] -> ShowS)
-> Show DeleteModelPackageGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteModelPackageGroup] -> ShowS
$cshowList :: [DeleteModelPackageGroup] -> ShowS
show :: DeleteModelPackageGroup -> String
$cshow :: DeleteModelPackageGroup -> String
showsPrec :: Int -> DeleteModelPackageGroup -> ShowS
$cshowsPrec :: Int -> DeleteModelPackageGroup -> ShowS
Prelude.Show, (forall x.
 DeleteModelPackageGroup -> Rep DeleteModelPackageGroup x)
-> (forall x.
    Rep DeleteModelPackageGroup x -> DeleteModelPackageGroup)
-> Generic DeleteModelPackageGroup
forall x. Rep DeleteModelPackageGroup x -> DeleteModelPackageGroup
forall x. DeleteModelPackageGroup -> Rep DeleteModelPackageGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteModelPackageGroup x -> DeleteModelPackageGroup
$cfrom :: forall x. DeleteModelPackageGroup -> Rep DeleteModelPackageGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteModelPackageGroup' 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:
--
-- 'modelPackageGroupName', 'deleteModelPackageGroup_modelPackageGroupName' - The name of the model group to delete.
newDeleteModelPackageGroup ::
  -- | 'modelPackageGroupName'
  Prelude.Text ->
  DeleteModelPackageGroup
newDeleteModelPackageGroup :: Text -> DeleteModelPackageGroup
newDeleteModelPackageGroup Text
pModelPackageGroupName_ =
  DeleteModelPackageGroup' :: Text -> DeleteModelPackageGroup
DeleteModelPackageGroup'
    { $sel:modelPackageGroupName:DeleteModelPackageGroup' :: Text
modelPackageGroupName =
        Text
pModelPackageGroupName_
    }

-- | The name of the model group to delete.
deleteModelPackageGroup_modelPackageGroupName :: Lens.Lens' DeleteModelPackageGroup Prelude.Text
deleteModelPackageGroup_modelPackageGroupName :: (Text -> f Text)
-> DeleteModelPackageGroup -> f DeleteModelPackageGroup
deleteModelPackageGroup_modelPackageGroupName = (DeleteModelPackageGroup -> Text)
-> (DeleteModelPackageGroup -> Text -> DeleteModelPackageGroup)
-> Lens DeleteModelPackageGroup DeleteModelPackageGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteModelPackageGroup' {Text
modelPackageGroupName :: Text
$sel:modelPackageGroupName:DeleteModelPackageGroup' :: DeleteModelPackageGroup -> Text
modelPackageGroupName} -> Text
modelPackageGroupName) (\s :: DeleteModelPackageGroup
s@DeleteModelPackageGroup' {} Text
a -> DeleteModelPackageGroup
s {$sel:modelPackageGroupName:DeleteModelPackageGroup' :: Text
modelPackageGroupName = Text
a} :: DeleteModelPackageGroup)

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

instance Prelude.Hashable DeleteModelPackageGroup

instance Prelude.NFData DeleteModelPackageGroup

instance Core.ToHeaders DeleteModelPackageGroup where
  toHeaders :: DeleteModelPackageGroup -> [Header]
toHeaders =
    [Header] -> DeleteModelPackageGroup -> [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.DeleteModelPackageGroup" ::
                          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 DeleteModelPackageGroup where
  toJSON :: DeleteModelPackageGroup -> Value
toJSON DeleteModelPackageGroup' {Text
modelPackageGroupName :: Text
$sel:modelPackageGroupName:DeleteModelPackageGroup' :: DeleteModelPackageGroup -> 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
"ModelPackageGroupName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelPackageGroupName
              )
          ]
      )

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

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

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

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

instance
  Prelude.NFData
    DeleteModelPackageGroupResponse