{-# 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.DeleteResourceSet
-- 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 ResourceSet.
module Amazonka.FMS.DeleteResourceSet
  ( -- * Creating a Request
    DeleteResourceSet (..),
    newDeleteResourceSet,

    -- * Request Lenses
    deleteResourceSet_identifier,

    -- * Destructuring the Response
    DeleteResourceSetResponse (..),
    newDeleteResourceSetResponse,
  )
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:/ 'newDeleteResourceSet' smart constructor.
data DeleteResourceSet = DeleteResourceSet'
  { -- | A unique identifier for the resource set, used in a TODO to refer to the
    -- resource set.
    DeleteResourceSet -> Text
identifier :: Prelude.Text
  }
  deriving (DeleteResourceSet -> DeleteResourceSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteResourceSet -> DeleteResourceSet -> Bool
$c/= :: DeleteResourceSet -> DeleteResourceSet -> Bool
== :: DeleteResourceSet -> DeleteResourceSet -> Bool
$c== :: DeleteResourceSet -> DeleteResourceSet -> Bool
Prelude.Eq, ReadPrec [DeleteResourceSet]
ReadPrec DeleteResourceSet
Int -> ReadS DeleteResourceSet
ReadS [DeleteResourceSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteResourceSet]
$creadListPrec :: ReadPrec [DeleteResourceSet]
readPrec :: ReadPrec DeleteResourceSet
$creadPrec :: ReadPrec DeleteResourceSet
readList :: ReadS [DeleteResourceSet]
$creadList :: ReadS [DeleteResourceSet]
readsPrec :: Int -> ReadS DeleteResourceSet
$creadsPrec :: Int -> ReadS DeleteResourceSet
Prelude.Read, Int -> DeleteResourceSet -> ShowS
[DeleteResourceSet] -> ShowS
DeleteResourceSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteResourceSet] -> ShowS
$cshowList :: [DeleteResourceSet] -> ShowS
show :: DeleteResourceSet -> String
$cshow :: DeleteResourceSet -> String
showsPrec :: Int -> DeleteResourceSet -> ShowS
$cshowsPrec :: Int -> DeleteResourceSet -> ShowS
Prelude.Show, forall x. Rep DeleteResourceSet x -> DeleteResourceSet
forall x. DeleteResourceSet -> Rep DeleteResourceSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteResourceSet x -> DeleteResourceSet
$cfrom :: forall x. DeleteResourceSet -> Rep DeleteResourceSet x
Prelude.Generic)

-- |
-- Create a value of 'DeleteResourceSet' 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:
--
-- 'identifier', 'deleteResourceSet_identifier' - A unique identifier for the resource set, used in a TODO to refer to the
-- resource set.
newDeleteResourceSet ::
  -- | 'identifier'
  Prelude.Text ->
  DeleteResourceSet
newDeleteResourceSet :: Text -> DeleteResourceSet
newDeleteResourceSet Text
pIdentifier_ =
  DeleteResourceSet' {$sel:identifier:DeleteResourceSet' :: Text
identifier = Text
pIdentifier_}

-- | A unique identifier for the resource set, used in a TODO to refer to the
-- resource set.
deleteResourceSet_identifier :: Lens.Lens' DeleteResourceSet Prelude.Text
deleteResourceSet_identifier :: Lens' DeleteResourceSet Text
deleteResourceSet_identifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResourceSet' {Text
identifier :: Text
$sel:identifier:DeleteResourceSet' :: DeleteResourceSet -> Text
identifier} -> Text
identifier) (\s :: DeleteResourceSet
s@DeleteResourceSet' {} Text
a -> DeleteResourceSet
s {$sel:identifier:DeleteResourceSet' :: Text
identifier = Text
a} :: DeleteResourceSet)

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

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

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

instance Data.ToHeaders DeleteResourceSet where
  toHeaders :: DeleteResourceSet -> [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.DeleteResourceSet" ::
                          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 DeleteResourceSet where
  toJSON :: DeleteResourceSet -> Value
toJSON DeleteResourceSet' {Text
identifier :: Text
$sel:identifier:DeleteResourceSet' :: DeleteResourceSet -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"Identifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
identifier)]
      )

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

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

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

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

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