{-# 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.Route53.DeleteReusableDelegationSet
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a reusable delegation set.
--
-- You can delete a reusable delegation set only if it isn\'t associated
-- with any hosted zones.
--
-- To verify that the reusable delegation set is not associated with any
-- hosted zones, submit a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetReusableDelegationSet.html GetReusableDelegationSet>
-- request and specify the ID of the reusable delegation set that you want
-- to delete.
module Amazonka.Route53.DeleteReusableDelegationSet
  ( -- * Creating a Request
    DeleteReusableDelegationSet (..),
    newDeleteReusableDelegationSet,

    -- * Request Lenses
    deleteReusableDelegationSet_id,

    -- * Destructuring the Response
    DeleteReusableDelegationSetResponse (..),
    newDeleteReusableDelegationSetResponse,

    -- * Response Lenses
    deleteReusableDelegationSetResponse_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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53.Types

-- | A request to delete a reusable delegation set.
--
-- /See:/ 'newDeleteReusableDelegationSet' smart constructor.
data DeleteReusableDelegationSet = DeleteReusableDelegationSet'
  { -- | The ID of the reusable delegation set that you want to delete.
    DeleteReusableDelegationSet -> ResourceId
id :: ResourceId
  }
  deriving (DeleteReusableDelegationSet -> DeleteReusableDelegationSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReusableDelegationSet -> DeleteReusableDelegationSet -> Bool
$c/= :: DeleteReusableDelegationSet -> DeleteReusableDelegationSet -> Bool
== :: DeleteReusableDelegationSet -> DeleteReusableDelegationSet -> Bool
$c== :: DeleteReusableDelegationSet -> DeleteReusableDelegationSet -> Bool
Prelude.Eq, ReadPrec [DeleteReusableDelegationSet]
ReadPrec DeleteReusableDelegationSet
Int -> ReadS DeleteReusableDelegationSet
ReadS [DeleteReusableDelegationSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReusableDelegationSet]
$creadListPrec :: ReadPrec [DeleteReusableDelegationSet]
readPrec :: ReadPrec DeleteReusableDelegationSet
$creadPrec :: ReadPrec DeleteReusableDelegationSet
readList :: ReadS [DeleteReusableDelegationSet]
$creadList :: ReadS [DeleteReusableDelegationSet]
readsPrec :: Int -> ReadS DeleteReusableDelegationSet
$creadsPrec :: Int -> ReadS DeleteReusableDelegationSet
Prelude.Read, Int -> DeleteReusableDelegationSet -> ShowS
[DeleteReusableDelegationSet] -> ShowS
DeleteReusableDelegationSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReusableDelegationSet] -> ShowS
$cshowList :: [DeleteReusableDelegationSet] -> ShowS
show :: DeleteReusableDelegationSet -> String
$cshow :: DeleteReusableDelegationSet -> String
showsPrec :: Int -> DeleteReusableDelegationSet -> ShowS
$cshowsPrec :: Int -> DeleteReusableDelegationSet -> ShowS
Prelude.Show, forall x.
Rep DeleteReusableDelegationSet x -> DeleteReusableDelegationSet
forall x.
DeleteReusableDelegationSet -> Rep DeleteReusableDelegationSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteReusableDelegationSet x -> DeleteReusableDelegationSet
$cfrom :: forall x.
DeleteReusableDelegationSet -> Rep DeleteReusableDelegationSet x
Prelude.Generic)

-- |
-- Create a value of 'DeleteReusableDelegationSet' 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:
--
-- 'id', 'deleteReusableDelegationSet_id' - The ID of the reusable delegation set that you want to delete.
newDeleteReusableDelegationSet ::
  -- | 'id'
  ResourceId ->
  DeleteReusableDelegationSet
newDeleteReusableDelegationSet :: ResourceId -> DeleteReusableDelegationSet
newDeleteReusableDelegationSet ResourceId
pId_ =
  DeleteReusableDelegationSet' {$sel:id:DeleteReusableDelegationSet' :: ResourceId
id = ResourceId
pId_}

-- | The ID of the reusable delegation set that you want to delete.
deleteReusableDelegationSet_id :: Lens.Lens' DeleteReusableDelegationSet ResourceId
deleteReusableDelegationSet_id :: Lens' DeleteReusableDelegationSet ResourceId
deleteReusableDelegationSet_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReusableDelegationSet' {ResourceId
id :: ResourceId
$sel:id:DeleteReusableDelegationSet' :: DeleteReusableDelegationSet -> ResourceId
id} -> ResourceId
id) (\s :: DeleteReusableDelegationSet
s@DeleteReusableDelegationSet' {} ResourceId
a -> DeleteReusableDelegationSet
s {$sel:id:DeleteReusableDelegationSet' :: ResourceId
id = ResourceId
a} :: DeleteReusableDelegationSet)

instance Core.AWSRequest DeleteReusableDelegationSet where
  type
    AWSResponse DeleteReusableDelegationSet =
      DeleteReusableDelegationSetResponse
  request :: (Service -> Service)
-> DeleteReusableDelegationSet
-> Request DeleteReusableDelegationSet
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteReusableDelegationSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteReusableDelegationSet)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteReusableDelegationSetResponse
DeleteReusableDelegationSetResponse'
            forall (f :: * -> *) a b. Functor 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 DeleteReusableDelegationSet where
  hashWithSalt :: Int -> DeleteReusableDelegationSet -> Int
hashWithSalt Int
_salt DeleteReusableDelegationSet' {ResourceId
id :: ResourceId
$sel:id:DeleteReusableDelegationSet' :: DeleteReusableDelegationSet -> ResourceId
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceId
id

instance Prelude.NFData DeleteReusableDelegationSet where
  rnf :: DeleteReusableDelegationSet -> ()
rnf DeleteReusableDelegationSet' {ResourceId
id :: ResourceId
$sel:id:DeleteReusableDelegationSet' :: DeleteReusableDelegationSet -> ResourceId
..} = forall a. NFData a => a -> ()
Prelude.rnf ResourceId
id

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

instance Data.ToPath DeleteReusableDelegationSet where
  toPath :: DeleteReusableDelegationSet -> ByteString
toPath DeleteReusableDelegationSet' {ResourceId
id :: ResourceId
$sel:id:DeleteReusableDelegationSet' :: DeleteReusableDelegationSet -> ResourceId
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2013-04-01/delegationset/", forall a. ToByteString a => a -> ByteString
Data.toBS ResourceId
id]

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

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

-- |
-- Create a value of 'DeleteReusableDelegationSetResponse' 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:
--
-- 'httpStatus', 'deleteReusableDelegationSetResponse_httpStatus' - The response's http status code.
newDeleteReusableDelegationSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteReusableDelegationSetResponse
newDeleteReusableDelegationSetResponse :: Int -> DeleteReusableDelegationSetResponse
newDeleteReusableDelegationSetResponse Int
pHttpStatus_ =
  DeleteReusableDelegationSetResponse'
    { $sel:httpStatus:DeleteReusableDelegationSetResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    DeleteReusableDelegationSetResponse
  where
  rnf :: DeleteReusableDelegationSetResponse -> ()
rnf DeleteReusableDelegationSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteReusableDelegationSetResponse' :: DeleteReusableDelegationSetResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus