{-# 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.DeleteModelPackageGroupPolicy
-- 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 group resource policy.
module Amazonka.SageMaker.DeleteModelPackageGroupPolicy
  ( -- * Creating a Request
    DeleteModelPackageGroupPolicy (..),
    newDeleteModelPackageGroupPolicy,

    -- * Request Lenses
    deleteModelPackageGroupPolicy_modelPackageGroupName,

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

-- |
-- Create a value of 'DeleteModelPackageGroupPolicy' 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', 'deleteModelPackageGroupPolicy_modelPackageGroupName' - The name of the model group for which to delete the policy.
newDeleteModelPackageGroupPolicy ::
  -- | 'modelPackageGroupName'
  Prelude.Text ->
  DeleteModelPackageGroupPolicy
newDeleteModelPackageGroupPolicy :: Text -> DeleteModelPackageGroupPolicy
newDeleteModelPackageGroupPolicy
  Text
pModelPackageGroupName_ =
    DeleteModelPackageGroupPolicy' :: Text -> DeleteModelPackageGroupPolicy
DeleteModelPackageGroupPolicy'
      { $sel:modelPackageGroupName:DeleteModelPackageGroupPolicy' :: Text
modelPackageGroupName =
          Text
pModelPackageGroupName_
      }

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

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

instance
  Prelude.Hashable
    DeleteModelPackageGroupPolicy

instance Prelude.NFData DeleteModelPackageGroupPolicy

instance Core.ToHeaders DeleteModelPackageGroupPolicy where
  toHeaders :: DeleteModelPackageGroupPolicy -> [Header]
toHeaders =
    [Header] -> DeleteModelPackageGroupPolicy -> [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.DeleteModelPackageGroupPolicy" ::
                          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 DeleteModelPackageGroupPolicy where
  toJSON :: DeleteModelPackageGroupPolicy -> Value
toJSON DeleteModelPackageGroupPolicy' {Text
modelPackageGroupName :: Text
$sel:modelPackageGroupName:DeleteModelPackageGroupPolicy' :: DeleteModelPackageGroupPolicy -> 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 DeleteModelPackageGroupPolicy where
  toPath :: DeleteModelPackageGroupPolicy -> ByteString
toPath = ByteString -> DeleteModelPackageGroupPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

instance
  Prelude.NFData
    DeleteModelPackageGroupPolicyResponse