{-# 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.RDS.DeleteDBInstance
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- The DeleteDBInstance action deletes a previously provisioned DB
-- instance. When you delete a DB instance, all automated backups for that
-- instance are deleted and can\'t be recovered. Manual DB snapshots of the
-- DB instance to be deleted by @DeleteDBInstance@ are not deleted.
--
-- If you request a final DB snapshot the status of the Amazon RDS DB
-- instance is @deleting@ until the DB snapshot is created. The API action
-- @DescribeDBInstance@ is used to monitor the status of this operation.
-- The action can\'t be canceled or reverted once submitted.
--
-- When a DB instance is in a failure state and has a status of @failed@,
-- @incompatible-restore@, or @incompatible-network@, you can only delete
-- it when you skip creation of the final snapshot with the
-- @SkipFinalSnapshot@ parameter.
--
-- If the specified DB instance is part of an Amazon Aurora DB cluster, you
-- can\'t delete the DB instance if both of the following conditions are
-- true:
--
-- -   The DB cluster is a read replica of another Amazon Aurora DB
--     cluster.
--
-- -   The DB instance is the only instance in the DB cluster.
--
-- To delete a DB instance in this case, first call the
-- @PromoteReadReplicaDBCluster@ API action to promote the DB cluster so
-- it\'s no longer a read replica. After the promotion completes, then call
-- the @DeleteDBInstance@ API action to delete the final instance in the DB
-- cluster.
module Amazonka.RDS.DeleteDBInstance
  ( -- * Creating a Request
    DeleteDBInstance (..),
    newDeleteDBInstance,

    -- * Request Lenses
    deleteDBInstance_deleteAutomatedBackups,
    deleteDBInstance_finalDBSnapshotIdentifier,
    deleteDBInstance_skipFinalSnapshot,
    deleteDBInstance_dbInstanceIdentifier,

    -- * Destructuring the Response
    DeleteDBInstanceResponse (..),
    newDeleteDBInstanceResponse,

    -- * Response Lenses
    deleteDBInstanceResponse_dbInstance,
    deleteDBInstanceResponse_httpStatus,
  )
where

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

-- |
--
-- /See:/ 'newDeleteDBInstance' smart constructor.
data DeleteDBInstance = DeleteDBInstance'
  { -- | A value that indicates whether to remove automated backups immediately
    -- after the DB instance is deleted. This parameter isn\'t case-sensitive.
    -- The default is to remove automated backups immediately after the DB
    -- instance is deleted.
    DeleteDBInstance -> Maybe Bool
deleteAutomatedBackups :: Prelude.Maybe Prelude.Bool,
    -- | The @DBSnapshotIdentifier@ of the new @DBSnapshot@ created when the
    -- @SkipFinalSnapshot@ parameter is disabled.
    --
    -- If you enable this parameter and also enable SkipFinalShapshot, the
    -- command results in an error.
    --
    -- This setting doesn\'t apply to RDS Custom.
    --
    -- Constraints:
    --
    -- -   Must be 1 to 255 letters or numbers.
    --
    -- -   First character must be a letter.
    --
    -- -   Can\'t end with a hyphen or contain two consecutive hyphens.
    --
    -- -   Can\'t be specified when deleting a read replica.
    DeleteDBInstance -> Maybe Text
finalDBSnapshotIdentifier :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether to skip the creation of a final DB
    -- snapshot before deleting the instance. If you enable this parameter, RDS
    -- doesn\'t create a DB snapshot. If you don\'t enable this parameter, RDS
    -- creates a DB snapshot before the DB instance is deleted. By default,
    -- skip isn\'t enabled, and the DB snapshot is created.
    --
    -- If you don\'t enable this parameter, you must specify the
    -- @FinalDBSnapshotIdentifier@ parameter.
    --
    -- When a DB instance is in a failure state and has a status of @failed@,
    -- @incompatible-restore@, or @incompatible-network@, RDS can delete the
    -- instance only if you enable this parameter.
    --
    -- If you delete a read replica or an RDS Custom instance, you must enable
    -- this setting.
    --
    -- This setting is required for RDS Custom.
    DeleteDBInstance -> Maybe Bool
skipFinalSnapshot :: Prelude.Maybe Prelude.Bool,
    -- | The DB instance identifier for the DB instance to be deleted. This
    -- parameter isn\'t case-sensitive.
    --
    -- Constraints:
    --
    -- -   Must match the name of an existing DB instance.
    DeleteDBInstance -> Text
dbInstanceIdentifier :: Prelude.Text
  }
  deriving (DeleteDBInstance -> DeleteDBInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDBInstance -> DeleteDBInstance -> Bool
$c/= :: DeleteDBInstance -> DeleteDBInstance -> Bool
== :: DeleteDBInstance -> DeleteDBInstance -> Bool
$c== :: DeleteDBInstance -> DeleteDBInstance -> Bool
Prelude.Eq, ReadPrec [DeleteDBInstance]
ReadPrec DeleteDBInstance
Int -> ReadS DeleteDBInstance
ReadS [DeleteDBInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDBInstance]
$creadListPrec :: ReadPrec [DeleteDBInstance]
readPrec :: ReadPrec DeleteDBInstance
$creadPrec :: ReadPrec DeleteDBInstance
readList :: ReadS [DeleteDBInstance]
$creadList :: ReadS [DeleteDBInstance]
readsPrec :: Int -> ReadS DeleteDBInstance
$creadsPrec :: Int -> ReadS DeleteDBInstance
Prelude.Read, Int -> DeleteDBInstance -> ShowS
[DeleteDBInstance] -> ShowS
DeleteDBInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDBInstance] -> ShowS
$cshowList :: [DeleteDBInstance] -> ShowS
show :: DeleteDBInstance -> String
$cshow :: DeleteDBInstance -> String
showsPrec :: Int -> DeleteDBInstance -> ShowS
$cshowsPrec :: Int -> DeleteDBInstance -> ShowS
Prelude.Show, forall x. Rep DeleteDBInstance x -> DeleteDBInstance
forall x. DeleteDBInstance -> Rep DeleteDBInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDBInstance x -> DeleteDBInstance
$cfrom :: forall x. DeleteDBInstance -> Rep DeleteDBInstance x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDBInstance' 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:
--
-- 'deleteAutomatedBackups', 'deleteDBInstance_deleteAutomatedBackups' - A value that indicates whether to remove automated backups immediately
-- after the DB instance is deleted. This parameter isn\'t case-sensitive.
-- The default is to remove automated backups immediately after the DB
-- instance is deleted.
--
-- 'finalDBSnapshotIdentifier', 'deleteDBInstance_finalDBSnapshotIdentifier' - The @DBSnapshotIdentifier@ of the new @DBSnapshot@ created when the
-- @SkipFinalSnapshot@ parameter is disabled.
--
-- If you enable this parameter and also enable SkipFinalShapshot, the
-- command results in an error.
--
-- This setting doesn\'t apply to RDS Custom.
--
-- Constraints:
--
-- -   Must be 1 to 255 letters or numbers.
--
-- -   First character must be a letter.
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens.
--
-- -   Can\'t be specified when deleting a read replica.
--
-- 'skipFinalSnapshot', 'deleteDBInstance_skipFinalSnapshot' - A value that indicates whether to skip the creation of a final DB
-- snapshot before deleting the instance. If you enable this parameter, RDS
-- doesn\'t create a DB snapshot. If you don\'t enable this parameter, RDS
-- creates a DB snapshot before the DB instance is deleted. By default,
-- skip isn\'t enabled, and the DB snapshot is created.
--
-- If you don\'t enable this parameter, you must specify the
-- @FinalDBSnapshotIdentifier@ parameter.
--
-- When a DB instance is in a failure state and has a status of @failed@,
-- @incompatible-restore@, or @incompatible-network@, RDS can delete the
-- instance only if you enable this parameter.
--
-- If you delete a read replica or an RDS Custom instance, you must enable
-- this setting.
--
-- This setting is required for RDS Custom.
--
-- 'dbInstanceIdentifier', 'deleteDBInstance_dbInstanceIdentifier' - The DB instance identifier for the DB instance to be deleted. This
-- parameter isn\'t case-sensitive.
--
-- Constraints:
--
-- -   Must match the name of an existing DB instance.
newDeleteDBInstance ::
  -- | 'dbInstanceIdentifier'
  Prelude.Text ->
  DeleteDBInstance
newDeleteDBInstance :: Text -> DeleteDBInstance
newDeleteDBInstance Text
pDBInstanceIdentifier_ =
  DeleteDBInstance'
    { $sel:deleteAutomatedBackups:DeleteDBInstance' :: Maybe Bool
deleteAutomatedBackups =
        forall a. Maybe a
Prelude.Nothing,
      $sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: Maybe Text
finalDBSnapshotIdentifier = forall a. Maybe a
Prelude.Nothing,
      $sel:skipFinalSnapshot:DeleteDBInstance' :: Maybe Bool
skipFinalSnapshot = forall a. Maybe a
Prelude.Nothing,
      $sel:dbInstanceIdentifier:DeleteDBInstance' :: Text
dbInstanceIdentifier = Text
pDBInstanceIdentifier_
    }

-- | A value that indicates whether to remove automated backups immediately
-- after the DB instance is deleted. This parameter isn\'t case-sensitive.
-- The default is to remove automated backups immediately after the DB
-- instance is deleted.
deleteDBInstance_deleteAutomatedBackups :: Lens.Lens' DeleteDBInstance (Prelude.Maybe Prelude.Bool)
deleteDBInstance_deleteAutomatedBackups :: Lens' DeleteDBInstance (Maybe Bool)
deleteDBInstance_deleteAutomatedBackups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstance' {Maybe Bool
deleteAutomatedBackups :: Maybe Bool
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
deleteAutomatedBackups} -> Maybe Bool
deleteAutomatedBackups) (\s :: DeleteDBInstance
s@DeleteDBInstance' {} Maybe Bool
a -> DeleteDBInstance
s {$sel:deleteAutomatedBackups:DeleteDBInstance' :: Maybe Bool
deleteAutomatedBackups = Maybe Bool
a} :: DeleteDBInstance)

-- | The @DBSnapshotIdentifier@ of the new @DBSnapshot@ created when the
-- @SkipFinalSnapshot@ parameter is disabled.
--
-- If you enable this parameter and also enable SkipFinalShapshot, the
-- command results in an error.
--
-- This setting doesn\'t apply to RDS Custom.
--
-- Constraints:
--
-- -   Must be 1 to 255 letters or numbers.
--
-- -   First character must be a letter.
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens.
--
-- -   Can\'t be specified when deleting a read replica.
deleteDBInstance_finalDBSnapshotIdentifier :: Lens.Lens' DeleteDBInstance (Prelude.Maybe Prelude.Text)
deleteDBInstance_finalDBSnapshotIdentifier :: Lens' DeleteDBInstance (Maybe Text)
deleteDBInstance_finalDBSnapshotIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstance' {Maybe Text
finalDBSnapshotIdentifier :: Maybe Text
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
finalDBSnapshotIdentifier} -> Maybe Text
finalDBSnapshotIdentifier) (\s :: DeleteDBInstance
s@DeleteDBInstance' {} Maybe Text
a -> DeleteDBInstance
s {$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: Maybe Text
finalDBSnapshotIdentifier = Maybe Text
a} :: DeleteDBInstance)

-- | A value that indicates whether to skip the creation of a final DB
-- snapshot before deleting the instance. If you enable this parameter, RDS
-- doesn\'t create a DB snapshot. If you don\'t enable this parameter, RDS
-- creates a DB snapshot before the DB instance is deleted. By default,
-- skip isn\'t enabled, and the DB snapshot is created.
--
-- If you don\'t enable this parameter, you must specify the
-- @FinalDBSnapshotIdentifier@ parameter.
--
-- When a DB instance is in a failure state and has a status of @failed@,
-- @incompatible-restore@, or @incompatible-network@, RDS can delete the
-- instance only if you enable this parameter.
--
-- If you delete a read replica or an RDS Custom instance, you must enable
-- this setting.
--
-- This setting is required for RDS Custom.
deleteDBInstance_skipFinalSnapshot :: Lens.Lens' DeleteDBInstance (Prelude.Maybe Prelude.Bool)
deleteDBInstance_skipFinalSnapshot :: Lens' DeleteDBInstance (Maybe Bool)
deleteDBInstance_skipFinalSnapshot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstance' {Maybe Bool
skipFinalSnapshot :: Maybe Bool
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
skipFinalSnapshot} -> Maybe Bool
skipFinalSnapshot) (\s :: DeleteDBInstance
s@DeleteDBInstance' {} Maybe Bool
a -> DeleteDBInstance
s {$sel:skipFinalSnapshot:DeleteDBInstance' :: Maybe Bool
skipFinalSnapshot = Maybe Bool
a} :: DeleteDBInstance)

-- | The DB instance identifier for the DB instance to be deleted. This
-- parameter isn\'t case-sensitive.
--
-- Constraints:
--
-- -   Must match the name of an existing DB instance.
deleteDBInstance_dbInstanceIdentifier :: Lens.Lens' DeleteDBInstance Prelude.Text
deleteDBInstance_dbInstanceIdentifier :: Lens' DeleteDBInstance Text
deleteDBInstance_dbInstanceIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstance' {Text
dbInstanceIdentifier :: Text
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
dbInstanceIdentifier} -> Text
dbInstanceIdentifier) (\s :: DeleteDBInstance
s@DeleteDBInstance' {} Text
a -> DeleteDBInstance
s {$sel:dbInstanceIdentifier:DeleteDBInstance' :: Text
dbInstanceIdentifier = Text
a} :: DeleteDBInstance)

instance Core.AWSRequest DeleteDBInstance where
  type
    AWSResponse DeleteDBInstance =
      DeleteDBInstanceResponse
  request :: (Service -> Service)
-> DeleteDBInstance -> Request DeleteDBInstance
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteDBInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDBInstance)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DeleteDBInstanceResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe DBInstance -> Int -> DeleteDBInstanceResponse
DeleteDBInstanceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DBInstance")
            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 DeleteDBInstance where
  hashWithSalt :: Int -> DeleteDBInstance -> Int
hashWithSalt Int
_salt DeleteDBInstance' {Maybe Bool
Maybe Text
Text
dbInstanceIdentifier :: Text
skipFinalSnapshot :: Maybe Bool
finalDBSnapshotIdentifier :: Maybe Text
deleteAutomatedBackups :: Maybe Bool
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteAutomatedBackups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
finalDBSnapshotIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
skipFinalSnapshot
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dbInstanceIdentifier

instance Prelude.NFData DeleteDBInstance where
  rnf :: DeleteDBInstance -> ()
rnf DeleteDBInstance' {Maybe Bool
Maybe Text
Text
dbInstanceIdentifier :: Text
skipFinalSnapshot :: Maybe Bool
finalDBSnapshotIdentifier :: Maybe Text
deleteAutomatedBackups :: Maybe Bool
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteAutomatedBackups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
finalDBSnapshotIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
skipFinalSnapshot
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dbInstanceIdentifier

instance Data.ToHeaders DeleteDBInstance where
  toHeaders :: DeleteDBInstance -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery DeleteDBInstance where
  toQuery :: DeleteDBInstance -> QueryString
toQuery DeleteDBInstance' {Maybe Bool
Maybe Text
Text
dbInstanceIdentifier :: Text
skipFinalSnapshot :: Maybe Bool
finalDBSnapshotIdentifier :: Maybe Text
deleteAutomatedBackups :: Maybe Bool
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteDBInstance" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"DeleteAutomatedBackups"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
deleteAutomatedBackups,
        ByteString
"FinalDBSnapshotIdentifier"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
finalDBSnapshotIdentifier,
        ByteString
"SkipFinalSnapshot" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
skipFinalSnapshot,
        ByteString
"DBInstanceIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
dbInstanceIdentifier
      ]

-- | /See:/ 'newDeleteDBInstanceResponse' smart constructor.
data DeleteDBInstanceResponse = DeleteDBInstanceResponse'
  { DeleteDBInstanceResponse -> Maybe DBInstance
dbInstance :: Prelude.Maybe DBInstance,
    -- | The response's http status code.
    DeleteDBInstanceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
$c/= :: DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
== :: DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
$c== :: DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDBInstanceResponse]
ReadPrec DeleteDBInstanceResponse
Int -> ReadS DeleteDBInstanceResponse
ReadS [DeleteDBInstanceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDBInstanceResponse]
$creadListPrec :: ReadPrec [DeleteDBInstanceResponse]
readPrec :: ReadPrec DeleteDBInstanceResponse
$creadPrec :: ReadPrec DeleteDBInstanceResponse
readList :: ReadS [DeleteDBInstanceResponse]
$creadList :: ReadS [DeleteDBInstanceResponse]
readsPrec :: Int -> ReadS DeleteDBInstanceResponse
$creadsPrec :: Int -> ReadS DeleteDBInstanceResponse
Prelude.Read, Int -> DeleteDBInstanceResponse -> ShowS
[DeleteDBInstanceResponse] -> ShowS
DeleteDBInstanceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDBInstanceResponse] -> ShowS
$cshowList :: [DeleteDBInstanceResponse] -> ShowS
show :: DeleteDBInstanceResponse -> String
$cshow :: DeleteDBInstanceResponse -> String
showsPrec :: Int -> DeleteDBInstanceResponse -> ShowS
$cshowsPrec :: Int -> DeleteDBInstanceResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteDBInstanceResponse x -> DeleteDBInstanceResponse
forall x.
DeleteDBInstanceResponse -> Rep DeleteDBInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDBInstanceResponse x -> DeleteDBInstanceResponse
$cfrom :: forall x.
DeleteDBInstanceResponse -> Rep DeleteDBInstanceResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDBInstanceResponse' 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:
--
-- 'dbInstance', 'deleteDBInstanceResponse_dbInstance' - Undocumented member.
--
-- 'httpStatus', 'deleteDBInstanceResponse_httpStatus' - The response's http status code.
newDeleteDBInstanceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteDBInstanceResponse
newDeleteDBInstanceResponse :: Int -> DeleteDBInstanceResponse
newDeleteDBInstanceResponse Int
pHttpStatus_ =
  DeleteDBInstanceResponse'
    { $sel:dbInstance:DeleteDBInstanceResponse' :: Maybe DBInstance
dbInstance =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DeleteDBInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
deleteDBInstanceResponse_dbInstance :: Lens.Lens' DeleteDBInstanceResponse (Prelude.Maybe DBInstance)
deleteDBInstanceResponse_dbInstance :: Lens' DeleteDBInstanceResponse (Maybe DBInstance)
deleteDBInstanceResponse_dbInstance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstanceResponse' {Maybe DBInstance
dbInstance :: Maybe DBInstance
$sel:dbInstance:DeleteDBInstanceResponse' :: DeleteDBInstanceResponse -> Maybe DBInstance
dbInstance} -> Maybe DBInstance
dbInstance) (\s :: DeleteDBInstanceResponse
s@DeleteDBInstanceResponse' {} Maybe DBInstance
a -> DeleteDBInstanceResponse
s {$sel:dbInstance:DeleteDBInstanceResponse' :: Maybe DBInstance
dbInstance = Maybe DBInstance
a} :: DeleteDBInstanceResponse)

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

instance Prelude.NFData DeleteDBInstanceResponse where
  rnf :: DeleteDBInstanceResponse -> ()
rnf DeleteDBInstanceResponse' {Int
Maybe DBInstance
httpStatus :: Int
dbInstance :: Maybe DBInstance
$sel:httpStatus:DeleteDBInstanceResponse' :: DeleteDBInstanceResponse -> Int
$sel:dbInstance:DeleteDBInstanceResponse' :: DeleteDBInstanceResponse -> Maybe DBInstance
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DBInstance
dbInstance
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus