{-# 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.ConnectCampaigns.DeleteCampaign
-- 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 a campaign from the specified Amazon Connect account.
module Amazonka.ConnectCampaigns.DeleteCampaign
  ( -- * Creating a Request
    DeleteCampaign (..),
    newDeleteCampaign,

    -- * Request Lenses
    deleteCampaign_id,

    -- * Destructuring the Response
    DeleteCampaignResponse (..),
    newDeleteCampaignResponse,
  )
where

import Amazonka.ConnectCampaigns.Types
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

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

-- |
-- Create a value of 'DeleteCampaign' 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:
--
-- 'id', 'deleteCampaign_id' - Undocumented member.
newDeleteCampaign ::
  -- | 'id'
  Prelude.Text ->
  DeleteCampaign
newDeleteCampaign :: Text -> DeleteCampaign
newDeleteCampaign Text
pId_ = DeleteCampaign' {$sel:id:DeleteCampaign' :: Text
id = Text
pId_}

-- | Undocumented member.
deleteCampaign_id :: Lens.Lens' DeleteCampaign Prelude.Text
deleteCampaign_id :: Lens' DeleteCampaign Text
deleteCampaign_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCampaign' {Text
id :: Text
$sel:id:DeleteCampaign' :: DeleteCampaign -> Text
id} -> Text
id) (\s :: DeleteCampaign
s@DeleteCampaign' {} Text
a -> DeleteCampaign
s {$sel:id:DeleteCampaign' :: Text
id = Text
a} :: DeleteCampaign)

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

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

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

instance Data.ToHeaders DeleteCampaign where
  toHeaders :: DeleteCampaign -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DeleteCampaign where
  toPath :: DeleteCampaign -> ByteString
toPath DeleteCampaign' {Text
id :: Text
$sel:id:DeleteCampaign' :: DeleteCampaign -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/campaigns/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]

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

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

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

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