{-# 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.CreateClusterSnapshot
-- 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)
--
-- Creates a manual snapshot of the specified cluster. The cluster must be
-- in the @available@ state.
--
-- For more information about working with snapshots, go to
-- <https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html Amazon Redshift Snapshots>
-- in the /Amazon Redshift Cluster Management Guide/.
module Amazonka.Redshift.CreateClusterSnapshot
  ( -- * Creating a Request
    CreateClusterSnapshot (..),
    newCreateClusterSnapshot,

    -- * Request Lenses
    createClusterSnapshot_manualSnapshotRetentionPeriod,
    createClusterSnapshot_tags,
    createClusterSnapshot_snapshotIdentifier,
    createClusterSnapshot_clusterIdentifier,

    -- * Destructuring the Response
    CreateClusterSnapshotResponse (..),
    newCreateClusterSnapshotResponse,

    -- * Response Lenses
    createClusterSnapshotResponse_snapshot,
    createClusterSnapshotResponse_httpStatus,
  )
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

-- |
--
-- /See:/ 'newCreateClusterSnapshot' smart constructor.
data CreateClusterSnapshot = CreateClusterSnapshot'
  { -- | The number of days that a manual snapshot is retained. If the value is
    -- -1, the manual snapshot is retained indefinitely.
    --
    -- The value must be either -1 or an integer between 1 and 3,653.
    --
    -- The default value is -1.
    CreateClusterSnapshot -> Maybe Int
manualSnapshotRetentionPeriod :: Prelude.Maybe Prelude.Int,
    -- | A list of tag instances.
    CreateClusterSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A unique identifier for the snapshot that you are requesting. This
    -- identifier must be unique for all snapshots within the Amazon Web
    -- Services account.
    --
    -- Constraints:
    --
    -- -   Cannot be null, empty, or blank
    --
    -- -   Must contain from 1 to 255 alphanumeric characters or hyphens
    --
    -- -   First character must be a letter
    --
    -- -   Cannot end with a hyphen or contain two consecutive hyphens
    --
    -- Example: @my-snapshot-id@
    CreateClusterSnapshot -> Text
snapshotIdentifier :: Prelude.Text,
    -- | The cluster identifier for which you want a snapshot.
    CreateClusterSnapshot -> Text
clusterIdentifier :: Prelude.Text
  }
  deriving (CreateClusterSnapshot -> CreateClusterSnapshot -> Bool
(CreateClusterSnapshot -> CreateClusterSnapshot -> Bool)
-> (CreateClusterSnapshot -> CreateClusterSnapshot -> Bool)
-> Eq CreateClusterSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterSnapshot -> CreateClusterSnapshot -> Bool
$c/= :: CreateClusterSnapshot -> CreateClusterSnapshot -> Bool
== :: CreateClusterSnapshot -> CreateClusterSnapshot -> Bool
$c== :: CreateClusterSnapshot -> CreateClusterSnapshot -> Bool
Prelude.Eq, ReadPrec [CreateClusterSnapshot]
ReadPrec CreateClusterSnapshot
Int -> ReadS CreateClusterSnapshot
ReadS [CreateClusterSnapshot]
(Int -> ReadS CreateClusterSnapshot)
-> ReadS [CreateClusterSnapshot]
-> ReadPrec CreateClusterSnapshot
-> ReadPrec [CreateClusterSnapshot]
-> Read CreateClusterSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterSnapshot]
$creadListPrec :: ReadPrec [CreateClusterSnapshot]
readPrec :: ReadPrec CreateClusterSnapshot
$creadPrec :: ReadPrec CreateClusterSnapshot
readList :: ReadS [CreateClusterSnapshot]
$creadList :: ReadS [CreateClusterSnapshot]
readsPrec :: Int -> ReadS CreateClusterSnapshot
$creadsPrec :: Int -> ReadS CreateClusterSnapshot
Prelude.Read, Int -> CreateClusterSnapshot -> ShowS
[CreateClusterSnapshot] -> ShowS
CreateClusterSnapshot -> String
(Int -> CreateClusterSnapshot -> ShowS)
-> (CreateClusterSnapshot -> String)
-> ([CreateClusterSnapshot] -> ShowS)
-> Show CreateClusterSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterSnapshot] -> ShowS
$cshowList :: [CreateClusterSnapshot] -> ShowS
show :: CreateClusterSnapshot -> String
$cshow :: CreateClusterSnapshot -> String
showsPrec :: Int -> CreateClusterSnapshot -> ShowS
$cshowsPrec :: Int -> CreateClusterSnapshot -> ShowS
Prelude.Show, (forall x. CreateClusterSnapshot -> Rep CreateClusterSnapshot x)
-> (forall x. Rep CreateClusterSnapshot x -> CreateClusterSnapshot)
-> Generic CreateClusterSnapshot
forall x. Rep CreateClusterSnapshot x -> CreateClusterSnapshot
forall x. CreateClusterSnapshot -> Rep CreateClusterSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateClusterSnapshot x -> CreateClusterSnapshot
$cfrom :: forall x. CreateClusterSnapshot -> Rep CreateClusterSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'CreateClusterSnapshot' 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:
--
-- 'manualSnapshotRetentionPeriod', 'createClusterSnapshot_manualSnapshotRetentionPeriod' - The number of days that a manual snapshot is retained. If the value is
-- -1, the manual snapshot is retained indefinitely.
--
-- The value must be either -1 or an integer between 1 and 3,653.
--
-- The default value is -1.
--
-- 'tags', 'createClusterSnapshot_tags' - A list of tag instances.
--
-- 'snapshotIdentifier', 'createClusterSnapshot_snapshotIdentifier' - A unique identifier for the snapshot that you are requesting. This
-- identifier must be unique for all snapshots within the Amazon Web
-- Services account.
--
-- Constraints:
--
-- -   Cannot be null, empty, or blank
--
-- -   Must contain from 1 to 255 alphanumeric characters or hyphens
--
-- -   First character must be a letter
--
-- -   Cannot end with a hyphen or contain two consecutive hyphens
--
-- Example: @my-snapshot-id@
--
-- 'clusterIdentifier', 'createClusterSnapshot_clusterIdentifier' - The cluster identifier for which you want a snapshot.
newCreateClusterSnapshot ::
  -- | 'snapshotIdentifier'
  Prelude.Text ->
  -- | 'clusterIdentifier'
  Prelude.Text ->
  CreateClusterSnapshot
newCreateClusterSnapshot :: Text -> Text -> CreateClusterSnapshot
newCreateClusterSnapshot
  Text
pSnapshotIdentifier_
  Text
pClusterIdentifier_ =
    CreateClusterSnapshot' :: Maybe Int -> Maybe [Tag] -> Text -> Text -> CreateClusterSnapshot
CreateClusterSnapshot'
      { $sel:manualSnapshotRetentionPeriod:CreateClusterSnapshot' :: Maybe Int
manualSnapshotRetentionPeriod =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateClusterSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotIdentifier:CreateClusterSnapshot' :: Text
snapshotIdentifier = Text
pSnapshotIdentifier_,
        $sel:clusterIdentifier:CreateClusterSnapshot' :: Text
clusterIdentifier = Text
pClusterIdentifier_
      }

-- | The number of days that a manual snapshot is retained. If the value is
-- -1, the manual snapshot is retained indefinitely.
--
-- The value must be either -1 or an integer between 1 and 3,653.
--
-- The default value is -1.
createClusterSnapshot_manualSnapshotRetentionPeriod :: Lens.Lens' CreateClusterSnapshot (Prelude.Maybe Prelude.Int)
createClusterSnapshot_manualSnapshotRetentionPeriod :: (Maybe Int -> f (Maybe Int))
-> CreateClusterSnapshot -> f CreateClusterSnapshot
createClusterSnapshot_manualSnapshotRetentionPeriod = (CreateClusterSnapshot -> Maybe Int)
-> (CreateClusterSnapshot -> Maybe Int -> CreateClusterSnapshot)
-> Lens
     CreateClusterSnapshot CreateClusterSnapshot (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSnapshot' {Maybe Int
manualSnapshotRetentionPeriod :: Maybe Int
$sel:manualSnapshotRetentionPeriod:CreateClusterSnapshot' :: CreateClusterSnapshot -> Maybe Int
manualSnapshotRetentionPeriod} -> Maybe Int
manualSnapshotRetentionPeriod) (\s :: CreateClusterSnapshot
s@CreateClusterSnapshot' {} Maybe Int
a -> CreateClusterSnapshot
s {$sel:manualSnapshotRetentionPeriod:CreateClusterSnapshot' :: Maybe Int
manualSnapshotRetentionPeriod = Maybe Int
a} :: CreateClusterSnapshot)

-- | A list of tag instances.
createClusterSnapshot_tags :: Lens.Lens' CreateClusterSnapshot (Prelude.Maybe [Tag])
createClusterSnapshot_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateClusterSnapshot -> f CreateClusterSnapshot
createClusterSnapshot_tags = (CreateClusterSnapshot -> Maybe [Tag])
-> (CreateClusterSnapshot -> Maybe [Tag] -> CreateClusterSnapshot)
-> Lens
     CreateClusterSnapshot
     CreateClusterSnapshot
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateClusterSnapshot' :: CreateClusterSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateClusterSnapshot
s@CreateClusterSnapshot' {} Maybe [Tag]
a -> CreateClusterSnapshot
s {$sel:tags:CreateClusterSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateClusterSnapshot) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateClusterSnapshot -> f CreateClusterSnapshot)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateClusterSnapshot
-> f CreateClusterSnapshot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique identifier for the snapshot that you are requesting. This
-- identifier must be unique for all snapshots within the Amazon Web
-- Services account.
--
-- Constraints:
--
-- -   Cannot be null, empty, or blank
--
-- -   Must contain from 1 to 255 alphanumeric characters or hyphens
--
-- -   First character must be a letter
--
-- -   Cannot end with a hyphen or contain two consecutive hyphens
--
-- Example: @my-snapshot-id@
createClusterSnapshot_snapshotIdentifier :: Lens.Lens' CreateClusterSnapshot Prelude.Text
createClusterSnapshot_snapshotIdentifier :: (Text -> f Text)
-> CreateClusterSnapshot -> f CreateClusterSnapshot
createClusterSnapshot_snapshotIdentifier = (CreateClusterSnapshot -> Text)
-> (CreateClusterSnapshot -> Text -> CreateClusterSnapshot)
-> Lens CreateClusterSnapshot CreateClusterSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSnapshot' {Text
snapshotIdentifier :: Text
$sel:snapshotIdentifier:CreateClusterSnapshot' :: CreateClusterSnapshot -> Text
snapshotIdentifier} -> Text
snapshotIdentifier) (\s :: CreateClusterSnapshot
s@CreateClusterSnapshot' {} Text
a -> CreateClusterSnapshot
s {$sel:snapshotIdentifier:CreateClusterSnapshot' :: Text
snapshotIdentifier = Text
a} :: CreateClusterSnapshot)

-- | The cluster identifier for which you want a snapshot.
createClusterSnapshot_clusterIdentifier :: Lens.Lens' CreateClusterSnapshot Prelude.Text
createClusterSnapshot_clusterIdentifier :: (Text -> f Text)
-> CreateClusterSnapshot -> f CreateClusterSnapshot
createClusterSnapshot_clusterIdentifier = (CreateClusterSnapshot -> Text)
-> (CreateClusterSnapshot -> Text -> CreateClusterSnapshot)
-> Lens CreateClusterSnapshot CreateClusterSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSnapshot' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:CreateClusterSnapshot' :: CreateClusterSnapshot -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: CreateClusterSnapshot
s@CreateClusterSnapshot' {} Text
a -> CreateClusterSnapshot
s {$sel:clusterIdentifier:CreateClusterSnapshot' :: Text
clusterIdentifier = Text
a} :: CreateClusterSnapshot)

instance Core.AWSRequest CreateClusterSnapshot where
  type
    AWSResponse CreateClusterSnapshot =
      CreateClusterSnapshotResponse
  request :: CreateClusterSnapshot -> Request CreateClusterSnapshot
request = Service -> CreateClusterSnapshot -> Request CreateClusterSnapshot
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateClusterSnapshot
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateClusterSnapshot)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse CreateClusterSnapshot))
-> Logger
-> Service
-> Proxy CreateClusterSnapshot
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateClusterSnapshot)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateClusterSnapshotResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Snapshot -> Int -> CreateClusterSnapshotResponse
CreateClusterSnapshotResponse'
            (Maybe Snapshot -> Int -> CreateClusterSnapshotResponse)
-> Either String (Maybe Snapshot)
-> Either String (Int -> CreateClusterSnapshotResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Snapshot)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Snapshot")
            Either String (Int -> CreateClusterSnapshotResponse)
-> Either String Int -> Either String CreateClusterSnapshotResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateClusterSnapshot

instance Prelude.NFData CreateClusterSnapshot

instance Core.ToHeaders CreateClusterSnapshot where
  toHeaders :: CreateClusterSnapshot -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateClusterSnapshot -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery CreateClusterSnapshot where
  toQuery :: CreateClusterSnapshot -> QueryString
toQuery CreateClusterSnapshot' {Maybe Int
Maybe [Tag]
Text
clusterIdentifier :: Text
snapshotIdentifier :: Text
tags :: Maybe [Tag]
manualSnapshotRetentionPeriod :: Maybe Int
$sel:clusterIdentifier:CreateClusterSnapshot' :: CreateClusterSnapshot -> Text
$sel:snapshotIdentifier:CreateClusterSnapshot' :: CreateClusterSnapshot -> Text
$sel:tags:CreateClusterSnapshot' :: CreateClusterSnapshot -> Maybe [Tag]
$sel:manualSnapshotRetentionPeriod:CreateClusterSnapshot' :: CreateClusterSnapshot -> Maybe Int
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateClusterSnapshot" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"ManualSnapshotRetentionPeriod"
          ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
manualSnapshotRetentionPeriod,
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Tag" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"SnapshotIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
snapshotIdentifier,
        ByteString
"ClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clusterIdentifier
      ]

-- | /See:/ 'newCreateClusterSnapshotResponse' smart constructor.
data CreateClusterSnapshotResponse = CreateClusterSnapshotResponse'
  { CreateClusterSnapshotResponse -> Maybe Snapshot
snapshot :: Prelude.Maybe Snapshot,
    -- | The response's http status code.
    CreateClusterSnapshotResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateClusterSnapshotResponse
-> CreateClusterSnapshotResponse -> Bool
(CreateClusterSnapshotResponse
 -> CreateClusterSnapshotResponse -> Bool)
-> (CreateClusterSnapshotResponse
    -> CreateClusterSnapshotResponse -> Bool)
-> Eq CreateClusterSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterSnapshotResponse
-> CreateClusterSnapshotResponse -> Bool
$c/= :: CreateClusterSnapshotResponse
-> CreateClusterSnapshotResponse -> Bool
== :: CreateClusterSnapshotResponse
-> CreateClusterSnapshotResponse -> Bool
$c== :: CreateClusterSnapshotResponse
-> CreateClusterSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [CreateClusterSnapshotResponse]
ReadPrec CreateClusterSnapshotResponse
Int -> ReadS CreateClusterSnapshotResponse
ReadS [CreateClusterSnapshotResponse]
(Int -> ReadS CreateClusterSnapshotResponse)
-> ReadS [CreateClusterSnapshotResponse]
-> ReadPrec CreateClusterSnapshotResponse
-> ReadPrec [CreateClusterSnapshotResponse]
-> Read CreateClusterSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterSnapshotResponse]
$creadListPrec :: ReadPrec [CreateClusterSnapshotResponse]
readPrec :: ReadPrec CreateClusterSnapshotResponse
$creadPrec :: ReadPrec CreateClusterSnapshotResponse
readList :: ReadS [CreateClusterSnapshotResponse]
$creadList :: ReadS [CreateClusterSnapshotResponse]
readsPrec :: Int -> ReadS CreateClusterSnapshotResponse
$creadsPrec :: Int -> ReadS CreateClusterSnapshotResponse
Prelude.Read, Int -> CreateClusterSnapshotResponse -> ShowS
[CreateClusterSnapshotResponse] -> ShowS
CreateClusterSnapshotResponse -> String
(Int -> CreateClusterSnapshotResponse -> ShowS)
-> (CreateClusterSnapshotResponse -> String)
-> ([CreateClusterSnapshotResponse] -> ShowS)
-> Show CreateClusterSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterSnapshotResponse] -> ShowS
$cshowList :: [CreateClusterSnapshotResponse] -> ShowS
show :: CreateClusterSnapshotResponse -> String
$cshow :: CreateClusterSnapshotResponse -> String
showsPrec :: Int -> CreateClusterSnapshotResponse -> ShowS
$cshowsPrec :: Int -> CreateClusterSnapshotResponse -> ShowS
Prelude.Show, (forall x.
 CreateClusterSnapshotResponse
 -> Rep CreateClusterSnapshotResponse x)
-> (forall x.
    Rep CreateClusterSnapshotResponse x
    -> CreateClusterSnapshotResponse)
-> Generic CreateClusterSnapshotResponse
forall x.
Rep CreateClusterSnapshotResponse x
-> CreateClusterSnapshotResponse
forall x.
CreateClusterSnapshotResponse
-> Rep CreateClusterSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateClusterSnapshotResponse x
-> CreateClusterSnapshotResponse
$cfrom :: forall x.
CreateClusterSnapshotResponse
-> Rep CreateClusterSnapshotResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateClusterSnapshotResponse' 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:
--
-- 'snapshot', 'createClusterSnapshotResponse_snapshot' - Undocumented member.
--
-- 'httpStatus', 'createClusterSnapshotResponse_httpStatus' - The response's http status code.
newCreateClusterSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateClusterSnapshotResponse
newCreateClusterSnapshotResponse :: Int -> CreateClusterSnapshotResponse
newCreateClusterSnapshotResponse Int
pHttpStatus_ =
  CreateClusterSnapshotResponse' :: Maybe Snapshot -> Int -> CreateClusterSnapshotResponse
CreateClusterSnapshotResponse'
    { $sel:snapshot:CreateClusterSnapshotResponse' :: Maybe Snapshot
snapshot =
        Maybe Snapshot
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateClusterSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createClusterSnapshotResponse_snapshot :: Lens.Lens' CreateClusterSnapshotResponse (Prelude.Maybe Snapshot)
createClusterSnapshotResponse_snapshot :: (Maybe Snapshot -> f (Maybe Snapshot))
-> CreateClusterSnapshotResponse -> f CreateClusterSnapshotResponse
createClusterSnapshotResponse_snapshot = (CreateClusterSnapshotResponse -> Maybe Snapshot)
-> (CreateClusterSnapshotResponse
    -> Maybe Snapshot -> CreateClusterSnapshotResponse)
-> Lens
     CreateClusterSnapshotResponse
     CreateClusterSnapshotResponse
     (Maybe Snapshot)
     (Maybe Snapshot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSnapshotResponse' {Maybe Snapshot
snapshot :: Maybe Snapshot
$sel:snapshot:CreateClusterSnapshotResponse' :: CreateClusterSnapshotResponse -> Maybe Snapshot
snapshot} -> Maybe Snapshot
snapshot) (\s :: CreateClusterSnapshotResponse
s@CreateClusterSnapshotResponse' {} Maybe Snapshot
a -> CreateClusterSnapshotResponse
s {$sel:snapshot:CreateClusterSnapshotResponse' :: Maybe Snapshot
snapshot = Maybe Snapshot
a} :: CreateClusterSnapshotResponse)

-- | The response's http status code.
createClusterSnapshotResponse_httpStatus :: Lens.Lens' CreateClusterSnapshotResponse Prelude.Int
createClusterSnapshotResponse_httpStatus :: (Int -> f Int)
-> CreateClusterSnapshotResponse -> f CreateClusterSnapshotResponse
createClusterSnapshotResponse_httpStatus = (CreateClusterSnapshotResponse -> Int)
-> (CreateClusterSnapshotResponse
    -> Int -> CreateClusterSnapshotResponse)
-> Lens
     CreateClusterSnapshotResponse CreateClusterSnapshotResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateClusterSnapshotResponse' :: CreateClusterSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateClusterSnapshotResponse
s@CreateClusterSnapshotResponse' {} Int
a -> CreateClusterSnapshotResponse
s {$sel:httpStatus:CreateClusterSnapshotResponse' :: Int
httpStatus = Int
a} :: CreateClusterSnapshotResponse)

instance Prelude.NFData CreateClusterSnapshotResponse