{-# 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.GetRelationalDatabaseEvents
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of events for a specific database in Amazon Lightsail.
--
-- This operation returns paginated results.
module Amazonka.Lightsail.GetRelationalDatabaseEvents
  ( -- * Creating a Request
    GetRelationalDatabaseEvents (..),
    newGetRelationalDatabaseEvents,

    -- * Request Lenses
    getRelationalDatabaseEvents_durationInMinutes,
    getRelationalDatabaseEvents_pageToken,
    getRelationalDatabaseEvents_relationalDatabaseName,

    -- * Destructuring the Response
    GetRelationalDatabaseEventsResponse (..),
    newGetRelationalDatabaseEventsResponse,

    -- * Response Lenses
    getRelationalDatabaseEventsResponse_nextPageToken,
    getRelationalDatabaseEventsResponse_relationalDatabaseEvents,
    getRelationalDatabaseEventsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetRelationalDatabaseEvents' smart constructor.
data GetRelationalDatabaseEvents = GetRelationalDatabaseEvents'
  { -- | The number of minutes in the past from which to retrieve events. For
    -- example, to get all events from the past 2 hours, enter 120.
    --
    -- Default: @60@
    --
    -- The minimum is 1 and the maximum is 14 days (20160 minutes).
    GetRelationalDatabaseEvents -> Maybe Int
durationInMinutes :: Prelude.Maybe Prelude.Int,
    -- | The token to advance to the next page of results from your request.
    --
    -- To get a page token, perform an initial @GetRelationalDatabaseEvents@
    -- 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.
    GetRelationalDatabaseEvents -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the database from which to get events.
    GetRelationalDatabaseEvents -> Text
relationalDatabaseName :: Prelude.Text
  }
  deriving (GetRelationalDatabaseEvents -> GetRelationalDatabaseEvents -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseEvents -> GetRelationalDatabaseEvents -> Bool
$c/= :: GetRelationalDatabaseEvents -> GetRelationalDatabaseEvents -> Bool
== :: GetRelationalDatabaseEvents -> GetRelationalDatabaseEvents -> Bool
$c== :: GetRelationalDatabaseEvents -> GetRelationalDatabaseEvents -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseEvents]
ReadPrec GetRelationalDatabaseEvents
Int -> ReadS GetRelationalDatabaseEvents
ReadS [GetRelationalDatabaseEvents]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseEvents]
$creadListPrec :: ReadPrec [GetRelationalDatabaseEvents]
readPrec :: ReadPrec GetRelationalDatabaseEvents
$creadPrec :: ReadPrec GetRelationalDatabaseEvents
readList :: ReadS [GetRelationalDatabaseEvents]
$creadList :: ReadS [GetRelationalDatabaseEvents]
readsPrec :: Int -> ReadS GetRelationalDatabaseEvents
$creadsPrec :: Int -> ReadS GetRelationalDatabaseEvents
Prelude.Read, Int -> GetRelationalDatabaseEvents -> ShowS
[GetRelationalDatabaseEvents] -> ShowS
GetRelationalDatabaseEvents -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseEvents] -> ShowS
$cshowList :: [GetRelationalDatabaseEvents] -> ShowS
show :: GetRelationalDatabaseEvents -> String
$cshow :: GetRelationalDatabaseEvents -> String
showsPrec :: Int -> GetRelationalDatabaseEvents -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseEvents -> ShowS
Prelude.Show, forall x.
Rep GetRelationalDatabaseEvents x -> GetRelationalDatabaseEvents
forall x.
GetRelationalDatabaseEvents -> Rep GetRelationalDatabaseEvents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseEvents x -> GetRelationalDatabaseEvents
$cfrom :: forall x.
GetRelationalDatabaseEvents -> Rep GetRelationalDatabaseEvents x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabaseEvents' 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:
--
-- 'durationInMinutes', 'getRelationalDatabaseEvents_durationInMinutes' - The number of minutes in the past from which to retrieve events. For
-- example, to get all events from the past 2 hours, enter 120.
--
-- Default: @60@
--
-- The minimum is 1 and the maximum is 14 days (20160 minutes).
--
-- 'pageToken', 'getRelationalDatabaseEvents_pageToken' - The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetRelationalDatabaseEvents@
-- 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.
--
-- 'relationalDatabaseName', 'getRelationalDatabaseEvents_relationalDatabaseName' - The name of the database from which to get events.
newGetRelationalDatabaseEvents ::
  -- | 'relationalDatabaseName'
  Prelude.Text ->
  GetRelationalDatabaseEvents
newGetRelationalDatabaseEvents :: Text -> GetRelationalDatabaseEvents
newGetRelationalDatabaseEvents
  Text
pRelationalDatabaseName_ =
    GetRelationalDatabaseEvents'
      { $sel:durationInMinutes:GetRelationalDatabaseEvents' :: Maybe Int
durationInMinutes =
          forall a. Maybe a
Prelude.Nothing,
        $sel:pageToken:GetRelationalDatabaseEvents' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing,
        $sel:relationalDatabaseName:GetRelationalDatabaseEvents' :: Text
relationalDatabaseName =
          Text
pRelationalDatabaseName_
      }

-- | The number of minutes in the past from which to retrieve events. For
-- example, to get all events from the past 2 hours, enter 120.
--
-- Default: @60@
--
-- The minimum is 1 and the maximum is 14 days (20160 minutes).
getRelationalDatabaseEvents_durationInMinutes :: Lens.Lens' GetRelationalDatabaseEvents (Prelude.Maybe Prelude.Int)
getRelationalDatabaseEvents_durationInMinutes :: Lens' GetRelationalDatabaseEvents (Maybe Int)
getRelationalDatabaseEvents_durationInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseEvents' {Maybe Int
durationInMinutes :: Maybe Int
$sel:durationInMinutes:GetRelationalDatabaseEvents' :: GetRelationalDatabaseEvents -> Maybe Int
durationInMinutes} -> Maybe Int
durationInMinutes) (\s :: GetRelationalDatabaseEvents
s@GetRelationalDatabaseEvents' {} Maybe Int
a -> GetRelationalDatabaseEvents
s {$sel:durationInMinutes:GetRelationalDatabaseEvents' :: Maybe Int
durationInMinutes = Maybe Int
a} :: GetRelationalDatabaseEvents)

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

-- | The name of the database from which to get events.
getRelationalDatabaseEvents_relationalDatabaseName :: Lens.Lens' GetRelationalDatabaseEvents Prelude.Text
getRelationalDatabaseEvents_relationalDatabaseName :: Lens' GetRelationalDatabaseEvents Text
getRelationalDatabaseEvents_relationalDatabaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseEvents' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:GetRelationalDatabaseEvents' :: GetRelationalDatabaseEvents -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: GetRelationalDatabaseEvents
s@GetRelationalDatabaseEvents' {} Text
a -> GetRelationalDatabaseEvents
s {$sel:relationalDatabaseName:GetRelationalDatabaseEvents' :: Text
relationalDatabaseName = Text
a} :: GetRelationalDatabaseEvents)

instance Core.AWSPager GetRelationalDatabaseEvents where
  page :: GetRelationalDatabaseEvents
-> AWSResponse GetRelationalDatabaseEvents
-> Maybe GetRelationalDatabaseEvents
page GetRelationalDatabaseEvents
rq AWSResponse GetRelationalDatabaseEvents
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRelationalDatabaseEvents
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetRelationalDatabaseEventsResponse (Maybe Text)
getRelationalDatabaseEventsResponse_nextPageToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRelationalDatabaseEvents
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetRelationalDatabaseEventsResponse
  (Maybe [RelationalDatabaseEvent])
getRelationalDatabaseEventsResponse_relationalDatabaseEvents
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetRelationalDatabaseEvents
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetRelationalDatabaseEvents (Maybe Text)
getRelationalDatabaseEvents_pageToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetRelationalDatabaseEvents
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetRelationalDatabaseEventsResponse (Maybe Text)
getRelationalDatabaseEventsResponse_nextPageToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetRelationalDatabaseEvents where
  type
    AWSResponse GetRelationalDatabaseEvents =
      GetRelationalDatabaseEventsResponse
  request :: (Service -> Service)
-> GetRelationalDatabaseEvents
-> Request GetRelationalDatabaseEvents
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetRelationalDatabaseEvents
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRelationalDatabaseEvents)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [RelationalDatabaseEvent]
-> Int
-> GetRelationalDatabaseEventsResponse
GetRelationalDatabaseEventsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextPageToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"relationalDatabaseEvents"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetRelationalDatabaseEvents where
  hashWithSalt :: Int -> GetRelationalDatabaseEvents -> Int
hashWithSalt Int
_salt GetRelationalDatabaseEvents' {Maybe Int
Maybe Text
Text
relationalDatabaseName :: Text
pageToken :: Maybe Text
durationInMinutes :: Maybe Int
$sel:relationalDatabaseName:GetRelationalDatabaseEvents' :: GetRelationalDatabaseEvents -> Text
$sel:pageToken:GetRelationalDatabaseEvents' :: GetRelationalDatabaseEvents -> Maybe Text
$sel:durationInMinutes:GetRelationalDatabaseEvents' :: GetRelationalDatabaseEvents -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
durationInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pageToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
relationalDatabaseName

instance Prelude.NFData GetRelationalDatabaseEvents where
  rnf :: GetRelationalDatabaseEvents -> ()
rnf GetRelationalDatabaseEvents' {Maybe Int
Maybe Text
Text
relationalDatabaseName :: Text
pageToken :: Maybe Text
durationInMinutes :: Maybe Int
$sel:relationalDatabaseName:GetRelationalDatabaseEvents' :: GetRelationalDatabaseEvents -> Text
$sel:pageToken:GetRelationalDatabaseEvents' :: GetRelationalDatabaseEvents -> Maybe Text
$sel:durationInMinutes:GetRelationalDatabaseEvents' :: GetRelationalDatabaseEvents -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
durationInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
relationalDatabaseName

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

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

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

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

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

-- |
-- Create a value of 'GetRelationalDatabaseEventsResponse' 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', 'getRelationalDatabaseEventsResponse_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
-- @GetRelationalDatabaseEvents@ request and specify the next page token
-- using the @pageToken@ parameter.
--
-- 'relationalDatabaseEvents', 'getRelationalDatabaseEventsResponse_relationalDatabaseEvents' - An object describing the result of your get relational database events
-- request.
--
-- 'httpStatus', 'getRelationalDatabaseEventsResponse_httpStatus' - The response's http status code.
newGetRelationalDatabaseEventsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRelationalDatabaseEventsResponse
newGetRelationalDatabaseEventsResponse :: Int -> GetRelationalDatabaseEventsResponse
newGetRelationalDatabaseEventsResponse Int
pHttpStatus_ =
  GetRelationalDatabaseEventsResponse'
    { $sel:nextPageToken:GetRelationalDatabaseEventsResponse' :: Maybe Text
nextPageToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:relationalDatabaseEvents:GetRelationalDatabaseEventsResponse' :: Maybe [RelationalDatabaseEvent]
relationalDatabaseEvents =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRelationalDatabaseEventsResponse' :: 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
-- @GetRelationalDatabaseEvents@ request and specify the next page token
-- using the @pageToken@ parameter.
getRelationalDatabaseEventsResponse_nextPageToken :: Lens.Lens' GetRelationalDatabaseEventsResponse (Prelude.Maybe Prelude.Text)
getRelationalDatabaseEventsResponse_nextPageToken :: Lens' GetRelationalDatabaseEventsResponse (Maybe Text)
getRelationalDatabaseEventsResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseEventsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetRelationalDatabaseEventsResponse' :: GetRelationalDatabaseEventsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetRelationalDatabaseEventsResponse
s@GetRelationalDatabaseEventsResponse' {} Maybe Text
a -> GetRelationalDatabaseEventsResponse
s {$sel:nextPageToken:GetRelationalDatabaseEventsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetRelationalDatabaseEventsResponse)

-- | An object describing the result of your get relational database events
-- request.
getRelationalDatabaseEventsResponse_relationalDatabaseEvents :: Lens.Lens' GetRelationalDatabaseEventsResponse (Prelude.Maybe [RelationalDatabaseEvent])
getRelationalDatabaseEventsResponse_relationalDatabaseEvents :: Lens'
  GetRelationalDatabaseEventsResponse
  (Maybe [RelationalDatabaseEvent])
getRelationalDatabaseEventsResponse_relationalDatabaseEvents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseEventsResponse' {Maybe [RelationalDatabaseEvent]
relationalDatabaseEvents :: Maybe [RelationalDatabaseEvent]
$sel:relationalDatabaseEvents:GetRelationalDatabaseEventsResponse' :: GetRelationalDatabaseEventsResponse
-> Maybe [RelationalDatabaseEvent]
relationalDatabaseEvents} -> Maybe [RelationalDatabaseEvent]
relationalDatabaseEvents) (\s :: GetRelationalDatabaseEventsResponse
s@GetRelationalDatabaseEventsResponse' {} Maybe [RelationalDatabaseEvent]
a -> GetRelationalDatabaseEventsResponse
s {$sel:relationalDatabaseEvents:GetRelationalDatabaseEventsResponse' :: Maybe [RelationalDatabaseEvent]
relationalDatabaseEvents = Maybe [RelationalDatabaseEvent]
a} :: GetRelationalDatabaseEventsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetRelationalDatabaseEventsResponse
  where
  rnf :: GetRelationalDatabaseEventsResponse -> ()
rnf GetRelationalDatabaseEventsResponse' {Int
Maybe [RelationalDatabaseEvent]
Maybe Text
httpStatus :: Int
relationalDatabaseEvents :: Maybe [RelationalDatabaseEvent]
nextPageToken :: Maybe Text
$sel:httpStatus:GetRelationalDatabaseEventsResponse' :: GetRelationalDatabaseEventsResponse -> Int
$sel:relationalDatabaseEvents:GetRelationalDatabaseEventsResponse' :: GetRelationalDatabaseEventsResponse
-> Maybe [RelationalDatabaseEvent]
$sel:nextPageToken:GetRelationalDatabaseEventsResponse' :: GetRelationalDatabaseEventsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextPageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RelationalDatabaseEvent]
relationalDatabaseEvents
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus