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

    -- * Request Lenses
    startCampaign_id,

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

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

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

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

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

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

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

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

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

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

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

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

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