{-# 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.StopCampaign
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Stops a campaign for the specified Amazon Connect account.
module Amazonka.ConnectCampaigns.StopCampaign
  ( -- * Creating a Request
    StopCampaign (..),
    newStopCampaign,

    -- * Request Lenses
    stopCampaign_id,

    -- * Destructuring the Response
    StopCampaignResponse (..),
    newStopCampaignResponse,
  )
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

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

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

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

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

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

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

instance Data.ToHeaders StopCampaign where
  toHeaders :: StopCampaign -> [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.ToJSON StopCampaign where
  toJSON :: StopCampaign -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)

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

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

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

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

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