{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.DeleteClusterSnapshotMessage
-- 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)
module Amazonka.Redshift.Types.DeleteClusterSnapshotMessage where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal

-- |
--
-- /See:/ 'newDeleteClusterSnapshotMessage' smart constructor.
data DeleteClusterSnapshotMessage = DeleteClusterSnapshotMessage'
  { -- | The unique identifier of the cluster the snapshot was created from. This
    -- parameter is required if your IAM user has a policy containing a
    -- snapshot resource element that specifies anything other than * for the
    -- cluster name.
    --
    -- Constraints: Must be the name of valid cluster.
    DeleteClusterSnapshotMessage -> Maybe Text
snapshotClusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the manual snapshot to be deleted.
    --
    -- Constraints: Must be the name of an existing snapshot that is in the
    -- @available@, @failed@, or @cancelled@ state.
    DeleteClusterSnapshotMessage -> Text
snapshotIdentifier :: Prelude.Text
  }
  deriving (DeleteClusterSnapshotMessage
-> DeleteClusterSnapshotMessage -> Bool
(DeleteClusterSnapshotMessage
 -> DeleteClusterSnapshotMessage -> Bool)
-> (DeleteClusterSnapshotMessage
    -> DeleteClusterSnapshotMessage -> Bool)
-> Eq DeleteClusterSnapshotMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteClusterSnapshotMessage
-> DeleteClusterSnapshotMessage -> Bool
$c/= :: DeleteClusterSnapshotMessage
-> DeleteClusterSnapshotMessage -> Bool
== :: DeleteClusterSnapshotMessage
-> DeleteClusterSnapshotMessage -> Bool
$c== :: DeleteClusterSnapshotMessage
-> DeleteClusterSnapshotMessage -> Bool
Prelude.Eq, ReadPrec [DeleteClusterSnapshotMessage]
ReadPrec DeleteClusterSnapshotMessage
Int -> ReadS DeleteClusterSnapshotMessage
ReadS [DeleteClusterSnapshotMessage]
(Int -> ReadS DeleteClusterSnapshotMessage)
-> ReadS [DeleteClusterSnapshotMessage]
-> ReadPrec DeleteClusterSnapshotMessage
-> ReadPrec [DeleteClusterSnapshotMessage]
-> Read DeleteClusterSnapshotMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteClusterSnapshotMessage]
$creadListPrec :: ReadPrec [DeleteClusterSnapshotMessage]
readPrec :: ReadPrec DeleteClusterSnapshotMessage
$creadPrec :: ReadPrec DeleteClusterSnapshotMessage
readList :: ReadS [DeleteClusterSnapshotMessage]
$creadList :: ReadS [DeleteClusterSnapshotMessage]
readsPrec :: Int -> ReadS DeleteClusterSnapshotMessage
$creadsPrec :: Int -> ReadS DeleteClusterSnapshotMessage
Prelude.Read, Int -> DeleteClusterSnapshotMessage -> ShowS
[DeleteClusterSnapshotMessage] -> ShowS
DeleteClusterSnapshotMessage -> String
(Int -> DeleteClusterSnapshotMessage -> ShowS)
-> (DeleteClusterSnapshotMessage -> String)
-> ([DeleteClusterSnapshotMessage] -> ShowS)
-> Show DeleteClusterSnapshotMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteClusterSnapshotMessage] -> ShowS
$cshowList :: [DeleteClusterSnapshotMessage] -> ShowS
show :: DeleteClusterSnapshotMessage -> String
$cshow :: DeleteClusterSnapshotMessage -> String
showsPrec :: Int -> DeleteClusterSnapshotMessage -> ShowS
$cshowsPrec :: Int -> DeleteClusterSnapshotMessage -> ShowS
Prelude.Show, (forall x.
 DeleteClusterSnapshotMessage -> Rep DeleteClusterSnapshotMessage x)
-> (forall x.
    Rep DeleteClusterSnapshotMessage x -> DeleteClusterSnapshotMessage)
-> Generic DeleteClusterSnapshotMessage
forall x.
Rep DeleteClusterSnapshotMessage x -> DeleteClusterSnapshotMessage
forall x.
DeleteClusterSnapshotMessage -> Rep DeleteClusterSnapshotMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteClusterSnapshotMessage x -> DeleteClusterSnapshotMessage
$cfrom :: forall x.
DeleteClusterSnapshotMessage -> Rep DeleteClusterSnapshotMessage x
Prelude.Generic)

-- |
-- Create a value of 'DeleteClusterSnapshotMessage' 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:
--
-- 'snapshotClusterIdentifier', 'deleteClusterSnapshotMessage_snapshotClusterIdentifier' - The unique identifier of the cluster the snapshot was created from. This
-- parameter is required if your IAM user has a policy containing a
-- snapshot resource element that specifies anything other than * for the
-- cluster name.
--
-- Constraints: Must be the name of valid cluster.
--
-- 'snapshotIdentifier', 'deleteClusterSnapshotMessage_snapshotIdentifier' - The unique identifier of the manual snapshot to be deleted.
--
-- Constraints: Must be the name of an existing snapshot that is in the
-- @available@, @failed@, or @cancelled@ state.
newDeleteClusterSnapshotMessage ::
  -- | 'snapshotIdentifier'
  Prelude.Text ->
  DeleteClusterSnapshotMessage
newDeleteClusterSnapshotMessage :: Text -> DeleteClusterSnapshotMessage
newDeleteClusterSnapshotMessage Text
pSnapshotIdentifier_ =
  DeleteClusterSnapshotMessage' :: Maybe Text -> Text -> DeleteClusterSnapshotMessage
DeleteClusterSnapshotMessage'
    { $sel:snapshotClusterIdentifier:DeleteClusterSnapshotMessage' :: Maybe Text
snapshotClusterIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotIdentifier:DeleteClusterSnapshotMessage' :: Text
snapshotIdentifier = Text
pSnapshotIdentifier_
    }

-- | The unique identifier of the cluster the snapshot was created from. This
-- parameter is required if your IAM user has a policy containing a
-- snapshot resource element that specifies anything other than * for the
-- cluster name.
--
-- Constraints: Must be the name of valid cluster.
deleteClusterSnapshotMessage_snapshotClusterIdentifier :: Lens.Lens' DeleteClusterSnapshotMessage (Prelude.Maybe Prelude.Text)
deleteClusterSnapshotMessage_snapshotClusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> DeleteClusterSnapshotMessage -> f DeleteClusterSnapshotMessage
deleteClusterSnapshotMessage_snapshotClusterIdentifier = (DeleteClusterSnapshotMessage -> Maybe Text)
-> (DeleteClusterSnapshotMessage
    -> Maybe Text -> DeleteClusterSnapshotMessage)
-> Lens
     DeleteClusterSnapshotMessage
     DeleteClusterSnapshotMessage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClusterSnapshotMessage' {Maybe Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotClusterIdentifier:DeleteClusterSnapshotMessage' :: DeleteClusterSnapshotMessage -> Maybe Text
snapshotClusterIdentifier} -> Maybe Text
snapshotClusterIdentifier) (\s :: DeleteClusterSnapshotMessage
s@DeleteClusterSnapshotMessage' {} Maybe Text
a -> DeleteClusterSnapshotMessage
s {$sel:snapshotClusterIdentifier:DeleteClusterSnapshotMessage' :: Maybe Text
snapshotClusterIdentifier = Maybe Text
a} :: DeleteClusterSnapshotMessage)

-- | The unique identifier of the manual snapshot to be deleted.
--
-- Constraints: Must be the name of an existing snapshot that is in the
-- @available@, @failed@, or @cancelled@ state.
deleteClusterSnapshotMessage_snapshotIdentifier :: Lens.Lens' DeleteClusterSnapshotMessage Prelude.Text
deleteClusterSnapshotMessage_snapshotIdentifier :: (Text -> f Text)
-> DeleteClusterSnapshotMessage -> f DeleteClusterSnapshotMessage
deleteClusterSnapshotMessage_snapshotIdentifier = (DeleteClusterSnapshotMessage -> Text)
-> (DeleteClusterSnapshotMessage
    -> Text -> DeleteClusterSnapshotMessage)
-> Lens
     DeleteClusterSnapshotMessage DeleteClusterSnapshotMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClusterSnapshotMessage' {Text
snapshotIdentifier :: Text
$sel:snapshotIdentifier:DeleteClusterSnapshotMessage' :: DeleteClusterSnapshotMessage -> Text
snapshotIdentifier} -> Text
snapshotIdentifier) (\s :: DeleteClusterSnapshotMessage
s@DeleteClusterSnapshotMessage' {} Text
a -> DeleteClusterSnapshotMessage
s {$sel:snapshotIdentifier:DeleteClusterSnapshotMessage' :: Text
snapshotIdentifier = Text
a} :: DeleteClusterSnapshotMessage)

instance
  Prelude.Hashable
    DeleteClusterSnapshotMessage

instance Prelude.NFData DeleteClusterSnapshotMessage

instance Core.ToQuery DeleteClusterSnapshotMessage where
  toQuery :: DeleteClusterSnapshotMessage -> QueryString
toQuery DeleteClusterSnapshotMessage' {Maybe Text
Text
snapshotIdentifier :: Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotIdentifier:DeleteClusterSnapshotMessage' :: DeleteClusterSnapshotMessage -> Text
$sel:snapshotClusterIdentifier:DeleteClusterSnapshotMessage' :: DeleteClusterSnapshotMessage -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"SnapshotClusterIdentifier"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
snapshotClusterIdentifier,
        ByteString
"SnapshotIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
snapshotIdentifier
      ]