{-# 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.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 PutDeliveryChannel = PutDeliveryChannel'
{
PutDeliveryChannel -> DeliveryChannel
deliveryChannel :: DeliveryChannel
}
deriving (PutDeliveryChannel -> PutDeliveryChannel -> Bool
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]
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
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. 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'
{ $sel:deliveryChannel:PutDeliveryChannel' :: DeliveryChannel
deliveryChannel =
DeliveryChannel
pDeliveryChannel_
}
putDeliveryChannel_deliveryChannel :: Lens.Lens' PutDeliveryChannel DeliveryChannel
putDeliveryChannel_deliveryChannel :: Lens' PutDeliveryChannel DeliveryChannel
putDeliveryChannel_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 :: (Service -> Service)
-> PutDeliveryChannel -> Request PutDeliveryChannel
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 PutDeliveryChannel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDeliveryChannel)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull PutDeliveryChannelResponse
PutDeliveryChannelResponse'
instance Prelude.Hashable PutDeliveryChannel where
hashWithSalt :: Int -> PutDeliveryChannel -> Int
hashWithSalt Int
_salt PutDeliveryChannel' {DeliveryChannel
deliveryChannel :: DeliveryChannel
$sel:deliveryChannel:PutDeliveryChannel' :: PutDeliveryChannel -> DeliveryChannel
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DeliveryChannel
deliveryChannel
instance Prelude.NFData PutDeliveryChannel where
rnf :: PutDeliveryChannel -> ()
rnf PutDeliveryChannel' {DeliveryChannel
deliveryChannel :: DeliveryChannel
$sel:deliveryChannel:PutDeliveryChannel' :: PutDeliveryChannel -> DeliveryChannel
..} =
forall a. NFData a => a -> ()
Prelude.rnf DeliveryChannel
deliveryChannel
instance Data.ToHeaders PutDeliveryChannel where
toHeaders :: PutDeliveryChannel -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"StarlingDoveService.PutDeliveryChannel" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutDeliveryChannel where
toJSON :: PutDeliveryChannel -> Value
toJSON PutDeliveryChannel' {DeliveryChannel
deliveryChannel :: DeliveryChannel
$sel:deliveryChannel:PutDeliveryChannel' :: PutDeliveryChannel -> DeliveryChannel
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"DeliveryChannel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DeliveryChannel
deliveryChannel)
]
)
instance Data.ToPath PutDeliveryChannel where
toPath :: PutDeliveryChannel -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutDeliveryChannel where
toQuery :: PutDeliveryChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutDeliveryChannelResponse = PutDeliveryChannelResponse'
{
}
deriving (PutDeliveryChannelResponse -> PutDeliveryChannelResponse -> Bool
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]
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
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.
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 where
rnf :: PutDeliveryChannelResponse -> ()
rnf PutDeliveryChannelResponse
_ = ()