{-# 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.DescribeClusterDbRevisions
-- 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 an array of @ClusterDbRevision@ objects.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeClusterDbRevisions
  ( -- * Creating a Request
    DescribeClusterDbRevisions (..),
    newDescribeClusterDbRevisions,

    -- * Request Lenses
    describeClusterDbRevisions_clusterIdentifier,
    describeClusterDbRevisions_marker,
    describeClusterDbRevisions_maxRecords,

    -- * Destructuring the Response
    DescribeClusterDbRevisionsResponse (..),
    newDescribeClusterDbRevisionsResponse,

    -- * Response Lenses
    describeClusterDbRevisionsResponse_clusterDbRevisions,
    describeClusterDbRevisionsResponse_marker,
    describeClusterDbRevisionsResponse_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:/ 'newDescribeClusterDbRevisions' smart constructor.
data DescribeClusterDbRevisions = DescribeClusterDbRevisions'
  { -- | A unique identifier for a cluster whose @ClusterDbRevisions@ you are
    -- requesting. This parameter is case sensitive. All clusters defined for
    -- an account are returned by default.
    DescribeClusterDbRevisions -> Maybe Text
clusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | An optional parameter that specifies the starting point for returning a
    -- set of response records. When the results of a
    -- @DescribeClusterDbRevisions@ request exceed the value specified in
    -- @MaxRecords@, Amazon Redshift 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.
    --
    -- Constraints: You can specify either the @ClusterIdentifier@ parameter,
    -- or the @marker@ parameter, but not both.
    DescribeClusterDbRevisions -> 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 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.
    --
    -- Default: 100
    --
    -- Constraints: minimum 20, maximum 100.
    DescribeClusterDbRevisions -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeClusterDbRevisions -> DescribeClusterDbRevisions -> Bool
(DescribeClusterDbRevisions -> DescribeClusterDbRevisions -> Bool)
-> (DescribeClusterDbRevisions
    -> DescribeClusterDbRevisions -> Bool)
-> Eq DescribeClusterDbRevisions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeClusterDbRevisions -> DescribeClusterDbRevisions -> Bool
$c/= :: DescribeClusterDbRevisions -> DescribeClusterDbRevisions -> Bool
== :: DescribeClusterDbRevisions -> DescribeClusterDbRevisions -> Bool
$c== :: DescribeClusterDbRevisions -> DescribeClusterDbRevisions -> Bool
Prelude.Eq, ReadPrec [DescribeClusterDbRevisions]
ReadPrec DescribeClusterDbRevisions
Int -> ReadS DescribeClusterDbRevisions
ReadS [DescribeClusterDbRevisions]
(Int -> ReadS DescribeClusterDbRevisions)
-> ReadS [DescribeClusterDbRevisions]
-> ReadPrec DescribeClusterDbRevisions
-> ReadPrec [DescribeClusterDbRevisions]
-> Read DescribeClusterDbRevisions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeClusterDbRevisions]
$creadListPrec :: ReadPrec [DescribeClusterDbRevisions]
readPrec :: ReadPrec DescribeClusterDbRevisions
$creadPrec :: ReadPrec DescribeClusterDbRevisions
readList :: ReadS [DescribeClusterDbRevisions]
$creadList :: ReadS [DescribeClusterDbRevisions]
readsPrec :: Int -> ReadS DescribeClusterDbRevisions
$creadsPrec :: Int -> ReadS DescribeClusterDbRevisions
Prelude.Read, Int -> DescribeClusterDbRevisions -> ShowS
[DescribeClusterDbRevisions] -> ShowS
DescribeClusterDbRevisions -> String
(Int -> DescribeClusterDbRevisions -> ShowS)
-> (DescribeClusterDbRevisions -> String)
-> ([DescribeClusterDbRevisions] -> ShowS)
-> Show DescribeClusterDbRevisions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeClusterDbRevisions] -> ShowS
$cshowList :: [DescribeClusterDbRevisions] -> ShowS
show :: DescribeClusterDbRevisions -> String
$cshow :: DescribeClusterDbRevisions -> String
showsPrec :: Int -> DescribeClusterDbRevisions -> ShowS
$cshowsPrec :: Int -> DescribeClusterDbRevisions -> ShowS
Prelude.Show, (forall x.
 DescribeClusterDbRevisions -> Rep DescribeClusterDbRevisions x)
-> (forall x.
    Rep DescribeClusterDbRevisions x -> DescribeClusterDbRevisions)
-> Generic DescribeClusterDbRevisions
forall x.
Rep DescribeClusterDbRevisions x -> DescribeClusterDbRevisions
forall x.
DescribeClusterDbRevisions -> Rep DescribeClusterDbRevisions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeClusterDbRevisions x -> DescribeClusterDbRevisions
$cfrom :: forall x.
DescribeClusterDbRevisions -> Rep DescribeClusterDbRevisions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeClusterDbRevisions' 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:
--
-- 'clusterIdentifier', 'describeClusterDbRevisions_clusterIdentifier' - A unique identifier for a cluster whose @ClusterDbRevisions@ you are
-- requesting. This parameter is case sensitive. All clusters defined for
-- an account are returned by default.
--
-- 'marker', 'describeClusterDbRevisions_marker' - An optional parameter that specifies the starting point for returning a
-- set of response records. When the results of a
-- @DescribeClusterDbRevisions@ request exceed the value specified in
-- @MaxRecords@, Amazon Redshift 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.
--
-- Constraints: You can specify either the @ClusterIdentifier@ parameter,
-- or the @marker@ parameter, but not both.
--
-- 'maxRecords', 'describeClusterDbRevisions_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 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.
--
-- Default: 100
--
-- Constraints: minimum 20, maximum 100.
newDescribeClusterDbRevisions ::
  DescribeClusterDbRevisions
newDescribeClusterDbRevisions :: DescribeClusterDbRevisions
newDescribeClusterDbRevisions =
  DescribeClusterDbRevisions' :: Maybe Text -> Maybe Text -> Maybe Int -> DescribeClusterDbRevisions
DescribeClusterDbRevisions'
    { $sel:clusterIdentifier:DescribeClusterDbRevisions' :: Maybe Text
clusterIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeClusterDbRevisions' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeClusterDbRevisions' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier for a cluster whose @ClusterDbRevisions@ you are
-- requesting. This parameter is case sensitive. All clusters defined for
-- an account are returned by default.
describeClusterDbRevisions_clusterIdentifier :: Lens.Lens' DescribeClusterDbRevisions (Prelude.Maybe Prelude.Text)
describeClusterDbRevisions_clusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterDbRevisions -> f DescribeClusterDbRevisions
describeClusterDbRevisions_clusterIdentifier = (DescribeClusterDbRevisions -> Maybe Text)
-> (DescribeClusterDbRevisions
    -> Maybe Text -> DescribeClusterDbRevisions)
-> Lens
     DescribeClusterDbRevisions
     DescribeClusterDbRevisions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterDbRevisions' {Maybe Text
clusterIdentifier :: Maybe Text
$sel:clusterIdentifier:DescribeClusterDbRevisions' :: DescribeClusterDbRevisions -> Maybe Text
clusterIdentifier} -> Maybe Text
clusterIdentifier) (\s :: DescribeClusterDbRevisions
s@DescribeClusterDbRevisions' {} Maybe Text
a -> DescribeClusterDbRevisions
s {$sel:clusterIdentifier:DescribeClusterDbRevisions' :: Maybe Text
clusterIdentifier = Maybe Text
a} :: DescribeClusterDbRevisions)

