{-# 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.Route53Resolver.DeleteFirewallDomainList
-- 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 the specified domain list.
module Amazonka.Route53Resolver.DeleteFirewallDomainList
  ( -- * Creating a Request
    DeleteFirewallDomainList (..),
    newDeleteFirewallDomainList,

    -- * Request Lenses
    deleteFirewallDomainList_firewallDomainListId,

    -- * Destructuring the Response
    DeleteFirewallDomainListResponse (..),
    newDeleteFirewallDomainListResponse,

    -- * Response Lenses
    deleteFirewallDomainListResponse_firewallDomainList,
    deleteFirewallDomainListResponse_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.Route53Resolver.Types

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

-- |
-- Create a value of 'DeleteFirewallDomainList' 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:
--
-- 'firewallDomainListId', 'deleteFirewallDomainList_firewallDomainListId' - The ID of the domain list that you want to delete.
newDeleteFirewallDomainList ::
  -- | 'firewallDomainListId'
  Prelude.Text ->
  DeleteFirewallDomainList
newDeleteFirewallDomainList :: Text -> DeleteFirewallDomainList
newDeleteFirewallDomainList Text
pFirewallDomainListId_ =
  DeleteFirewallDomainList'
    { $sel:firewallDomainListId:DeleteFirewallDomainList' :: Text
firewallDomainListId =
        Text
pFirewallDomainListId_
    }

-- | The ID of the domain list that you want to delete.
deleteFirewallDomainList_firewallDomainListId :: Lens.Lens' DeleteFirewallDomainList Prelude.Text
deleteFirewallDomainList_firewallDomainListId :: Lens' DeleteFirewallDomainList Text
deleteFirewallDomainList_firewallDomainListId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallDomainList' {Text
firewallDomainListId :: Text
$sel:firewallDomainListId:DeleteFirewallDomainList' :: DeleteFirewallDomainList -> Text
firewallDomainListId} -> Text
firewallDomainListId) (\s :: DeleteFirewallDomainList
s@DeleteFirewallDomainList' {} Text
a -> DeleteFirewallDomainList
s {$sel:firewallDomainListId:DeleteFirewallDomainList' :: Text
firewallDomainListId = Text
a} :: DeleteFirewallDomainList)

instance Core.AWSRequest DeleteFirewallDomainList where
  type
    AWSResponse DeleteFirewallDomainList =
      DeleteFirewallDomainListResponse
  request :: (Service -> Service)
-> DeleteFirewallDomainList -> Request DeleteFirewallDomainList
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteFirewallDomainList
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteFirewallDomainList)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe FirewallDomainList -> Int -> DeleteFirewallDomainListResponse
DeleteFirewallDomainListResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FirewallDomainList")
            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 DeleteFirewallDomainList where
  hashWithSalt :: Int -> DeleteFirewallDomainList -> Int
hashWithSalt Int
_salt DeleteFirewallDomainList' {Text
firewallDomainListId :: Text
$sel:firewallDomainListId:DeleteFirewallDomainList' :: DeleteFirewallDomainList -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
firewallDomainListId

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

instance Data.ToHeaders DeleteFirewallDomainList where
  toHeaders :: DeleteFirewallDomainList -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Route53Resolver.DeleteFirewallDomainList" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteFirewallDomainList where
  toJSON :: DeleteFirewallDomainList -> Value
toJSON DeleteFirewallDomainList' {Text
firewallDomainListId :: Text
$sel:firewallDomainListId:DeleteFirewallDomainList' :: DeleteFirewallDomainList -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"FirewallDomainListId"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
firewallDomainListId
              )
          ]
      )

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

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

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

-- |
-- Create a value of 'DeleteFirewallDomainListResponse' 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:
--
-- 'firewallDomainList', 'deleteFirewallDomainListResponse_firewallDomainList' - The domain list that you just deleted.
--
-- 'httpStatus', 'deleteFirewallDomainListResponse_httpStatus' - The response's http status code.
newDeleteFirewallDomainListResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteFirewallDomainListResponse
newDeleteFirewallDomainListResponse :: Int -> DeleteFirewallDomainListResponse
newDeleteFirewallDomainListResponse Int
pHttpStatus_ =
  DeleteFirewallDomainListResponse'
    { $sel:firewallDomainList:DeleteFirewallDomainListResponse' :: Maybe FirewallDomainList
firewallDomainList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DeleteFirewallDomainListResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The domain list that you just deleted.
deleteFirewallDomainListResponse_firewallDomainList :: Lens.Lens' DeleteFirewallDomainListResponse (Prelude.Maybe FirewallDomainList)
deleteFirewallDomainListResponse_firewallDomainList :: Lens' DeleteFirewallDomainListResponse (Maybe FirewallDomainList)
deleteFirewallDomainListResponse_firewallDomainList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFirewallDomainListResponse' {Maybe FirewallDomainList
firewallDomainList :: Maybe FirewallDomainList
$sel:firewallDomainList:DeleteFirewallDomainListResponse' :: DeleteFirewallDomainListResponse -> Maybe FirewallDomainList
firewallDomainList} -> Maybe FirewallDomainList
firewallDomainList) (\s :: DeleteFirewallDomainListResponse
s@DeleteFirewallDomainListResponse' {} Maybe FirewallDomainList
a -> DeleteFirewallDomainListResponse
s {$sel:firewallDomainList:DeleteFirewallDomainListResponse' :: Maybe FirewallDomainList
firewallDomainList = Maybe FirewallDomainList
a} :: DeleteFirewallDomainListResponse)

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

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