{-# 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.Redshift.DeleteSnapshotCopyGrant
-- 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 snapshot copy grant.
module Amazonka.Redshift.DeleteSnapshotCopyGrant
  ( -- * Creating a Request
    DeleteSnapshotCopyGrant (..),
    newDeleteSnapshotCopyGrant,

    -- * Request Lenses
    deleteSnapshotCopyGrant_snapshotCopyGrantName,

    -- * Destructuring the Response
    DeleteSnapshotCopyGrantResponse (..),
    newDeleteSnapshotCopyGrantResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The result of the @DeleteSnapshotCopyGrant@ action.
--
-- /See:/ 'newDeleteSnapshotCopyGrant' smart constructor.
data DeleteSnapshotCopyGrant = DeleteSnapshotCopyGrant'
  { -- | The name of the snapshot copy grant to delete.
    DeleteSnapshotCopyGrant -> Text
snapshotCopyGrantName :: Prelude.Text
  }
  deriving (DeleteSnapshotCopyGrant -> DeleteSnapshotCopyGrant -> Bool
(DeleteSnapshotCopyGrant -> DeleteSnapshotCopyGrant -> Bool)
-> (DeleteSnapshotCopyGrant -> DeleteSnapshotCopyGrant -> Bool)
-> Eq DeleteSnapshotCopyGrant
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSnapshotCopyGrant -> DeleteSnapshotCopyGrant -> Bool
$c/= :: DeleteSnapshotCopyGrant -> DeleteSnapshotCopyGrant -> Bool
== :: DeleteSnapshotCopyGrant -> DeleteSnapshotCopyGrant -> Bool
$c== :: DeleteSnapshotCopyGrant -> DeleteSnapshotCopyGrant -> Bool
Prelude.Eq, ReadPrec [DeleteSnapshotCopyGrant]
ReadPrec DeleteSnapshotCopyGrant
Int -> ReadS DeleteSnapshotCopyGrant
ReadS [DeleteSnapshotCopyGrant]
(Int -> ReadS DeleteSnapshotCopyGrant)
-> ReadS [DeleteSnapshotCopyGrant]
-> ReadPrec DeleteSnapshotCopyGrant
-> ReadPrec [DeleteSnapshotCopyGrant]
-> Read DeleteSnapshotCopyGrant
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSnapshotCopyGrant]
$creadListPrec :: ReadPrec [DeleteSnapshotCopyGrant]
readPrec :: ReadPrec DeleteSnapshotCopyGrant
$creadPrec :: ReadPrec DeleteSnapshotCopyGrant
readList :: ReadS [DeleteSnapshotCopyGrant]
$creadList :: ReadS [DeleteSnapshotCopyGrant]
readsPrec :: Int -> ReadS DeleteSnapshotCopyGrant
$creadsPrec :: Int -> ReadS DeleteSnapshotCopyGrant
Prelude.Read, Int -> DeleteSnapshotCopyGrant -> ShowS
[DeleteSnapshotCopyGrant] -> ShowS
DeleteSnapshotCopyGrant -> String
(Int -> DeleteSnapshotCopyGrant -> ShowS)
-> (DeleteSnapshotCopyGrant -> String)
-> ([DeleteSnapshotCopyGrant] -> ShowS)
-> Show DeleteSnapshotCopyGrant
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSnapshotCopyGrant] -> ShowS
$cshowList :: [DeleteSnapshotCopyGrant] -> ShowS
show :: DeleteSnapshotCopyGrant -> String
$cshow :: DeleteSnapshotCopyGrant -> String
showsPrec :: Int -> DeleteSnapshotCopyGrant -> ShowS
$cshowsPrec :: Int -> DeleteSnapshotCopyGrant -> ShowS
Prelude.Show, (forall x.
 DeleteSnapshotCopyGrant -> Rep DeleteSnapshotCopyGrant x)
-> (forall x.
    Rep DeleteSnapshotCopyGrant x -> DeleteSnapshotCopyGrant)
-> Generic DeleteSnapshotCopyGrant
forall x. Rep DeleteSnapshotCopyGrant x -> DeleteSnapshotCopyGrant
forall x. DeleteSnapshotCopyGrant -> Rep DeleteSnapshotCopyGrant x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSnapshotCopyGrant x -> DeleteSnapshotCopyGrant
$cfrom :: forall x. DeleteSnapshotCopyGrant -> Rep DeleteSnapshotCopyGrant x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSnapshotCopyGrant' 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:
--
-- 'snapshotCopyGrantName', 'deleteSnapshotCopyGrant_snapshotCopyGrantName' - The name of the snapshot copy grant to delete.
newDeleteSnapshotCopyGrant ::
  -- | 'snapshotCopyGrantName'
  Prelude.Text ->
  DeleteSnapshotCopyGrant
newDeleteSnapshotCopyGrant :: Text -> DeleteSnapshotCopyGrant
newDeleteSnapshotCopyGrant Text
pSnapshotCopyGrantName_ =
  DeleteSnapshotCopyGrant' :: Text -> DeleteSnapshotCopyGrant
DeleteSnapshotCopyGrant'
    { $sel:snapshotCopyGrantName:DeleteSnapshotCopyGrant' :: Text
snapshotCopyGrantName =
        Text
pSnapshotCopyGrantName_
    }

-- | The name of the snapshot copy grant to delete.
deleteSnapshotCopyGrant_snapshotCopyGrantName :: Lens.Lens' DeleteSnapshotCopyGrant Prelude.Text
deleteSnapshotCopyGrant_snapshotCopyGrantName :: (Text -> f Text)
-> DeleteSnapshotCopyGrant -> f DeleteSnapshotCopyGrant
deleteSnapshotCopyGrant_snapshotCopyGrantName = (DeleteSnapshotCopyGrant -> Text)
-> (DeleteSnapshotCopyGrant -> Text -> DeleteSnapshotCopyGrant)
-> Lens DeleteSnapshotCopyGrant DeleteSnapshotCopyGrant Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSnapshotCopyGrant' {Text
snapshotCopyGrantName :: Text
$sel:snapshotCopyGrantName:DeleteSnapshotCopyGrant' :: DeleteSnapshotCopyGrant -> Text
snapshotCopyGrantName} -> Text
snapshotCopyGrantName) (\s :: DeleteSnapshotCopyGrant
s@DeleteSnapshotCopyGrant' {} Text
a -> DeleteSnapshotCopyGrant
s {$sel:snapshotCopyGrantName:DeleteSnapshotCopyGrant' :: Text
snapshotCopyGrantName = Text
a} :: DeleteSnapshotCopyGrant)

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

instance Prelude.Hashable DeleteSnapshotCopyGrant

instance Prelude.NFData DeleteSnapshotCopyGrant

instance Core.ToHeaders DeleteSnapshotCopyGrant where
  toHeaders :: DeleteSnapshotCopyGrant -> [Header]
toHeaders = [Header] -> DeleteSnapshotCopyGrant -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery DeleteSnapshotCopyGrant where
  toQuery :: DeleteSnapshotCopyGrant -> QueryString
toQuery DeleteSnapshotCopyGrant' {Text
snapshotCopyGrantName :: Text
$sel:snapshotCopyGrantName:DeleteSnapshotCopyGrant' :: DeleteSnapshotCopyGrant -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteSnapshotCopyGrant" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"SnapshotCopyGrantName"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
snapshotCopyGrantName
      ]

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

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

instance
  Prelude.NFData
    DeleteSnapshotCopyGrantResponse