-- | An optional parameter that specifies the starting point for returning a
-- set of response records. When the results of a
-- @DescribeClusterDbRevisions@ request exceed the value specified in
-- @MaxRecords@, Amazon Redshift 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.
--
-- Constraints: You can specify either the @ClusterIdentifier@ parameter,
-- or the @marker@ parameter, but not both.
describeClusterDbRevisions_marker :: Lens.Lens' DescribeClusterDbRevisions (Prelude.Maybe Prelude.Text)
describeClusterDbRevisions_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterDbRevisions -> f DescribeClusterDbRevisions
describeClusterDbRevisions_marker = (DescribeClusterDbRevisions -> Maybe Text)
-> (DescribeClusterDbRevisions
    -> Maybe Text -> DescribeClusterDbRevisions)
-> Lens
     DescribeClusterDbRevisions
     DescribeClusterDbRevisions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterDbRevisions' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeClusterDbRevisions' :: DescribeClusterDbRevisions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeClusterDbRevisions
s@DescribeClusterDbRevisions' {} Maybe Text
a -> DescribeClusterDbRevisions
s {$sel:marker:DescribeClusterDbRevisions' :: Maybe Text
marker = Maybe Text
a} :: DescribeClusterDbRevisions)

-- | 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 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.
--
-- Default: 100
--
-- Constraints: minimum 20, maximum 100.
describeClusterDbRevisions_maxRecords :: Lens.Lens' DescribeClusterDbRevisions (Prelude.Maybe Prelude.Int)
describeClusterDbRevisions_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeClusterDbRevisions -> f DescribeClusterDbRevisions
describeClusterDbRevisions_maxRecords = (DescribeClusterDbRevisions -> Maybe Int)
-> (DescribeClusterDbRevisions
    -> Maybe Int -> DescribeClusterDbRevisions)
-> Lens
     DescribeClusterDbRevisions
     DescribeClusterDbRevisions
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterDbRevisions' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeClusterDbRevisions' :: DescribeClusterDbRevisions -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeClusterDbRevisions
s@DescribeClusterDbRevisions' {} Maybe Int
a -> DescribeClusterDbRevisions
s {$sel:maxRecords:DescribeClusterDbRevisions' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeClusterDbRevisions)

instance Core.AWSPager DescribeClusterDbRevisions where
  page :: DescribeClusterDbRevisions
-> AWSResponse DescribeClusterDbRevisions
-> Maybe DescribeClusterDbRevisions
page DescribeClusterDbRevisions
rq AWSResponse DescribeClusterDbRevisions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeClusterDbRevisions
DescribeClusterDbRevisionsResponse
rs
            DescribeClusterDbRevisionsResponse
-> Getting (First Text) DescribeClusterDbRevisionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeClusterDbRevisionsResponse
-> Const (First Text) DescribeClusterDbRevisionsResponse
Lens' DescribeClusterDbRevisionsResponse (Maybe Text)
describeClusterDbRevisionsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeClusterDbRevisionsResponse
 -> Const (First Text) DescribeClusterDbRevisionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeClusterDbRevisionsResponse 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 DescribeClusterDbRevisions
forall a. Maybe a
Prelude.Nothing
    | Maybe [ClusterDbRevision] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeClusterDbRevisions
DescribeClusterDbRevisionsResponse
rs
            DescribeClusterDbRevisionsResponse
-> Getting
     (First [ClusterDbRevision])
     DescribeClusterDbRevisionsResponse
     [ClusterDbRevision]
-> Maybe [ClusterDbRevision]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ClusterDbRevision]
 -> Const (First [ClusterDbRevision]) (Maybe [ClusterDbRevision]))
-> DescribeClusterDbRevisionsResponse
-> Const
     (First [ClusterDbRevision]) DescribeClusterDbRevisionsResponse
Lens'
  DescribeClusterDbRevisionsResponse (Maybe [ClusterDbRevision])
describeClusterDbRevisionsResponse_clusterDbRevisions
              ((Maybe [ClusterDbRevision]
  -> Const (First [ClusterDbRevision]) (Maybe [ClusterDbRevision]))
 -> DescribeClusterDbRevisionsResponse
 -> Const
      (First [ClusterDbRevision]) DescribeClusterDbRevisionsResponse)
-> (([ClusterDbRevision]
     -> Const (First [ClusterDbRevision]) [ClusterDbRevision])
    -> Maybe [ClusterDbRevision]
    -> Const (First [ClusterDbRevision]) (Maybe [ClusterDbRevision]))
-> Getting
     (First [ClusterDbRevision])
     DescribeClusterDbRevisionsResponse
     [ClusterDbRevision]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ClusterDbRevision]
 -> Const (First [ClusterDbRevision]) [ClusterDbRevision])
-> Maybe [ClusterDbRevision]
-> Const (First [ClusterDbRevision]) (Maybe [ClusterDbRevision])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeClusterDbRevisions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeClusterDbRevisions -> Maybe DescribeClusterDbRevisions
forall a. a -> Maybe a
Prelude.Just (DescribeClusterDbRevisions -> Maybe DescribeClusterDbRevisions)
-> DescribeClusterDbRevisions -> Maybe DescribeClusterDbRevisions
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeClusterDbRevisions
rq
          DescribeClusterDbRevisions
-> (DescribeClusterDbRevisions -> DescribeClusterDbRevisions)
-> DescribeClusterDbRevisions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeClusterDbRevisions
-> Identity DescribeClusterDbRevisions
Lens
  DescribeClusterDbRevisions
  DescribeClusterDbRevisions
  (Maybe Text)
  (Maybe Text)
describeClusterDbRevisions_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeClusterDbRevisions
 -> Identity DescribeClusterDbRevisions)
-> Maybe Text
-> DescribeClusterDbRevisions
-> DescribeClusterDbRevisions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeClusterDbRevisions
DescribeClusterDbRevisionsResponse
rs
          DescribeClusterDbRevisionsResponse
-> Getting (First Text) DescribeClusterDbRevisionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeClusterDbRevisionsResponse
-> Const (First Text) DescribeClusterDbRevisionsResponse
Lens' DescribeClusterDbRevisionsResponse (Maybe Text)
describeClusterDbRevisionsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeClusterDbRevisionsResponse
 -> Const (First Text) DescribeClusterDbRevisionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeClusterDbRevisionsResponse 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 DescribeClusterDbRevisions where
  type
    AWSResponse DescribeClusterDbRevisions =
      DescribeClusterDbRevisionsResponse
  request :: DescribeClusterDbRevisions -> Request DescribeClusterDbRevisions
request = Service
-> DescribeClusterDbRevisions -> Request DescribeClusterDbRevisions
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeClusterDbRevisions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeClusterDbRevisions)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeClusterDbRevisions))
-> Logger
-> Service
-> Proxy DescribeClusterDbRevisions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeClusterDbRevisions)))
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
"DescribeClusterDbRevisionsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [ClusterDbRevision]
-> Maybe Text -> Int -> DescribeClusterDbRevisionsResponse
DescribeClusterDbRevisionsResponse'
            (Maybe [ClusterDbRevision]
 -> Maybe Text -> Int -> DescribeClusterDbRevisionsResponse)
-> Either String (Maybe [ClusterDbRevision])
-> Either
     String (Maybe Text -> Int -> DescribeClusterDbRevisionsResponse)
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
"ClusterDbRevisions"
                            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 [ClusterDbRevision]))
-> Either String (Maybe [ClusterDbRevision])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ClusterDbRevision])
-> [Node] -> Either String (Maybe [ClusterDbRevision])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ClusterDbRevision]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ClusterDbRevision")
                        )
            Either
  String (Maybe Text -> Int -> DescribeClusterDbRevisionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeClusterDbRevisionsResponse)
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 -> DescribeClusterDbRevisionsResponse)
-> Either String Int
-> Either String DescribeClusterDbRevisionsResponse
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 DescribeClusterDbRevisions

instance Prelude.NFData DescribeClusterDbRevisions

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

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

instance Core.ToQuery DescribeClusterDbRevisions where
  toQuery :: DescribeClusterDbRevisions -> QueryString
toQuery DescribeClusterDbRevisions' {Maybe Int
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
clusterIdentifier :: Maybe Text
$sel:maxRecords:DescribeClusterDbRevisions' :: DescribeClusterDbRevisions -> Maybe Int
$sel:marker:DescribeClusterDbRevisions' :: DescribeClusterDbRevisions -> Maybe Text
$sel:clusterIdentifier:DescribeClusterDbRevisions' :: DescribeClusterDbRevisions -> 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
"DescribeClusterDbRevisions" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"ClusterIdentifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clusterIdentifier,
        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
      ]

-- | /See:/ 'newDescribeClusterDbRevisionsResponse' smart constructor.
data DescribeClusterDbRevisionsResponse = DescribeClusterDbRevisionsResponse'
  { -- | A list of revisions.
    DescribeClusterDbRevisionsResponse -> Maybe [ClusterDbRevision]
clusterDbRevisions :: Prelude.Maybe [ClusterDbRevision],
    -- | A string representing the starting point for the next set of revisions.
    -- If a value is returned in a response, you can retrieve the next set of
    -- revisions by providing the value in the @marker@ parameter and retrying
    -- the command. If the @marker@ field is empty, all revisions have already
    -- been returned.
    DescribeClusterDbRevisionsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeClusterDbRevisionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeClusterDbRevisionsResponse
-> DescribeClusterDbRevisionsResponse -> Bool
(DescribeClusterDbRevisionsResponse
 -> DescribeClusterDbRevisionsResponse -> Bool)
-> (DescribeClusterDbRevisionsResponse
    -> DescribeClusterDbRevisionsResponse -> Bool)
-> Eq DescribeClusterDbRevisionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeClusterDbRevisionsResponse
-> DescribeClusterDbRevisionsResponse -> Bool
$c/= :: DescribeClusterDbRevisionsResponse
-> DescribeClusterDbRevisionsResponse -> Bool
== :: DescribeClusterDbRevisionsResponse
-> DescribeClusterDbRevisionsResponse -> Bool
$c== :: DescribeClusterDbRevisionsResponse
-> DescribeClusterDbRevisionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeClusterDbRevisionsResponse]
ReadPrec DescribeClusterDbRevisionsResponse
Int -> ReadS DescribeClusterDbRevisionsResponse
ReadS [DescribeClusterDbRevisionsResponse]
(Int -> ReadS DescribeClusterDbRevisionsResponse)
-> ReadS [DescribeClusterDbRevisionsResponse]
-> ReadPrec DescribeClusterDbRevisionsResponse
-> ReadPrec [DescribeClusterDbRevisionsResponse]
-> Read DescribeClusterDbRevisionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeClusterDbRevisionsResponse]
$creadListPrec :: ReadPrec [DescribeClusterDbRevisionsResponse]
readPrec :: ReadPrec DescribeClusterDbRevisionsResponse
$creadPrec :: ReadPrec DescribeClusterDbRevisionsResponse
readList :: ReadS [DescribeClusterDbRevisionsResponse]
$creadList :: ReadS [DescribeClusterDbRevisionsResponse]
readsPrec :: Int -> ReadS DescribeClusterDbRevisionsResponse
$creadsPrec :: Int -> ReadS DescribeClusterDbRevisionsResponse
Prelude.Read, Int -> DescribeClusterDbRevisionsResponse -> ShowS
[DescribeClusterDbRevisionsResponse] -> ShowS
DescribeClusterDbRevisionsResponse -> String
(Int -> DescribeClusterDbRevisionsResponse -> ShowS)
-> (DescribeClusterDbRevisionsResponse -> String)
-> ([DescribeClusterDbRevisionsResponse] -> ShowS)
-> Show DescribeClusterDbRevisionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeClusterDbRevisionsResponse] -> ShowS
$cshowList :: [DescribeClusterDbRevisionsResponse] -> ShowS
show :: DescribeClusterDbRevisionsResponse -> String
$cshow :: DescribeClusterDbRevisionsResponse -> String
showsPrec :: Int -> DescribeClusterDbRevisionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeClusterDbRevisionsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeClusterDbRevisionsResponse
 -> Rep DescribeClusterDbRevisionsResponse x)
-> (forall x.
    Rep DescribeClusterDbRevisionsResponse x
    -> DescribeClusterDbRevisionsResponse)
-> Generic DescribeClusterDbRevisionsResponse
forall x.
Rep DescribeClusterDbRevisionsResponse x
-> DescribeClusterDbRevisionsResponse
forall x.
DescribeClusterDbRevisionsResponse
-> Rep DescribeClusterDbRevisionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeClusterDbRevisionsResponse x
-> DescribeClusterDbRevisionsResponse
$cfrom :: forall x.
DescribeClusterDbRevisionsResponse
-> Rep DescribeClusterDbRevisionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeClusterDbRevisionsResponse' 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:
--
-- 'clusterDbRevisions', 'describeClusterDbRevisionsResponse_clusterDbRevisions' - A list of revisions.
--
-- 'marker', 'describeClusterDbRevisionsResponse_marker' - A string representing the starting point for the next set of revisions.
-- If a value is returned in a response, you can retrieve the next set of
-- revisions by providing the value in the @marker@ parameter and retrying
-- the command. If the @marker@ field is empty, all revisions have already
-- been returned.
--
-- 'httpStatus', 'describeClusterDbRevisionsResponse_httpStatus' - The response's http status code.
newDescribeClusterDbRevisionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeClusterDbRevisionsResponse
newDescribeClusterDbRevisionsResponse :: Int -> DescribeClusterDbRevisionsResponse
newDescribeClusterDbRevisionsResponse Int
pHttpStatus_ =
  DescribeClusterDbRevisionsResponse' :: Maybe [ClusterDbRevision]
-> Maybe Text -> Int -> DescribeClusterDbRevisionsResponse
DescribeClusterDbRevisionsResponse'
    { $sel:clusterDbRevisions:DescribeClusterDbRevisionsResponse' :: Maybe [ClusterDbRevision]
clusterDbRevisions =
        Maybe [ClusterDbRevision]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeClusterDbRevisionsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeClusterDbRevisionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of revisions.
describeClusterDbRevisionsResponse_clusterDbRevisions :: Lens.Lens' DescribeClusterDbRevisionsResponse (Prelude.Maybe [ClusterDbRevision])
describeClusterDbRevisionsResponse_clusterDbRevisions :: (Maybe [ClusterDbRevision] -> f (Maybe [ClusterDbRevision]))
-> DescribeClusterDbRevisionsResponse
-> f DescribeClusterDbRevisionsResponse
describeClusterDbRevisionsResponse_clusterDbRevisions = (DescribeClusterDbRevisionsResponse -> Maybe [ClusterDbRevision])
-> (DescribeClusterDbRevisionsResponse
    -> Maybe [ClusterDbRevision] -> DescribeClusterDbRevisionsResponse)
-> Lens'
     DescribeClusterDbRevisionsResponse (Maybe [ClusterDbRevision])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterDbRevisionsResponse' {Maybe [ClusterDbRevision]
clusterDbRevisions :: Maybe [ClusterDbRevision]
$sel:clusterDbRevisions:DescribeClusterDbRevisionsResponse' :: DescribeClusterDbRevisionsResponse -> Maybe [ClusterDbRevision]
clusterDbRevisions} -> Maybe [ClusterDbRevision]
clusterDbRevisions) (\s :: DescribeClusterDbRevisionsResponse
s@DescribeClusterDbRevisionsResponse' {} Maybe [ClusterDbRevision]
a -> DescribeClusterDbRevisionsResponse
s {$sel:clusterDbRevisions:DescribeClusterDbRevisionsResponse' :: Maybe [ClusterDbRevision]
clusterDbRevisions = Maybe [ClusterDbRevision]
a} :: DescribeClusterDbRevisionsResponse) ((Maybe [ClusterDbRevision] -> f (Maybe [ClusterDbRevision]))
 -> DescribeClusterDbRevisionsResponse
 -> f DescribeClusterDbRevisionsResponse)
-> ((Maybe [ClusterDbRevision] -> f (Maybe [ClusterDbRevision]))
    -> Maybe [ClusterDbRevision] -> f (Maybe [ClusterDbRevision]))
-> (Maybe [ClusterDbRevision] -> f (Maybe [ClusterDbRevision]))
-> DescribeClusterDbRevisionsResponse
-> f DescribeClusterDbRevisionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ClusterDbRevision]
  [ClusterDbRevision]
  [ClusterDbRevision]
  [ClusterDbRevision]
-> Iso
     (Maybe [ClusterDbRevision])
     (Maybe [ClusterDbRevision])
     (Maybe [ClusterDbRevision])
     (Maybe [ClusterDbRevision])
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
  [ClusterDbRevision]
  [ClusterDbRevision]
  [ClusterDbRevision]
  [ClusterDbRevision]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A string representing the starting point for the next set of revisions.
-- If a value is returned in a response, you can retrieve the next set of
-- revisions by providing the value in the @marker@ parameter and retrying
-- the command. If the @marker@ field is empty, all revisions have already
-- been returned.
describeClusterDbRevisionsResponse_marker :: Lens.Lens' DescribeClusterDbRevisionsResponse (Prelude.Maybe Prelude.Text)
describeClusterDbRevisionsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeClusterDbRevisionsResponse
-> f DescribeClusterDbRevisionsResponse
describeClusterDbRevisionsResponse_marker = (DescribeClusterDbRevisionsResponse -> Maybe Text)
-> (DescribeClusterDbRevisionsResponse
    -> Maybe Text -> DescribeClusterDbRevisionsResponse)
-> Lens' DescribeClusterDbRevisionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterDbRevisionsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeClusterDbRevisionsResponse' :: DescribeClusterDbRevisionsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeClusterDbRevisionsResponse
s@DescribeClusterDbRevisionsResponse' {} Maybe Text
a -> DescribeClusterDbRevisionsResponse
s {$sel:marker:DescribeClusterDbRevisionsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeClusterDbRevisionsResponse)

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

instance
  Prelude.NFData
    DescribeClusterDbRevisionsResponse