{-# 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.DeleteCidrCollection
-- 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 CIDR collection in the current Amazon Web Services account.
-- The collection must be empty before it can be deleted.
module Amazonka.Route53.DeleteCidrCollection
  ( -- * Creating a Request
    DeleteCidrCollection (..),
    newDeleteCidrCollection,

    -- * Request Lenses
    deleteCidrCollection_id,

    -- * Destructuring the Response
    DeleteCidrCollectionResponse (..),
    newDeleteCidrCollectionResponse,

    -- * Response Lenses
    deleteCidrCollectionResponse_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

-- | /See:/ 'newDeleteCidrCollection' smart constructor.
data DeleteCidrCollection = DeleteCidrCollection'
  { -- | The UUID of the collection to delete.
    DeleteCidrCollection -> Text
id :: Prelude.Text
  }
  deriving (DeleteCidrCollection -> DeleteCidrCollection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCidrCollection -> DeleteCidrCollection -> Bool
$c/= :: DeleteCidrCollection -> DeleteCidrCollection -> Bool
== :: DeleteCidrCollection -> DeleteCidrCollection -> Bool
$c== :: DeleteCidrCollection -> DeleteCidrCollection -> Bool
Prelude.Eq, ReadPrec [DeleteCidrCollection]
ReadPrec DeleteCidrCollection
Int -> ReadS DeleteCidrCollection
ReadS [DeleteCidrCollection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCidrCollection]
$creadListPrec :: ReadPrec [DeleteCidrCollection]
readPrec :: ReadPrec DeleteCidrCollection
$creadPrec :: ReadPrec DeleteCidrCollection
readList :: ReadS [DeleteCidrCollection]
$creadList :: ReadS [DeleteCidrCollection]
readsPrec :: Int -> ReadS DeleteCidrCollection
$creadsPrec :: Int -> ReadS DeleteCidrCollection
Prelude.Read, Int -> DeleteCidrCollection -> ShowS
[DeleteCidrCollection] -> ShowS
DeleteCidrCollection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCidrCollection] -> ShowS
$cshowList :: [DeleteCidrCollection] -> ShowS
show :: DeleteCidrCollection -> String
$cshow :: DeleteCidrCollection -> String
showsPrec :: Int -> DeleteCidrCollection -> ShowS
$cshowsPrec :: Int -> DeleteCidrCollection -> ShowS
Prelude.Show, forall x. Rep DeleteCidrCollection x -> DeleteCidrCollection
forall x. DeleteCidrCollection -> Rep DeleteCidrCollection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCidrCollection x -> DeleteCidrCollection
$cfrom :: forall x. DeleteCidrCollection -> Rep DeleteCidrCollection x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCidrCollection' 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', 'deleteCidrCollection_id' - The UUID of the collection to delete.
newDeleteCidrCollection ::
  -- | 'id'
  Prelude.Text ->
  DeleteCidrCollection
newDeleteCidrCollection :: Text -> DeleteCidrCollection
newDeleteCidrCollection Text
pId_ =
  DeleteCidrCollection' {$sel:id:DeleteCidrCollection' :: Text
id = Text
pId_}

-- | The UUID of the collection to delete.
deleteCidrCollection_id :: Lens.Lens' DeleteCidrCollection Prelude.Text
deleteCidrCollection_id :: Lens' DeleteCidrCollection Text
deleteCidrCollection_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCidrCollection' {Text
id :: Text
$sel:id:DeleteCidrCollection' :: DeleteCidrCollection -> Text
id} -> Text
id) (\s :: DeleteCidrCollection
s@DeleteCidrCollection' {} Text
a -> DeleteCidrCollection
s {$sel:id:DeleteCidrCollection' :: Text
id = Text
a} :: DeleteCidrCollection)

instance Core.AWSRequest DeleteCidrCollection where
  type
    AWSResponse DeleteCidrCollection =
      DeleteCidrCollectionResponse
  request :: (Service -> Service)
-> DeleteCidrCollection -> Request DeleteCidrCollection
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 DeleteCidrCollection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteCidrCollection)))
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 -> DeleteCidrCollectionResponse
DeleteCidrCollectionResponse'
            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 DeleteCidrCollection where
  hashWithSalt :: Int -> DeleteCidrCollection -> Int
hashWithSalt Int
_salt DeleteCidrCollection' {Text
id :: Text
$sel:id:DeleteCidrCollection' :: DeleteCidrCollection -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

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

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

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

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

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

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

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

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