{-# 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.Lightsail.GetRelationalDatabaseSnapshots
-- 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 information about all of your database snapshots in Amazon
-- Lightsail.
--
-- This operation returns paginated results.
module Amazonka.Lightsail.GetRelationalDatabaseSnapshots
  ( -- * Creating a Request
    GetRelationalDatabaseSnapshots (..),
    newGetRelationalDatabaseSnapshots,

    -- * Request Lenses
    getRelationalDatabaseSnapshots_pageToken,

    -- * Destructuring the Response
    GetRelationalDatabaseSnapshotsResponse (..),
    newGetRelationalDatabaseSnapshotsResponse,

    -- * Response Lenses
    getRelationalDatabaseSnapshotsResponse_nextPageToken,
    getRelationalDatabaseSnapshotsResponse_relationalDatabaseSnapshots,
    getRelationalDatabaseSnapshotsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetRelationalDatabaseSnapshots' smart constructor.
data GetRelationalDatabaseSnapshots = GetRelationalDatabaseSnapshots'
  { -- | The token to advance to the next page of results from your request.
    --
    -- To get a page token, perform an initial @GetRelationalDatabaseSnapshots@
    -- request. If your results are paginated, the response will return a next
    -- page token that you can specify as the page token in a subsequent
    -- request.
    GetRelationalDatabaseSnapshots -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetRelationalDatabaseSnapshots
-> GetRelationalDatabaseSnapshots -> Bool
(GetRelationalDatabaseSnapshots
 -> GetRelationalDatabaseSnapshots -> Bool)
-> (GetRelationalDatabaseSnapshots
    -> GetRelationalDatabaseSnapshots -> Bool)
-> Eq GetRelationalDatabaseSnapshots
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseSnapshots
-> GetRelationalDatabaseSnapshots -> Bool
$c/= :: GetRelationalDatabaseSnapshots
-> GetRelationalDatabaseSnapshots -> Bool
== :: GetRelationalDatabaseSnapshots
-> GetRelationalDatabaseSnapshots -> Bool
$c== :: GetRelationalDatabaseSnapshots
-> GetRelationalDatabaseSnapshots -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseSnapshots]
ReadPrec GetRelationalDatabaseSnapshots
Int -> ReadS GetRelationalDatabaseSnapshots
ReadS [GetRelationalDatabaseSnapshots]
(Int -> ReadS GetRelationalDatabaseSnapshots)
-> ReadS [GetRelationalDatabaseSnapshots]
-> ReadPrec GetRelationalDatabaseSnapshots
-> ReadPrec [GetRelationalDatabaseSnapshots]
-> Read GetRelationalDatabaseSnapshots
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseSnapshots]
$creadListPrec :: ReadPrec [GetRelationalDatabaseSnapshots]
readPrec :: ReadPrec GetRelationalDatabaseSnapshots
$creadPrec :: ReadPrec GetRelationalDatabaseSnapshots
readList :: ReadS [GetRelationalDatabaseSnapshots]
$creadList :: ReadS [GetRelationalDatabaseSnapshots]
readsPrec :: Int -> ReadS GetRelationalDatabaseSnapshots
$creadsPrec :: Int -> ReadS GetRelationalDatabaseSnapshots
Prelude.Read, Int -> GetRelationalDatabaseSnapshots -> ShowS
[GetRelationalDatabaseSnapshots] -> ShowS
GetRelationalDatabaseSnapshots -> String
(Int -> GetRelationalDatabaseSnapshots -> ShowS)
-> (GetRelationalDatabaseSnapshots -> String)
-> ([GetRelationalDatabaseSnapshots] -> ShowS)
-> Show GetRelationalDatabaseSnapshots
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseSnapshots] -> ShowS
$cshowList :: [GetRelationalDatabaseSnapshots] -> ShowS
show :: GetRelationalDatabaseSnapshots -> String
$cshow :: GetRelationalDatabaseSnapshots -> String
showsPrec :: Int -> GetRelationalDatabaseSnapshots -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseSnapshots -> ShowS
Prelude.Show, (forall x.
 GetRelationalDatabaseSnapshots
 -> Rep GetRelationalDatabaseSnapshots x)
-> (forall x.
    Rep GetRelationalDatabaseSnapshots x
    -> GetRelationalDatabaseSnapshots)
-> Generic GetRelationalDatabaseSnapshots
forall x.
Rep GetRelationalDatabaseSnapshots x
-> GetRelationalDatabaseSnapshots
forall x.
GetRelationalDatabaseSnapshots
-> Rep GetRelationalDatabaseSnapshots x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseSnapshots x
-> GetRelationalDatabaseSnapshots
$cfrom :: forall x.
GetRelationalDatabaseSnapshots
-> Rep GetRelationalDatabaseSnapshots x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabaseSnapshots' 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:
--
-- 'pageToken', 'getRelationalDatabaseSnapshots_pageToken' - The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetRelationalDatabaseSnapshots@
-- request. If your results are paginated, the response will return a next
-- page token that you can specify as the page token in a subsequent
-- request.
newGetRelationalDatabaseSnapshots ::
  GetRelationalDatabaseSnapshots
newGetRelationalDatabaseSnapshots :: GetRelationalDatabaseSnapshots
newGetRelationalDatabaseSnapshots =
  GetRelationalDatabaseSnapshots' :: Maybe Text -> GetRelationalDatabaseSnapshots
GetRelationalDatabaseSnapshots'
    { $sel:pageToken:GetRelationalDatabaseSnapshots' :: Maybe Text
pageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetRelationalDatabaseSnapshots@
-- request. If your results are paginated, the response will return a next
-- page token that you can specify as the page token in a subsequent
-- request.
getRelationalDatabaseSnapshots_pageToken :: Lens.Lens' GetRelationalDatabaseSnapshots (Prelude.Maybe Prelude.Text)
getRelationalDatabaseSnapshots_pageToken :: (Maybe Text -> f (Maybe Text))
-> GetRelationalDatabaseSnapshots
-> f GetRelationalDatabaseSnapshots
getRelationalDatabaseSnapshots_pageToken = (GetRelationalDatabaseSnapshots -> Maybe Text)
-> (GetRelationalDatabaseSnapshots
    -> Maybe Text -> GetRelationalDatabaseSnapshots)
-> Lens
     GetRelationalDatabaseSnapshots
     GetRelationalDatabaseSnapshots
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseSnapshots' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetRelationalDatabaseSnapshots' :: GetRelationalDatabaseSnapshots -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: GetRelationalDatabaseSnapshots
s@GetRelationalDatabaseSnapshots' {} Maybe Text
a -> GetRelationalDatabaseSnapshots
s {$sel:pageToken:GetRelationalDatabaseSnapshots' :: Maybe Text
pageToken = Maybe Text
a} :: GetRelationalDatabaseSnapshots)

instance Core.AWSPager GetRelationalDatabaseSnapshots where
  page :: GetRelationalDatabaseSnapshots
-> AWSResponse GetRelationalDatabaseSnapshots
-> Maybe GetRelationalDatabaseSnapshots
page GetRelationalDatabaseSnapshots
rq AWSResponse GetRelationalDatabaseSnapshots
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRelationalDatabaseSnapshots
GetRelationalDatabaseSnapshotsResponse
rs
            GetRelationalDatabaseSnapshotsResponse
-> Getting (First Text) GetRelationalDatabaseSnapshotsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetRelationalDatabaseSnapshotsResponse
-> Const (First Text) GetRelationalDatabaseSnapshotsResponse
Lens' GetRelationalDatabaseSnapshotsResponse (Maybe Text)
getRelationalDatabaseSnapshotsResponse_nextPageToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetRelationalDatabaseSnapshotsResponse
 -> Const (First Text) GetRelationalDatabaseSnapshotsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetRelationalDatabaseSnapshotsResponse 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 GetRelationalDatabaseSnapshots
forall a. Maybe a
Prelude.Nothing
    | Maybe [RelationalDatabaseSnapshot] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRelationalDatabaseSnapshots
GetRelationalDatabaseSnapshotsResponse
rs
            GetRelationalDatabaseSnapshotsResponse
-> Getting
     (First [RelationalDatabaseSnapshot])
     GetRelationalDatabaseSnapshotsResponse
     [RelationalDatabaseSnapshot]
-> Maybe [RelationalDatabaseSnapshot]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [RelationalDatabaseSnapshot]
 -> Const
      (First [RelationalDatabaseSnapshot])
      (Maybe [RelationalDatabaseSnapshot]))
-> GetRelationalDatabaseSnapshotsResponse
-> Const
     (First [RelationalDatabaseSnapshot])
     GetRelationalDatabaseSnapshotsResponse
Lens'
  GetRelationalDatabaseSnapshotsResponse
  (Maybe [RelationalDatabaseSnapshot])
getRelationalDatabaseSnapshotsResponse_relationalDatabaseSnapshots
              ((Maybe [RelationalDatabaseSnapshot]
  -> Const
       (First [RelationalDatabaseSnapshot])
       (Maybe [RelationalDatabaseSnapshot]))
 -> GetRelationalDatabaseSnapshotsResponse
 -> Const
      (First [RelationalDatabaseSnapshot])
      GetRelationalDatabaseSnapshotsResponse)
-> (([RelationalDatabaseSnapshot]
     -> Const
          (First [RelationalDatabaseSnapshot]) [RelationalDatabaseSnapshot])
    -> Maybe [RelationalDatabaseSnapshot]
    -> Const
         (First [RelationalDatabaseSnapshot])
         (Maybe [RelationalDatabaseSnapshot]))
-> Getting
     (First [RelationalDatabaseSnapshot])
     GetRelationalDatabaseSnapshotsResponse
     [RelationalDatabaseSnapshot]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RelationalDatabaseSnapshot]
 -> Const
      (First [RelationalDatabaseSnapshot]) [RelationalDatabaseSnapshot])
-> Maybe [RelationalDatabaseSnapshot]
-> Const
     (First [RelationalDatabaseSnapshot])
     (Maybe [RelationalDatabaseSnapshot])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetRelationalDatabaseSnapshots
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetRelationalDatabaseSnapshots
-> Maybe GetRelationalDatabaseSnapshots
forall a. a -> Maybe a
Prelude.Just (GetRelationalDatabaseSnapshots
 -> Maybe GetRelationalDatabaseSnapshots)
-> GetRelationalDatabaseSnapshots
-> Maybe GetRelationalDatabaseSnapshots
forall a b. (a -> b) -> a -> b
Prelude.$
        GetRelationalDatabaseSnapshots
rq
          GetRelationalDatabaseSnapshots
-> (GetRelationalDatabaseSnapshots
    -> GetRelationalDatabaseSnapshots)
-> GetRelationalDatabaseSnapshots
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetRelationalDatabaseSnapshots
-> Identity GetRelationalDatabaseSnapshots
Lens
  GetRelationalDatabaseSnapshots
  GetRelationalDatabaseSnapshots
  (Maybe Text)
  (Maybe Text)
getRelationalDatabaseSnapshots_pageToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetRelationalDatabaseSnapshots
 -> Identity GetRelationalDatabaseSnapshots)
-> Maybe Text
-> GetRelationalDatabaseSnapshots
-> GetRelationalDatabaseSnapshots
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetRelationalDatabaseSnapshots
GetRelationalDatabaseSnapshotsResponse
rs
          GetRelationalDatabaseSnapshotsResponse
-> Getting (First Text) GetRelationalDatabaseSnapshotsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetRelationalDatabaseSnapshotsResponse
-> Const (First Text) GetRelationalDatabaseSnapshotsResponse
Lens' GetRelationalDatabaseSnapshotsResponse (Maybe Text)
getRelationalDatabaseSnapshotsResponse_nextPageToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetRelationalDatabaseSnapshotsResponse
 -> Const (First Text) GetRelationalDatabaseSnapshotsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetRelationalDatabaseSnapshotsResponse 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
    GetRelationalDatabaseSnapshots
  where
  type
    AWSResponse GetRelationalDatabaseSnapshots =
      GetRelationalDatabaseSnapshotsResponse
  request :: GetRelationalDatabaseSnapshots
-> Request GetRelationalDatabaseSnapshots
request = Service
-> GetRelationalDatabaseSnapshots
-> Request GetRelationalDatabaseSnapshots
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetRelationalDatabaseSnapshots
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetRelationalDatabaseSnapshots)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetRelationalDatabaseSnapshots))
-> Logger
-> Service
-> Proxy GetRelationalDatabaseSnapshots
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetRelationalDatabaseSnapshots)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [RelationalDatabaseSnapshot]
-> Int
-> GetRelationalDatabaseSnapshotsResponse
GetRelationalDatabaseSnapshotsResponse'
            (Maybe Text
 -> Maybe [RelationalDatabaseSnapshot]
 -> Int
 -> GetRelationalDatabaseSnapshotsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [RelationalDatabaseSnapshot]
      -> Int -> GetRelationalDatabaseSnapshotsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextPageToken")
            Either
  String
  (Maybe [RelationalDatabaseSnapshot]
   -> Int -> GetRelationalDatabaseSnapshotsResponse)
-> Either String (Maybe [RelationalDatabaseSnapshot])
-> Either String (Int -> GetRelationalDatabaseSnapshotsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [RelationalDatabaseSnapshot]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"relationalDatabaseSnapshots"
                            Either String (Maybe (Maybe [RelationalDatabaseSnapshot]))
-> Maybe [RelationalDatabaseSnapshot]
-> Either String (Maybe [RelationalDatabaseSnapshot])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RelationalDatabaseSnapshot]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> GetRelationalDatabaseSnapshotsResponse)
-> Either String Int
-> Either String GetRelationalDatabaseSnapshotsResponse
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
    GetRelationalDatabaseSnapshots

instance
  Prelude.NFData
    GetRelationalDatabaseSnapshots

instance
  Core.ToHeaders
    GetRelationalDatabaseSnapshots
  where
  toHeaders :: GetRelationalDatabaseSnapshots -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> GetRelationalDatabaseSnapshots -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.GetRelationalDatabaseSnapshots" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetRelationalDatabaseSnapshots where
  toJSON :: GetRelationalDatabaseSnapshots -> Value
toJSON GetRelationalDatabaseSnapshots' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetRelationalDatabaseSnapshots' :: GetRelationalDatabaseSnapshots -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"pageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pageToken]
      )

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

instance Core.ToQuery GetRelationalDatabaseSnapshots where
  toQuery :: GetRelationalDatabaseSnapshots -> QueryString
toQuery = QueryString -> GetRelationalDatabaseSnapshots -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetRelationalDatabaseSnapshotsResponse' smart constructor.
data GetRelationalDatabaseSnapshotsResponse = GetRelationalDatabaseSnapshotsResponse'
  { -- | The token to advance to the next page of results from your request.
    --
    -- A next page token is not returned if there are no more results to
    -- display.
    --
    -- To get the next page of results, perform another
    -- @GetRelationalDatabaseSnapshots@ request and specify the next page token
    -- using the @pageToken@ parameter.
    GetRelationalDatabaseSnapshotsResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | An object describing the result of your get relational database
    -- snapshots request.
    GetRelationalDatabaseSnapshotsResponse
-> Maybe [RelationalDatabaseSnapshot]
relationalDatabaseSnapshots :: Prelude.Maybe [RelationalDatabaseSnapshot],
    -- | The response's http status code.
    GetRelationalDatabaseSnapshotsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRelationalDatabaseSnapshotsResponse
-> GetRelationalDatabaseSnapshotsResponse -> Bool
(GetRelationalDatabaseSnapshotsResponse
 -> GetRelationalDatabaseSnapshotsResponse -> Bool)
-> (GetRelationalDatabaseSnapshotsResponse
    -> GetRelationalDatabaseSnapshotsResponse -> Bool)
-> Eq GetRelationalDatabaseSnapshotsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseSnapshotsResponse
-> GetRelationalDatabaseSnapshotsResponse -> Bool
$c/= :: GetRelationalDatabaseSnapshotsResponse
-> GetRelationalDatabaseSnapshotsResponse -> Bool
== :: GetRelationalDatabaseSnapshotsResponse
-> GetRelationalDatabaseSnapshotsResponse -> Bool
$c== :: GetRelationalDatabaseSnapshotsResponse
-> GetRelationalDatabaseSnapshotsResponse -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseSnapshotsResponse]
ReadPrec GetRelationalDatabaseSnapshotsResponse
Int -> ReadS GetRelationalDatabaseSnapshotsResponse
ReadS [GetRelationalDatabaseSnapshotsResponse]
(Int -> ReadS GetRelationalDatabaseSnapshotsResponse)
-> ReadS [GetRelationalDatabaseSnapshotsResponse]
-> ReadPrec GetRelationalDatabaseSnapshotsResponse
-> ReadPrec [GetRelationalDatabaseSnapshotsResponse]
-> Read GetRelationalDatabaseSnapshotsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseSnapshotsResponse]
$creadListPrec :: ReadPrec [GetRelationalDatabaseSnapshotsResponse]
readPrec :: ReadPrec GetRelationalDatabaseSnapshotsResponse
$creadPrec :: ReadPrec GetRelationalDatabaseSnapshotsResponse
readList :: ReadS [GetRelationalDatabaseSnapshotsResponse]
$creadList :: ReadS [GetRelationalDatabaseSnapshotsResponse]
readsPrec :: Int -> ReadS GetRelationalDatabaseSnapshotsResponse
$creadsPrec :: Int -> ReadS GetRelationalDatabaseSnapshotsResponse
Prelude.Read, Int -> GetRelationalDatabaseSnapshotsResponse -> ShowS
[GetRelationalDatabaseSnapshotsResponse] -> ShowS
GetRelationalDatabaseSnapshotsResponse -> String
(Int -> GetRelationalDatabaseSnapshotsResponse -> ShowS)
-> (GetRelationalDatabaseSnapshotsResponse -> String)
-> ([GetRelationalDatabaseSnapshotsResponse] -> ShowS)
-> Show GetRelationalDatabaseSnapshotsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseSnapshotsResponse] -> ShowS
$cshowList :: [GetRelationalDatabaseSnapshotsResponse] -> ShowS
show :: GetRelationalDatabaseSnapshotsResponse -> String
$cshow :: GetRelationalDatabaseSnapshotsResponse -> String
showsPrec :: Int -> GetRelationalDatabaseSnapshotsResponse -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseSnapshotsResponse -> ShowS
Prelude.Show, (forall x.
 GetRelationalDatabaseSnapshotsResponse
 -> Rep GetRelationalDatabaseSnapshotsResponse x)
-> (forall x.
    Rep GetRelationalDatabaseSnapshotsResponse x
    -> GetRelationalDatabaseSnapshotsResponse)
-> Generic GetRelationalDatabaseSnapshotsResponse
forall x.
Rep GetRelationalDatabaseSnapshotsResponse x
-> GetRelationalDatabaseSnapshotsResponse
forall x.
GetRelationalDatabaseSnapshotsResponse
-> Rep GetRelationalDatabaseSnapshotsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseSnapshotsResponse x
-> GetRelationalDatabaseSnapshotsResponse
$cfrom :: forall x.
GetRelationalDatabaseSnapshotsResponse
-> Rep GetRelationalDatabaseSnapshotsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabaseSnapshotsResponse' 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:
--
-- 'nextPageToken', 'getRelationalDatabaseSnapshotsResponse_nextPageToken' - The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another
-- @GetRelationalDatabaseSnapshots@ request and specify the next page token
-- using the @pageToken@ parameter.
--
-- 'relationalDatabaseSnapshots', 'getRelationalDatabaseSnapshotsResponse_relationalDatabaseSnapshots' - An object describing the result of your get relational database
-- snapshots request.
--
-- 'httpStatus', 'getRelationalDatabaseSnapshotsResponse_httpStatus' - The response's http status code.
newGetRelationalDatabaseSnapshotsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRelationalDatabaseSnapshotsResponse
newGetRelationalDatabaseSnapshotsResponse :: Int -> GetRelationalDatabaseSnapshotsResponse
newGetRelationalDatabaseSnapshotsResponse
  Int
pHttpStatus_ =
    GetRelationalDatabaseSnapshotsResponse' :: Maybe Text
-> Maybe [RelationalDatabaseSnapshot]
-> Int
-> GetRelationalDatabaseSnapshotsResponse
GetRelationalDatabaseSnapshotsResponse'
      { $sel:nextPageToken:GetRelationalDatabaseSnapshotsResponse' :: Maybe Text
nextPageToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:relationalDatabaseSnapshots:GetRelationalDatabaseSnapshotsResponse' :: Maybe [RelationalDatabaseSnapshot]
relationalDatabaseSnapshots =
          Maybe [RelationalDatabaseSnapshot]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetRelationalDatabaseSnapshotsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another
-- @GetRelationalDatabaseSnapshots@ request and specify the next page token
-- using the @pageToken@ parameter.
getRelationalDatabaseSnapshotsResponse_nextPageToken :: Lens.Lens' GetRelationalDatabaseSnapshotsResponse (Prelude.Maybe Prelude.Text)
getRelationalDatabaseSnapshotsResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetRelationalDatabaseSnapshotsResponse
-> f GetRelationalDatabaseSnapshotsResponse
getRelationalDatabaseSnapshotsResponse_nextPageToken = (GetRelationalDatabaseSnapshotsResponse -> Maybe Text)
-> (GetRelationalDatabaseSnapshotsResponse
    -> Maybe Text -> GetRelationalDatabaseSnapshotsResponse)
-> Lens' GetRelationalDatabaseSnapshotsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseSnapshotsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetRelationalDatabaseSnapshotsResponse' :: GetRelationalDatabaseSnapshotsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetRelationalDatabaseSnapshotsResponse
s@GetRelationalDatabaseSnapshotsResponse' {} Maybe Text
a -> GetRelationalDatabaseSnapshotsResponse
s {$sel:nextPageToken:GetRelationalDatabaseSnapshotsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetRelationalDatabaseSnapshotsResponse)

-- | An object describing the result of your get relational database
-- snapshots request.
getRelationalDatabaseSnapshotsResponse_relationalDatabaseSnapshots :: Lens.Lens' GetRelationalDatabaseSnapshotsResponse (Prelude.Maybe [RelationalDatabaseSnapshot])
getRelationalDatabaseSnapshotsResponse_relationalDatabaseSnapshots :: (Maybe [RelationalDatabaseSnapshot]
 -> f (Maybe [RelationalDatabaseSnapshot]))
-> GetRelationalDatabaseSnapshotsResponse
-> f GetRelationalDatabaseSnapshotsResponse
getRelationalDatabaseSnapshotsResponse_relationalDatabaseSnapshots = (GetRelationalDatabaseSnapshotsResponse
 -> Maybe [RelationalDatabaseSnapshot])
-> (GetRelationalDatabaseSnapshotsResponse
    -> Maybe [RelationalDatabaseSnapshot]
    -> GetRelationalDatabaseSnapshotsResponse)
-> Lens'
     GetRelationalDatabaseSnapshotsResponse
     (Maybe [RelationalDatabaseSnapshot])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseSnapshotsResponse' {Maybe [RelationalDatabaseSnapshot]
relationalDatabaseSnapshots :: Maybe [RelationalDatabaseSnapshot]
$sel:relationalDatabaseSnapshots:GetRelationalDatabaseSnapshotsResponse' :: GetRelationalDatabaseSnapshotsResponse
-> Maybe [RelationalDatabaseSnapshot]
relationalDatabaseSnapshots} -> Maybe [RelationalDatabaseSnapshot]
relationalDatabaseSnapshots) (\s :: GetRelationalDatabaseSnapshotsResponse
s@GetRelationalDatabaseSnapshotsResponse' {} Maybe [RelationalDatabaseSnapshot]
a -> GetRelationalDatabaseSnapshotsResponse
s {$sel:relationalDatabaseSnapshots:GetRelationalDatabaseSnapshotsResponse' :: Maybe [RelationalDatabaseSnapshot]
relationalDatabaseSnapshots = Maybe [RelationalDatabaseSnapshot]
a} :: GetRelationalDatabaseSnapshotsResponse) ((Maybe [RelationalDatabaseSnapshot]
  -> f (Maybe [RelationalDatabaseSnapshot]))
 -> GetRelationalDatabaseSnapshotsResponse
 -> f GetRelationalDatabaseSnapshotsResponse)
-> ((Maybe [RelationalDatabaseSnapshot]
     -> f (Maybe [RelationalDatabaseSnapshot]))
    -> Maybe [RelationalDatabaseSnapshot]
    -> f (Maybe [RelationalDatabaseSnapshot]))
-> (Maybe [RelationalDatabaseSnapshot]
    -> f (Maybe [RelationalDatabaseSnapshot]))
-> GetRelationalDatabaseSnapshotsResponse
-> f GetRelationalDatabaseSnapshotsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RelationalDatabaseSnapshot]
  [RelationalDatabaseSnapshot]
  [RelationalDatabaseSnapshot]
  [RelationalDatabaseSnapshot]
-> Iso
     (Maybe [RelationalDatabaseSnapshot])
     (Maybe [RelationalDatabaseSnapshot])
     (Maybe [RelationalDatabaseSnapshot])
     (Maybe [RelationalDatabaseSnapshot])
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
  [RelationalDatabaseSnapshot]
  [RelationalDatabaseSnapshot]
  [RelationalDatabaseSnapshot]
  [RelationalDatabaseSnapshot]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetRelationalDatabaseSnapshotsResponse