{-# 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.GetRelationalDatabases
-- 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 databases in Amazon Lightsail.
--
-- This operation returns paginated results.
module Amazonka.Lightsail.GetRelationalDatabases
  ( -- * Creating a Request
    GetRelationalDatabases (..),
    newGetRelationalDatabases,

    -- * Request Lenses
    getRelationalDatabases_pageToken,

    -- * Destructuring the Response
    GetRelationalDatabasesResponse (..),
    newGetRelationalDatabasesResponse,

    -- * Response Lenses
    getRelationalDatabasesResponse_nextPageToken,
    getRelationalDatabasesResponse_relationalDatabases,
    getRelationalDatabasesResponse_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:/ 'newGetRelationalDatabases' smart constructor.
data GetRelationalDatabases = GetRelationalDatabases'
  { -- | The token to advance to the next page of results from your request.
    --
    -- To get a page token, perform an initial @GetRelationalDatabases@
    -- 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.
    GetRelationalDatabases -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetRelationalDatabases -> GetRelationalDatabases -> Bool
(GetRelationalDatabases -> GetRelationalDatabases -> Bool)
-> (GetRelationalDatabases -> GetRelationalDatabases -> Bool)
-> Eq GetRelationalDatabases
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabases -> GetRelationalDatabases -> Bool
$c/= :: GetRelationalDatabases -> GetRelationalDatabases -> Bool
== :: GetRelationalDatabases -> GetRelationalDatabases -> Bool
$c== :: GetRelationalDatabases -> GetRelationalDatabases -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabases]
ReadPrec GetRelationalDatabases
Int -> ReadS GetRelationalDatabases
ReadS [GetRelationalDatabases]
(Int -> ReadS GetRelationalDatabases)
-> ReadS [GetRelationalDatabases]
-> ReadPrec GetRelationalDatabases
-> ReadPrec [GetRelationalDatabases]
-> Read GetRelationalDatabases
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabases]
$creadListPrec :: ReadPrec [GetRelationalDatabases]
readPrec :: ReadPrec GetRelationalDatabases
$creadPrec :: ReadPrec GetRelationalDatabases
readList :: ReadS [GetRelationalDatabases]
$creadList :: ReadS [GetRelationalDatabases]
readsPrec :: Int -> ReadS GetRelationalDatabases
$creadsPrec :: Int -> ReadS GetRelationalDatabases
Prelude.Read, Int -> GetRelationalDatabases -> ShowS
[GetRelationalDatabases] -> ShowS
GetRelationalDatabases -> String
(Int -> GetRelationalDatabases -> ShowS)
-> (GetRelationalDatabases -> String)
-> ([GetRelationalDatabases] -> ShowS)
-> Show GetRelationalDatabases
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabases] -> ShowS
$cshowList :: [GetRelationalDatabases] -> ShowS
show :: GetRelationalDatabases -> String
$cshow :: GetRelationalDatabases -> String
showsPrec :: Int -> GetRelationalDatabases -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabases -> ShowS
Prelude.Show, (forall x. GetRelationalDatabases -> Rep GetRelationalDatabases x)
-> (forall x.
    Rep GetRelationalDatabases x -> GetRelationalDatabases)
-> Generic GetRelationalDatabases
forall x. Rep GetRelationalDatabases x -> GetRelationalDatabases
forall x. GetRelationalDatabases -> Rep GetRelationalDatabases x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRelationalDatabases x -> GetRelationalDatabases
$cfrom :: forall x. GetRelationalDatabases -> Rep GetRelationalDatabases x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabases' 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', 'getRelationalDatabases_pageToken' - The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetRelationalDatabases@
-- 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.
newGetRelationalDatabases ::
  GetRelationalDatabases
newGetRelationalDatabases :: GetRelationalDatabases
newGetRelationalDatabases =
  GetRelationalDatabases' :: Maybe Text -> GetRelationalDatabases
GetRelationalDatabases'
    { $sel:pageToken:GetRelationalDatabases' :: 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 @GetRelationalDatabases@
-- 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.
getRelationalDatabases_pageToken :: Lens.Lens' GetRelationalDatabases (Prelude.Maybe Prelude.Text)
getRelationalDatabases_pageToken :: (Maybe Text -> f (Maybe Text))
-> GetRelationalDatabases -> f GetRelationalDatabases
getRelationalDatabases_pageToken = (GetRelationalDatabases -> Maybe Text)
-> (GetRelationalDatabases -> Maybe Text -> GetRelationalDatabases)
-> Lens
     GetRelationalDatabases
     GetRelationalDatabases
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabases' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetRelationalDatabases' :: GetRelationalDatabases -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: GetRelationalDatabases
s@GetRelationalDatabases' {} Maybe Text
a -> GetRelationalDatabases
s {$sel:pageToken:GetRelationalDatabases' :: Maybe Text
pageToken = Maybe Text
a} :: GetRelationalDatabases)

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

instance Prelude.NFData GetRelationalDatabases

instance Core.ToHeaders GetRelationalDatabases where
  toHeaders :: GetRelationalDatabases -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetRelationalDatabases -> 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.GetRelationalDatabases" ::
                          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 GetRelationalDatabases where
  toJSON :: GetRelationalDatabases -> Value
toJSON GetRelationalDatabases' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetRelationalDatabases' :: GetRelationalDatabases -> 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 GetRelationalDatabases where
  toPath :: GetRelationalDatabases -> ByteString
toPath = ByteString -> GetRelationalDatabases -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetRelationalDatabasesResponse' smart constructor.
data GetRelationalDatabasesResponse = GetRelationalDatabasesResponse'
  { -- | 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
    -- @GetRelationalDatabases@ request and specify the next page token using
    -- the @pageToken@ parameter.
    GetRelationalDatabasesResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | An object describing the result of your get relational databases
    -- request.
    GetRelationalDatabasesResponse -> Maybe [RelationalDatabase]
relationalDatabases :: Prelude.Maybe [RelationalDatabase],
    -- | The response's http status code.
    GetRelationalDatabasesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRelationalDatabasesResponse
-> GetRelationalDatabasesResponse -> Bool
(GetRelationalDatabasesResponse
 -> GetRelationalDatabasesResponse -> Bool)
-> (GetRelationalDatabasesResponse
    -> GetRelationalDatabasesResponse -> Bool)
-> Eq GetRelationalDatabasesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabasesResponse
-> GetRelationalDatabasesResponse -> Bool
$c/= :: GetRelationalDatabasesResponse
-> GetRelationalDatabasesResponse -> Bool
== :: GetRelationalDatabasesResponse
-> GetRelationalDatabasesResponse -> Bool
$c== :: GetRelationalDatabasesResponse
-> GetRelationalDatabasesResponse -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabasesResponse]
ReadPrec GetRelationalDatabasesResponse
Int -> ReadS GetRelationalDatabasesResponse
ReadS [GetRelationalDatabasesResponse]
(Int -> ReadS GetRelationalDatabasesResponse)
-> ReadS [GetRelationalDatabasesResponse]
-> ReadPrec GetRelationalDatabasesResponse
-> ReadPrec [GetRelationalDatabasesResponse]
-> Read GetRelationalDatabasesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabasesResponse]
$creadListPrec :: ReadPrec [GetRelationalDatabasesResponse]
readPrec :: ReadPrec GetRelationalDatabasesResponse
$creadPrec :: ReadPrec GetRelationalDatabasesResponse
readList :: ReadS [GetRelationalDatabasesResponse]
$creadList :: ReadS [GetRelationalDatabasesResponse]
readsPrec :: Int -> ReadS GetRelationalDatabasesResponse
$creadsPrec :: Int -> ReadS GetRelationalDatabasesResponse
Prelude.Read, Int -> GetRelationalDatabasesResponse -> ShowS
[GetRelationalDatabasesResponse] -> ShowS
GetRelationalDatabasesResponse -> String
(Int -> GetRelationalDatabasesResponse -> ShowS)
-> (GetRelationalDatabasesResponse -> String)
-> ([GetRelationalDatabasesResponse] -> ShowS)
-> Show GetRelationalDatabasesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabasesResponse] -> ShowS
$cshowList :: [GetRelationalDatabasesResponse] -> ShowS
show :: GetRelationalDatabasesResponse -> String
$cshow :: GetRelationalDatabasesResponse -> String
showsPrec :: Int -> GetRelationalDatabasesResponse -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabasesResponse -> ShowS
Prelude.Show, (forall x.
 GetRelationalDatabasesResponse
 -> Rep GetRelationalDatabasesResponse x)
-> (forall x.
    Rep GetRelationalDatabasesResponse x
    -> GetRelationalDatabasesResponse)
-> Generic GetRelationalDatabasesResponse
forall x.
Rep GetRelationalDatabasesResponse x
-> GetRelationalDatabasesResponse
forall x.
GetRelationalDatabasesResponse
-> Rep GetRelationalDatabasesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabasesResponse x
-> GetRelationalDatabasesResponse
$cfrom :: forall x.
GetRelationalDatabasesResponse
-> Rep GetRelationalDatabasesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabasesResponse' 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', 'getRelationalDatabasesResponse_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
-- @GetRelationalDatabases@ request and specify the next page token using
-- the @pageToken@ parameter.
--
-- 'relationalDatabases', 'getRelationalDatabasesResponse_relationalDatabases' - An object describing the result of your get relational databases
-- request.
--
-- 'httpStatus', 'getRelationalDatabasesResponse_httpStatus' - The response's http status code.
newGetRelationalDatabasesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRelationalDatabasesResponse
newGetRelationalDatabasesResponse :: Int -> GetRelationalDatabasesResponse
newGetRelationalDatabasesResponse Int
pHttpStatus_ =
  GetRelationalDatabasesResponse' :: Maybe Text
-> Maybe [RelationalDatabase]
-> Int
-> GetRelationalDatabasesResponse
GetRelationalDatabasesResponse'
    { $sel:nextPageToken:GetRelationalDatabasesResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:relationalDatabases:GetRelationalDatabasesResponse' :: Maybe [RelationalDatabase]
relationalDatabases = Maybe [RelationalDatabase]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRelationalDatabasesResponse' :: 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
-- @GetRelationalDatabases@ request and specify the next page token using
-- the @pageToken@ parameter.
getRelationalDatabasesResponse_nextPageToken :: Lens.Lens' GetRelationalDatabasesResponse (Prelude.Maybe Prelude.Text)
getRelationalDatabasesResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetRelationalDatabasesResponse
-> f GetRelationalDatabasesResponse
getRelationalDatabasesResponse_nextPageToken = (GetRelationalDatabasesResponse -> Maybe Text)
-> (GetRelationalDatabasesResponse
    -> Maybe Text -> GetRelationalDatabasesResponse)
-> Lens' GetRelationalDatabasesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabasesResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetRelationalDatabasesResponse' :: GetRelationalDatabasesResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetRelationalDatabasesResponse
s@GetRelationalDatabasesResponse' {} Maybe Text
a -> GetRelationalDatabasesResponse
s {$sel:nextPageToken:GetRelationalDatabasesResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetRelationalDatabasesResponse)

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

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

instance
  Prelude.NFData
    GetRelationalDatabasesResponse