{-# 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.DescribeClusterSnapshots
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns one or more snapshot objects, which contain metadata about your
-- cluster snapshots. By default, this operation returns information about
-- all snapshots of all clusters that are owned by your Amazon Web Services
-- account. No information is returned for snapshots owned by inactive
-- Amazon Web Services accounts.
--
-- If you specify both tag keys and tag values in the same request, Amazon
-- Redshift returns all snapshots that match any combination of the
-- specified keys and values. For example, if you have @owner@ and
-- @environment@ for tag keys, and @admin@ and @test@ for tag values, all
-- snapshots that have any combination of those values are returned. Only
-- snapshots that you own are returned in the response; shared snapshots
-- are not returned with the tag key and tag value request parameters.
--
-- If both tag keys and values are omitted from the request, snapshots are
-- returned regardless of whether they have tag keys or values associated
-- with them.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeClusterSnapshots
  ( -- * Creating a Request
    DescribeClusterSnapshots (..),
    newDescribeClusterSnapshots,

    -- * Request Lenses
    describeClusterSnapshots_clusterExists,
    describeClusterSnapshots_clusterIdentifier,
    describeClusterSnapshots_endTime,
    describeClusterSnapshots_marker,
    describeClusterSnapshots_maxRecords,
    describeClusterSnapshots_ownerAccount,
    describeClusterSnapshots_snapshotArn,
    describeClusterSnapshots_snapshotIdentifier,
    describeClusterSnapshots_snapshotType,
    describeClusterSnapshots_sortingEntities,
    describeClusterSnapshots_startTime,
    describeClusterSnapshots_tagKeys,
    describeClusterSnapshots_tagValues,

    -- * Destructuring the Response
    DescribeClusterSnapshotsResponse (..),
    newDescribeClusterSnapshotsResponse,

    -- * Response Lenses
    describeClusterSnapshotsResponse_marker,
    describeClusterSnapshotsResponse_snapshots,
    describeClusterSnapshotsResponse_httpStatus,
  )
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.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newDescribeClusterSnapshots' smart constructor.
data DescribeClusterSnapshots = DescribeClusterSnapshots'
  { -- | A value that indicates whether to return snapshots only for an existing
    -- cluster. You can perform table-level restore only by using a snapshot of
    -- an existing cluster, that is, a cluster that has not been deleted.
    -- Values for this parameter work as follows:
    --
    -- -   If @ClusterExists@ is set to @true@, @ClusterIdentifier@ is
    --     required.
    --
    -- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ isn\'t
    --     specified, all snapshots associated with deleted clusters (orphaned
    --     snapshots) are returned.
    --
    -- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ is
    --     specified for a deleted cluster, snapshots associated with that
    --     cluster are returned.
    --
    -- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ is
    --     specified for an existing cluster, no snapshots are returned.
    DescribeClusterSnapshots -> Maybe Bool
clusterExists :: Prelude.Maybe Prelude.Bool,
    -- | The identifier of the cluster which generated the requested snapshots.
    DescribeClusterSnapshots -> Maybe Text
clusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | A time value that requests only snapshots created at or before the
    -- specified time. The time value is specified in ISO 8601 format. For more
    -- information about ISO 8601, go to the
    -- <http://en.wikipedia.org/wiki/ISO_8601 ISO8601 Wikipedia page.>
    --
    -- Example: @2012-07-16T18:00:00Z@
    DescribeClusterSnapshots -> Maybe ISO8601
endTime :: Prelude.Maybe Data.ISO8601,
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeClusterSnapshots
    -- request exceed the value specified in @MaxRecords@, Amazon Web Services
    -- returns a value in the @Marker@ field of the response. You can retrieve
    -- the next set of response records by providing the returned marker value
    -- in the @Marker@ parameter and retrying the request.
    DescribeClusterSnapshots -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of response records to return in each call. If the
    -- number of remaining response records exceeds the specified @MaxRecords@
    -- value, a value is returned in a @marker@ field of the response. You can
    -- retrieve the next set of records by retrying the command with the
    -- returned marker value.
    --
    -- Default: @100@
    --
    -- Constraints: minimum 20, maximum 100.
    DescribeClusterSnapshots -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Web Services account used to create or copy the snapshot. Use
    -- this field to filter the results to snapshots owned by a particular
    -- account. To describe snapshots you own, either specify your Amazon Web
    -- Services account, or do not specify the parameter.
    DescribeClusterSnapshots -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the snapshot associated with the
    -- message to describe cluster snapshots.
    DescribeClusterSnapshots -> Maybe Text
snapshotArn :: Prelude.Maybe Prelude.Text,
    -- | The snapshot identifier of the snapshot about which to return
    -- information.
    DescribeClusterSnapshots -> Maybe Text
snapshotIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The type of snapshots for which you are requesting information. By
    -- default, snapshots of all types are returned.
    --
    -- Valid Values: @automated@ | @manual@
    DescribeClusterSnapshots -> Maybe Text
snapshotType :: Prelude.Maybe Prelude.Text,
    DescribeClusterSnapshots -> Maybe [SnapshotSortingEntity]
sortingEntities :: Prelude.Maybe [SnapshotSortingEntity],
    -- | A value that requests only snapshots created at or after the specified
    -- time. The time value is specified in ISO 8601 format. For more
    -- information about ISO 8601, go to the
    -- <http://en.wikipedia.org/wiki/ISO_8601 ISO8601 Wikipedia page.>
    --
    -- Example: @2012-07-16T18:00:00Z@
    DescribeClusterSnapshots -> Maybe ISO8601
startTime :: Prelude.Maybe Data.ISO8601,
    -- | A tag key or keys for which you want to return all matching cluster
    -- snapshots that are associated with the specified key or keys. For
    -- example, suppose that you have snapshots that are tagged with keys
    -- called @owner@ and @environment@. If you specify both of these tag keys
    -- in the request, Amazon Redshift returns a response with the snapshots
    -- that have either or both of these tag keys associated with them.
    DescribeClusterSnapshots -> Maybe [Text]
tagKeys :: Prelude.Maybe [Prelude.Text],
    -- | A tag value or values for which you want to return all matching cluster
    -- snapshots that are associated with the specified tag value or values.
    -- For example, suppose that you have snapshots that are tagged with values
    -- called @admin@ and @test@. If you specify both of these tag values in
    -- the request, Amazon Redshift returns a response with the snapshots that
    -- have either or both of these tag values associated with them.
    DescribeClusterSnapshots -> Maybe [Text]
tagValues :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeClusterSnapshots -> DescribeClusterSnapshots -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeClusterSnapshots -> DescribeClusterSnapshots -> Bool
$c/= :: DescribeClusterSnapshots -> DescribeClusterSnapshots -> Bool
== :: DescribeClusterSnapshots -> DescribeClusterSnapshots -> Bool
$c== :: DescribeClusterSnapshots -> DescribeClusterSnapshots -> Bool
Prelude.Eq, ReadPrec [DescribeClusterSnapshots]
ReadPrec DescribeClusterSnapshots
Int -> ReadS DescribeClusterSnapshots
ReadS [DescribeClusterSnapshots]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeClusterSnapshots]
$creadListPrec :: ReadPrec [DescribeClusterSnapshots]
readPrec :: ReadPrec DescribeClusterSnapshots
$creadPrec :: ReadPrec DescribeClusterSnapshots
readList :: ReadS [DescribeClusterSnapshots]
$creadList :: ReadS [DescribeClusterSnapshots]
readsPrec :: Int -> ReadS DescribeClusterSnapshots
$creadsPrec :: Int -> ReadS DescribeClusterSnapshots
Prelude.Read, Int -> DescribeClusterSnapshots -> ShowS
[DescribeClusterSnapshots] -> ShowS
DescribeClusterSnapshots -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeClusterSnapshots] -> ShowS
$cshowList :: [DescribeClusterSnapshots] -> ShowS
show :: DescribeClusterSnapshots -> String
$cshow :: DescribeClusterSnapshots -> String
showsPrec :: Int -> DescribeClusterSnapshots -> ShowS
$cshowsPrec :: Int -> DescribeClusterSnapshots -> ShowS
Prelude.Show, forall x.
Rep DescribeClusterSnapshots x -> DescribeClusterSnapshots
forall x.
DescribeClusterSnapshots -> Rep DescribeClusterSnapshots x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeClusterSnapshots x -> DescribeClusterSnapshots
$cfrom :: forall x.
DescribeClusterSnapshots -> Rep DescribeClusterSnapshots x
Prelude.Generic)

