{-# 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-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)
--
-- 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_snapshotIdentifier,
    describeClusterSnapshots_tagValues,
    describeClusterSnapshots_clusterExists,
    describeClusterSnapshots_startTime,
    describeClusterSnapshots_tagKeys,
    describeClusterSnapshots_clusterIdentifier,
    describeClusterSnapshots_snapshotType,
    describeClusterSnapshots_sortingEntities,
    describeClusterSnapshots_marker,
    describeClusterSnapshots_maxRecords,
    describeClusterSnapshots_endTime,
    describeClusterSnapshots_ownerAccount,

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

    -- * Response Lenses
    describeClusterSnapshotsResponse_snapshots,
    describeClusterSnapshotsResponse_marker,
    describeClusterSnapshotsResponse_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:/ 'newDescribeClusterSnapshots' smart constructor.
data DescribeClusterSnapshots = DescribeClusterSnapshots'
  { -- | The snapshot identifier of the snapshot about which to return
    -- information.
    DescribeClusterSnapshots -> Maybe Text
snapshotIdentifier :: 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],
    -- | 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,
    -- | 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 Core.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],
    -- | The identifier of the cluster which generated the requested snapshots.
    DescribeClusterSnapshots -> Maybe Text
clusterIdentifier :: 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],
    -- | 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,
    -- | 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 Core.ISO8601,
    -- | 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
  }
  deriving (DescribeClusterSnapshots -> DescribeClusterSnapshots -> Bool
(DescribeClusterSnapshots -> DescribeClusterSnapshots -> Bool)
-> (DescribeClusterSnapshots -> DescribeClusterSnapshots -> Bool)
-> Eq DescribeClusterSnapshots
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]
(Int -> ReadS DescribeClusterSnapshots)
-> ReadS [DescribeClusterSnapshots]
-> ReadPrec DescribeClusterSnapshots
-> ReadPrec [DescribeClusterSnapshots]
-> Read 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
(Int -> DescribeClusterSnapshots -> ShowS)
-> (DescribeClusterSnapshots -> String)
-> ([DescribeClusterSnapshots] -> ShowS)
-> Show DescribeClusterSnapshots
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.
 DescribeClusterSnapshots -> Rep DescribeClusterSnapshots x)
-> (forall x.
    Rep DescribeClusterSnapshots x -> DescribeClusterSnapshots)
-> Generic DescribeClusterSnapshots
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:
--
-- 'snapshotIdentifier', 'describeClusterSnapshots_snapshotIdentifier' - The snapshot identifier of the snapshot about which to return
-- information.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- 'clusterIdentifier', 'describeClusterSnapshots_clusterIdentifier' - The identifier of the cluster which generated the requested snapshots.
--
-- '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' -
--
-- '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.
--
-- '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@
--
-- '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.
newDescribeClusterSnapshots ::
  DescribeClusterSnapshots
newDescribeClusterSnapshots :: DescribeClusterSnapshots
newDescribeClusterSnapshots =
  DescribeClusterSnapshots' :: Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Maybe ISO8601
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [SnapshotSortingEntity]
-> Maybe Text
-> Maybe Int
-> Maybe ISO8601
-> Maybe Text
-> DescribeClusterSnapshots
DescribeClusterSnapshots'
    { $sel:snapshotIdentifier:DescribeClusterSnapshots' :: Maybe Text
snapshotIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tagValues:DescribeClusterSnapshots' :: Maybe [Text]
tagValues = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterExists:DescribeClusterSnapshots' :: Maybe Bool
clusterExists = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:DescribeClusterSnapshots' :: Maybe ISO8601
startTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:tagKeys:DescribeClusterSnapshots' :: Maybe [Text]
tagKeys = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterIdentifier:DescribeClusterSnapshots' :: Maybe Text
clusterIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotType:DescribeClusterSnapshots' :: Maybe Text
snapshotType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sortingEntities:DescribeClusterSnapshots' :: Maybe [SnapshotSortingEntity]
sortingEntities = Maybe [SnapshotSortingEntity]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeClusterSnapshots' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeClusterSnapshots' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:DescribeClusterSnapshots' :: Maybe ISO8601
endTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:ownerAccount:DescribeClusterSnapshots' :: Maybe Text
ownerAccount = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The snapshot identifier of the snapshot about which to return
-- information.
describeClusterSnapshots_snapshotIdentifier :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Text)
describeClusterSnapshots_snapshotIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_snapshotIdentifier = (DescribeClusterSnapshots -> Maybe Text)
-> (DescribeClusterSnapshots
    -> Maybe Text -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_tagValues = (DescribeClusterSnapshots -> Maybe [Text])
-> (DescribeClusterSnapshots
    -> Maybe [Text] -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeClusterSnapshots -> f DescribeClusterSnapshots)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeClusterSnapshots
-> f DescribeClusterSnapshots
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_clusterExists = (DescribeClusterSnapshots -> Maybe Bool)
-> (DescribeClusterSnapshots
    -> Maybe Bool -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe Bool)
     (Maybe Bool)
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)

-- | 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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_startTime = (DescribeClusterSnapshots -> Maybe ISO8601)
-> (DescribeClusterSnapshots
    -> Maybe ISO8601 -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe ISO8601)
     (Maybe ISO8601)
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) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> DescribeClusterSnapshots -> f DescribeClusterSnapshots)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeClusterSnapshots
-> f DescribeClusterSnapshots
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._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 :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_tagKeys = (DescribeClusterSnapshots -> Maybe [Text])
-> (DescribeClusterSnapshots
    -> Maybe [Text] -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeClusterSnapshots -> f DescribeClusterSnapshots)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeClusterSnapshots
-> f DescribeClusterSnapshots
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the cluster which generated the requested snapshots.
describeClusterSnapshots_clusterIdentifier :: Lens.Lens' DescribeClusterSnapshots (Prelude.Maybe Prelude.Text)
describeClusterSnapshots_clusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_clusterIdentifier = (DescribeClusterSnapshots -> Maybe Text)
-> (DescribeClusterSnapshots
    -> Maybe Text -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_snapshotType = (DescribeClusterSnapshots -> Maybe Text)
-> (DescribeClusterSnapshots
    -> Maybe Text -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe [SnapshotSortingEntity]
 -> f (Maybe [SnapshotSortingEntity]))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_sortingEntities = (DescribeClusterSnapshots -> Maybe [SnapshotSortingEntity])
-> (DescribeClusterSnapshots
    -> Maybe [SnapshotSortingEntity] -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe [SnapshotSortingEntity])
     (Maybe [SnapshotSortingEntity])
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) ((Maybe [SnapshotSortingEntity]
  -> f (Maybe [SnapshotSortingEntity]))
 -> DescribeClusterSnapshots -> f DescribeClusterSnapshots)
-> ((Maybe [SnapshotSortingEntity]
     -> f (Maybe [SnapshotSortingEntity]))
    -> Maybe [SnapshotSortingEntity]
    -> f (Maybe [SnapshotSortingEntity]))
-> (Maybe [SnapshotSortingEntity]
    -> f (Maybe [SnapshotSortingEntity]))
-> DescribeClusterSnapshots
-> f DescribeClusterSnapshots
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SnapshotSortingEntity]
  [SnapshotSortingEntity]
  [SnapshotSortingEntity]
  [SnapshotSortingEntity]
-> Iso
     (Maybe [SnapshotSortingEntity])
     (Maybe [SnapshotSortingEntity])
     (Maybe [SnapshotSortingEntity])
     (Maybe [SnapshotSortingEntity])
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
  [SnapshotSortingEntity]
  [SnapshotSortingEntity]
  [SnapshotSortingEntity]
  [SnapshotSortingEntity]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_marker = (DescribeClusterSnapshots -> Maybe Text)
-> (DescribeClusterSnapshots
    -> Maybe Text -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Int -> f (Maybe Int))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_maxRecords = (DescribeClusterSnapshots -> Maybe Int)
-> (DescribeClusterSnapshots
    -> Maybe Int -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe Int)
     (Maybe Int)
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)

-- | 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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_endTime = (DescribeClusterSnapshots -> Maybe ISO8601)
-> (DescribeClusterSnapshots
    -> Maybe ISO8601 -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe ISO8601)
     (Maybe ISO8601)
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) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> DescribeClusterSnapshots -> f DescribeClusterSnapshots)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeClusterSnapshots
-> f DescribeClusterSnapshots
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterSnapshots -> f DescribeClusterSnapshots
describeClusterSnapshots_ownerAccount = (DescribeClusterSnapshots -> Maybe Text)
-> (DescribeClusterSnapshots
    -> Maybe Text -> DescribeClusterSnapshots)
-> Lens
     DescribeClusterSnapshots
     DescribeClusterSnapshots
     (Maybe Text)
     (Maybe Text)
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)

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

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

instance Prelude.NFData DescribeClusterSnapshots

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

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

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

-- | Contains the output from the DescribeClusterSnapshots action.
--
-- /See:/ 'newDescribeClusterSnapshotsResponse' smart constructor.
data DescribeClusterSnapshotsResponse = DescribeClusterSnapshotsResponse'
  { -- | A list of Snapshot instances.
    DescribeClusterSnapshotsResponse -> Maybe [Snapshot]
snapshots :: Prelude.Maybe [Snapshot],
    -- | 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,
    -- | The response's http status code.
    DescribeClusterSnapshotsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeClusterSnapshotsResponse
-> DescribeClusterSnapshotsResponse -> Bool
(DescribeClusterSnapshotsResponse
 -> DescribeClusterSnapshotsResponse -> Bool)
-> (DescribeClusterSnapshotsResponse
    -> DescribeClusterSnapshotsResponse -> Bool)
-> Eq DescribeClusterSnapshotsResponse
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]
(Int -> ReadS DescribeClusterSnapshotsResponse)
-> ReadS [DescribeClusterSnapshotsResponse]
-> ReadPrec DescribeClusterSnapshotsResponse
-> ReadPrec [DescribeClusterSnapshotsResponse]
-> Read 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
(Int -> DescribeClusterSnapshotsResponse -> ShowS)
-> (DescribeClusterSnapshotsResponse -> String)
-> ([DescribeClusterSnapshotsResponse] -> ShowS)
-> Show DescribeClusterSnapshotsResponse
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.
 DescribeClusterSnapshotsResponse
 -> Rep DescribeClusterSnapshotsResponse x)
-> (forall x.
    Rep DescribeClusterSnapshotsResponse x
    -> DescribeClusterSnapshotsResponse)
-> Generic DescribeClusterSnapshotsResponse
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:
--
-- 'snapshots', 'describeClusterSnapshotsResponse_snapshots' - A list of Snapshot instances.
--
-- '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.
--
-- 'httpStatus', 'describeClusterSnapshotsResponse_httpStatus' - The response's http status code.
newDescribeClusterSnapshotsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeClusterSnapshotsResponse
newDescribeClusterSnapshotsResponse :: Int -> DescribeClusterSnapshotsResponse
newDescribeClusterSnapshotsResponse Int
pHttpStatus_ =
  DescribeClusterSnapshotsResponse' :: Maybe [Snapshot]
-> Maybe Text -> Int -> DescribeClusterSnapshotsResponse
DescribeClusterSnapshotsResponse'
    { $sel:snapshots:DescribeClusterSnapshotsResponse' :: Maybe [Snapshot]
snapshots =
        Maybe [Snapshot]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeClusterSnapshotsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeClusterSnapshotsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of Snapshot instances.
describeClusterSnapshotsResponse_snapshots :: Lens.Lens' DescribeClusterSnapshotsResponse (Prelude.Maybe [Snapshot])
describeClusterSnapshotsResponse_snapshots :: (Maybe [Snapshot] -> f (Maybe [Snapshot]))
-> DescribeClusterSnapshotsResponse
-> f DescribeClusterSnapshotsResponse
describeClusterSnapshotsResponse_snapshots = (DescribeClusterSnapshotsResponse -> Maybe [Snapshot])
-> (DescribeClusterSnapshotsResponse
    -> Maybe [Snapshot] -> DescribeClusterSnapshotsResponse)
-> Lens' DescribeClusterSnapshotsResponse (Maybe [Snapshot])
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) ((Maybe [Snapshot] -> f (Maybe [Snapshot]))
 -> DescribeClusterSnapshotsResponse
 -> f DescribeClusterSnapshotsResponse)
-> ((Maybe [Snapshot] -> f (Maybe [Snapshot]))
    -> Maybe [Snapshot] -> f (Maybe [Snapshot]))
-> (Maybe [Snapshot] -> f (Maybe [Snapshot]))
-> DescribeClusterSnapshotsResponse
-> f DescribeClusterSnapshotsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Snapshot] [Snapshot] [Snapshot] [Snapshot]
-> Iso
     (Maybe [Snapshot])
     (Maybe [Snapshot])
     (Maybe [Snapshot])
     (Maybe [Snapshot])
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 [Snapshot] [Snapshot] [Snapshot] [Snapshot]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterSnapshotsResponse
-> f DescribeClusterSnapshotsResponse
describeClusterSnapshotsResponse_marker = (DescribeClusterSnapshotsResponse -> Maybe Text)
-> (DescribeClusterSnapshotsResponse
    -> Maybe Text -> DescribeClusterSnapshotsResponse)
-> Lens' DescribeClusterSnapshotsResponse (Maybe Text)
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)

-- | The response's http status code.
describeClusterSnapshotsResponse_httpStatus :: Lens.Lens' DescribeClusterSnapshotsResponse Prelude.Int
describeClusterSnapshotsResponse_httpStatus :: (Int -> f Int)
-> DescribeClusterSnapshotsResponse
-> f DescribeClusterSnapshotsResponse
describeClusterSnapshotsResponse_httpStatus = (DescribeClusterSnapshotsResponse -> Int)
-> (DescribeClusterSnapshotsResponse
    -> Int -> DescribeClusterSnapshotsResponse)
-> Lens
     DescribeClusterSnapshotsResponse
     DescribeClusterSnapshotsResponse
     Int
     Int
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