{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Redshift.Types.DeleteClusterSnapshotMessage where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:snapshotClusterIdentifier:DeleteClusterSnapshotMessage' :: Maybe Text
snapshotClusterIdentifier =
        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 :: Lens' DeleteClusterSnapshotMessage (Maybe Text)
deleteClusterSnapshotMessage_snapshotClusterIdentifier = 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 :: Lens' DeleteClusterSnapshotMessage Text
deleteClusterSnapshotMessage_snapshotIdentifier = 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
  where
  hashWithSalt :: Int -> DeleteClusterSnapshotMessage -> Int
hashWithSalt Int
_salt DeleteClusterSnapshotMessage' {Maybe Text
Text
snapshotIdentifier :: Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotIdentifier:DeleteClusterSnapshotMessage' :: DeleteClusterSnapshotMessage -> Text
$sel:snapshotClusterIdentifier:DeleteClusterSnapshotMessage' :: DeleteClusterSnapshotMessage -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotClusterIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotIdentifier

instance Prelude.NFData DeleteClusterSnapshotMessage where
  rnf :: DeleteClusterSnapshotMessage -> ()
rnf DeleteClusterSnapshotMessage' {Maybe Text
Text
snapshotIdentifier :: Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotIdentifier:DeleteClusterSnapshotMessage' :: DeleteClusterSnapshotMessage -> Text
$sel:snapshotClusterIdentifier:DeleteClusterSnapshotMessage' :: DeleteClusterSnapshotMessage -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotClusterIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotIdentifier

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"SnapshotClusterIdentifier"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
snapshotClusterIdentifier,
        ByteString
"SnapshotIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
snapshotIdentifier
      ]