{-# 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-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)
--
-- 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_finalDBSnapshotIdentifier,
    deleteDBInstance_deleteAutomatedBackups,
    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.Lens as Lens
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'
  { -- | The @DBSnapshotIdentifier@ of the new @DBSnapshot@ created when the
    -- @SkipFinalSnapshot@ parameter is disabled.
    --
    -- Specifying this parameter and also specifying to skip final DB snapshot
    -- creation in SkipFinalShapshot results in an error.
    --
    -- 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 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,
    -- | A value that indicates whether to skip the creation of a final DB
    -- snapshot before the DB instance is deleted. If skip is specified, no DB
    -- snapshot is created. If skip isn\'t specified, a DB snapshot is created
    -- before the DB instance is deleted. By default, skip isn\'t specified,
    -- and the DB snapshot is created.
    --
    -- When a DB instance is in a failure state and has a status of \'failed\',
    -- \'incompatible-restore\', or \'incompatible-network\', it can only be
    -- deleted when skip is specified.
    --
    -- Specify skip when deleting a read replica.
    --
    -- The FinalDBSnapshotIdentifier parameter must be specified if skip isn\'t
    -- specified.
    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
(DeleteDBInstance -> DeleteDBInstance -> Bool)
-> (DeleteDBInstance -> DeleteDBInstance -> Bool)
-> Eq DeleteDBInstance
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]
(Int -> ReadS DeleteDBInstance)
-> ReadS [DeleteDBInstance]
-> ReadPrec DeleteDBInstance
-> ReadPrec [DeleteDBInstance]
-> Read 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
(Int -> DeleteDBInstance -> ShowS)
-> (DeleteDBInstance -> String)
-> ([DeleteDBInstance] -> ShowS)
-> Show DeleteDBInstance
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. DeleteDBInstance -> Rep DeleteDBInstance x)
-> (forall x. Rep DeleteDBInstance x -> DeleteDBInstance)
-> Generic DeleteDBInstance
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:
--
-- 'finalDBSnapshotIdentifier', 'deleteDBInstance_finalDBSnapshotIdentifier' - The @DBSnapshotIdentifier@ of the new @DBSnapshot@ created when the
-- @SkipFinalSnapshot@ parameter is disabled.
--
-- Specifying this parameter and also specifying to skip final DB snapshot
-- creation in SkipFinalShapshot results in an error.
--
-- 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.
--
-- '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.
--
-- 'skipFinalSnapshot', 'deleteDBInstance_skipFinalSnapshot' - A value that indicates whether to skip the creation of a final DB
-- snapshot before the DB instance is deleted. If skip is specified, no DB
-- snapshot is created. If skip isn\'t specified, a DB snapshot is created
-- before the DB instance is deleted. By default, skip isn\'t specified,
-- and the DB snapshot is created.
--
-- When a DB instance is in a failure state and has a status of \'failed\',
-- \'incompatible-restore\', or \'incompatible-network\', it can only be
-- deleted when skip is specified.
--
-- Specify skip when deleting a read replica.
--
-- The FinalDBSnapshotIdentifier parameter must be specified if skip isn\'t
-- specified.
--
-- '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' :: Maybe Text -> Maybe Bool -> Maybe Bool -> Text -> DeleteDBInstance
DeleteDBInstance'
    { $sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: Maybe Text
finalDBSnapshotIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deleteAutomatedBackups:DeleteDBInstance' :: Maybe Bool
deleteAutomatedBackups = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:skipFinalSnapshot:DeleteDBInstance' :: Maybe Bool
skipFinalSnapshot = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:dbInstanceIdentifier:DeleteDBInstance' :: Text
dbInstanceIdentifier = Text
pDBInstanceIdentifier_
    }

-- | The @DBSnapshotIdentifier@ of the new @DBSnapshot@ created when the
-- @SkipFinalSnapshot@ parameter is disabled.
--
-- Specifying this parameter and also specifying to skip final DB snapshot
-- creation in SkipFinalShapshot results in an error.
--
-- 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 :: (Maybe Text -> f (Maybe Text))
-> DeleteDBInstance -> f DeleteDBInstance
deleteDBInstance_finalDBSnapshotIdentifier = (DeleteDBInstance -> Maybe Text)
-> (DeleteDBInstance -> Maybe Text -> DeleteDBInstance)
-> Lens DeleteDBInstance DeleteDBInstance (Maybe Text) (Maybe Text)
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 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 :: (Maybe Bool -> f (Maybe Bool))
-> DeleteDBInstance -> f DeleteDBInstance
deleteDBInstance_deleteAutomatedBackups = (DeleteDBInstance -> Maybe Bool)
-> (DeleteDBInstance -> Maybe Bool -> DeleteDBInstance)
-> Lens DeleteDBInstance DeleteDBInstance (Maybe Bool) (Maybe Bool)
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)

-- | A value that indicates whether to skip the creation of a final DB
-- snapshot before the DB instance is deleted. If skip is specified, no DB
-- snapshot is created. If skip isn\'t specified, a DB snapshot is created
-- before the DB instance is deleted. By default, skip isn\'t specified,
-- and the DB snapshot is created.
--
-- When a DB instance is in a failure state and has a status of \'failed\',
-- \'incompatible-restore\', or \'incompatible-network\', it can only be
-- deleted when skip is specified.
--
-- Specify skip when deleting a read replica.
--
-- The FinalDBSnapshotIdentifier parameter must be specified if skip isn\'t
-- specified.
deleteDBInstance_skipFinalSnapshot :: Lens.Lens' DeleteDBInstance (Prelude.Maybe Prelude.Bool)
deleteDBInstance_skipFinalSnapshot :: (Maybe Bool -> f (Maybe Bool))
-> DeleteDBInstance -> f DeleteDBInstance
deleteDBInstance_skipFinalSnapshot = (DeleteDBInstance -> Maybe Bool)
-> (DeleteDBInstance -> Maybe Bool -> DeleteDBInstance)
-> Lens DeleteDBInstance DeleteDBInstance (Maybe Bool) (Maybe Bool)
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 :: (Text -> f Text) -> DeleteDBInstance -> f DeleteDBInstance
deleteDBInstance_dbInstanceIdentifier = (DeleteDBInstance -> Text)
-> (DeleteDBInstance -> Text -> DeleteDBInstance)
-> Lens DeleteDBInstance DeleteDBInstance Text Text
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 :: DeleteDBInstance -> Request DeleteDBInstance
request = Service -> DeleteDBInstance -> Request DeleteDBInstance
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteDBInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDBInstance)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DeleteDBInstance))
-> Logger
-> Service
-> Proxy DeleteDBInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDBInstance)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Maybe DBInstance -> Int -> DeleteDBInstanceResponse)
-> Either String (Maybe DBInstance)
-> Either String (Int -> DeleteDBInstanceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBInstance)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBInstance")
            Either String (Int -> DeleteDBInstanceResponse)
-> Either String Int -> Either String DeleteDBInstanceResponse
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 DeleteDBInstance

instance Prelude.NFData DeleteDBInstance

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

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

instance Core.ToQuery DeleteDBInstance where
  toQuery :: DeleteDBInstance -> QueryString
toQuery DeleteDBInstance' {Maybe Bool
Maybe Text
Text
dbInstanceIdentifier :: Text
skipFinalSnapshot :: Maybe Bool
deleteAutomatedBackups :: Maybe Bool
finalDBSnapshotIdentifier :: Maybe Text
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteDBInstance" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"FinalDBSnapshotIdentifier"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
finalDBSnapshotIdentifier,
        ByteString
"DeleteAutomatedBackups"
          ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
deleteAutomatedBackups,
        ByteString
"SkipFinalSnapshot" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
skipFinalSnapshot,
        ByteString
"DBInstanceIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: 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
(DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool)
-> (DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool)
-> Eq DeleteDBInstanceResponse
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]
(Int -> ReadS DeleteDBInstanceResponse)
-> ReadS [DeleteDBInstanceResponse]
-> ReadPrec DeleteDBInstanceResponse
-> ReadPrec [DeleteDBInstanceResponse]
-> Read 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
(Int -> DeleteDBInstanceResponse -> ShowS)
-> (DeleteDBInstanceResponse -> String)
-> ([DeleteDBInstanceResponse] -> ShowS)
-> Show DeleteDBInstanceResponse
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.
 DeleteDBInstanceResponse -> Rep DeleteDBInstanceResponse x)
-> (forall x.
    Rep DeleteDBInstanceResponse x -> DeleteDBInstanceResponse)
-> Generic DeleteDBInstanceResponse
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' :: Maybe DBInstance -> Int -> DeleteDBInstanceResponse
DeleteDBInstanceResponse'
    { $sel:dbInstance:DeleteDBInstanceResponse' :: Maybe DBInstance
dbInstance =
        Maybe 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 :: (Maybe DBInstance -> f (Maybe DBInstance))
-> DeleteDBInstanceResponse -> f DeleteDBInstanceResponse
deleteDBInstanceResponse_dbInstance = (DeleteDBInstanceResponse -> Maybe DBInstance)
-> (DeleteDBInstanceResponse
    -> Maybe DBInstance -> DeleteDBInstanceResponse)
-> Lens
     DeleteDBInstanceResponse
     DeleteDBInstanceResponse
     (Maybe DBInstance)
     (Maybe 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 :: (Int -> f Int)
-> DeleteDBInstanceResponse -> f DeleteDBInstanceResponse
deleteDBInstanceResponse_httpStatus = (DeleteDBInstanceResponse -> Int)
-> (DeleteDBInstanceResponse -> Int -> DeleteDBInstanceResponse)
-> Lens DeleteDBInstanceResponse DeleteDBInstanceResponse Int Int
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