{-# 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.DeleteAppsList
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Permanently deletes an Firewall Manager applications list.
module Amazonka.FMS.DeleteAppsList
  ( -- * Creating a Request
    DeleteAppsList (..),
    newDeleteAppsList,

    -- * Request Lenses
    deleteAppsList_listId,

    -- * Destructuring the Response
    DeleteAppsListResponse (..),
    newDeleteAppsListResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteAppsList' 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', 'deleteAppsList_listId' - The ID of the applications list that you want to delete. You can
-- retrieve this ID from @PutAppsList@, @ListAppsLists@, and @GetAppsList@.
newDeleteAppsList ::
  -- | 'listId'
  Prelude.Text ->
  DeleteAppsList
newDeleteAppsList :: Text -> DeleteAppsList
newDeleteAppsList Text
pListId_ =
  DeleteAppsList' {$sel:listId:DeleteAppsList' :: Text
listId = Text
pListId_}

-- | The ID of the applications list that you want to delete. You can
-- retrieve this ID from @PutAppsList@, @ListAppsLists@, and @GetAppsList@.
deleteAppsList_listId :: Lens.Lens' DeleteAppsList Prelude.Text
deleteAppsList_listId :: Lens' DeleteAppsList Text
deleteAppsList_listId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAppsList' {Text
listId :: Text
$sel:listId:DeleteAppsList' :: DeleteAppsList -> Text
listId} -> Text
listId) (\s :: DeleteAppsList
s@DeleteAppsList' {} Text
a -> DeleteAppsList
s {$sel:listId:DeleteAppsList' :: Text
listId = Text
a} :: DeleteAppsList)

instance Core.AWSRequest DeleteAppsList where
  type
    AWSResponse DeleteAppsList =
      DeleteAppsListResponse
  request :: (Service -> Service) -> DeleteAppsList -> Request DeleteAppsList
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 DeleteAppsList
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAppsList)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteAppsListResponse
DeleteAppsListResponse'

instance Prelude.Hashable DeleteAppsList where
  hashWithSalt :: Int -> DeleteAppsList -> Int
hashWithSalt Int
_salt DeleteAppsList' {Text
listId :: Text
$sel:listId:DeleteAppsList' :: DeleteAppsList -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
listId

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

instance Data.ToHeaders DeleteAppsList where
  toHeaders :: DeleteAppsList -> [Header]
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 -> [Header]
Data.=# ( ByteString
"AWSFMS_20180101.DeleteAppsList" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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

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

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

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

instance Prelude.NFData DeleteAppsListResponse where
  rnf :: DeleteAppsListResponse -> ()
rnf DeleteAppsListResponse
_ = ()