{-# 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.GetRelationalDatabaseBlueprints
(
GetRelationalDatabaseBlueprints (..),
newGetRelationalDatabaseBlueprints,
getRelationalDatabaseBlueprints_pageToken,
GetRelationalDatabaseBlueprintsResponse (..),
newGetRelationalDatabaseBlueprintsResponse,
getRelationalDatabaseBlueprintsResponse_blueprints,
getRelationalDatabaseBlueprintsResponse_nextPageToken,
getRelationalDatabaseBlueprintsResponse_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
data GetRelationalDatabaseBlueprints = GetRelationalDatabaseBlueprints'
{
GetRelationalDatabaseBlueprints -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
}
deriving (GetRelationalDatabaseBlueprints
-> GetRelationalDatabaseBlueprints -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseBlueprints
-> GetRelationalDatabaseBlueprints -> Bool
$c/= :: GetRelationalDatabaseBlueprints
-> GetRelationalDatabaseBlueprints -> Bool
== :: GetRelationalDatabaseBlueprints
-> GetRelationalDatabaseBlueprints -> Bool
$c== :: GetRelationalDatabaseBlueprints
-> GetRelationalDatabaseBlueprints -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseBlueprints]
ReadPrec GetRelationalDatabaseBlueprints
Int -> ReadS GetRelationalDatabaseBlueprints
ReadS [GetRelationalDatabaseBlueprints]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseBlueprints]
$creadListPrec :: ReadPrec [GetRelationalDatabaseBlueprints]
readPrec :: ReadPrec GetRelationalDatabaseBlueprints
$creadPrec :: ReadPrec GetRelationalDatabaseBlueprints
readList :: ReadS [GetRelationalDatabaseBlueprints]
$creadList :: ReadS [GetRelationalDatabaseBlueprints]
readsPrec :: Int -> ReadS GetRelationalDatabaseBlueprints
$creadsPrec :: Int -> ReadS GetRelationalDatabaseBlueprints
Prelude.Read, Int -> GetRelationalDatabaseBlueprints -> ShowS
[GetRelationalDatabaseBlueprints] -> ShowS
GetRelationalDatabaseBlueprints -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseBlueprints] -> ShowS
$cshowList :: [GetRelationalDatabaseBlueprints] -> ShowS
show :: GetRelationalDatabaseBlueprints -> String
$cshow :: GetRelationalDatabaseBlueprints -> String
showsPrec :: Int -> GetRelationalDatabaseBlueprints -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseBlueprints -> ShowS
Prelude.Show, forall x.
Rep GetRelationalDatabaseBlueprints x
-> GetRelationalDatabaseBlueprints
forall x.
GetRelationalDatabaseBlueprints
-> Rep GetRelationalDatabaseBlueprints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseBlueprints x
-> GetRelationalDatabaseBlueprints
$cfrom :: forall x.
GetRelationalDatabaseBlueprints
-> Rep GetRelationalDatabaseBlueprints x
Prelude.Generic)
newGetRelationalDatabaseBlueprints ::
GetRelationalDatabaseBlueprints
newGetRelationalDatabaseBlueprints :: GetRelationalDatabaseBlueprints
newGetRelationalDatabaseBlueprints =
GetRelationalDatabaseBlueprints'
{ $sel:pageToken:GetRelationalDatabaseBlueprints' :: Maybe Text
pageToken =
forall a. Maybe a
Prelude.Nothing
}
getRelationalDatabaseBlueprints_pageToken :: Lens.Lens' GetRelationalDatabaseBlueprints (Prelude.Maybe Prelude.Text)
getRelationalDatabaseBlueprints_pageToken :: Lens' GetRelationalDatabaseBlueprints (Maybe Text)
getRelationalDatabaseBlueprints_pageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseBlueprints' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetRelationalDatabaseBlueprints' :: GetRelationalDatabaseBlueprints -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: GetRelationalDatabaseBlueprints
s@GetRelationalDatabaseBlueprints' {} Maybe Text
a -> GetRelationalDatabaseBlueprints
s {$sel:pageToken:GetRelationalDatabaseBlueprints' :: Maybe Text
pageToken = Maybe Text
a} :: GetRelationalDatabaseBlueprints)
instance
Core.AWSPager
GetRelationalDatabaseBlueprints
where
page :: GetRelationalDatabaseBlueprints
-> AWSResponse GetRelationalDatabaseBlueprints
-> Maybe GetRelationalDatabaseBlueprints
page GetRelationalDatabaseBlueprints
rq AWSResponse GetRelationalDatabaseBlueprints
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse GetRelationalDatabaseBlueprints
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetRelationalDatabaseBlueprintsResponse (Maybe Text)
getRelationalDatabaseBlueprintsResponse_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 GetRelationalDatabaseBlueprints
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
GetRelationalDatabaseBlueprintsResponse
(Maybe [RelationalDatabaseBlueprint])
getRelationalDatabaseBlueprintsResponse_blueprints
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.$ GetRelationalDatabaseBlueprints
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetRelationalDatabaseBlueprints (Maybe Text)
getRelationalDatabaseBlueprints_pageToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetRelationalDatabaseBlueprints
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetRelationalDatabaseBlueprintsResponse (Maybe Text)
getRelationalDatabaseBlueprintsResponse_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
GetRelationalDatabaseBlueprints
where
type
AWSResponse GetRelationalDatabaseBlueprints =
GetRelationalDatabaseBlueprintsResponse
request :: (Service -> Service)
-> GetRelationalDatabaseBlueprints
-> Request GetRelationalDatabaseBlueprints
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 GetRelationalDatabaseBlueprints
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetRelationalDatabaseBlueprints)))
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 [RelationalDatabaseBlueprint]
-> Maybe Text -> Int -> GetRelationalDatabaseBlueprintsResponse
GetRelationalDatabaseBlueprintsResponse'
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
"blueprints" 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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GetRelationalDatabaseBlueprints
where
hashWithSalt :: Int -> GetRelationalDatabaseBlueprints -> Int
hashWithSalt
Int
_salt
GetRelationalDatabaseBlueprints' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetRelationalDatabaseBlueprints' :: GetRelationalDatabaseBlueprints -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pageToken
instance
Prelude.NFData
GetRelationalDatabaseBlueprints
where
rnf :: GetRelationalDatabaseBlueprints -> ()
rnf GetRelationalDatabaseBlueprints' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetRelationalDatabaseBlueprints' :: GetRelationalDatabaseBlueprints -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pageToken
instance
Data.ToHeaders
GetRelationalDatabaseBlueprints
where
toHeaders :: GetRelationalDatabaseBlueprints -> 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.GetRelationalDatabaseBlueprints" ::
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 GetRelationalDatabaseBlueprints where
toJSON :: GetRelationalDatabaseBlueprints -> Value
toJSON GetRelationalDatabaseBlueprints' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetRelationalDatabaseBlueprints' :: GetRelationalDatabaseBlueprints -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(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]
)
instance Data.ToPath GetRelationalDatabaseBlueprints where
toPath :: GetRelationalDatabaseBlueprints -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetRelationalDatabaseBlueprints where
toQuery :: GetRelationalDatabaseBlueprints -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetRelationalDatabaseBlueprintsResponse = GetRelationalDatabaseBlueprintsResponse'
{
GetRelationalDatabaseBlueprintsResponse
-> Maybe [RelationalDatabaseBlueprint]
blueprints :: Prelude.Maybe [RelationalDatabaseBlueprint],
GetRelationalDatabaseBlueprintsResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
GetRelationalDatabaseBlueprintsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetRelationalDatabaseBlueprintsResponse
-> GetRelationalDatabaseBlueprintsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseBlueprintsResponse
-> GetRelationalDatabaseBlueprintsResponse -> Bool
$c/= :: GetRelationalDatabaseBlueprintsResponse
-> GetRelationalDatabaseBlueprintsResponse -> Bool
== :: GetRelationalDatabaseBlueprintsResponse
-> GetRelationalDatabaseBlueprintsResponse -> Bool
$c== :: GetRelationalDatabaseBlueprintsResponse
-> GetRelationalDatabaseBlueprintsResponse -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseBlueprintsResponse]
ReadPrec GetRelationalDatabaseBlueprintsResponse
Int -> ReadS GetRelationalDatabaseBlueprintsResponse
ReadS [GetRelationalDatabaseBlueprintsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseBlueprintsResponse]
$creadListPrec :: ReadPrec [GetRelationalDatabaseBlueprintsResponse]
readPrec :: ReadPrec GetRelationalDatabaseBlueprintsResponse
$creadPrec :: ReadPrec GetRelationalDatabaseBlueprintsResponse
readList :: ReadS [GetRelationalDatabaseBlueprintsResponse]
$creadList :: ReadS [GetRelationalDatabaseBlueprintsResponse]
readsPrec :: Int -> ReadS GetRelationalDatabaseBlueprintsResponse
$creadsPrec :: Int -> ReadS GetRelationalDatabaseBlueprintsResponse
Prelude.Read, Int -> GetRelationalDatabaseBlueprintsResponse -> ShowS
[GetRelationalDatabaseBlueprintsResponse] -> ShowS
GetRelationalDatabaseBlueprintsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseBlueprintsResponse] -> ShowS
$cshowList :: [GetRelationalDatabaseBlueprintsResponse] -> ShowS
show :: GetRelationalDatabaseBlueprintsResponse -> String
$cshow :: GetRelationalDatabaseBlueprintsResponse -> String
showsPrec :: Int -> GetRelationalDatabaseBlueprintsResponse -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseBlueprintsResponse -> ShowS
Prelude.Show, forall x.
Rep GetRelationalDatabaseBlueprintsResponse x
-> GetRelationalDatabaseBlueprintsResponse
forall x.
GetRelationalDatabaseBlueprintsResponse
-> Rep GetRelationalDatabaseBlueprintsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseBlueprintsResponse x
-> GetRelationalDatabaseBlueprintsResponse
$cfrom :: forall x.
GetRelationalDatabaseBlueprintsResponse
-> Rep GetRelationalDatabaseBlueprintsResponse x
Prelude.Generic)
newGetRelationalDatabaseBlueprintsResponse ::
Prelude.Int ->
GetRelationalDatabaseBlueprintsResponse
newGetRelationalDatabaseBlueprintsResponse :: Int -> GetRelationalDatabaseBlueprintsResponse
newGetRelationalDatabaseBlueprintsResponse
Int
pHttpStatus_ =
GetRelationalDatabaseBlueprintsResponse'
{ $sel:blueprints:GetRelationalDatabaseBlueprintsResponse' :: Maybe [RelationalDatabaseBlueprint]
blueprints =
forall a. Maybe a
Prelude.Nothing,
$sel:nextPageToken:GetRelationalDatabaseBlueprintsResponse' :: Maybe Text
nextPageToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetRelationalDatabaseBlueprintsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getRelationalDatabaseBlueprintsResponse_blueprints :: Lens.Lens' GetRelationalDatabaseBlueprintsResponse (Prelude.Maybe [RelationalDatabaseBlueprint])
getRelationalDatabaseBlueprintsResponse_blueprints :: Lens'
GetRelationalDatabaseBlueprintsResponse
(Maybe [RelationalDatabaseBlueprint])
getRelationalDatabaseBlueprintsResponse_blueprints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseBlueprintsResponse' {Maybe [RelationalDatabaseBlueprint]
blueprints :: Maybe [RelationalDatabaseBlueprint]
$sel:blueprints:GetRelationalDatabaseBlueprintsResponse' :: GetRelationalDatabaseBlueprintsResponse
-> Maybe [RelationalDatabaseBlueprint]
blueprints} -> Maybe [RelationalDatabaseBlueprint]
blueprints) (\s :: GetRelationalDatabaseBlueprintsResponse
s@GetRelationalDatabaseBlueprintsResponse' {} Maybe [RelationalDatabaseBlueprint]
a -> GetRelationalDatabaseBlueprintsResponse
s {$sel:blueprints:GetRelationalDatabaseBlueprintsResponse' :: Maybe [RelationalDatabaseBlueprint]
blueprints = Maybe [RelationalDatabaseBlueprint]
a} :: GetRelationalDatabaseBlueprintsResponse) 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
getRelationalDatabaseBlueprintsResponse_nextPageToken :: Lens.Lens' GetRelationalDatabaseBlueprintsResponse (Prelude.Maybe Prelude.Text)
getRelationalDatabaseBlueprintsResponse_nextPageToken :: Lens' GetRelationalDatabaseBlueprintsResponse (Maybe Text)
getRelationalDatabaseBlueprintsResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseBlueprintsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetRelationalDatabaseBlueprintsResponse' :: GetRelationalDatabaseBlueprintsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetRelationalDatabaseBlueprintsResponse
s@GetRelationalDatabaseBlueprintsResponse' {} Maybe Text
a -> GetRelationalDatabaseBlueprintsResponse
s {$sel:nextPageToken:GetRelationalDatabaseBlueprintsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetRelationalDatabaseBlueprintsResponse)
getRelationalDatabaseBlueprintsResponse_httpStatus :: Lens.Lens' GetRelationalDatabaseBlueprintsResponse Prelude.Int
getRelationalDatabaseBlueprintsResponse_httpStatus :: Lens' GetRelationalDatabaseBlueprintsResponse Int
getRelationalDatabaseBlueprintsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseBlueprintsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRelationalDatabaseBlueprintsResponse' :: GetRelationalDatabaseBlueprintsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRelationalDatabaseBlueprintsResponse
s@GetRelationalDatabaseBlueprintsResponse' {} Int
a -> GetRelationalDatabaseBlueprintsResponse
s {$sel:httpStatus:GetRelationalDatabaseBlueprintsResponse' :: Int
httpStatus = Int
a} :: GetRelationalDatabaseBlueprintsResponse)
instance
Prelude.NFData
GetRelationalDatabaseBlueprintsResponse
where
rnf :: GetRelationalDatabaseBlueprintsResponse -> ()
rnf GetRelationalDatabaseBlueprintsResponse' {Int
Maybe [RelationalDatabaseBlueprint]
Maybe Text
httpStatus :: Int
nextPageToken :: Maybe Text
blueprints :: Maybe [RelationalDatabaseBlueprint]
$sel:httpStatus:GetRelationalDatabaseBlueprintsResponse' :: GetRelationalDatabaseBlueprintsResponse -> Int
$sel:nextPageToken:GetRelationalDatabaseBlueprintsResponse' :: GetRelationalDatabaseBlueprintsResponse -> Maybe Text
$sel:blueprints:GetRelationalDatabaseBlueprintsResponse' :: GetRelationalDatabaseBlueprintsResponse
-> Maybe [RelationalDatabaseBlueprint]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [RelationalDatabaseBlueprint]
blueprints
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Int
httpStatus