{-# 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 #-}
module Amazonka.ConnectCampaigns.PauseCampaign
(
PauseCampaign (..),
newPauseCampaign,
pauseCampaign_id,
PauseCampaignResponse (..),
newPauseCampaignResponse,
)
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
data PauseCampaign = PauseCampaign'
{ PauseCampaign -> Text
id :: Prelude.Text
}
deriving (PauseCampaign -> PauseCampaign -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PauseCampaign -> PauseCampaign -> Bool
$c/= :: PauseCampaign -> PauseCampaign -> Bool
== :: PauseCampaign -> PauseCampaign -> Bool
$c== :: PauseCampaign -> PauseCampaign -> Bool
Prelude.Eq, ReadPrec [PauseCampaign]
ReadPrec PauseCampaign
Int -> ReadS PauseCampaign
ReadS [PauseCampaign]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PauseCampaign]
$creadListPrec :: ReadPrec [PauseCampaign]
readPrec :: ReadPrec PauseCampaign
$creadPrec :: ReadPrec PauseCampaign
readList :: ReadS [PauseCampaign]
$creadList :: ReadS [PauseCampaign]
readsPrec :: Int -> ReadS PauseCampaign
$creadsPrec :: Int -> ReadS PauseCampaign
Prelude.Read, Int -> PauseCampaign -> ShowS
[PauseCampaign] -> ShowS
PauseCampaign -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PauseCampaign] -> ShowS
$cshowList :: [PauseCampaign] -> ShowS
show :: PauseCampaign -> String
$cshow :: PauseCampaign -> String
showsPrec :: Int -> PauseCampaign -> ShowS
$cshowsPrec :: Int -> PauseCampaign -> ShowS
Prelude.Show, forall x. Rep PauseCampaign x -> PauseCampaign
forall x. PauseCampaign -> Rep PauseCampaign x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PauseCampaign x -> PauseCampaign
$cfrom :: forall x. PauseCampaign -> Rep PauseCampaign x
Prelude.Generic)
newPauseCampaign ::
Prelude.Text ->
PauseCampaign
newPauseCampaign :: Text -> PauseCampaign
newPauseCampaign Text
pId_ = PauseCampaign' {$sel:id:PauseCampaign' :: Text
id = Text
pId_}
pauseCampaign_id :: Lens.Lens' PauseCampaign Prelude.Text
pauseCampaign_id :: Lens' PauseCampaign Text
pauseCampaign_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PauseCampaign' {Text
id :: Text
$sel:id:PauseCampaign' :: PauseCampaign -> Text
id} -> Text
id) (\s :: PauseCampaign
s@PauseCampaign' {} Text
a -> PauseCampaign
s {$sel:id:PauseCampaign' :: Text
id = Text
a} :: PauseCampaign)
instance Core.AWSRequest PauseCampaign where
type
AWSResponse PauseCampaign =
PauseCampaignResponse
request :: (Service -> Service) -> PauseCampaign -> Request PauseCampaign
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 PauseCampaign
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PauseCampaign)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull PauseCampaignResponse
PauseCampaignResponse'
instance Prelude.Hashable PauseCampaign where
hashWithSalt :: Int -> PauseCampaign -> Int
hashWithSalt Int
_salt PauseCampaign' {Text
id :: Text
$sel:id:PauseCampaign' :: PauseCampaign -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData PauseCampaign where
rnf :: PauseCampaign -> ()
rnf PauseCampaign' {Text
id :: Text
$sel:id:PauseCampaign' :: PauseCampaign -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders PauseCampaign where
toHeaders :: PauseCampaign -> [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 PauseCampaign where
toJSON :: PauseCampaign -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath PauseCampaign where
toPath :: PauseCampaign -> ByteString
toPath PauseCampaign' {Text
id :: Text
$sel:id:PauseCampaign' :: PauseCampaign -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/campaigns/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id, ByteString
"/pause"]
instance Data.ToQuery PauseCampaign where
toQuery :: PauseCampaign -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PauseCampaignResponse = PauseCampaignResponse'
{
}
deriving (PauseCampaignResponse -> PauseCampaignResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PauseCampaignResponse -> PauseCampaignResponse -> Bool
$c/= :: PauseCampaignResponse -> PauseCampaignResponse -> Bool
== :: PauseCampaignResponse -> PauseCampaignResponse -> Bool
$c== :: PauseCampaignResponse -> PauseCampaignResponse -> Bool
Prelude.Eq, ReadPrec [PauseCampaignResponse]
ReadPrec PauseCampaignResponse
Int -> ReadS PauseCampaignResponse
ReadS [PauseCampaignResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PauseCampaignResponse]
$creadListPrec :: ReadPrec [PauseCampaignResponse]
readPrec :: ReadPrec PauseCampaignResponse
$creadPrec :: ReadPrec PauseCampaignResponse
readList :: ReadS [PauseCampaignResponse]
$creadList :: ReadS [PauseCampaignResponse]
readsPrec :: Int -> ReadS PauseCampaignResponse
$creadsPrec :: Int -> ReadS PauseCampaignResponse
Prelude.Read, Int -> PauseCampaignResponse -> ShowS
[PauseCampaignResponse] -> ShowS
PauseCampaignResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PauseCampaignResponse] -> ShowS
$cshowList :: [PauseCampaignResponse] -> ShowS
show :: PauseCampaignResponse -> String
$cshow :: PauseCampaignResponse -> String
showsPrec :: Int -> PauseCampaignResponse -> ShowS
$cshowsPrec :: Int -> PauseCampaignResponse -> ShowS
Prelude.Show, forall x. Rep PauseCampaignResponse x -> PauseCampaignResponse
forall x. PauseCampaignResponse -> Rep PauseCampaignResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PauseCampaignResponse x -> PauseCampaignResponse
$cfrom :: forall x. PauseCampaignResponse -> Rep PauseCampaignResponse x
Prelude.Generic)
newPauseCampaignResponse ::
PauseCampaignResponse
newPauseCampaignResponse :: PauseCampaignResponse
newPauseCampaignResponse = PauseCampaignResponse
PauseCampaignResponse'
instance Prelude.NFData PauseCampaignResponse where
rnf :: PauseCampaignResponse -> ()
rnf PauseCampaignResponse
_ = ()