{-# 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.CreateRelationalDatabaseFromSnapshot
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new database from an existing database snapshot in Amazon
-- Lightsail.
--
-- You can create a new database from a snapshot in if something goes wrong
-- with your original database, or to change it to a different plan, such
-- as a high availability or standard plan.
--
-- The @create relational database from snapshot@ operation supports
-- tag-based access control via request tags and resource tags applied to
-- the resource identified by relationalDatabaseSnapshotName. For more
-- information, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-controlling-access-using-tags Amazon Lightsail Developer Guide>.
module Amazonka.Lightsail.CreateRelationalDatabaseFromSnapshot
  ( -- * Creating a Request
    CreateRelationalDatabaseFromSnapshot (..),
    newCreateRelationalDatabaseFromSnapshot,

    -- * Request Lenses
    createRelationalDatabaseFromSnapshot_sourceRelationalDatabaseName,
    createRelationalDatabaseFromSnapshot_relationalDatabaseBundleId,
    createRelationalDatabaseFromSnapshot_publiclyAccessible,
    createRelationalDatabaseFromSnapshot_useLatestRestorableTime,
    createRelationalDatabaseFromSnapshot_restoreTime,
    createRelationalDatabaseFromSnapshot_availabilityZone,
    createRelationalDatabaseFromSnapshot_relationalDatabaseSnapshotName,
    createRelationalDatabaseFromSnapshot_tags,
    createRelationalDatabaseFromSnapshot_relationalDatabaseName,

    -- * Destructuring the Response
    CreateRelationalDatabaseFromSnapshotResponse (..),
    newCreateRelationalDatabaseFromSnapshotResponse,

    -- * Response Lenses
    createRelationalDatabaseFromSnapshotResponse_operations,
    createRelationalDatabaseFromSnapshotResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateRelationalDatabaseFromSnapshot' smart constructor.
data CreateRelationalDatabaseFromSnapshot = CreateRelationalDatabaseFromSnapshot'
  { -- | The name of the source database.
    CreateRelationalDatabaseFromSnapshot -> Maybe Text
sourceRelationalDatabaseName :: Prelude.Maybe Prelude.Text,
    -- | The bundle ID for your new database. A bundle describes the performance
    -- specifications for your database.
    --
    -- You can get a list of database bundle IDs by using the
    -- @get relational database bundles@ operation.
    --
    -- When creating a new database from a snapshot, you cannot choose a bundle
    -- that is smaller than the bundle of the source database.
    CreateRelationalDatabaseFromSnapshot -> Maybe Text
relationalDatabaseBundleId :: Prelude.Maybe Prelude.Text,
    -- | Specifies the accessibility options for your new database. A value of
    -- @true@ specifies a database that is available to resources outside of
    -- your Lightsail account. A value of @false@ specifies a database that is
    -- available only to your Lightsail resources in the same region as your
    -- database.
    CreateRelationalDatabaseFromSnapshot -> Maybe Bool
publiclyAccessible :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether your database is restored from the latest backup time.
    -- A value of @true@ restores from the latest backup time.
    --
    -- Default: @false@
    --
    -- Constraints: Cannot be specified if the @restore time@ parameter is
    -- provided.
    CreateRelationalDatabaseFromSnapshot -> Maybe Bool
useLatestRestorableTime :: Prelude.Maybe Prelude.Bool,
    -- | The date and time to restore your database from.
    --
    -- Constraints:
    --
    -- -   Must be before the latest restorable time for the database.
    --
    -- -   Cannot be specified if the @use latest restorable time@ parameter is
    --     @true@.
    --
    -- -   Specified in Coordinated Universal Time (UTC).
    --
    -- -   Specified in the Unix time format.
    --
    --     For example, if you wish to use a restore time of October 1, 2018,
    --     at 8 PM UTC, then you input @1538424000@ as the restore time.
    CreateRelationalDatabaseFromSnapshot -> Maybe POSIX
restoreTime :: Prelude.Maybe Core.POSIX,
    -- | The Availability Zone in which to create your new database. Use the
    -- @us-east-2a@ case-sensitive format.
    --
    -- You can get a list of Availability Zones by using the @get regions@
    -- operation. Be sure to add the
    -- @include relational database Availability Zones@ parameter to your
    -- request.
    CreateRelationalDatabaseFromSnapshot -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The name of the database snapshot from which to create your new
    -- database.
    CreateRelationalDatabaseFromSnapshot -> Maybe Text
relationalDatabaseSnapshotName :: Prelude.Maybe Prelude.Text,
    -- | The tag keys and optional values to add to the resource during create.
    --
    -- Use the @TagResource@ action to tag a resource after it\'s created.
    CreateRelationalDatabaseFromSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name to use for your new Lightsail database resource.
    --
    -- Constraints:
    --
    -- -   Must contain from 2 to 255 alphanumeric characters, or hyphens.
    --
    -- -   The first and last character must be a letter or number.
    CreateRelationalDatabaseFromSnapshot -> Text
relationalDatabaseName :: Prelude.Text
  }
  deriving (CreateRelationalDatabaseFromSnapshot
-> CreateRelationalDatabaseFromSnapshot -> Bool
(CreateRelationalDatabaseFromSnapshot
 -> CreateRelationalDatabaseFromSnapshot -> Bool)
-> (CreateRelationalDatabaseFromSnapshot
    -> CreateRelationalDatabaseFromSnapshot -> Bool)
-> Eq CreateRelationalDatabaseFromSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRelationalDatabaseFromSnapshot
-> CreateRelationalDatabaseFromSnapshot -> Bool
$c/= :: CreateRelationalDatabaseFromSnapshot
-> CreateRelationalDatabaseFromSnapshot -> Bool
== :: CreateRelationalDatabaseFromSnapshot
-> CreateRelationalDatabaseFromSnapshot -> Bool
$c== :: CreateRelationalDatabaseFromSnapshot
-> CreateRelationalDatabaseFromSnapshot -> Bool
Prelude.Eq, ReadPrec [CreateRelationalDatabaseFromSnapshot]
ReadPrec CreateRelationalDatabaseFromSnapshot
Int -> ReadS CreateRelationalDatabaseFromSnapshot
ReadS [CreateRelationalDatabaseFromSnapshot]
(Int -> ReadS CreateRelationalDatabaseFromSnapshot)
-> ReadS [CreateRelationalDatabaseFromSnapshot]
-> ReadPrec CreateRelationalDatabaseFromSnapshot
-> ReadPrec [CreateRelationalDatabaseFromSnapshot]
-> Read CreateRelationalDatabaseFromSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRelationalDatabaseFromSnapshot]
$creadListPrec :: ReadPrec [CreateRelationalDatabaseFromSnapshot]
readPrec :: ReadPrec CreateRelationalDatabaseFromSnapshot
$creadPrec :: ReadPrec CreateRelationalDatabaseFromSnapshot
readList :: ReadS [CreateRelationalDatabaseFromSnapshot]
$creadList :: ReadS [CreateRelationalDatabaseFromSnapshot]
readsPrec :: Int -> ReadS CreateRelationalDatabaseFromSnapshot
$creadsPrec :: Int -> ReadS CreateRelationalDatabaseFromSnapshot
Prelude.Read, Int -> CreateRelationalDatabaseFromSnapshot -> ShowS
[CreateRelationalDatabaseFromSnapshot] -> ShowS
CreateRelationalDatabaseFromSnapshot -> String
(Int -> CreateRelationalDatabaseFromSnapshot -> ShowS)
-> (CreateRelationalDatabaseFromSnapshot -> String)
-> ([CreateRelationalDatabaseFromSnapshot] -> ShowS)
-> Show CreateRelationalDatabaseFromSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRelationalDatabaseFromSnapshot] -> ShowS
$cshowList :: [CreateRelationalDatabaseFromSnapshot] -> ShowS
show :: CreateRelationalDatabaseFromSnapshot -> String
$cshow :: CreateRelationalDatabaseFromSnapshot -> String
showsPrec :: Int -> CreateRelationalDatabaseFromSnapshot -> ShowS
$cshowsPrec :: Int -> CreateRelationalDatabaseFromSnapshot -> ShowS
Prelude.Show, (forall x.
 CreateRelationalDatabaseFromSnapshot
 -> Rep CreateRelationalDatabaseFromSnapshot x)
-> (forall x.
    Rep CreateRelationalDatabaseFromSnapshot x
    -> CreateRelationalDatabaseFromSnapshot)
-> Generic CreateRelationalDatabaseFromSnapshot
forall x.
Rep CreateRelationalDatabaseFromSnapshot x
-> CreateRelationalDatabaseFromSnapshot
forall x.
CreateRelationalDatabaseFromSnapshot
-> Rep CreateRelationalDatabaseFromSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRelationalDatabaseFromSnapshot x
-> CreateRelationalDatabaseFromSnapshot
$cfrom :: forall x.
CreateRelationalDatabaseFromSnapshot
-> Rep CreateRelationalDatabaseFromSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'CreateRelationalDatabaseFromSnapshot' 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:
--
-- 'sourceRelationalDatabaseName', 'createRelationalDatabaseFromSnapshot_sourceRelationalDatabaseName' - The name of the source database.
--
-- 'relationalDatabaseBundleId', 'createRelationalDatabaseFromSnapshot_relationalDatabaseBundleId' - The bundle ID for your new database. A bundle describes the performance
-- specifications for your database.
--
-- You can get a list of database bundle IDs by using the
-- @get relational database bundles@ operation.
--
-- When creating a new database from a snapshot, you cannot choose a bundle
-- that is smaller than the bundle of the source database.
--
-- 'publiclyAccessible', 'createRelationalDatabaseFromSnapshot_publiclyAccessible' - Specifies the accessibility options for your new database. A value of
-- @true@ specifies a database that is available to resources outside of
-- your Lightsail account. A value of @false@ specifies a database that is
-- available only to your Lightsail resources in the same region as your
-- database.
--
-- 'useLatestRestorableTime', 'createRelationalDatabaseFromSnapshot_useLatestRestorableTime' - Specifies whether your database is restored from the latest backup time.
-- A value of @true@ restores from the latest backup time.
--
-- Default: @false@
--
-- Constraints: Cannot be specified if the @restore time@ parameter is
-- provided.
--
-- 'restoreTime', 'createRelationalDatabaseFromSnapshot_restoreTime' - The date and time to restore your database from.
--
-- Constraints:
--
-- -   Must be before the latest restorable time for the database.
--
-- -   Cannot be specified if the @use latest restorable time@ parameter is
--     @true@.
--
-- -   Specified in Coordinated Universal Time (UTC).
--
-- -   Specified in the Unix time format.
--
--     For example, if you wish to use a restore time of October 1, 2018,
--     at 8 PM UTC, then you input @1538424000@ as the restore time.
--
-- 'availabilityZone', 'createRelationalDatabaseFromSnapshot_availabilityZone' - The Availability Zone in which to create your new database. Use the
-- @us-east-2a@ case-sensitive format.
--
-- You can get a list of Availability Zones by using the @get regions@
-- operation. Be sure to add the
-- @include relational database Availability Zones@ parameter to your
-- request.
--
-- 'relationalDatabaseSnapshotName', 'createRelationalDatabaseFromSnapshot_relationalDatabaseSnapshotName' - The name of the database snapshot from which to create your new
-- database.
--
-- 'tags', 'createRelationalDatabaseFromSnapshot_tags' - The tag keys and optional values to add to the resource during create.
--
-- Use the @TagResource@ action to tag a resource after it\'s created.
--
-- 'relationalDatabaseName', 'createRelationalDatabaseFromSnapshot_relationalDatabaseName' - The name to use for your new Lightsail database resource.
--
-- Constraints:
--
-- -   Must contain from 2 to 255 alphanumeric characters, or hyphens.
--
-- -   The first and last character must be a letter or number.
newCreateRelationalDatabaseFromSnapshot ::
  -- | 'relationalDatabaseName'
  Prelude.Text ->
  CreateRelationalDatabaseFromSnapshot
newCreateRelationalDatabaseFromSnapshot :: Text -> CreateRelationalDatabaseFromSnapshot
newCreateRelationalDatabaseFromSnapshot
  Text
pRelationalDatabaseName_ =
    CreateRelationalDatabaseFromSnapshot' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> CreateRelationalDatabaseFromSnapshot
CreateRelationalDatabaseFromSnapshot'
      { $sel:sourceRelationalDatabaseName:CreateRelationalDatabaseFromSnapshot' :: Maybe Text
sourceRelationalDatabaseName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:relationalDatabaseBundleId:CreateRelationalDatabaseFromSnapshot' :: Maybe Text
relationalDatabaseBundleId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:publiclyAccessible:CreateRelationalDatabaseFromSnapshot' :: Maybe Bool
publiclyAccessible = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:useLatestRestorableTime:CreateRelationalDatabaseFromSnapshot' :: Maybe Bool
useLatestRestorableTime =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:restoreTime:CreateRelationalDatabaseFromSnapshot' :: Maybe POSIX
restoreTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:availabilityZone:CreateRelationalDatabaseFromSnapshot' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:relationalDatabaseSnapshotName:CreateRelationalDatabaseFromSnapshot' :: Maybe Text
relationalDatabaseSnapshotName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateRelationalDatabaseFromSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:relationalDatabaseName:CreateRelationalDatabaseFromSnapshot' :: Text
relationalDatabaseName =
          Text
pRelationalDatabaseName_
      }

-- | The name of the source database.
createRelationalDatabaseFromSnapshot_sourceRelationalDatabaseName :: Lens.Lens' CreateRelationalDatabaseFromSnapshot (Prelude.Maybe Prelude.Text)
createRelationalDatabaseFromSnapshot_sourceRelationalDatabaseName :: (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_sourceRelationalDatabaseName = (CreateRelationalDatabaseFromSnapshot -> Maybe Text)
-> (CreateRelationalDatabaseFromSnapshot
    -> Maybe Text -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Maybe Text
sourceRelationalDatabaseName :: Maybe Text
$sel:sourceRelationalDatabaseName:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Text
sourceRelationalDatabaseName} -> Maybe Text
sourceRelationalDatabaseName) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Maybe Text
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:sourceRelationalDatabaseName:CreateRelationalDatabaseFromSnapshot' :: Maybe Text
sourceRelationalDatabaseName = Maybe Text
a} :: CreateRelationalDatabaseFromSnapshot)

-- | The bundle ID for your new database. A bundle describes the performance
-- specifications for your database.
--
-- You can get a list of database bundle IDs by using the
-- @get relational database bundles@ operation.
--
-- When creating a new database from a snapshot, you cannot choose a bundle
-- that is smaller than the bundle of the source database.
createRelationalDatabaseFromSnapshot_relationalDatabaseBundleId :: Lens.Lens' CreateRelationalDatabaseFromSnapshot (Prelude.Maybe Prelude.Text)
createRelationalDatabaseFromSnapshot_relationalDatabaseBundleId :: (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_relationalDatabaseBundleId = (CreateRelationalDatabaseFromSnapshot -> Maybe Text)
-> (CreateRelationalDatabaseFromSnapshot
    -> Maybe Text -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Maybe Text
relationalDatabaseBundleId :: Maybe Text
$sel:relationalDatabaseBundleId:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Text
relationalDatabaseBundleId} -> Maybe Text
relationalDatabaseBundleId) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Maybe Text
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:relationalDatabaseBundleId:CreateRelationalDatabaseFromSnapshot' :: Maybe Text
relationalDatabaseBundleId = Maybe Text
a} :: CreateRelationalDatabaseFromSnapshot)

-- | Specifies the accessibility options for your new database. A value of
-- @true@ specifies a database that is available to resources outside of
-- your Lightsail account. A value of @false@ specifies a database that is
-- available only to your Lightsail resources in the same region as your
-- database.
createRelationalDatabaseFromSnapshot_publiclyAccessible :: Lens.Lens' CreateRelationalDatabaseFromSnapshot (Prelude.Maybe Prelude.Bool)
createRelationalDatabaseFromSnapshot_publiclyAccessible :: (Maybe Bool -> f (Maybe Bool))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_publiclyAccessible = (CreateRelationalDatabaseFromSnapshot -> Maybe Bool)
-> (CreateRelationalDatabaseFromSnapshot
    -> Maybe Bool -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Maybe Bool
publiclyAccessible :: Maybe Bool
$sel:publiclyAccessible:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Bool
publiclyAccessible} -> Maybe Bool
publiclyAccessible) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Maybe Bool
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:publiclyAccessible:CreateRelationalDatabaseFromSnapshot' :: Maybe Bool
publiclyAccessible = Maybe Bool
a} :: CreateRelationalDatabaseFromSnapshot)

-- | Specifies whether your database is restored from the latest backup time.
-- A value of @true@ restores from the latest backup time.
--
-- Default: @false@
--
-- Constraints: Cannot be specified if the @restore time@ parameter is
-- provided.
createRelationalDatabaseFromSnapshot_useLatestRestorableTime :: Lens.Lens' CreateRelationalDatabaseFromSnapshot (Prelude.Maybe Prelude.Bool)
createRelationalDatabaseFromSnapshot_useLatestRestorableTime :: (Maybe Bool -> f (Maybe Bool))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_useLatestRestorableTime = (CreateRelationalDatabaseFromSnapshot -> Maybe Bool)
-> (CreateRelationalDatabaseFromSnapshot
    -> Maybe Bool -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Maybe Bool
useLatestRestorableTime :: Maybe Bool
$sel:useLatestRestorableTime:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Bool
useLatestRestorableTime} -> Maybe Bool
useLatestRestorableTime) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Maybe Bool
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:useLatestRestorableTime:CreateRelationalDatabaseFromSnapshot' :: Maybe Bool
useLatestRestorableTime = Maybe Bool
a} :: CreateRelationalDatabaseFromSnapshot)

-- | The date and time to restore your database from.
--
-- Constraints:
--
-- -   Must be before the latest restorable time for the database.
--
-- -   Cannot be specified if the @use latest restorable time@ parameter is
--     @true@.
--
-- -   Specified in Coordinated Universal Time (UTC).
--
-- -   Specified in the Unix time format.
--
--     For example, if you wish to use a restore time of October 1, 2018,
--     at 8 PM UTC, then you input @1538424000@ as the restore time.
createRelationalDatabaseFromSnapshot_restoreTime :: Lens.Lens' CreateRelationalDatabaseFromSnapshot (Prelude.Maybe Prelude.UTCTime)
createRelationalDatabaseFromSnapshot_restoreTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_restoreTime = (CreateRelationalDatabaseFromSnapshot -> Maybe POSIX)
-> (CreateRelationalDatabaseFromSnapshot
    -> Maybe POSIX -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Maybe POSIX
restoreTime :: Maybe POSIX
$sel:restoreTime:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe POSIX
restoreTime} -> Maybe POSIX
restoreTime) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Maybe POSIX
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:restoreTime:CreateRelationalDatabaseFromSnapshot' :: Maybe POSIX
restoreTime = Maybe POSIX
a} :: CreateRelationalDatabaseFromSnapshot) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateRelationalDatabaseFromSnapshot
 -> f CreateRelationalDatabaseFromSnapshot)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Availability Zone in which to create your new database. Use the
-- @us-east-2a@ case-sensitive format.
--
-- You can get a list of Availability Zones by using the @get regions@
-- operation. Be sure to add the
-- @include relational database Availability Zones@ parameter to your
-- request.
createRelationalDatabaseFromSnapshot_availabilityZone :: Lens.Lens' CreateRelationalDatabaseFromSnapshot (Prelude.Maybe Prelude.Text)
createRelationalDatabaseFromSnapshot_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_availabilityZone = (CreateRelationalDatabaseFromSnapshot -> Maybe Text)
-> (CreateRelationalDatabaseFromSnapshot
    -> Maybe Text -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Maybe Text
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:availabilityZone:CreateRelationalDatabaseFromSnapshot' :: Maybe Text
availabilityZone = Maybe Text
a} :: CreateRelationalDatabaseFromSnapshot)

-- | The name of the database snapshot from which to create your new
-- database.
createRelationalDatabaseFromSnapshot_relationalDatabaseSnapshotName :: Lens.Lens' CreateRelationalDatabaseFromSnapshot (Prelude.Maybe Prelude.Text)
createRelationalDatabaseFromSnapshot_relationalDatabaseSnapshotName :: (Maybe Text -> f (Maybe Text))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_relationalDatabaseSnapshotName = (CreateRelationalDatabaseFromSnapshot -> Maybe Text)
-> (CreateRelationalDatabaseFromSnapshot
    -> Maybe Text -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Maybe Text
relationalDatabaseSnapshotName :: Maybe Text
$sel:relationalDatabaseSnapshotName:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Text
relationalDatabaseSnapshotName} -> Maybe Text
relationalDatabaseSnapshotName) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Maybe Text
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:relationalDatabaseSnapshotName:CreateRelationalDatabaseFromSnapshot' :: Maybe Text
relationalDatabaseSnapshotName = Maybe Text
a} :: CreateRelationalDatabaseFromSnapshot)

-- | The tag keys and optional values to add to the resource during create.
--
-- Use the @TagResource@ action to tag a resource after it\'s created.
createRelationalDatabaseFromSnapshot_tags :: Lens.Lens' CreateRelationalDatabaseFromSnapshot (Prelude.Maybe [Tag])
createRelationalDatabaseFromSnapshot_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_tags = (CreateRelationalDatabaseFromSnapshot -> Maybe [Tag])
-> (CreateRelationalDatabaseFromSnapshot
    -> Maybe [Tag] -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Maybe [Tag]
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:tags:CreateRelationalDatabaseFromSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateRelationalDatabaseFromSnapshot) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateRelationalDatabaseFromSnapshot
 -> f CreateRelationalDatabaseFromSnapshot)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
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

-- | The name to use for your new Lightsail database resource.
--
-- Constraints:
--
-- -   Must contain from 2 to 255 alphanumeric characters, or hyphens.
--
-- -   The first and last character must be a letter or number.
createRelationalDatabaseFromSnapshot_relationalDatabaseName :: Lens.Lens' CreateRelationalDatabaseFromSnapshot Prelude.Text
createRelationalDatabaseFromSnapshot_relationalDatabaseName :: (Text -> f Text)
-> CreateRelationalDatabaseFromSnapshot
-> f CreateRelationalDatabaseFromSnapshot
createRelationalDatabaseFromSnapshot_relationalDatabaseName = (CreateRelationalDatabaseFromSnapshot -> Text)
-> (CreateRelationalDatabaseFromSnapshot
    -> Text -> CreateRelationalDatabaseFromSnapshot)
-> Lens
     CreateRelationalDatabaseFromSnapshot
     CreateRelationalDatabaseFromSnapshot
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshot' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: CreateRelationalDatabaseFromSnapshot
s@CreateRelationalDatabaseFromSnapshot' {} Text
a -> CreateRelationalDatabaseFromSnapshot
s {$sel:relationalDatabaseName:CreateRelationalDatabaseFromSnapshot' :: Text
relationalDatabaseName = Text
a} :: CreateRelationalDatabaseFromSnapshot)

instance
  Core.AWSRequest
    CreateRelationalDatabaseFromSnapshot
  where
  type
    AWSResponse CreateRelationalDatabaseFromSnapshot =
      CreateRelationalDatabaseFromSnapshotResponse
  request :: CreateRelationalDatabaseFromSnapshot
-> Request CreateRelationalDatabaseFromSnapshot
request = Service
-> CreateRelationalDatabaseFromSnapshot
-> Request CreateRelationalDatabaseFromSnapshot
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateRelationalDatabaseFromSnapshot
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateRelationalDatabaseFromSnapshot)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse CreateRelationalDatabaseFromSnapshot))
-> Logger
-> Service
-> Proxy CreateRelationalDatabaseFromSnapshot
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateRelationalDatabaseFromSnapshot)))
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 -> CreateRelationalDatabaseFromSnapshotResponse
CreateRelationalDatabaseFromSnapshotResponse'
            (Maybe [Operation]
 -> Int -> CreateRelationalDatabaseFromSnapshotResponse)
-> Either String (Maybe [Operation])
-> Either
     String (Int -> CreateRelationalDatabaseFromSnapshotResponse)
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 -> CreateRelationalDatabaseFromSnapshotResponse)
-> Either String Int
-> Either String CreateRelationalDatabaseFromSnapshotResponse
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
    CreateRelationalDatabaseFromSnapshot

instance
  Prelude.NFData
    CreateRelationalDatabaseFromSnapshot

instance
  Core.ToHeaders
    CreateRelationalDatabaseFromSnapshot
  where
  toHeaders :: CreateRelationalDatabaseFromSnapshot -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> CreateRelationalDatabaseFromSnapshot -> 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.CreateRelationalDatabaseFromSnapshot" ::
                          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
    CreateRelationalDatabaseFromSnapshot
  where
  toJSON :: CreateRelationalDatabaseFromSnapshot -> Value
toJSON CreateRelationalDatabaseFromSnapshot' {Maybe Bool
Maybe [Tag]
Maybe Text
Maybe POSIX
Text
relationalDatabaseName :: Text
tags :: Maybe [Tag]
relationalDatabaseSnapshotName :: Maybe Text
availabilityZone :: Maybe Text
restoreTime :: Maybe POSIX
useLatestRestorableTime :: Maybe Bool
publiclyAccessible :: Maybe Bool
relationalDatabaseBundleId :: Maybe Text
sourceRelationalDatabaseName :: Maybe Text
$sel:relationalDatabaseName:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Text
$sel:tags:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe [Tag]
$sel:relationalDatabaseSnapshotName:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Text
$sel:availabilityZone:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Text
$sel:restoreTime:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe POSIX
$sel:useLatestRestorableTime:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Bool
$sel:publiclyAccessible:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Bool
$sel:relationalDatabaseBundleId:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Text
$sel:sourceRelationalDatabaseName:CreateRelationalDatabaseFromSnapshot' :: CreateRelationalDatabaseFromSnapshot -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"sourceRelationalDatabaseName" 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
sourceRelationalDatabaseName,
            (Text
"relationalDatabaseBundleId" 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
relationalDatabaseBundleId,
            (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
"useLatestRestorableTime" 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
useLatestRestorableTime,
            (Text
"restoreTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
restoreTime,
            (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
"relationalDatabaseSnapshotName" 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
relationalDatabaseSnapshotName,
            (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
              )
          ]
      )

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

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

-- | /See:/ 'newCreateRelationalDatabaseFromSnapshotResponse' smart constructor.
data CreateRelationalDatabaseFromSnapshotResponse = CreateRelationalDatabaseFromSnapshotResponse'
  { -- | An array of objects that describe the result of the action, such as the
    -- status of the request, the timestamp of the request, and the resources
    -- affected by the request.
    CreateRelationalDatabaseFromSnapshotResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
    -- | The response's http status code.
    CreateRelationalDatabaseFromSnapshotResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateRelationalDatabaseFromSnapshotResponse
-> CreateRelationalDatabaseFromSnapshotResponse -> Bool
(CreateRelationalDatabaseFromSnapshotResponse
 -> CreateRelationalDatabaseFromSnapshotResponse -> Bool)
-> (CreateRelationalDatabaseFromSnapshotResponse
    -> CreateRelationalDatabaseFromSnapshotResponse -> Bool)
-> Eq CreateRelationalDatabaseFromSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRelationalDatabaseFromSnapshotResponse
-> CreateRelationalDatabaseFromSnapshotResponse -> Bool
$c/= :: CreateRelationalDatabaseFromSnapshotResponse
-> CreateRelationalDatabaseFromSnapshotResponse -> Bool
== :: CreateRelationalDatabaseFromSnapshotResponse
-> CreateRelationalDatabaseFromSnapshotResponse -> Bool
$c== :: CreateRelationalDatabaseFromSnapshotResponse
-> CreateRelationalDatabaseFromSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [CreateRelationalDatabaseFromSnapshotResponse]
ReadPrec CreateRelationalDatabaseFromSnapshotResponse
Int -> ReadS CreateRelationalDatabaseFromSnapshotResponse
ReadS [CreateRelationalDatabaseFromSnapshotResponse]
(Int -> ReadS CreateRelationalDatabaseFromSnapshotResponse)
-> ReadS [CreateRelationalDatabaseFromSnapshotResponse]
-> ReadPrec CreateRelationalDatabaseFromSnapshotResponse
-> ReadPrec [CreateRelationalDatabaseFromSnapshotResponse]
-> Read CreateRelationalDatabaseFromSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRelationalDatabaseFromSnapshotResponse]
$creadListPrec :: ReadPrec [CreateRelationalDatabaseFromSnapshotResponse]
readPrec :: ReadPrec CreateRelationalDatabaseFromSnapshotResponse
$creadPrec :: ReadPrec CreateRelationalDatabaseFromSnapshotResponse
readList :: ReadS [CreateRelationalDatabaseFromSnapshotResponse]
$creadList :: ReadS [CreateRelationalDatabaseFromSnapshotResponse]
readsPrec :: Int -> ReadS CreateRelationalDatabaseFromSnapshotResponse
$creadsPrec :: Int -> ReadS CreateRelationalDatabaseFromSnapshotResponse
Prelude.Read, Int -> CreateRelationalDatabaseFromSnapshotResponse -> ShowS
[CreateRelationalDatabaseFromSnapshotResponse] -> ShowS
CreateRelationalDatabaseFromSnapshotResponse -> String
(Int -> CreateRelationalDatabaseFromSnapshotResponse -> ShowS)
-> (CreateRelationalDatabaseFromSnapshotResponse -> String)
-> ([CreateRelationalDatabaseFromSnapshotResponse] -> ShowS)
-> Show CreateRelationalDatabaseFromSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRelationalDatabaseFromSnapshotResponse] -> ShowS
$cshowList :: [CreateRelationalDatabaseFromSnapshotResponse] -> ShowS
show :: CreateRelationalDatabaseFromSnapshotResponse -> String
$cshow :: CreateRelationalDatabaseFromSnapshotResponse -> String
showsPrec :: Int -> CreateRelationalDatabaseFromSnapshotResponse -> ShowS
$cshowsPrec :: Int -> CreateRelationalDatabaseFromSnapshotResponse -> ShowS
Prelude.Show, (forall x.
 CreateRelationalDatabaseFromSnapshotResponse
 -> Rep CreateRelationalDatabaseFromSnapshotResponse x)
-> (forall x.
    Rep CreateRelationalDatabaseFromSnapshotResponse x
    -> CreateRelationalDatabaseFromSnapshotResponse)
-> Generic CreateRelationalDatabaseFromSnapshotResponse
forall x.
Rep CreateRelationalDatabaseFromSnapshotResponse x
-> CreateRelationalDatabaseFromSnapshotResponse
forall x.
CreateRelationalDatabaseFromSnapshotResponse
-> Rep CreateRelationalDatabaseFromSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRelationalDatabaseFromSnapshotResponse x
-> CreateRelationalDatabaseFromSnapshotResponse
$cfrom :: forall x.
CreateRelationalDatabaseFromSnapshotResponse
-> Rep CreateRelationalDatabaseFromSnapshotResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateRelationalDatabaseFromSnapshotResponse' 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:
--
-- 'operations', 'createRelationalDatabaseFromSnapshotResponse_operations' - An array of objects that describe the result of the action, such as the
-- status of the request, the timestamp of the request, and the resources
-- affected by the request.
--
-- 'httpStatus', 'createRelationalDatabaseFromSnapshotResponse_httpStatus' - The response's http status code.
newCreateRelationalDatabaseFromSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateRelationalDatabaseFromSnapshotResponse
newCreateRelationalDatabaseFromSnapshotResponse :: Int -> CreateRelationalDatabaseFromSnapshotResponse
newCreateRelationalDatabaseFromSnapshotResponse
  Int
pHttpStatus_ =
    CreateRelationalDatabaseFromSnapshotResponse' :: Maybe [Operation]
-> Int -> CreateRelationalDatabaseFromSnapshotResponse
CreateRelationalDatabaseFromSnapshotResponse'
      { $sel:operations:CreateRelationalDatabaseFromSnapshotResponse' :: Maybe [Operation]
operations =
          Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateRelationalDatabaseFromSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | An array of objects that describe the result of the action, such as the
-- status of the request, the timestamp of the request, and the resources
-- affected by the request.
createRelationalDatabaseFromSnapshotResponse_operations :: Lens.Lens' CreateRelationalDatabaseFromSnapshotResponse (Prelude.Maybe [Operation])
createRelationalDatabaseFromSnapshotResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> CreateRelationalDatabaseFromSnapshotResponse
-> f CreateRelationalDatabaseFromSnapshotResponse
createRelationalDatabaseFromSnapshotResponse_operations = (CreateRelationalDatabaseFromSnapshotResponse -> Maybe [Operation])
-> (CreateRelationalDatabaseFromSnapshotResponse
    -> Maybe [Operation]
    -> CreateRelationalDatabaseFromSnapshotResponse)
-> Lens
     CreateRelationalDatabaseFromSnapshotResponse
     CreateRelationalDatabaseFromSnapshotResponse
     (Maybe [Operation])
     (Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRelationalDatabaseFromSnapshotResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:CreateRelationalDatabaseFromSnapshotResponse' :: CreateRelationalDatabaseFromSnapshotResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: CreateRelationalDatabaseFromSnapshotResponse
s@CreateRelationalDatabaseFromSnapshotResponse' {} Maybe [Operation]
a -> CreateRelationalDatabaseFromSnapshotResponse
s {$sel:operations:CreateRelationalDatabaseFromSnapshotResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: CreateRelationalDatabaseFromSnapshotResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
 -> CreateRelationalDatabaseFromSnapshotResponse
 -> f CreateRelationalDatabaseFromSnapshotResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
    -> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> CreateRelationalDatabaseFromSnapshotResponse
-> f CreateRelationalDatabaseFromSnapshotResponse
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

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

instance
  Prelude.NFData
    CreateRelationalDatabaseFromSnapshotResponse