-- |
-- Create a value of 'DescribeClusterSnapshots' 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:
--
-- 'clusterExists', 'describeClusterSnapshots_clusterExists' - A value that indicates whether to return snapshots only for an existing
-- cluster. You can perform table-level restore only by using a snapshot of
-- an existing cluster, that is, a cluster that has not been deleted.
-- Values for this parameter work as follows:
--
-- -   If @ClusterExists@ is set to @true@, @ClusterIdentifier@ is
--     required.
--
-- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ isn\'t
--     specified, all snapshots associated with deleted clusters (orphaned
--     snapshots) are returned.
--
-- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ is
--     specified for a deleted cluster, snapshots associated with that
--     cluster are returned.
--
-- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ is
--     specified for an existing cluster, no snapshots are returned.
--
-- 'clusterIdentifier', 'describeClusterSnapshots_clusterIdentifier' - The identifier of the cluster which generated the requested snapshots.
--
-- 'endTime', 'describeClusterSnapshots_endTime' - A time value that requests only snapshots created at or before the
-- specified time. The time value is specified in ISO 8601 format. For more
-- information about ISO 8601, go to the
-- <http://en.wikipedia.org/wiki/ISO_8601 ISO8601 Wikipedia page.>
--
-- Example: @2012-07-16T18:00:00Z@
--
-- 'marker', 'describeClusterSnapshots_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeClusterSnapshots
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- 'maxRecords', 'describeClusterSnapshots_maxRecords' - The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
--
-- 'ownerAccount', 'describeClusterSnapshots_ownerAccount' - The Amazon Web Services account used to create or copy the snapshot. Use
-- this field to filter the results to snapshots owned by a particular
-- account. To describe snapshots you own, either specify your Amazon Web
-- Services account, or do not specify the parameter.
--
-- 'snapshotArn', 'describeClusterSnapshots_snapshotArn' - The Amazon Resource Name (ARN) of the snapshot associated with the
-- message to describe cluster snapshots.
--
-- 'snapshotIdentifier', 'describeClusterSnapshots_snapshotIdentifier' - The snapshot identifier of the snapshot about which to return
-- information.
--
-- 'snapshotType', 'describeClusterSnapshots_snapshotType' - The type of snapshots for which you are requesting information. By
-- default, snapshots of all types are returned.
--
-- Valid Values: @automated@ | @manual@
--
-- 'sortingEntities', 'describeClusterSnapshots_sortingEntities' -
--
-- 'startTime', 'describeClusterSnapshots_startTime' - A value that requests only snapshots created at or after the specified
-- time. The time value is specified in ISO 8601 format. For more
-- information about ISO 8601, go to the
-- <http://en.wikipedia.org/wiki/ISO_8601 ISO8601 Wikipedia page.>
--
-- Example: @2012-07-16T18:00:00Z@
--
-- 'tagKeys', 'describeClusterSnapshots_tagKeys' - A tag key or keys for which you want to return all matching cluster
-- snapshots that are associated with the specified key or keys. For
-- example, suppose that you have snapshots that are tagged with keys
-- called @owner@ and @environment@. If you specify both of these tag keys
-- in the request, Amazon Redshift returns a response with the snapshots
-- that have either or both of these tag keys associated with them.
--
-- 'tagValues', 'describeClusterSnapshots_tagValues' - A tag value or values for which you want to return all matching cluster
-- snapshots that are associated with the specified tag value or values.
-- For example, suppose that you have snapshots that are tagged with values
-- called @admin@ and @test@. If you specify both of these tag values in
-- the request, Amazon Redshift returns a response with the snapshots that
-- have either or both of these tag values associated with them.
newDescribeClusterSnapshots ::
  DescribeClusterSnapshots
