{-# 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 #-}
module Amazonka.Lightsail.GetRelationalDatabaseLogStreams
(
GetRelationalDatabaseLogStreams (..),
newGetRelationalDatabaseLogStreams,
getRelationalDatabaseLogStreams_relationalDatabaseName,
GetRelationalDatabaseLogStreamsResponse (..),
newGetRelationalDatabaseLogStreamsResponse,
getRelationalDatabaseLogStreamsResponse_logStreams,
getRelationalDatabaseLogStreamsResponse_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
data GetRelationalDatabaseLogStreams = GetRelationalDatabaseLogStreams'
{
GetRelationalDatabaseLogStreams -> Text
relationalDatabaseName :: Prelude.Text
}
deriving (GetRelationalDatabaseLogStreams
-> GetRelationalDatabaseLogStreams -> Bool
(GetRelationalDatabaseLogStreams
-> GetRelationalDatabaseLogStreams -> Bool)
-> (GetRelationalDatabaseLogStreams
-> GetRelationalDatabaseLogStreams -> Bool)
-> Eq GetRelationalDatabaseLogStreams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseLogStreams
-> GetRelationalDatabaseLogStreams -> Bool
$c/= :: GetRelationalDatabaseLogStreams
-> GetRelationalDatabaseLogStreams -> Bool
== :: GetRelationalDatabaseLogStreams
-> GetRelationalDatabaseLogStreams -> Bool
$c== :: GetRelationalDatabaseLogStreams
-> GetRelationalDatabaseLogStreams -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseLogStreams]
ReadPrec GetRelationalDatabaseLogStreams
Int -> ReadS GetRelationalDatabaseLogStreams
ReadS [GetRelationalDatabaseLogStreams]
(Int -> ReadS GetRelationalDatabaseLogStreams)
-> ReadS [GetRelationalDatabaseLogStreams]
-> ReadPrec GetRelationalDatabaseLogStreams
-> ReadPrec [GetRelationalDatabaseLogStreams]
-> Read GetRelationalDatabaseLogStreams
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseLogStreams]
$creadListPrec :: ReadPrec [GetRelationalDatabaseLogStreams]
readPrec :: ReadPrec GetRelationalDatabaseLogStreams
$creadPrec :: ReadPrec GetRelationalDatabaseLogStreams
readList :: ReadS [GetRelationalDatabaseLogStreams]
$creadList :: ReadS [GetRelationalDatabaseLogStreams]
readsPrec :: Int -> ReadS GetRelationalDatabaseLogStreams
$creadsPrec :: Int -> ReadS GetRelationalDatabaseLogStreams
Prelude.Read, Int -> GetRelationalDatabaseLogStreams -> ShowS
[GetRelationalDatabaseLogStreams] -> ShowS
GetRelationalDatabaseLogStreams -> String
(Int -> GetRelationalDatabaseLogStreams -> ShowS)
-> (GetRelationalDatabaseLogStreams -> String)
-> ([GetRelationalDatabaseLogStreams] -> ShowS)
-> Show GetRelationalDatabaseLogStreams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseLogStreams] -> ShowS
$cshowList :: [GetRelationalDatabaseLogStreams] -> ShowS
show :: GetRelationalDatabaseLogStreams -> String
$cshow :: GetRelationalDatabaseLogStreams -> String
showsPrec :: Int -> GetRelationalDatabaseLogStreams -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseLogStreams -> ShowS
Prelude.Show, (forall x.
GetRelationalDatabaseLogStreams
-> Rep GetRelationalDatabaseLogStreams x)
-> (forall x.
Rep GetRelationalDatabaseLogStreams x
-> GetRelationalDatabaseLogStreams)
-> Generic GetRelationalDatabaseLogStreams
forall x.
Rep GetRelationalDatabaseLogStreams x
-> GetRelationalDatabaseLogStreams
forall x.
GetRelationalDatabaseLogStreams
-> Rep GetRelationalDatabaseLogStreams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseLogStreams x
-> GetRelationalDatabaseLogStreams
$cfrom :: forall x.
GetRelationalDatabaseLogStreams
-> Rep GetRelationalDatabaseLogStreams x
Prelude.Generic)
newGetRelationalDatabaseLogStreams ::
Prelude.Text ->
GetRelationalDatabaseLogStreams
newGetRelationalDatabaseLogStreams :: Text -> GetRelationalDatabaseLogStreams
newGetRelationalDatabaseLogStreams
Text
pRelationalDatabaseName_ =
GetRelationalDatabaseLogStreams' :: Text -> GetRelationalDatabaseLogStreams
GetRelationalDatabaseLogStreams'
{ $sel:relationalDatabaseName:GetRelationalDatabaseLogStreams' :: Text
relationalDatabaseName =
Text
pRelationalDatabaseName_
}
getRelationalDatabaseLogStreams_relationalDatabaseName :: Lens.Lens' GetRelationalDatabaseLogStreams Prelude.Text
getRelationalDatabaseLogStreams_relationalDatabaseName :: (Text -> f Text)
-> GetRelationalDatabaseLogStreams
-> f GetRelationalDatabaseLogStreams
getRelationalDatabaseLogStreams_relationalDatabaseName = (GetRelationalDatabaseLogStreams -> Text)
-> (GetRelationalDatabaseLogStreams
-> Text -> GetRelationalDatabaseLogStreams)
-> Lens
GetRelationalDatabaseLogStreams
GetRelationalDatabaseLogStreams
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseLogStreams' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:GetRelationalDatabaseLogStreams' :: GetRelationalDatabaseLogStreams -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: GetRelationalDatabaseLogStreams
s@GetRelationalDatabaseLogStreams' {} Text
a -> GetRelationalDatabaseLogStreams
s {$sel:relationalDatabaseName:GetRelationalDatabaseLogStreams' :: Text
relationalDatabaseName = Text
a} :: GetRelationalDatabaseLogStreams)
instance
Core.AWSRequest
GetRelationalDatabaseLogStreams
where
type
AWSResponse GetRelationalDatabaseLogStreams =
GetRelationalDatabaseLogStreamsResponse
request :: GetRelationalDatabaseLogStreams
-> Request GetRelationalDatabaseLogStreams
request = Service
-> GetRelationalDatabaseLogStreams
-> Request GetRelationalDatabaseLogStreams
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetRelationalDatabaseLogStreams
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetRelationalDatabaseLogStreams)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetRelationalDatabaseLogStreams))
-> Logger
-> Service
-> Proxy GetRelationalDatabaseLogStreams
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetRelationalDatabaseLogStreams)))
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] -> Int -> GetRelationalDatabaseLogStreamsResponse
GetRelationalDatabaseLogStreamsResponse'
(Maybe [Text] -> Int -> GetRelationalDatabaseLogStreamsResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> GetRelationalDatabaseLogStreamsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"logStreams" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetRelationalDatabaseLogStreamsResponse)
-> Either String Int
-> Either String GetRelationalDatabaseLogStreamsResponse
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
GetRelationalDatabaseLogStreams
instance
Prelude.NFData
GetRelationalDatabaseLogStreams
instance
Core.ToHeaders
GetRelationalDatabaseLogStreams
where
toHeaders :: GetRelationalDatabaseLogStreams -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetRelationalDatabaseLogStreams -> 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.GetRelationalDatabaseLogStreams" ::
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 GetRelationalDatabaseLogStreams where
toJSON :: GetRelationalDatabaseLogStreams -> Value
toJSON GetRelationalDatabaseLogStreams' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:GetRelationalDatabaseLogStreams' :: GetRelationalDatabaseLogStreams -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"relationalDatabaseName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
relationalDatabaseName
)
]
)
instance Core.ToPath GetRelationalDatabaseLogStreams where
toPath :: GetRelationalDatabaseLogStreams -> ByteString
toPath = ByteString -> GetRelationalDatabaseLogStreams -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetRelationalDatabaseLogStreams where
toQuery :: GetRelationalDatabaseLogStreams -> QueryString
toQuery = QueryString -> GetRelationalDatabaseLogStreams -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetRelationalDatabaseLogStreamsResponse = GetRelationalDatabaseLogStreamsResponse'
{
GetRelationalDatabaseLogStreamsResponse -> Maybe [Text]
logStreams :: Prelude.Maybe [Prelude.Text],
GetRelationalDatabaseLogStreamsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetRelationalDatabaseLogStreamsResponse
-> GetRelationalDatabaseLogStreamsResponse -> Bool
(GetRelationalDatabaseLogStreamsResponse
-> GetRelationalDatabaseLogStreamsResponse -> Bool)
-> (GetRelationalDatabaseLogStreamsResponse
-> GetRelationalDatabaseLogStreamsResponse -> Bool)
-> Eq GetRelationalDatabaseLogStreamsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseLogStreamsResponse
-> GetRelationalDatabaseLogStreamsResponse -> Bool
$c/= :: GetRelationalDatabaseLogStreamsResponse
-> GetRelationalDatabaseLogStreamsResponse -> Bool
== :: GetRelationalDatabaseLogStreamsResponse
-> GetRelationalDatabaseLogStreamsResponse -> Bool
$c== :: GetRelationalDatabaseLogStreamsResponse
-> GetRelationalDatabaseLogStreamsResponse -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseLogStreamsResponse]
ReadPrec GetRelationalDatabaseLogStreamsResponse
Int -> ReadS GetRelationalDatabaseLogStreamsResponse
ReadS [GetRelationalDatabaseLogStreamsResponse]
(Int -> ReadS GetRelationalDatabaseLogStreamsResponse)
-> ReadS [GetRelationalDatabaseLogStreamsResponse]
-> ReadPrec GetRelationalDatabaseLogStreamsResponse
-> ReadPrec [GetRelationalDatabaseLogStreamsResponse]
-> Read GetRelationalDatabaseLogStreamsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseLogStreamsResponse]
$creadListPrec :: ReadPrec [GetRelationalDatabaseLogStreamsResponse]
readPrec :: ReadPrec GetRelationalDatabaseLogStreamsResponse
$creadPrec :: ReadPrec GetRelationalDatabaseLogStreamsResponse
readList :: ReadS [GetRelationalDatabaseLogStreamsResponse]
$creadList :: ReadS [GetRelationalDatabaseLogStreamsResponse]
readsPrec :: Int -> ReadS GetRelationalDatabaseLogStreamsResponse
$creadsPrec :: Int -> ReadS GetRelationalDatabaseLogStreamsResponse
Prelude.Read, Int -> GetRelationalDatabaseLogStreamsResponse -> ShowS
[GetRelationalDatabaseLogStreamsResponse] -> ShowS
GetRelationalDatabaseLogStreamsResponse -> String
(Int -> GetRelationalDatabaseLogStreamsResponse -> ShowS)
-> (GetRelationalDatabaseLogStreamsResponse -> String)
-> ([GetRelationalDatabaseLogStreamsResponse] -> ShowS)
-> Show GetRelationalDatabaseLogStreamsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseLogStreamsResponse] -> ShowS
$cshowList :: [GetRelationalDatabaseLogStreamsResponse] -> ShowS
show :: GetRelationalDatabaseLogStreamsResponse -> String
$cshow :: GetRelationalDatabaseLogStreamsResponse -> String
showsPrec :: Int -> GetRelationalDatabaseLogStreamsResponse -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseLogStreamsResponse -> ShowS
Prelude.Show, (forall x.
GetRelationalDatabaseLogStreamsResponse
-> Rep GetRelationalDatabaseLogStreamsResponse x)
-> (forall x.
Rep GetRelationalDatabaseLogStreamsResponse x
-> GetRelationalDatabaseLogStreamsResponse)
-> Generic GetRelationalDatabaseLogStreamsResponse
forall x.
Rep GetRelationalDatabaseLogStreamsResponse x
-> GetRelationalDatabaseLogStreamsResponse
forall x.
GetRelationalDatabaseLogStreamsResponse
-> Rep GetRelationalDatabaseLogStreamsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseLogStreamsResponse x
-> GetRelationalDatabaseLogStreamsResponse
$cfrom :: forall x.
GetRelationalDatabaseLogStreamsResponse
-> Rep GetRelationalDatabaseLogStreamsResponse x
Prelude.Generic)
newGetRelationalDatabaseLogStreamsResponse ::
Prelude.Int ->
GetRelationalDatabaseLogStreamsResponse
newGetRelationalDatabaseLogStreamsResponse :: Int -> GetRelationalDatabaseLogStreamsResponse
newGetRelationalDatabaseLogStreamsResponse
Int
pHttpStatus_ =
GetRelationalDatabaseLogStreamsResponse' :: Maybe [Text] -> Int -> GetRelationalDatabaseLogStreamsResponse
GetRelationalDatabaseLogStreamsResponse'
{ $sel:logStreams:GetRelationalDatabaseLogStreamsResponse' :: Maybe [Text]
logStreams =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetRelationalDatabaseLogStreamsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getRelationalDatabaseLogStreamsResponse_logStreams :: Lens.Lens' GetRelationalDatabaseLogStreamsResponse (Prelude.Maybe [Prelude.Text])
getRelationalDatabaseLogStreamsResponse_logStreams :: (Maybe [Text] -> f (Maybe [Text]))
-> GetRelationalDatabaseLogStreamsResponse
-> f GetRelationalDatabaseLogStreamsResponse
getRelationalDatabaseLogStreamsResponse_logStreams = (GetRelationalDatabaseLogStreamsResponse -> Maybe [Text])
-> (GetRelationalDatabaseLogStreamsResponse
-> Maybe [Text] -> GetRelationalDatabaseLogStreamsResponse)
-> Lens
GetRelationalDatabaseLogStreamsResponse
GetRelationalDatabaseLogStreamsResponse
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseLogStreamsResponse' {Maybe [Text]
logStreams :: Maybe [Text]
$sel:logStreams:GetRelationalDatabaseLogStreamsResponse' :: GetRelationalDatabaseLogStreamsResponse -> Maybe [Text]
logStreams} -> Maybe [Text]
logStreams) (\s :: GetRelationalDatabaseLogStreamsResponse
s@GetRelationalDatabaseLogStreamsResponse' {} Maybe [Text]
a -> GetRelationalDatabaseLogStreamsResponse
s {$sel:logStreams:GetRelationalDatabaseLogStreamsResponse' :: Maybe [Text]
logStreams = Maybe [Text]
a} :: GetRelationalDatabaseLogStreamsResponse) ((Maybe [Text] -> f (Maybe [Text]))
-> GetRelationalDatabaseLogStreamsResponse
-> f GetRelationalDatabaseLogStreamsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetRelationalDatabaseLogStreamsResponse
-> f GetRelationalDatabaseLogStreamsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getRelationalDatabaseLogStreamsResponse_httpStatus :: Lens.Lens' GetRelationalDatabaseLogStreamsResponse Prelude.Int
getRelationalDatabaseLogStreamsResponse_httpStatus :: (Int -> f Int)
-> GetRelationalDatabaseLogStreamsResponse
-> f GetRelationalDatabaseLogStreamsResponse
getRelationalDatabaseLogStreamsResponse_httpStatus = (GetRelationalDatabaseLogStreamsResponse -> Int)
-> (GetRelationalDatabaseLogStreamsResponse
-> Int -> GetRelationalDatabaseLogStreamsResponse)
-> Lens
GetRelationalDatabaseLogStreamsResponse
GetRelationalDatabaseLogStreamsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseLogStreamsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRelationalDatabaseLogStreamsResponse' :: GetRelationalDatabaseLogStreamsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRelationalDatabaseLogStreamsResponse
s@GetRelationalDatabaseLogStreamsResponse' {} Int
a -> GetRelationalDatabaseLogStreamsResponse
s {$sel:httpStatus:GetRelationalDatabaseLogStreamsResponse' :: Int
httpStatus = Int
a} :: GetRelationalDatabaseLogStreamsResponse)
instance
Prelude.NFData
GetRelationalDatabaseLogStreamsResponse