{-# 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.DeleteRelationalDatabase
-- 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)
--
-- Deletes a database in Amazon Lightsail.
--
-- The @delete relational database@ operation supports tag-based access
-- control via resource tags applied to the resource identified by
-- relationalDatabaseName. 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.DeleteRelationalDatabase
  ( -- * Creating a Request
    DeleteRelationalDatabase (..),
    newDeleteRelationalDatabase,

    -- * Request Lenses
    deleteRelationalDatabase_skipFinalSnapshot,
    deleteRelationalDatabase_finalRelationalDatabaseSnapshotName,
    deleteRelationalDatabase_relationalDatabaseName,

    -- * Destructuring the Response
    DeleteRelationalDatabaseResponse (..),
    newDeleteRelationalDatabaseResponse,

    -- * Response Lenses
    deleteRelationalDatabaseResponse_operations,
    deleteRelationalDatabaseResponse_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:/ 'newDeleteRelationalDatabase' smart constructor.
data DeleteRelationalDatabase = DeleteRelationalDatabase'
  { -- | Determines whether a final database snapshot is created before your
    -- database is deleted. If @true@ is specified, no database snapshot is
    -- created. If @false@ is specified, a database snapshot is created before
    -- your database is deleted.
    --
    -- You must specify the @final relational database snapshot name@ parameter
    -- if the @skip final snapshot@ parameter is @false@.
    --
    -- Default: @false@
    DeleteRelationalDatabase -> Maybe Bool
skipFinalSnapshot :: Prelude.Maybe Prelude.Bool,
    -- | The name of the database snapshot created if @skip final snapshot@ is
    -- @false@, which is the default value for that parameter.
    --
    -- Specifying this parameter and also specifying the @skip final snapshot@
    -- parameter to @true@ results in an error.
    --
    -- Constraints:
    --
    -- -   Must contain from 2 to 255 alphanumeric characters, or hyphens.
    --
    -- -   The first and last character must be a letter or number.
    DeleteRelationalDatabase -> Maybe Text
finalRelationalDatabaseSnapshotName :: Prelude.Maybe Prelude.Text,
    -- | The name of the database that you are deleting.
    DeleteRelationalDatabase -> Text
relationalDatabaseName :: Prelude.Text
  }
  deriving (DeleteRelationalDatabase -> DeleteRelationalDatabase -> Bool
(DeleteRelationalDatabase -> DeleteRelationalDatabase -> Bool)
-> (DeleteRelationalDatabase -> DeleteRelationalDatabase -> Bool)
-> Eq DeleteRelationalDatabase
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRelationalDatabase -> DeleteRelationalDatabase -> Bool
$c/= :: DeleteRelationalDatabase -> DeleteRelationalDatabase -> Bool
== :: DeleteRelationalDatabase -> DeleteRelationalDatabase -> Bool
$c== :: DeleteRelationalDatabase -> DeleteRelationalDatabase -> Bool
Prelude.Eq, ReadPrec [DeleteRelationalDatabase]
ReadPrec DeleteRelationalDatabase
Int -> ReadS DeleteRelationalDatabase
ReadS [DeleteRelationalDatabase]
(Int -> ReadS DeleteRelationalDatabase)
-> ReadS [DeleteRelationalDatabase]
-> ReadPrec DeleteRelationalDatabase
-> ReadPrec [DeleteRelationalDatabase]
-> Read DeleteRelationalDatabase
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRelationalDatabase]
$creadListPrec :: ReadPrec [DeleteRelationalDatabase]
readPrec :: ReadPrec DeleteRelationalDatabase
$creadPrec :: ReadPrec DeleteRelationalDatabase
readList :: ReadS [DeleteRelationalDatabase]
$creadList :: ReadS [DeleteRelationalDatabase]
readsPrec :: Int -> ReadS DeleteRelationalDatabase
$creadsPrec :: Int -> ReadS DeleteRelationalDatabase
Prelude.Read, Int -> DeleteRelationalDatabase -> ShowS
[DeleteRelationalDatabase] -> ShowS
DeleteRelationalDatabase -> String
(Int -> DeleteRelationalDatabase -> ShowS)
-> (DeleteRelationalDatabase -> String)
-> ([DeleteRelationalDatabase] -> ShowS)
-> Show DeleteRelationalDatabase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRelationalDatabase] -> ShowS
$cshowList :: [DeleteRelationalDatabase] -> ShowS
show :: DeleteRelationalDatabase -> String
$cshow :: DeleteRelationalDatabase -> String
showsPrec :: Int -> DeleteRelationalDatabase -> ShowS
$cshowsPrec :: Int -> DeleteRelationalDatabase -> ShowS
Prelude.Show, (forall x.
 DeleteRelationalDatabase -> Rep DeleteRelationalDatabase x)
-> (forall x.
    Rep DeleteRelationalDatabase x -> DeleteRelationalDatabase)
-> Generic DeleteRelationalDatabase
forall x.
Rep DeleteRelationalDatabase x -> DeleteRelationalDatabase
forall x.
DeleteRelationalDatabase -> Rep DeleteRelationalDatabase x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRelationalDatabase x -> DeleteRelationalDatabase
$cfrom :: forall x.
DeleteRelationalDatabase -> Rep DeleteRelationalDatabase x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRelationalDatabase' 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:
--
-- 'skipFinalSnapshot', 'deleteRelationalDatabase_skipFinalSnapshot' - Determines whether a final database snapshot is created before your
-- database is deleted. If @true@ is specified, no database snapshot is
-- created. If @false@ is specified, a database snapshot is created before
-- your database is deleted.
--
-- You must specify the @final relational database snapshot name@ parameter
-- if the @skip final snapshot@ parameter is @false@.
--
-- Default: @false@
--
-- 'finalRelationalDatabaseSnapshotName', 'deleteRelationalDatabase_finalRelationalDatabaseSnapshotName' - The name of the database snapshot created if @skip final snapshot@ is
-- @false@, which is the default value for that parameter.
--
-- Specifying this parameter and also specifying the @skip final snapshot@
-- parameter to @true@ results in an error.
--
-- Constraints:
--
-- -   Must contain from 2 to 255 alphanumeric characters, or hyphens.
--
-- -   The first and last character must be a letter or number.
--
-- 'relationalDatabaseName', 'deleteRelationalDatabase_relationalDatabaseName' - The name of the database that you are deleting.
newDeleteRelationalDatabase ::
  -- | 'relationalDatabaseName'
  Prelude.Text ->
  DeleteRelationalDatabase
newDeleteRelationalDatabase :: Text -> DeleteRelationalDatabase
newDeleteRelationalDatabase Text
pRelationalDatabaseName_ =
  DeleteRelationalDatabase' :: Maybe Bool -> Maybe Text -> Text -> DeleteRelationalDatabase
DeleteRelationalDatabase'
    { $sel:skipFinalSnapshot:DeleteRelationalDatabase' :: Maybe Bool
skipFinalSnapshot =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:finalRelationalDatabaseSnapshotName:DeleteRelationalDatabase' :: Maybe Text
finalRelationalDatabaseSnapshotName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:relationalDatabaseName:DeleteRelationalDatabase' :: Text
relationalDatabaseName = Text
pRelationalDatabaseName_
    }

-- | Determines whether a final database snapshot is created before your
-- database is deleted. If @true@ is specified, no database snapshot is
-- created. If @false@ is specified, a database snapshot is created before
-- your database is deleted.
--
-- You must specify the @final relational database snapshot name@ parameter
-- if the @skip final snapshot@ parameter is @false@.
--
-- Default: @false@
deleteRelationalDatabase_skipFinalSnapshot :: Lens.Lens' DeleteRelationalDatabase (Prelude.Maybe Prelude.Bool)
deleteRelationalDatabase_skipFinalSnapshot :: (Maybe Bool -> f (Maybe Bool))
-> DeleteRelationalDatabase -> f DeleteRelationalDatabase
deleteRelationalDatabase_skipFinalSnapshot = (DeleteRelationalDatabase -> Maybe Bool)
-> (DeleteRelationalDatabase
    -> Maybe Bool -> DeleteRelationalDatabase)
-> Lens
     DeleteRelationalDatabase
     DeleteRelationalDatabase
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRelationalDatabase' {Maybe Bool
skipFinalSnapshot :: Maybe Bool
$sel:skipFinalSnapshot:DeleteRelationalDatabase' :: DeleteRelationalDatabase -> Maybe Bool
skipFinalSnapshot} -> Maybe Bool
skipFinalSnapshot) (\s :: DeleteRelationalDatabase
s@DeleteRelationalDatabase' {} Maybe Bool
a -> DeleteRelationalDatabase
s {$sel:skipFinalSnapshot:DeleteRelationalDatabase' :: Maybe Bool
skipFinalSnapshot = Maybe Bool
a} :: DeleteRelationalDatabase)

-- | The name of the database snapshot created if @skip final snapshot@ is
-- @false@, which is the default value for that parameter.
--
-- Specifying this parameter and also specifying the @skip final snapshot@
-- parameter to @true@ results in an error.
--
-- Constraints:
--
-- -   Must contain from 2 to 255 alphanumeric characters, or hyphens.
--
-- -   The first and last character must be a letter or number.
deleteRelationalDatabase_finalRelationalDatabaseSnapshotName :: Lens.Lens' DeleteRelationalDatabase (Prelude.Maybe Prelude.Text)
deleteRelationalDatabase_finalRelationalDatabaseSnapshotName :: (Maybe Text -> f (Maybe Text))
-> DeleteRelationalDatabase -> f DeleteRelationalDatabase
deleteRelationalDatabase_finalRelationalDatabaseSnapshotName = (DeleteRelationalDatabase -> Maybe Text)
-> (DeleteRelationalDatabase
    -> Maybe Text -> DeleteRelationalDatabase)
-> Lens
     DeleteRelationalDatabase
     DeleteRelationalDatabase
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRelationalDatabase' {Maybe Text
finalRelationalDatabaseSnapshotName :: Maybe Text
$sel:finalRelationalDatabaseSnapshotName:DeleteRelationalDatabase' :: DeleteRelationalDatabase -> Maybe Text
finalRelationalDatabaseSnapshotName} -> Maybe Text
finalRelationalDatabaseSnapshotName) (\s :: DeleteRelationalDatabase
s@DeleteRelationalDatabase' {} Maybe Text
a -> DeleteRelationalDatabase
s {$sel:finalRelationalDatabaseSnapshotName:DeleteRelationalDatabase' :: Maybe Text
finalRelationalDatabaseSnapshotName = Maybe Text
a} :: DeleteRelationalDatabase)

-- | The name of the database that you are deleting.
deleteRelationalDatabase_relationalDatabaseName :: Lens.Lens' DeleteRelationalDatabase Prelude.Text
deleteRelationalDatabase_relationalDatabaseName :: (Text -> f Text)
-> DeleteRelationalDatabase -> f DeleteRelationalDatabase
deleteRelationalDatabase_relationalDatabaseName = (DeleteRelationalDatabase -> Text)
-> (DeleteRelationalDatabase -> Text -> DeleteRelationalDatabase)
-> Lens DeleteRelationalDatabase DeleteRelationalDatabase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRelationalDatabase' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:DeleteRelationalDatabase' :: DeleteRelationalDatabase -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: DeleteRelationalDatabase
s@DeleteRelationalDatabase' {} Text
a -> DeleteRelationalDatabase
s {$sel:relationalDatabaseName:DeleteRelationalDatabase' :: Text
relationalDatabaseName = Text
a} :: DeleteRelationalDatabase)

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

instance Prelude.NFData DeleteRelationalDatabase

instance Core.ToHeaders DeleteRelationalDatabase where
  toHeaders :: DeleteRelationalDatabase -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteRelationalDatabase -> 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.DeleteRelationalDatabase" ::
                          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 DeleteRelationalDatabase where
  toJSON :: DeleteRelationalDatabase -> Value
toJSON DeleteRelationalDatabase' {Maybe Bool
Maybe Text
Text
relationalDatabaseName :: Text
finalRelationalDatabaseSnapshotName :: Maybe Text
skipFinalSnapshot :: Maybe Bool
$sel:relationalDatabaseName:DeleteRelationalDatabase' :: DeleteRelationalDatabase -> Text
$sel:finalRelationalDatabaseSnapshotName:DeleteRelationalDatabase' :: DeleteRelationalDatabase -> Maybe Text
$sel:skipFinalSnapshot:DeleteRelationalDatabase' :: DeleteRelationalDatabase -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"skipFinalSnapshot" 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
skipFinalSnapshot,
            (Text
"finalRelationalDatabaseSnapshotName" 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
finalRelationalDatabaseSnapshotName,
            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 DeleteRelationalDatabase where
  toPath :: DeleteRelationalDatabase -> ByteString
toPath = ByteString -> DeleteRelationalDatabase -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'DeleteRelationalDatabaseResponse' 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', 'deleteRelationalDatabaseResponse_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', 'deleteRelationalDatabaseResponse_httpStatus' - The response's http status code.
newDeleteRelationalDatabaseResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteRelationalDatabaseResponse
newDeleteRelationalDatabaseResponse :: Int -> DeleteRelationalDatabaseResponse
newDeleteRelationalDatabaseResponse Int
pHttpStatus_ =
  DeleteRelationalDatabaseResponse' :: Maybe [Operation] -> Int -> DeleteRelationalDatabaseResponse
DeleteRelationalDatabaseResponse'
    { $sel:operations:DeleteRelationalDatabaseResponse' :: Maybe [Operation]
operations =
        Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DeleteRelationalDatabaseResponse' :: 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.
deleteRelationalDatabaseResponse_operations :: Lens.Lens' DeleteRelationalDatabaseResponse (Prelude.Maybe [Operation])
deleteRelationalDatabaseResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> DeleteRelationalDatabaseResponse
-> f DeleteRelationalDatabaseResponse
deleteRelationalDatabaseResponse_operations = (DeleteRelationalDatabaseResponse -> Maybe [Operation])
-> (DeleteRelationalDatabaseResponse
    -> Maybe [Operation] -> DeleteRelationalDatabaseResponse)
-> Lens
     DeleteRelationalDatabaseResponse
     DeleteRelationalDatabaseResponse
     (Maybe [Operation])
     (Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRelationalDatabaseResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:DeleteRelationalDatabaseResponse' :: DeleteRelationalDatabaseResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: DeleteRelationalDatabaseResponse
s@DeleteRelationalDatabaseResponse' {} Maybe [Operation]
a -> DeleteRelationalDatabaseResponse
s {$sel:operations:DeleteRelationalDatabaseResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: DeleteRelationalDatabaseResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
 -> DeleteRelationalDatabaseResponse
 -> f DeleteRelationalDatabaseResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
    -> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> DeleteRelationalDatabaseResponse
-> f DeleteRelationalDatabaseResponse
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.
deleteRelationalDatabaseResponse_httpStatus :: Lens.Lens' DeleteRelationalDatabaseResponse Prelude.Int
deleteRelationalDatabaseResponse_httpStatus :: (Int -> f Int)
-> DeleteRelationalDatabaseResponse
-> f DeleteRelationalDatabaseResponse
deleteRelationalDatabaseResponse_httpStatus = (DeleteRelationalDatabaseResponse -> Int)
-> (DeleteRelationalDatabaseResponse
    -> Int -> DeleteRelationalDatabaseResponse)
-> Lens
     DeleteRelationalDatabaseResponse
     DeleteRelationalDatabaseResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRelationalDatabaseResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteRelationalDatabaseResponse' :: DeleteRelationalDatabaseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteRelationalDatabaseResponse
s@DeleteRelationalDatabaseResponse' {} Int
a -> DeleteRelationalDatabaseResponse
s {$sel:httpStatus:DeleteRelationalDatabaseResponse' :: Int
httpStatus = Int
a} :: DeleteRelationalDatabaseResponse)

instance
  Prelude.NFData
    DeleteRelationalDatabaseResponse