{-# 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.Config.PutDeliveryChannel
(
PutDeliveryChannel (..),
newPutDeliveryChannel,
putDeliveryChannel_deliveryChannel,
PutDeliveryChannelResponse (..),
newPutDeliveryChannelResponse,
)
where
import Amazonka.Config.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
data PutDeliveryChannel = PutDeliveryChannel'
{
PutDeliveryChannel -> DeliveryChannel
deliveryChannel :: DeliveryChannel
}
deriving (PutDeliveryChannel -> PutDeliveryChannel -> Bool
(PutDeliveryChannel -> PutDeliveryChannel -> Bool)
-> (PutDeliveryChannel -> PutDeliveryChannel -> Bool)
-> Eq PutDeliveryChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDeliveryChannel -> PutDeliveryChannel -> Bool
$c/= :: PutDeliveryChannel -> PutDeliveryChannel -> Bool
== :: PutDeliveryChannel -> PutDeliveryChannel -> Bool
$c== :: PutDeliveryChannel -> PutDeliveryChannel -> Bool
Prelude.Eq, ReadPrec [PutDeliveryChannel]
ReadPrec PutDeliveryChannel
Int -> ReadS PutDeliveryChannel
ReadS [PutDeliveryChannel]
(Int -> ReadS PutDeliveryChannel)
-> ReadS [PutDeliveryChannel]
-> ReadPrec PutDeliveryChannel
-> ReadPrec [PutDeliveryChannel]
-> Read PutDeliveryChannel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDeliveryChannel]
$creadListPrec :: ReadPrec [PutDeliveryChannel]
readPrec :: ReadPrec PutDeliveryChannel
$creadPrec :: ReadPrec PutDeliveryChannel
readList :: ReadS [PutDeliveryChannel]
$creadList :: ReadS [PutDeliveryChannel]
readsPrec :: Int -> ReadS PutDeliveryChannel
$creadsPrec :: Int -> ReadS PutDeliveryChannel
Prelude.Read, Int -> PutDeliveryChannel -> ShowS
[PutDeliveryChannel] -> ShowS
PutDeliveryChannel -> String
(Int -> PutDeliveryChannel -> ShowS)
-> (PutDeliveryChannel -> String)
-> ([PutDeliveryChannel] -> ShowS)
-> Show PutDeliveryChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDeliveryChannel] -> ShowS
$cshowList :: [PutDeliveryChannel] -> ShowS
show :: PutDeliveryChannel -> String
$cshow :: PutDeliveryChannel -> String
showsPrec :: Int -> PutDeliveryChannel -> ShowS
$cshowsPrec :: Int -> PutDeliveryChannel -> ShowS
Prelude.Show, (forall x. PutDeliveryChannel -> Rep PutDeliveryChannel x)
-> (forall x. Rep PutDeliveryChannel x -> PutDeliveryChannel)
-> Generic PutDeliveryChannel
forall x. Rep PutDeliveryChannel x -> PutDeliveryChannel
forall x. PutDeliveryChannel -> Rep PutDeliveryChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutDeliveryChannel x -> PutDeliveryChannel
$cfrom :: forall x. PutDeliveryChannel -> Rep PutDeliveryChannel x
Prelude.Generic)
newPutDeliveryChannel ::
DeliveryChannel ->
PutDeliveryChannel
newPutDeliveryChannel :: DeliveryChannel -> PutDeliveryChannel
newPutDeliveryChannel DeliveryChannel
pDeliveryChannel_ =
PutDeliveryChannel' :: DeliveryChannel -> PutDeliveryChannel
PutDeliveryChannel'
{ $sel:deliveryChannel:PutDeliveryChannel' :: DeliveryChannel
deliveryChannel =
DeliveryChannel
pDeliveryChannel_
}
putDeliveryChannel_deliveryChannel :: Lens.Lens' PutDeliveryChannel DeliveryChannel
putDeliveryChannel_deliveryChannel :: (DeliveryChannel -> f DeliveryChannel)
-> PutDeliveryChannel -> f PutDeliveryChannel
putDeliveryChannel_deliveryChannel = (PutDeliveryChannel -> DeliveryChannel)
-> (PutDeliveryChannel -> DeliveryChannel -> PutDeliveryChannel)
-> Lens
PutDeliveryChannel
PutDeliveryChannel
DeliveryChannel
DeliveryChannel
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDeliveryChannel' {DeliveryChannel
deliveryChannel :: DeliveryChannel
$sel:deliveryChannel:PutDeliveryChannel' :: PutDeliveryChannel -> DeliveryChannel
deliveryChannel} -> DeliveryChannel
deliveryChannel) (\s :: PutDeliveryChannel
s@PutDeliveryChannel' {} DeliveryChannel
a -> PutDeliveryChannel
s {$sel:deliveryChannel:PutDeliveryChannel' :: DeliveryChannel
deliveryChannel = DeliveryChannel
a} :: PutDeliveryChannel)
instance Core.AWSRequest PutDeliveryChannel where
type
AWSResponse PutDeliveryChannel =
PutDeliveryChannelResponse
request :: PutDeliveryChannel -> Request PutDeliveryChannel
request = Service -> PutDeliveryChannel -> Request PutDeliveryChannel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutDeliveryChannel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDeliveryChannel)))
response =
AWSResponse PutDeliveryChannel
-> Logger
-> Service
-> Proxy PutDeliveryChannel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDeliveryChannel)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutDeliveryChannel
PutDeliveryChannelResponse
PutDeliveryChannelResponse'
instance Prelude.Hashable PutDeliveryChannel
instance Prelude.NFData PutDeliveryChannel
instance Core.ToHeaders PutDeliveryChannel where
toHeaders :: PutDeliveryChannel -> [Header]
toHeaders =
[Header] -> PutDeliveryChannel -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"StarlingDoveService.PutDeliveryChannel" ::
Prelude.ByteString
),
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.ToJSON PutDeliveryChannel where
toJSON :: PutDeliveryChannel -> Value
toJSON PutDeliveryChannel' {DeliveryChannel
deliveryChannel :: DeliveryChannel
$sel:deliveryChannel:PutDeliveryChannel' :: PutDeliveryChannel -> DeliveryChannel
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DeliveryChannel" Text -> DeliveryChannel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DeliveryChannel
deliveryChannel)
]
)
instance Core.ToPath PutDeliveryChannel where
toPath :: PutDeliveryChannel -> ByteString
toPath = ByteString -> PutDeliveryChannel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutDeliveryChannel where
toQuery :: PutDeliveryChannel -> QueryString
toQuery = QueryString -> PutDeliveryChannel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutDeliveryChannelResponse = PutDeliveryChannelResponse'
{
}
deriving (PutDeliveryChannelResponse -> PutDeliveryChannelResponse -> Bool
(PutDeliveryChannelResponse -> PutDeliveryChannelResponse -> Bool)
-> (PutDeliveryChannelResponse
-> PutDeliveryChannelResponse -> Bool)
-> Eq PutDeliveryChannelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDeliveryChannelResponse -> PutDeliveryChannelResponse -> Bool
$c/= :: PutDeliveryChannelResponse -> PutDeliveryChannelResponse -> Bool
== :: PutDeliveryChannelResponse -> PutDeliveryChannelResponse -> Bool
$c== :: PutDeliveryChannelResponse -> PutDeliveryChannelResponse -> Bool
Prelude.Eq, ReadPrec [PutDeliveryChannelResponse]
ReadPrec PutDeliveryChannelResponse
Int -> ReadS PutDeliveryChannelResponse
ReadS [PutDeliveryChannelResponse]
(Int -> ReadS PutDeliveryChannelResponse)
-> ReadS [PutDeliveryChannelResponse]
-> ReadPrec PutDeliveryChannelResponse
-> ReadPrec [PutDeliveryChannelResponse]
-> Read PutDeliveryChannelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDeliveryChannelResponse]
$creadListPrec :: ReadPrec [PutDeliveryChannelResponse]
readPrec :: ReadPrec PutDeliveryChannelResponse
$creadPrec :: ReadPrec PutDeliveryChannelResponse
readList :: ReadS [PutDeliveryChannelResponse]
$creadList :: ReadS [PutDeliveryChannelResponse]
readsPrec :: Int -> ReadS PutDeliveryChannelResponse
$creadsPrec :: Int -> ReadS PutDeliveryChannelResponse
Prelude.Read, Int -> PutDeliveryChannelResponse -> ShowS
[PutDeliveryChannelResponse] -> ShowS
PutDeliveryChannelResponse -> String
(Int -> PutDeliveryChannelResponse -> ShowS)
-> (PutDeliveryChannelResponse -> String)
-> ([PutDeliveryChannelResponse] -> ShowS)
-> Show PutDeliveryChannelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDeliveryChannelResponse] -> ShowS
$cshowList :: [PutDeliveryChannelResponse] -> ShowS
show :: PutDeliveryChannelResponse -> String
$cshow :: PutDeliveryChannelResponse -> String
showsPrec :: Int -> PutDeliveryChannelResponse -> ShowS
$cshowsPrec :: Int -> PutDeliveryChannelResponse -> ShowS
Prelude.Show, (forall x.
PutDeliveryChannelResponse -> Rep PutDeliveryChannelResponse x)
-> (forall x.
Rep PutDeliveryChannelResponse x -> PutDeliveryChannelResponse)
-> Generic PutDeliveryChannelResponse
forall x.
Rep PutDeliveryChannelResponse x -> PutDeliveryChannelResponse
forall x.
PutDeliveryChannelResponse -> Rep PutDeliveryChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDeliveryChannelResponse x -> PutDeliveryChannelResponse
$cfrom :: forall x.
PutDeliveryChannelResponse -> Rep PutDeliveryChannelResponse x
Prelude.Generic)
newPutDeliveryChannelResponse ::
PutDeliveryChannelResponse
newPutDeliveryChannelResponse :: PutDeliveryChannelResponse
newPutDeliveryChannelResponse =
PutDeliveryChannelResponse
PutDeliveryChannelResponse'
instance Prelude.NFData PutDeliveryChannelResponse