{-# 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.AMP.DeleteAlertManagerDefinition
-- 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)
--
-- Deletes an alert manager definition.
module Amazonka.AMP.DeleteAlertManagerDefinition
  ( -- * Creating a Request
    DeleteAlertManagerDefinition (..),
    newDeleteAlertManagerDefinition,

    -- * Request Lenses
    deleteAlertManagerDefinition_clientToken,
    deleteAlertManagerDefinition_workspaceId,

    -- * Destructuring the Response
    DeleteAlertManagerDefinitionResponse (..),
    newDeleteAlertManagerDefinitionResponse,
  )
where

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

-- | Represents the input of a DeleteAlertManagerDefinition operation.
--
-- /See:/ 'newDeleteAlertManagerDefinition' smart constructor.
data DeleteAlertManagerDefinition = DeleteAlertManagerDefinition'
  { -- | Optional, unique, case-sensitive, user-provided identifier to ensure the
    -- idempotency of the request.
    DeleteAlertManagerDefinition -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the workspace in which to delete the alert manager definition.
    DeleteAlertManagerDefinition -> Text
workspaceId :: Prelude.Text
  }
  deriving (DeleteAlertManagerDefinition
-> DeleteAlertManagerDefinition -> Bool
(DeleteAlertManagerDefinition
 -> DeleteAlertManagerDefinition -> Bool)
-> (DeleteAlertManagerDefinition
    -> DeleteAlertManagerDefinition -> Bool)
-> Eq DeleteAlertManagerDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAlertManagerDefinition
-> DeleteAlertManagerDefinition -> Bool
$c/= :: DeleteAlertManagerDefinition
-> DeleteAlertManagerDefinition -> Bool
== :: DeleteAlertManagerDefinition
-> DeleteAlertManagerDefinition -> Bool
$c== :: DeleteAlertManagerDefinition
-> DeleteAlertManagerDefinition -> Bool
Prelude.Eq, ReadPrec [DeleteAlertManagerDefinition]
ReadPrec DeleteAlertManagerDefinition
Int -> ReadS DeleteAlertManagerDefinition
ReadS [DeleteAlertManagerDefinition]
(Int -> ReadS DeleteAlertManagerDefinition)
-> ReadS [DeleteAlertManagerDefinition]
-> ReadPrec DeleteAlertManagerDefinition
-> ReadPrec [DeleteAlertManagerDefinition]
-> Read DeleteAlertManagerDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAlertManagerDefinition]
$creadListPrec :: ReadPrec [DeleteAlertManagerDefinition]
readPrec :: ReadPrec DeleteAlertManagerDefinition
$creadPrec :: ReadPrec DeleteAlertManagerDefinition
readList :: ReadS [DeleteAlertManagerDefinition]
$creadList :: ReadS [DeleteAlertManagerDefinition]
readsPrec :: Int -> ReadS DeleteAlertManagerDefinition
$creadsPrec :: Int -> ReadS DeleteAlertManagerDefinition
Prelude.Read, Int -> DeleteAlertManagerDefinition -> ShowS
[DeleteAlertManagerDefinition] -> ShowS
DeleteAlertManagerDefinition -> String
(Int -> DeleteAlertManagerDefinition -> ShowS)
-> (DeleteAlertManagerDefinition -> String)
-> ([DeleteAlertManagerDefinition] -> ShowS)
-> Show DeleteAlertManagerDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAlertManagerDefinition] -> ShowS
$cshowList :: [DeleteAlertManagerDefinition] -> ShowS
show :: DeleteAlertManagerDefinition -> String
$cshow :: DeleteAlertManagerDefinition -> String
showsPrec :: Int -> DeleteAlertManagerDefinition -> ShowS
$cshowsPrec :: Int -> DeleteAlertManagerDefinition -> ShowS
Prelude.Show, (forall x.
 DeleteAlertManagerDefinition -> Rep DeleteAlertManagerDefinition x)
-> (forall x.
    Rep DeleteAlertManagerDefinition x -> DeleteAlertManagerDefinition)
-> Generic DeleteAlertManagerDefinition
forall x.
Rep DeleteAlertManagerDefinition x -> DeleteAlertManagerDefinition
forall x.
DeleteAlertManagerDefinition -> Rep DeleteAlertManagerDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAlertManagerDefinition x -> DeleteAlertManagerDefinition
$cfrom :: forall x.
DeleteAlertManagerDefinition -> Rep DeleteAlertManagerDefinition x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAlertManagerDefinition' 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:
--
-- 'clientToken', 'deleteAlertManagerDefinition_clientToken' - Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
--
-- 'workspaceId', 'deleteAlertManagerDefinition_workspaceId' - The ID of the workspace in which to delete the alert manager definition.
newDeleteAlertManagerDefinition ::
  -- | 'workspaceId'
  Prelude.Text ->
  DeleteAlertManagerDefinition
newDeleteAlertManagerDefinition :: Text -> DeleteAlertManagerDefinition
newDeleteAlertManagerDefinition Text
pWorkspaceId_ =
  DeleteAlertManagerDefinition' :: Maybe Text -> Text -> DeleteAlertManagerDefinition
DeleteAlertManagerDefinition'
    { $sel:clientToken:DeleteAlertManagerDefinition' :: Maybe Text
clientToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceId:DeleteAlertManagerDefinition' :: Text
workspaceId = Text
pWorkspaceId_
    }

-- | Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
deleteAlertManagerDefinition_clientToken :: Lens.Lens' DeleteAlertManagerDefinition (Prelude.Maybe Prelude.Text)
deleteAlertManagerDefinition_clientToken :: (Maybe Text -> f (Maybe Text))
-> DeleteAlertManagerDefinition -> f DeleteAlertManagerDefinition
deleteAlertManagerDefinition_clientToken = (DeleteAlertManagerDefinition -> Maybe Text)
-> (DeleteAlertManagerDefinition
    -> Maybe Text -> DeleteAlertManagerDefinition)
-> Lens
     DeleteAlertManagerDefinition
     DeleteAlertManagerDefinition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlertManagerDefinition' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:DeleteAlertManagerDefinition' :: DeleteAlertManagerDefinition -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: DeleteAlertManagerDefinition
s@DeleteAlertManagerDefinition' {} Maybe Text
a -> DeleteAlertManagerDefinition
s {$sel:clientToken:DeleteAlertManagerDefinition' :: Maybe Text
clientToken = Maybe Text
a} :: DeleteAlertManagerDefinition)

-- | The ID of the workspace in which to delete the alert manager definition.
deleteAlertManagerDefinition_workspaceId :: Lens.Lens' DeleteAlertManagerDefinition Prelude.Text
deleteAlertManagerDefinition_workspaceId :: (Text -> f Text)
-> DeleteAlertManagerDefinition -> f DeleteAlertManagerDefinition
deleteAlertManagerDefinition_workspaceId = (DeleteAlertManagerDefinition -> Text)
-> (DeleteAlertManagerDefinition
    -> Text -> DeleteAlertManagerDefinition)
-> Lens
     DeleteAlertManagerDefinition DeleteAlertManagerDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlertManagerDefinition' {Text
workspaceId :: Text
$sel:workspaceId:DeleteAlertManagerDefinition' :: DeleteAlertManagerDefinition -> Text
workspaceId} -> Text
workspaceId) (\s :: DeleteAlertManagerDefinition
s@DeleteAlertManagerDefinition' {} Text
a -> DeleteAlertManagerDefinition
s {$sel:workspaceId:DeleteAlertManagerDefinition' :: Text
workspaceId = Text
a} :: DeleteAlertManagerDefinition)

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

instance
  Prelude.Hashable
    DeleteAlertManagerDefinition

instance Prelude.NFData DeleteAlertManagerDefinition

instance Core.ToHeaders DeleteAlertManagerDefinition where
  toHeaders :: DeleteAlertManagerDefinition -> [Header]
toHeaders =
    [Header] -> DeleteAlertManagerDefinition -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DeleteAlertManagerDefinition where
  toPath :: DeleteAlertManagerDefinition -> ByteString
toPath DeleteAlertManagerDefinition' {Maybe Text
Text
workspaceId :: Text
clientToken :: Maybe Text
$sel:workspaceId:DeleteAlertManagerDefinition' :: DeleteAlertManagerDefinition -> Text
$sel:clientToken:DeleteAlertManagerDefinition' :: DeleteAlertManagerDefinition -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/workspaces/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workspaceId,
        ByteString
"/alertmanager/definition"
      ]

instance Core.ToQuery DeleteAlertManagerDefinition where
  toQuery :: DeleteAlertManagerDefinition -> QueryString
toQuery DeleteAlertManagerDefinition' {Maybe Text
Text
workspaceId :: Text
clientToken :: Maybe Text
$sel:workspaceId:DeleteAlertManagerDefinition' :: DeleteAlertManagerDefinition -> Text
$sel:clientToken:DeleteAlertManagerDefinition' :: DeleteAlertManagerDefinition -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"clientToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientToken]

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

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

instance
  Prelude.NFData
    DeleteAlertManagerDefinitionResponse