{-# 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.CreateRelationalDatabase
(
CreateRelationalDatabase (..),
newCreateRelationalDatabase,
createRelationalDatabase_masterUserPassword,
createRelationalDatabase_publiclyAccessible,
createRelationalDatabase_preferredMaintenanceWindow,
createRelationalDatabase_preferredBackupWindow,
createRelationalDatabase_availabilityZone,
createRelationalDatabase_tags,
createRelationalDatabase_relationalDatabaseName,
createRelationalDatabase_relationalDatabaseBlueprintId,
createRelationalDatabase_relationalDatabaseBundleId,
createRelationalDatabase_masterDatabaseName,
createRelationalDatabase_masterUsername,
CreateRelationalDatabaseResponse (..),
newCreateRelationalDatabaseResponse,
createRelationalDatabaseResponse_operations,
createRelationalDatabaseResponse_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 CreateRelationalDatabase = CreateRelationalDatabase'
{
CreateRelationalDatabase -> Maybe (Sensitive Text)
masterUserPassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CreateRelationalDatabase -> Maybe Bool
publiclyAccessible :: Prelude.Maybe Prelude.Bool,
CreateRelationalDatabase -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
CreateRelationalDatabase -> Maybe Text
preferredBackupWindow :: Prelude.Maybe Prelude.Text,
CreateRelationalDatabase -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
CreateRelationalDatabase -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateRelationalDatabase -> Text
relationalDatabaseName :: Prelude.Text,
CreateRelationalDatabase -> Text
relationalDatabaseBlueprintId :: Prelude.Text,
CreateRelationalDatabase -> Text
relationalDatabaseBundleId :: Prelude.Text,
CreateRelationalDatabase -> Text
masterDatabaseName :: Prelude.Text,
CreateRelationalDatabase -> Text
masterUsername :: Prelude.Text
}
deriving (CreateRelationalDatabase -> CreateRelationalDatabase -> Bool
(CreateRelationalDatabase -> CreateRelationalDatabase -> Bool)
-> (CreateRelationalDatabase -> CreateRelationalDatabase -> Bool)
-> Eq CreateRelationalDatabase
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRelationalDatabase -> CreateRelationalDatabase -> Bool
$c/= :: CreateRelationalDatabase -> CreateRelationalDatabase -> Bool
== :: CreateRelationalDatabase -> CreateRelationalDatabase -> Bool
$c== :: CreateRelationalDatabase -> CreateRelationalDatabase -> Bool
Prelude.Eq, Int -> CreateRelationalDatabase -> ShowS
[CreateRelationalDatabase] -> ShowS
CreateRelationalDatabase -> String
(Int -> CreateRelationalDatabase -> ShowS)
-> (CreateRelationalDatabase -> String)
-> ([CreateRelationalDatabase] -> ShowS)
-> Show CreateRelationalDatabase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRelationalDatabase] -> ShowS
$cshowList :: [CreateRelationalDatabase] -> ShowS
show :: CreateRelationalDatabase -> String
$cshow :: CreateRelationalDatabase -> String
showsPrec :: Int -> CreateRelationalDatabase -> ShowS
$cshowsPrec :: Int -> CreateRelationalDatabase -> ShowS
Prelude.Show, (forall x.
CreateRelationalDatabase -> Rep CreateRelationalDatabase x)
-> (forall x.
Rep CreateRelationalDatabase x -> CreateRelationalDatabase)
-> Generic CreateRelationalDatabase
forall x.
Rep CreateRelationalDatabase x -> CreateRelationalDatabase
forall x.
CreateRelationalDatabase -> Rep CreateRelationalDatabase x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRelationalDatabase x -> CreateRelationalDatabase
$cfrom :: forall x.
CreateRelationalDatabase -> Rep CreateRelationalDatabase x
Prelude.Generic)
newCreateRelationalDatabase ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateRelationalDatabase
newCreateRelationalDatabase :: Text -> Text -> Text -> Text -> Text -> CreateRelationalDatabase
newCreateRelationalDatabase
Text
pRelationalDatabaseName_
Text
pRelationalDatabaseBlueprintId_
Text
pRelationalDatabaseBundleId_
Text
pMasterDatabaseName_
Text
pMasterUsername_ =
CreateRelationalDatabase' :: Maybe (Sensitive Text)
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateRelationalDatabase
CreateRelationalDatabase'
{ $sel:masterUserPassword:CreateRelationalDatabase' :: Maybe (Sensitive Text)
masterUserPassword =
Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:publiclyAccessible:CreateRelationalDatabase' :: Maybe Bool
publiclyAccessible = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:preferredMaintenanceWindow:CreateRelationalDatabase' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:preferredBackupWindow:CreateRelationalDatabase' :: Maybe Text
preferredBackupWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:CreateRelationalDatabase' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateRelationalDatabase' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:relationalDatabaseName:CreateRelationalDatabase' :: Text
relationalDatabaseName = Text
pRelationalDatabaseName_,
$sel:relationalDatabaseBlueprintId:CreateRelationalDatabase' :: Text
relationalDatabaseBlueprintId =
Text
pRelationalDatabaseBlueprintId_,
$sel:relationalDatabaseBundleId:CreateRelationalDatabase' :: Text
relationalDatabaseBundleId =
Text
pRelationalDatabaseBundleId_,
$sel:masterDatabaseName:CreateRelationalDatabase' :: Text
masterDatabaseName = Text
pMasterDatabaseName_,
$sel:masterUsername:CreateRelationalDatabase' :: Text
masterUsername = Text
pMasterUsername_
}
createRelationalDatabase_masterUserPassword :: Lens.Lens' CreateRelationalDatabase (Prelude.Maybe Prelude.Text)
createRelationalDatabase_masterUserPassword :: (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_masterUserPassword = (CreateRelationalDatabase -> Maybe (Sensitive Text))
-> (CreateRelationalDatabase
-> Maybe (Sensitive Text) -> CreateRelationalDatabase)
-> Lens
CreateRelationalDatabase
CreateRelationalDatabase
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Maybe (Sensitive Text)
masterUserPassword :: Maybe (Sensitive Text)
$sel:masterUserPassword:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe (Sensitive Text)
masterUserPassword} -> Maybe (Sensitive Text)
masterUserPassword) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Maybe (Sensitive Text)
a -> CreateRelationalDatabase
s {$sel:masterUserPassword:CreateRelationalDatabase' :: Maybe (Sensitive Text)
masterUserPassword = Maybe (Sensitive Text)
a} :: CreateRelationalDatabase) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CreateRelationalDatabase -> f CreateRelationalDatabase)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabase
-> f CreateRelationalDatabase
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
createRelationalDatabase_publiclyAccessible :: Lens.Lens' CreateRelationalDatabase (Prelude.Maybe Prelude.Bool)
createRelationalDatabase_publiclyAccessible :: (Maybe Bool -> f (Maybe Bool))
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_publiclyAccessible = (CreateRelationalDatabase -> Maybe Bool)
-> (CreateRelationalDatabase
-> Maybe Bool -> CreateRelationalDatabase)
-> Lens
CreateRelationalDatabase
CreateRelationalDatabase
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Maybe Bool
publiclyAccessible :: Maybe Bool
$sel:publiclyAccessible:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe Bool
publiclyAccessible} -> Maybe Bool
publiclyAccessible) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Maybe Bool
a -> CreateRelationalDatabase
s {$sel:publiclyAccessible:CreateRelationalDatabase' :: Maybe Bool
publiclyAccessible = Maybe Bool
a} :: CreateRelationalDatabase)
createRelationalDatabase_preferredMaintenanceWindow :: Lens.Lens' CreateRelationalDatabase (Prelude.Maybe Prelude.Text)
createRelationalDatabase_preferredMaintenanceWindow :: (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_preferredMaintenanceWindow = (CreateRelationalDatabase -> Maybe Text)
-> (CreateRelationalDatabase
-> Maybe Text -> CreateRelationalDatabase)
-> Lens
CreateRelationalDatabase
CreateRelationalDatabase
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Maybe Text
a -> CreateRelationalDatabase
s {$sel:preferredMaintenanceWindow:CreateRelationalDatabase' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: CreateRelationalDatabase)
createRelationalDatabase_preferredBackupWindow :: Lens.Lens' CreateRelationalDatabase (Prelude.Maybe Prelude.Text)
createRelationalDatabase_preferredBackupWindow :: (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_preferredBackupWindow = (CreateRelationalDatabase -> Maybe Text)
-> (CreateRelationalDatabase
-> Maybe Text -> CreateRelationalDatabase)
-> Lens
CreateRelationalDatabase
CreateRelationalDatabase
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Maybe Text
preferredBackupWindow :: Maybe Text
$sel:preferredBackupWindow:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe Text
preferredBackupWindow} -> Maybe Text
preferredBackupWindow) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Maybe Text
a -> CreateRelationalDatabase
s {$sel:preferredBackupWindow:CreateRelationalDatabase' :: Maybe Text
preferredBackupWindow = Maybe Text
a} :: CreateRelationalDatabase)
createRelationalDatabase_availabilityZone :: Lens.Lens' CreateRelationalDatabase (Prelude.Maybe Prelude.Text)
createRelationalDatabase_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_availabilityZone = (CreateRelationalDatabase -> Maybe Text)
-> (CreateRelationalDatabase
-> Maybe Text -> CreateRelationalDatabase)
-> Lens
CreateRelationalDatabase
CreateRelationalDatabase
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Maybe Text
a -> CreateRelationalDatabase
s {$sel:availabilityZone:CreateRelationalDatabase' :: Maybe Text
availabilityZone = Maybe Text
a} :: CreateRelationalDatabase)
createRelationalDatabase_tags :: Lens.Lens' CreateRelationalDatabase (Prelude.Maybe [Tag])
createRelationalDatabase_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_tags = (CreateRelationalDatabase -> Maybe [Tag])
-> (CreateRelationalDatabase
-> Maybe [Tag] -> CreateRelationalDatabase)
-> Lens
CreateRelationalDatabase
CreateRelationalDatabase
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Maybe [Tag]
a -> CreateRelationalDatabase
s {$sel:tags:CreateRelationalDatabase' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateRelationalDatabase) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRelationalDatabase -> f CreateRelationalDatabase)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRelationalDatabase
-> f CreateRelationalDatabase
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createRelationalDatabase_relationalDatabaseName :: Lens.Lens' CreateRelationalDatabase Prelude.Text
createRelationalDatabase_relationalDatabaseName :: (Text -> f Text)
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_relationalDatabaseName = (CreateRelationalDatabase -> Text)
-> (CreateRelationalDatabase -> Text -> CreateRelationalDatabase)
-> Lens CreateRelationalDatabase CreateRelationalDatabase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Text
a -> CreateRelationalDatabase
s {$sel:relationalDatabaseName:CreateRelationalDatabase' :: Text
relationalDatabaseName = Text
a} :: CreateRelationalDatabase)
createRelationalDatabase_relationalDatabaseBlueprintId :: Lens.Lens' CreateRelationalDatabase Prelude.Text
createRelationalDatabase_relationalDatabaseBlueprintId :: (Text -> f Text)
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_relationalDatabaseBlueprintId = (CreateRelationalDatabase -> Text)
-> (CreateRelationalDatabase -> Text -> CreateRelationalDatabase)
-> Lens CreateRelationalDatabase CreateRelationalDatabase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Text
relationalDatabaseBlueprintId :: Text
$sel:relationalDatabaseBlueprintId:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
relationalDatabaseBlueprintId} -> Text
relationalDatabaseBlueprintId) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Text
a -> CreateRelationalDatabase
s {$sel:relationalDatabaseBlueprintId:CreateRelationalDatabase' :: Text
relationalDatabaseBlueprintId = Text
a} :: CreateRelationalDatabase)
createRelationalDatabase_relationalDatabaseBundleId :: Lens.Lens' CreateRelationalDatabase Prelude.Text
createRelationalDatabase_relationalDatabaseBundleId :: (Text -> f Text)
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_relationalDatabaseBundleId = (CreateRelationalDatabase -> Text)
-> (CreateRelationalDatabase -> Text -> CreateRelationalDatabase)
-> Lens CreateRelationalDatabase CreateRelationalDatabase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Text
relationalDatabaseBundleId :: Text
$sel:relationalDatabaseBundleId:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
relationalDatabaseBundleId} -> Text
relationalDatabaseBundleId) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Text
a -> CreateRelationalDatabase
s {$sel:relationalDatabaseBundleId:CreateRelationalDatabase' :: Text
relationalDatabaseBundleId = Text
a} :: CreateRelationalDatabase)
createRelationalDatabase_masterDatabaseName :: Lens.Lens' CreateRelationalDatabase Prelude.Text
createRelationalDatabase_masterDatabaseName :: (Text -> f Text)
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_masterDatabaseName = (CreateRelationalDatabase -> Text)
-> (CreateRelationalDatabase -> Text -> CreateRelationalDatabase)
-> Lens CreateRelationalDatabase CreateRelationalDatabase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Text
masterDatabaseName :: Text
$sel:masterDatabaseName:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
masterDatabaseName} -> Text
masterDatabaseName) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Text
a -> CreateRelationalDatabase
s {$sel:masterDatabaseName:CreateRelationalDatabase' :: Text
masterDatabaseName = Text
a} :: CreateRelationalDatabase)
createRelationalDatabase_masterUsername :: Lens.Lens' CreateRelationalDatabase Prelude.Text
createRelationalDatabase_masterUsername :: (Text -> f Text)
-> CreateRelationalDatabase -> f CreateRelationalDatabase
createRelationalDatabase_masterUsername = (CreateRelationalDatabase -> Text)
-> (CreateRelationalDatabase -> Text -> CreateRelationalDatabase)
-> Lens CreateRelationalDatabase CreateRelationalDatabase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabase' {Text
masterUsername :: Text
$sel:masterUsername:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
masterUsername} -> Text
masterUsername) (\s :: CreateRelationalDatabase
s@CreateRelationalDatabase' {} Text
a -> CreateRelationalDatabase
s {$sel:masterUsername:CreateRelationalDatabase' :: Text
masterUsername = Text
a} :: CreateRelationalDatabase)
instance Core.AWSRequest CreateRelationalDatabase where
type
AWSResponse CreateRelationalDatabase =
CreateRelationalDatabaseResponse
request :: CreateRelationalDatabase -> Request CreateRelationalDatabase
request = Service
-> CreateRelationalDatabase -> Request CreateRelationalDatabase
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateRelationalDatabase
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateRelationalDatabase)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateRelationalDatabase))
-> Logger
-> Service
-> Proxy CreateRelationalDatabase
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateRelationalDatabase)))
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 [Operation] -> Int -> CreateRelationalDatabaseResponse
CreateRelationalDatabaseResponse'
(Maybe [Operation] -> Int -> CreateRelationalDatabaseResponse)
-> Either String (Maybe [Operation])
-> Either String (Int -> CreateRelationalDatabaseResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Operation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operations" Either String (Maybe (Maybe [Operation]))
-> Maybe [Operation] -> Either String (Maybe [Operation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Operation]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> CreateRelationalDatabaseResponse)
-> Either String Int
-> Either String CreateRelationalDatabaseResponse
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 CreateRelationalDatabase
instance Prelude.NFData CreateRelationalDatabase
instance Core.ToHeaders CreateRelationalDatabase where
toHeaders :: CreateRelationalDatabase -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateRelationalDatabase -> 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.CreateRelationalDatabase" ::
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 CreateRelationalDatabase where
toJSON :: CreateRelationalDatabase -> Value
toJSON CreateRelationalDatabase' {Maybe Bool
Maybe [Tag]
Maybe Text
Maybe (Sensitive Text)
Text
masterUsername :: Text
masterDatabaseName :: Text
relationalDatabaseBundleId :: Text
relationalDatabaseBlueprintId :: Text
relationalDatabaseName :: Text
tags :: Maybe [Tag]
availabilityZone :: Maybe Text
preferredBackupWindow :: Maybe Text
preferredMaintenanceWindow :: Maybe Text
publiclyAccessible :: Maybe Bool
masterUserPassword :: Maybe (Sensitive Text)
$sel:masterUsername:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
$sel:masterDatabaseName:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
$sel:relationalDatabaseBundleId:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
$sel:relationalDatabaseBlueprintId:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
$sel:relationalDatabaseName:CreateRelationalDatabase' :: CreateRelationalDatabase -> Text
$sel:tags:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe [Tag]
$sel:availabilityZone:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe Text
$sel:preferredBackupWindow:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe Text
$sel:preferredMaintenanceWindow:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe Text
$sel:publiclyAccessible:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe Bool
$sel:masterUserPassword:CreateRelationalDatabase' :: CreateRelationalDatabase -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"masterUserPassword" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
masterUserPassword,
(Text
"publiclyAccessible" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
publiclyAccessible,
(Text
"preferredMaintenanceWindow" 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
preferredMaintenanceWindow,
(Text
"preferredBackupWindow" 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
preferredBackupWindow,
(Text
"availabilityZone" 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
availabilityZone,
(Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
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
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"relationalDatabaseBlueprintId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
relationalDatabaseBlueprintId
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"relationalDatabaseBundleId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
relationalDatabaseBundleId
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"masterDatabaseName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
masterDatabaseName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"masterUsername" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
masterUsername)
]
)
instance Core.ToPath CreateRelationalDatabase where
toPath :: CreateRelationalDatabase -> ByteString
toPath = ByteString -> CreateRelationalDatabase -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateRelationalDatabase where
toQuery :: CreateRelationalDatabase -> QueryString
toQuery = QueryString -> CreateRelationalDatabase -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateRelationalDatabaseResponse = CreateRelationalDatabaseResponse'
{
CreateRelationalDatabaseResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
CreateRelationalDatabaseResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateRelationalDatabaseResponse
-> CreateRelationalDatabaseResponse -> Bool
(CreateRelationalDatabaseResponse
-> CreateRelationalDatabaseResponse -> Bool)
-> (CreateRelationalDatabaseResponse
-> CreateRelationalDatabaseResponse -> Bool)
-> Eq CreateRelationalDatabaseResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRelationalDatabaseResponse
-> CreateRelationalDatabaseResponse -> Bool
$c/= :: CreateRelationalDatabaseResponse
-> CreateRelationalDatabaseResponse -> Bool
== :: CreateRelationalDatabaseResponse
-> CreateRelationalDatabaseResponse -> Bool
$c== :: CreateRelationalDatabaseResponse
-> CreateRelationalDatabaseResponse -> Bool
Prelude.Eq, ReadPrec [CreateRelationalDatabaseResponse]
ReadPrec CreateRelationalDatabaseResponse
Int -> ReadS CreateRelationalDatabaseResponse
ReadS [CreateRelationalDatabaseResponse]
(Int -> ReadS CreateRelationalDatabaseResponse)
-> ReadS [CreateRelationalDatabaseResponse]
-> ReadPrec CreateRelationalDatabaseResponse
-> ReadPrec [CreateRelationalDatabaseResponse]
-> Read CreateRelationalDatabaseResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRelationalDatabaseResponse]
$creadListPrec :: ReadPrec [CreateRelationalDatabaseResponse]
readPrec :: ReadPrec CreateRelationalDatabaseResponse
$creadPrec :: ReadPrec CreateRelationalDatabaseResponse
readList :: ReadS [CreateRelationalDatabaseResponse]
$creadList :: ReadS [CreateRelationalDatabaseResponse]
readsPrec :: Int -> ReadS CreateRelationalDatabaseResponse
$creadsPrec :: Int -> ReadS CreateRelationalDatabaseResponse
Prelude.Read, Int -> CreateRelationalDatabaseResponse -> ShowS
[CreateRelationalDatabaseResponse] -> ShowS
CreateRelationalDatabaseResponse -> String
(Int -> CreateRelationalDatabaseResponse -> ShowS)
-> (CreateRelationalDatabaseResponse -> String)
-> ([CreateRelationalDatabaseResponse] -> ShowS)
-> Show CreateRelationalDatabaseResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRelationalDatabaseResponse] -> ShowS
$cshowList :: [CreateRelationalDatabaseResponse] -> ShowS
show :: CreateRelationalDatabaseResponse -> String
$cshow :: CreateRelationalDatabaseResponse -> String
showsPrec :: Int -> CreateRelationalDatabaseResponse -> ShowS
$cshowsPrec :: Int -> CreateRelationalDatabaseResponse -> ShowS
Prelude.Show, (forall x.
CreateRelationalDatabaseResponse
-> Rep CreateRelationalDatabaseResponse x)
-> (forall x.
Rep CreateRelationalDatabaseResponse x
-> CreateRelationalDatabaseResponse)
-> Generic CreateRelationalDatabaseResponse
forall x.
Rep CreateRelationalDatabaseResponse x
-> CreateRelationalDatabaseResponse
forall x.
CreateRelationalDatabaseResponse
-> Rep CreateRelationalDatabaseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRelationalDatabaseResponse x
-> CreateRelationalDatabaseResponse
$cfrom :: forall x.
CreateRelationalDatabaseResponse
-> Rep CreateRelationalDatabaseResponse x
Prelude.Generic)
newCreateRelationalDatabaseResponse ::
Prelude.Int ->
CreateRelationalDatabaseResponse
newCreateRelationalDatabaseResponse :: Int -> CreateRelationalDatabaseResponse
newCreateRelationalDatabaseResponse Int
pHttpStatus_ =
CreateRelationalDatabaseResponse' :: Maybe [Operation] -> Int -> CreateRelationalDatabaseResponse
CreateRelationalDatabaseResponse'
{ $sel:operations:CreateRelationalDatabaseResponse' :: Maybe [Operation]
operations =
Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateRelationalDatabaseResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createRelationalDatabaseResponse_operations :: Lens.Lens' CreateRelationalDatabaseResponse (Prelude.Maybe [Operation])
createRelationalDatabaseResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> CreateRelationalDatabaseResponse
-> f CreateRelationalDatabaseResponse
createRelationalDatabaseResponse_operations = (CreateRelationalDatabaseResponse -> Maybe [Operation])
-> (CreateRelationalDatabaseResponse
-> Maybe [Operation] -> CreateRelationalDatabaseResponse)
-> Lens
CreateRelationalDatabaseResponse
CreateRelationalDatabaseResponse
(Maybe [Operation])
(Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:CreateRelationalDatabaseResponse' :: CreateRelationalDatabaseResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: CreateRelationalDatabaseResponse
s@CreateRelationalDatabaseResponse' {} Maybe [Operation]
a -> CreateRelationalDatabaseResponse
s {$sel:operations:CreateRelationalDatabaseResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: CreateRelationalDatabaseResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
-> CreateRelationalDatabaseResponse
-> f CreateRelationalDatabaseResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
-> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> CreateRelationalDatabaseResponse
-> f CreateRelationalDatabaseResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Operation] [Operation] [Operation] [Operation]
-> Iso
(Maybe [Operation])
(Maybe [Operation])
(Maybe [Operation])
(Maybe [Operation])
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 [Operation] [Operation] [Operation] [Operation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createRelationalDatabaseResponse_httpStatus :: Lens.Lens' CreateRelationalDatabaseResponse Prelude.Int
createRelationalDatabaseResponse_httpStatus :: (Int -> f Int)
-> CreateRelationalDatabaseResponse
-> f CreateRelationalDatabaseResponse
createRelationalDatabaseResponse_httpStatus = (CreateRelationalDatabaseResponse -> Int)
-> (CreateRelationalDatabaseResponse
-> Int -> CreateRelationalDatabaseResponse)
-> Lens
CreateRelationalDatabaseResponse
CreateRelationalDatabaseResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateRelationalDatabaseResponse' :: CreateRelationalDatabaseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateRelationalDatabaseResponse
s@CreateRelationalDatabaseResponse' {} Int
a -> CreateRelationalDatabaseResponse
s {$sel:httpStatus:CreateRelationalDatabaseResponse' :: Int
httpStatus = Int
a} :: CreateRelationalDatabaseResponse)
instance
Prelude.NFData
CreateRelationalDatabaseResponse