newDescribeClusterSnapshots :: DescribeClusterSnapshots
newDescribeClusterSnapshots =
  DescribeClusterSnapshots'
    { $sel:clusterExists:DescribeClusterSnapshots' :: Maybe Bool
clusterExists =
        forall a. Maybe a
Prelude.Nothing,
      $sel:clusterIdentifier:DescribeClusterSnapshots' :: Maybe Text
clusterIdentifier = forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:DescribeClusterSnapshots' :: Maybe ISO8601
endTime = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeClusterSnapshots' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeClusterSnapshots' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:ownerAccount:DescribeClusterSnapshots' :: Maybe Text
ownerAccount = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotArn:DescribeClusterSnapshots' :: Maybe Text
snapshotArn = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotIdentifier:DescribeClusterSnapshots' :: Maybe Text
snapshotIdentifier = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotType:DescribeClusterSnapshots' :: Maybe Text
snapshotType = forall a. Maybe a
Prelude.Nothing,
      $sel:sortingEntities:DescribeClusterSnapshots' :: Maybe [SnapshotSortingEntity]
sortingEntities = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:DescribeClusterSnapshots' :: Maybe ISO8601
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:tagKeys:DescribeClusterSnapshots' :: Maybe [Text]
tagKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:tagValues:DescribeClusterSnapshots' :: Maybe [Text]
tagValues = forall a. Maybe a
Prelude.Nothing
    }

-- | A value that indicates whether to return snapshots only for an existing
-- cluster. You can perform table-level restore only by using a snapshot of
-- an existing cluster, that is, a cluster that has not been deleted.
-- Values for this parameter work as follows:
--
-- -   If @ClusterExists@ is set to @true@, @ClusterIdentifier@ is
--     required.
--
-- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ isn\'t
--     specified, all snapshots associated with deleted clusters (orphaned
--     snapshots) are returned.
--
-- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ is
--     specified for a deleted cluster, snapshots associated with that
--     cluster are returned.
--
-- -   If @ClusterExists@ is set to @false@ and @ClusterIdentifier@ is
--     specified for an existing cluster, no snapshots are returned.
describeClusterSnapshots_clusterExists :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Bool)
describeClusterSnapshots_clusterExists :: Lens' DescribeClusterSnapshots (Maybe Bool)
describeClusterSnapshots_clusterExists = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe Bool
clusterExists :: Maybe Bool
$sel:clusterExists:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Bool
clusterExists} -> Maybe Bool
clusterExists) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe Bool
a -> DescribeClusterSnapshots
s {$sel:clusterExists:DescribeClusterSnapshots' :: Maybe Bool
clusterExists = Maybe Bool
a} :: DescribeClusterSnapshots)

-- | The identifier of the cluster which generated the requested snapshots.
describeClusterSnapshots_clusterIdentifier :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Text)
describeClusterSnapshots_clusterIdentifier :: Lens' DescribeClusterSnapshots (Maybe Text)
describeClusterSnapshots_clusterIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe Text
clusterIdentifier :: Maybe Text
$sel:clusterIdentifier:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
clusterIdentifier} -> Maybe Text
clusterIdentifier) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe Text
a -> DescribeClusterSnapshots
s {$sel:clusterIdentifier:DescribeClusterSnapshots' :: Maybe Text
clusterIdentifier = Maybe Text
a} :: DescribeClusterSnapshots)

-- | A time value that requests only snapshots created at or before the
-- specified time. The time value is specified in ISO 8601 format. For more
-- information about ISO 8601, go to the
-- <http://en.wikipedia.org/wiki/ISO_8601 ISO8601 Wikipedia page.>
--
-- Example: @2012-07-16T18:00:00Z@
describeClusterSnapshots_endTime :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.UTCTime)
describeClusterSnapshots_endTime :: Lens' DescribeClusterSnapshots (Maybe UTCTime)
describeClusterSnapshots_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe ISO8601
endTime :: Maybe ISO8601
$sel:endTime:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe ISO8601
endTime} -> Maybe ISO8601
endTime) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe ISO8601
a -> DescribeClusterSnapshots
s {$sel:endTime:DescribeClusterSnapshots' :: Maybe ISO8601
endTime = Maybe ISO8601
a} :: DescribeClusterSnapshots) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeClusterSnapshots
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
describeClusterSnapshots_marker :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Text)
describeClusterSnapshots_marker :: Lens' DescribeClusterSnapshots (Maybe Text)
describeClusterSnapshots_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe Text
a -> DescribeClusterSnapshots
s {$sel:marker:DescribeClusterSnapshots' :: Maybe Text
marker = Maybe Text
a} :: DescribeClusterSnapshots)

-- | The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
describeClusterSnapshots_maxRecords :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Int)
describeClusterSnapshots_maxRecords :: Lens' DescribeClusterSnapshots (Maybe Int)
describeClusterSnapshots_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe Int
a -> DescribeClusterSnapshots
s {$sel:maxRecords:DescribeClusterSnapshots' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeClusterSnapshots)

-- | The Amazon Web Services account used to create or copy the snapshot. Use
-- this field to filter the results to snapshots owned by a particular
-- account. To describe snapshots you own, either specify your Amazon Web
-- Services account, or do not specify the parameter.
describeClusterSnapshots_ownerAccount :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Text)
describeClusterSnapshots_ownerAccount :: Lens' DescribeClusterSnapshots (Maybe Text)
describeClusterSnapshots_ownerAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe Text
ownerAccount :: Maybe Text
$sel:ownerAccount:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe Text
a -> DescribeClusterSnapshots
s {$sel:ownerAccount:DescribeClusterSnapshots' :: Maybe Text
ownerAccount = Maybe Text
a} :: DescribeClusterSnapshots)

-- | The Amazon Resource Name (ARN) of the snapshot associated with the
-- message to describe cluster snapshots.
describeClusterSnapshots_snapshotArn :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Text)
describeClusterSnapshots_snapshotArn :: Lens' DescribeClusterSnapshots (Maybe Text)
describeClusterSnapshots_snapshotArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe Text
snapshotArn :: Maybe Text
$sel:snapshotArn:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
snapshotArn} -> Maybe Text
snapshotArn) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe Text
a -> DescribeClusterSnapshots
s {$sel:snapshotArn:DescribeClusterSnapshots' :: Maybe Text
snapshotArn = Maybe Text
a} :: DescribeClusterSnapshots)

-- | The snapshot identifier of the snapshot about which to return
-- information.
describeClusterSnapshots_snapshotIdentifier :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Text)
describeClusterSnapshots_snapshotIdentifier :: Lens' DescribeClusterSnapshots (Maybe Text)
describeClusterSnapshots_snapshotIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe Text
snapshotIdentifier :: Maybe Text
$sel:snapshotIdentifier:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
snapshotIdentifier} -> Maybe Text
snapshotIdentifier) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe Text
a -> DescribeClusterSnapshots
s {$sel:snapshotIdentifier:DescribeClusterSnapshots' :: Maybe Text
snapshotIdentifier = Maybe Text
a} :: DescribeClusterSnapshots)

-- | The type of snapshots for which you are requesting information. By
-- default, snapshots of all types are returned.
--
-- Valid Values: @automated@ | @manual@
describeClusterSnapshots_snapshotType :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Text)
describeClusterSnapshots_snapshotType :: Lens' DescribeClusterSnapshots (Maybe Text)
describeClusterSnapshots_snapshotType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe Text
snapshotType :: Maybe Text
$sel:snapshotType:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
snapshotType} -> Maybe Text
snapshotType) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe Text
a -> DescribeClusterSnapshots
s {$sel:snapshotType:DescribeClusterSnapshots' :: Maybe Text
snapshotType = Maybe Text
a} :: DescribeClusterSnapshots)

describeClusterSnapshots_sortingEntities :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe [SnapshotSortingEntity])
describeClusterSnapshots_sortingEntities :: Lens' DescribeClusterSnapshots (Maybe [SnapshotSortingEntity])
describeClusterSnapshots_sortingEntities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe [SnapshotSortingEntity]
sortingEntities :: Maybe [SnapshotSortingEntity]
$sel:sortingEntities:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [SnapshotSortingEntity]
sortingEntities} -> Maybe [SnapshotSortingEntity]
sortingEntities) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe [SnapshotSortingEntity]
a -> DescribeClusterSnapshots
s {$sel:sortingEntities:DescribeClusterSnapshots' :: Maybe [SnapshotSortingEntity]
sortingEntities = Maybe [SnapshotSortingEntity]
a} :: DescribeClusterSnapshots) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A value that requests only snapshots created at or after the specified
-- time. The time value is specified in ISO 8601 format. For more
-- information about ISO 8601, go to the
-- <http://en.wikipedia.org/wiki/ISO_8601 ISO8601 Wikipedia page.>
--
-- Example: @2012-07-16T18:00:00Z@
describeClusterSnapshots_startTime :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.UTCTime)
describeClusterSnapshots_startTime :: Lens' DescribeClusterSnapshots (Maybe UTCTime)
describeClusterSnapshots_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe ISO8601
a -> DescribeClusterSnapshots
s {$sel:startTime:DescribeClusterSnapshots' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: DescribeClusterSnapshots) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A tag key or keys for which you want to return all matching cluster
-- snapshots that are associated with the specified key or keys. For
-- example, suppose that you have snapshots that are tagged with keys
-- called @owner@ and @environment@. If you specify both of these tag keys
-- in the request, Amazon Redshift returns a response with the snapshots
-- that have either or both of these tag keys associated with them.
describeClusterSnapshots_tagKeys :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe [Prelude.Text])
describeClusterSnapshots_tagKeys :: Lens' DescribeClusterSnapshots (Maybe [Text])
describeClusterSnapshots_tagKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe [Text]
tagKeys :: Maybe [Text]
$sel:tagKeys:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [Text]
tagKeys} -> Maybe [Text]
tagKeys) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe [Text]
a -> DescribeClusterSnapshots
s {$sel:tagKeys:DescribeClusterSnapshots' :: Maybe [Text]
tagKeys = Maybe [Text]
a} :: DescribeClusterSnapshots) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A tag value or values for which you want to return all matching cluster
-- snapshots that are associated with the specified tag value or values.
-- For example, suppose that you have snapshots that are tagged with values
-- called @admin@ and @test@. If you specify both of these tag values in
-- the request, Amazon Redshift returns a response with the snapshots that
-- have either or both of these tag values associated with them.
describeClusterSnapshots_tagValues :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe [Prelude.Text])
describeClusterSnapshots_tagValues :: Lens' DescribeClusterSnapshots (Maybe [Text])
describeClusterSnapshots_tagValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshots' {Maybe [Text]
tagValues :: Maybe [Text]
$sel:tagValues:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [Text]
tagValues} -> Maybe [Text]
tagValues) (\s :: DescribeClusterSnapshots
s@DescribeClusterSnapshots' {} Maybe [Text]
a -> DescribeClusterSnapshots
s {$sel:tagValues:DescribeClusterSnapshots' :: Maybe [Text]
tagValues = Maybe [Text]
a} :: DescribeClusterSnapshots) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager DescribeClusterSnapshots where
  page :: DescribeClusterSnapshots
-> AWSResponse DescribeClusterSnapshots
-> Maybe DescribeClusterSnapshots
page DescribeClusterSnapshots
rq AWSResponse DescribeClusterSnapshots
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeClusterSnapshots
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeClusterSnapshotsResponse (Maybe Text)
describeClusterSnapshotsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeClusterSnapshots
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeClusterSnapshotsResponse (Maybe [Snapshot])
describeClusterSnapshotsResponse_snapshots
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeClusterSnapshots
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeClusterSnapshots (Maybe Text)
describeClusterSnapshots_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeClusterSnapshots
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeClusterSnapshotsResponse (Maybe Text)
describeClusterSnapshotsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeClusterSnapshots where
  type
    AWSResponse DescribeClusterSnapshots =
      DescribeClusterSnapshotsResponse
  request :: (Service -> Service)
-> DescribeClusterSnapshots -> Request DescribeClusterSnapshots
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeClusterSnapshots
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeClusterSnapshots)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeClusterSnapshotsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [Snapshot] -> Int -> DescribeClusterSnapshotsResponse
DescribeClusterSnapshotsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Snapshots"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"Snapshot")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeClusterSnapshots where
  hashWithSalt :: Int -> DescribeClusterSnapshots -> Int
hashWithSalt Int
_salt DescribeClusterSnapshots' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [SnapshotSortingEntity]
Maybe Text
Maybe ISO8601
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
startTime :: Maybe ISO8601
sortingEntities :: Maybe [SnapshotSortingEntity]
snapshotType :: Maybe Text
snapshotIdentifier :: Maybe Text
snapshotArn :: Maybe Text
ownerAccount :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
endTime :: Maybe ISO8601
clusterIdentifier :: Maybe Text
clusterExists :: Maybe Bool
$sel:tagValues:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [Text]
$sel:tagKeys:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [Text]
$sel:startTime:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe ISO8601
$sel:sortingEntities:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [SnapshotSortingEntity]
$sel:snapshotType:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:snapshotIdentifier:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:snapshotArn:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:ownerAccount:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:maxRecords:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Int
$sel:marker:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:endTime:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe ISO8601
$sel:clusterIdentifier:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:clusterExists:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
clusterExists
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownerAccount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SnapshotSortingEntity]
sortingEntities
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagValues

instance Prelude.NFData DescribeClusterSnapshots where
  rnf :: DescribeClusterSnapshots -> ()
rnf DescribeClusterSnapshots' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [SnapshotSortingEntity]
Maybe Text
Maybe ISO8601
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
startTime :: Maybe ISO8601
sortingEntities :: Maybe [SnapshotSortingEntity]
snapshotType :: Maybe Text
snapshotIdentifier :: Maybe Text
snapshotArn :: Maybe Text
ownerAccount :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
endTime :: Maybe ISO8601
clusterIdentifier :: Maybe Text
clusterExists :: Maybe Bool
$sel:tagValues:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [Text]
$sel:tagKeys:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [Text]
$sel:startTime:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe ISO8601
$sel:sortingEntities:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [SnapshotSortingEntity]
$sel:snapshotType:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:snapshotIdentifier:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:snapshotArn:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:ownerAccount:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:maxRecords:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Int
$sel:marker:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:endTime:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe ISO8601
$sel:clusterIdentifier:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:clusterExists:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
clusterExists
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerAccount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SnapshotSortingEntity]
sortingEntities
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagValues

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

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

instance Data.ToQuery DescribeClusterSnapshots where
  toQuery :: DescribeClusterSnapshots -> QueryString
toQuery DescribeClusterSnapshots' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [SnapshotSortingEntity]
Maybe Text
Maybe ISO8601
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
startTime :: Maybe ISO8601
sortingEntities :: Maybe [SnapshotSortingEntity]
snapshotType :: Maybe Text
snapshotIdentifier :: Maybe Text
snapshotArn :: Maybe Text
ownerAccount :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
endTime :: Maybe ISO8601
clusterIdentifier :: Maybe Text
clusterExists :: Maybe Bool
$sel:tagValues:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [Text]
$sel:tagKeys:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [Text]
$sel:startTime:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe ISO8601
$sel:sortingEntities:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe [SnapshotSortingEntity]
$sel:snapshotType:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:snapshotIdentifier:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:snapshotArn:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:ownerAccount:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:maxRecords:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Int
$sel:marker:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:endTime:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe ISO8601
$sel:clusterIdentifier:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Text
$sel:clusterExists:DescribeClusterSnapshots' :: DescribeClusterSnapshots -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeClusterSnapshots" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"ClusterExists" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
clusterExists,
        ByteString
"ClusterIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clusterIdentifier,
        ByteString
"EndTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ISO8601
endTime,
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords,
        ByteString
"OwnerAccount" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
ownerAccount,
        ByteString
"SnapshotArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
snapshotArn,
        ByteString
"SnapshotIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
snapshotIdentifier,
        ByteString
"SnapshotType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
snapshotType,
        ByteString
"SortingEntities"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"SnapshotSortingEntity"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SnapshotSortingEntity]
sortingEntities
            ),
        ByteString
"StartTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ISO8601
startTime,
        ByteString
"TagKeys"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagKey" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagKeys),
        ByteString
"TagValues"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagValue" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagValues)
      ]

-- | Contains the output from the DescribeClusterSnapshots action.
--
-- /See:/ 'newDescribeClusterSnapshotsResponse' smart constructor.
data DescribeClusterSnapshotsResponse = DescribeClusterSnapshotsResponse'
  { -- | A value that indicates the starting point for the next set of response
    -- records in a subsequent request. If a value is returned in a response,
    -- you can retrieve the next set of records by providing this returned
    -- marker value in the @Marker@ parameter and retrying the command. If the
    -- @Marker@ field is empty, all response records have been retrieved for
    -- the request.
    DescribeClusterSnapshotsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A list of Snapshot instances.
    DescribeClusterSnapshotsResponse -> Maybe [Snapshot]
snapshots :: Prelude.Maybe [Snapshot],
    -- | The response's http status code.
    DescribeClusterSnapshotsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeClusterSnapshotsResponse
-> DescribeClusterSnapshotsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeClusterSnapshotsResponse
-> DescribeClusterSnapshotsResponse -> Bool
$c/= :: DescribeClusterSnapshotsResponse
-> DescribeClusterSnapshotsResponse -> Bool
== :: DescribeClusterSnapshotsResponse
-> DescribeClusterSnapshotsResponse -> Bool
$c== :: DescribeClusterSnapshotsResponse
-> DescribeClusterSnapshotsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeClusterSnapshotsResponse]
ReadPrec DescribeClusterSnapshotsResponse
Int -> ReadS DescribeClusterSnapshotsResponse
ReadS [DescribeClusterSnapshotsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeClusterSnapshotsResponse]
$creadListPrec :: ReadPrec [DescribeClusterSnapshotsResponse]
readPrec :: ReadPrec DescribeClusterSnapshotsResponse
$creadPrec :: ReadPrec DescribeClusterSnapshotsResponse
readList :: ReadS [DescribeClusterSnapshotsResponse]
$creadList :: ReadS [DescribeClusterSnapshotsResponse]
readsPrec :: Int -> ReadS DescribeClusterSnapshotsResponse
$creadsPrec :: Int -> ReadS DescribeClusterSnapshotsResponse
Prelude.Read, Int -> DescribeClusterSnapshotsResponse -> ShowS
[DescribeClusterSnapshotsResponse] -> ShowS
DescribeClusterSnapshotsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeClusterSnapshotsResponse] -> ShowS
$cshowList :: [DescribeClusterSnapshotsResponse] -> ShowS
show :: DescribeClusterSnapshotsResponse -> String
$cshow :: DescribeClusterSnapshotsResponse -> String
showsPrec :: Int -> DescribeClusterSnapshotsResponse -> ShowS
$cshowsPrec :: Int -> DescribeClusterSnapshotsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeClusterSnapshotsResponse x
-> DescribeClusterSnapshotsResponse
forall x.
DescribeClusterSnapshotsResponse
-> Rep DescribeClusterSnapshotsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeClusterSnapshotsResponse x
-> DescribeClusterSnapshotsResponse
$cfrom :: forall x.
DescribeClusterSnapshotsResponse
-> Rep DescribeClusterSnapshotsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeClusterSnapshotsResponse' 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:
--
-- 'marker', 'describeClusterSnapshotsResponse_marker' - A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
--
-- 'snapshots', 'describeClusterSnapshotsResponse_snapshots' - A list of Snapshot instances.
--
-- 'httpStatus', 'describeClusterSnapshotsResponse_httpStatus' - The response's http status code.
newDescribeClusterSnapshotsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeClusterSnapshotsResponse
newDescribeClusterSnapshotsResponse :: Int -> DescribeClusterSnapshotsResponse
newDescribeClusterSnapshotsResponse Int
pHttpStatus_ =
  DescribeClusterSnapshotsResponse'
    { $sel:marker:DescribeClusterSnapshotsResponse' :: Maybe Text
marker =
        forall a. Maybe a
Prelude.Nothing,
      $sel:snapshots:DescribeClusterSnapshotsResponse' :: Maybe [Snapshot]
snapshots = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeClusterSnapshotsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
describeClusterSnapshotsResponse_marker :: Lens.Lens' DescribeClusterSnapshotsResponse (Prelude.Maybe Prelude.Text)
describeClusterSnapshotsResponse_marker :: Lens' DescribeClusterSnapshotsResponse (Maybe Text)
describeClusterSnapshotsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshotsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeClusterSnapshotsResponse' :: DescribeClusterSnapshotsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeClusterSnapshotsResponse
s@DescribeClusterSnapshotsResponse' {} Maybe Text
a -> DescribeClusterSnapshotsResponse
s {$sel:marker:DescribeClusterSnapshotsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeClusterSnapshotsResponse)

-- | A list of Snapshot instances.
describeClusterSnapshotsResponse_snapshots :: Lens.Lens' DescribeClusterSnapshotsResponse (Prelude.Maybe [Snapshot])
describeClusterSnapshotsResponse_snapshots :: Lens' DescribeClusterSnapshotsResponse (Maybe [Snapshot])
describeClusterSnapshotsResponse_snapshots = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSnapshotsResponse' {Maybe [Snapshot]
snapshots :: Maybe [Snapshot]
$sel:snapshots:DescribeClusterSnapshotsResponse' :: DescribeClusterSnapshotsResponse -> Maybe [Snapshot]
snapshots} -> Maybe [Snapshot]
snapshots) (\s :: DescribeClusterSnapshotsResponse
s@DescribeClusterSnapshotsResponse' {} Maybe [Snapshot]
a -> DescribeClusterSnapshotsResponse
s {$sel:snapshots:DescribeClusterSnapshotsResponse' :: Maybe [Snapshot]
snapshots = Maybe [Snapshot]
a} :: DescribeClusterSnapshotsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeClusterSnapshotsResponse
  where
  rnf :: DescribeClusterSnapshotsResponse -> ()
rnf DescribeClusterSnapshotsResponse' {Int
Maybe [Snapshot]
Maybe Text
httpStatus :: Int
snapshots :: Maybe [Snapshot]
marker :: Maybe Text
$sel:httpStatus:DescribeClusterSnapshotsResponse' :: DescribeClusterSnapshotsResponse -> Int
$sel:snapshots:DescribeClusterSnapshotsResponse' :: DescribeClusterSnapshotsResponse -> Maybe [Snapshot]
$sel:marker:DescribeClusterSnapshotsResponse' :: DescribeClusterSnapshotsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Snapshot]
snapshots
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus