{-# 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.FMS.DeleteProtocolsList
-- 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)
--
-- Permanently deletes an Firewall Manager protocols list.
module Amazonka.FMS.DeleteProtocolsList
  ( -- * Creating a Request
    DeleteProtocolsList (..),
    newDeleteProtocolsList,

    -- * Request Lenses
    deleteProtocolsList_listId,

    -- * Destructuring the Response
    DeleteProtocolsListResponse (..),
    newDeleteProtocolsListResponse,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.FMS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteProtocolsList' smart constructor.
data DeleteProtocolsList = DeleteProtocolsList'
  { -- | The ID of the protocols list that you want to delete. You can retrieve
    -- this ID from @PutProtocolsList@, @ListProtocolsLists@, and
    -- @GetProtocolsLost@.
    DeleteProtocolsList -> Text
listId :: Prelude.Text
  }
  deriving (DeleteProtocolsList -> DeleteProtocolsList -> Bool
(DeleteProtocolsList -> DeleteProtocolsList -> Bool)
-> (DeleteProtocolsList -> DeleteProtocolsList -> Bool)
-> Eq DeleteProtocolsList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProtocolsList -> DeleteProtocolsList -> Bool
$c/= :: DeleteProtocolsList -> DeleteProtocolsList -> Bool
== :: DeleteProtocolsList -> DeleteProtocolsList -> Bool
$c== :: DeleteProtocolsList -> DeleteProtocolsList -> Bool
Prelude.Eq, ReadPrec [DeleteProtocolsList]
ReadPrec DeleteProtocolsList
Int -> ReadS DeleteProtocolsList
ReadS [DeleteProtocolsList]
(Int -> ReadS DeleteProtocolsList)
-> ReadS [DeleteProtocolsList]
-> ReadPrec DeleteProtocolsList
-> ReadPrec [DeleteProtocolsList]
-> Read DeleteProtocolsList
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProtocolsList]
$creadListPrec :: ReadPrec [DeleteProtocolsList]
readPrec :: ReadPrec DeleteProtocolsList
$creadPrec :: ReadPrec DeleteProtocolsList
readList :: ReadS [DeleteProtocolsList]
$creadList :: ReadS [DeleteProtocolsList]
readsPrec :: Int -> ReadS DeleteProtocolsList
$creadsPrec :: Int -> ReadS DeleteProtocolsList
Prelude.Read, Int -> DeleteProtocolsList -> ShowS
[DeleteProtocolsList] -> ShowS
DeleteProtocolsList -> String
(Int -> DeleteProtocolsList -> ShowS)
-> (DeleteProtocolsList -> String)
-> ([DeleteProtocolsList] -> ShowS)
-> Show DeleteProtocolsList
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProtocolsList] -> ShowS
$cshowList :: [DeleteProtocolsList] -> ShowS
show :: DeleteProtocolsList -> String
$cshow :: DeleteProtocolsList -> String
showsPrec :: Int -> DeleteProtocolsList -> ShowS
$cshowsPrec :: Int -> DeleteProtocolsList -> ShowS
Prelude.Show, (forall x. DeleteProtocolsList -> Rep DeleteProtocolsList x)
-> (forall x. Rep DeleteProtocolsList x -> DeleteProtocolsList)
-> Generic DeleteProtocolsList
forall x. Rep DeleteProtocolsList x -> DeleteProtocolsList
forall x. DeleteProtocolsList -> Rep DeleteProtocolsList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProtocolsList x -> DeleteProtocolsList
$cfrom :: forall x. DeleteProtocolsList -> Rep DeleteProtocolsList x
Prelude.Generic)

-- |
-- Create a value of 'DeleteProtocolsList' 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:
--
-- 'listId', 'deleteProtocolsList_listId' - The ID of the protocols list that you want to delete. You can retrieve
-- this ID from @PutProtocolsList@, @ListProtocolsLists@, and
-- @GetProtocolsLost@.
newDeleteProtocolsList ::
  -- | 'listId'
  Prelude.Text ->
  DeleteProtocolsList
newDeleteProtocolsList :: Text -> DeleteProtocolsList
newDeleteProtocolsList Text
pListId_ =
  DeleteProtocolsList' :: Text -> DeleteProtocolsList
DeleteProtocolsList' {$sel:listId:DeleteProtocolsList' :: Text
listId = Text
pListId_}

-- | The ID of the protocols list that you want to delete. You can retrieve
-- this ID from @PutProtocolsList@, @ListProtocolsLists@, and
-- @GetProtocolsLost@.
deleteProtocolsList_listId :: Lens.Lens' DeleteProtocolsList Prelude.Text
deleteProtocolsList_listId :: (Text -> f Text) -> DeleteProtocolsList -> f DeleteProtocolsList
deleteProtocolsList_listId = (DeleteProtocolsList -> Text)
-> (DeleteProtocolsList -> Text -> DeleteProtocolsList)
-> Lens DeleteProtocolsList DeleteProtocolsList Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProtocolsList' {Text
listId :: Text
$sel:listId:DeleteProtocolsList' :: DeleteProtocolsList -> Text
listId} -> Text
listId) (\s :: DeleteProtocolsList
s@DeleteProtocolsList' {} Text
a -> DeleteProtocolsList
s {$sel:listId:DeleteProtocolsList' :: Text
listId = Text
a} :: DeleteProtocolsList)

instance Core.AWSRequest DeleteProtocolsList where
  type
    AWSResponse DeleteProtocolsList =
      DeleteProtocolsListResponse
  request :: DeleteProtocolsList -> Request DeleteProtocolsList
request = Service -> DeleteProtocolsList -> Request DeleteProtocolsList
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteProtocolsList
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteProtocolsList)))
response =
    AWSResponse DeleteProtocolsList
-> Logger
-> Service
-> Proxy DeleteProtocolsList
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteProtocolsList)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteProtocolsList
DeleteProtocolsListResponse
DeleteProtocolsListResponse'

instance Prelude.Hashable DeleteProtocolsList

instance Prelude.NFData DeleteProtocolsList

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

instance Core.ToJSON DeleteProtocolsList where
  toJSON :: DeleteProtocolsList -> Value
toJSON DeleteProtocolsList' {Text
listId :: Text
$sel:listId:DeleteProtocolsList' :: DeleteProtocolsList -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ListId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
listId)]
      )

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

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

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

-- |
-- Create a value of 'DeleteProtocolsListResponse' 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.
newDeleteProtocolsListResponse ::
  DeleteProtocolsListResponse
newDeleteProtocolsListResponse :: DeleteProtocolsListResponse
newDeleteProtocolsListResponse =
  DeleteProtocolsListResponse
DeleteProtocolsListResponse'

instance Prelude.NFData DeleteProtocolsListResponse