{-# 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.APIGatewayManagementAPI.PostToConnection
(
PostToConnection (..),
newPostToConnection,
postToConnection_connectionId,
postToConnection_data,
PostToConnectionResponse (..),
newPostToConnectionResponse,
)
where
import Amazonka.APIGatewayManagementAPI.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 PostToConnection = PostToConnection'
{
PostToConnection -> Text
connectionId :: Prelude.Text,
PostToConnection -> ByteString
data' :: Prelude.ByteString
}
deriving (PostToConnection -> PostToConnection -> Bool
(PostToConnection -> PostToConnection -> Bool)
-> (PostToConnection -> PostToConnection -> Bool)
-> Eq PostToConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostToConnection -> PostToConnection -> Bool
$c/= :: PostToConnection -> PostToConnection -> Bool
== :: PostToConnection -> PostToConnection -> Bool
$c== :: PostToConnection -> PostToConnection -> Bool
Prelude.Eq, ReadPrec [PostToConnection]
ReadPrec PostToConnection
Int -> ReadS PostToConnection
ReadS [PostToConnection]
(Int -> ReadS PostToConnection)
-> ReadS [PostToConnection]
-> ReadPrec PostToConnection
-> ReadPrec [PostToConnection]
-> Read PostToConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PostToConnection]
$creadListPrec :: ReadPrec [PostToConnection]
readPrec :: ReadPrec PostToConnection
$creadPrec :: ReadPrec PostToConnection
readList :: ReadS [PostToConnection]
$creadList :: ReadS [PostToConnection]
readsPrec :: Int -> ReadS PostToConnection
$creadsPrec :: Int -> ReadS PostToConnection
Prelude.Read, Int -> PostToConnection -> ShowS
[PostToConnection] -> ShowS
PostToConnection -> String
(Int -> PostToConnection -> ShowS)
-> (PostToConnection -> String)
-> ([PostToConnection] -> ShowS)
-> Show PostToConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostToConnection] -> ShowS
$cshowList :: [PostToConnection] -> ShowS
show :: PostToConnection -> String
$cshow :: PostToConnection -> String
showsPrec :: Int -> PostToConnection -> ShowS
$cshowsPrec :: Int -> PostToConnection -> ShowS
Prelude.Show, (forall x. PostToConnection -> Rep PostToConnection x)
-> (forall x. Rep PostToConnection x -> PostToConnection)
-> Generic PostToConnection
forall x. Rep PostToConnection x -> PostToConnection
forall x. PostToConnection -> Rep PostToConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PostToConnection x -> PostToConnection
$cfrom :: forall x. PostToConnection -> Rep PostToConnection x
Prelude.Generic)
newPostToConnection ::
Prelude.Text ->
Prelude.ByteString ->
PostToConnection
newPostToConnection :: Text -> ByteString -> PostToConnection
newPostToConnection Text
pConnectionId_ ByteString
pData_ =
PostToConnection' :: Text -> ByteString -> PostToConnection
PostToConnection'
{ $sel:connectionId:PostToConnection' :: Text
connectionId = Text
pConnectionId_,
$sel:data':PostToConnection' :: ByteString
data' = ByteString
pData_
}
postToConnection_connectionId :: Lens.Lens' PostToConnection Prelude.Text
postToConnection_connectionId :: (Text -> f Text) -> PostToConnection -> f PostToConnection
postToConnection_connectionId = (PostToConnection -> Text)
-> (PostToConnection -> Text -> PostToConnection)
-> Lens PostToConnection PostToConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostToConnection' {Text
connectionId :: Text
$sel:connectionId:PostToConnection' :: PostToConnection -> Text
connectionId} -> Text
connectionId) (\s :: PostToConnection
s@PostToConnection' {} Text
a -> PostToConnection
s {$sel:connectionId:PostToConnection' :: Text
connectionId = Text
a} :: PostToConnection)
postToConnection_data :: Lens.Lens' PostToConnection Prelude.ByteString
postToConnection_data :: (ByteString -> f ByteString)
-> PostToConnection -> f PostToConnection
postToConnection_data = (PostToConnection -> ByteString)
-> (PostToConnection -> ByteString -> PostToConnection)
-> Lens PostToConnection PostToConnection ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostToConnection' {ByteString
data' :: ByteString
$sel:data':PostToConnection' :: PostToConnection -> ByteString
data'} -> ByteString
data') (\s :: PostToConnection
s@PostToConnection' {} ByteString
a -> PostToConnection
s {$sel:data':PostToConnection' :: ByteString
data' = ByteString
a} :: PostToConnection)
instance Core.AWSRequest PostToConnection where
type
AWSResponse PostToConnection =
PostToConnectionResponse
request :: PostToConnection -> Request PostToConnection
request = Service -> PostToConnection -> Request PostToConnection
forall a. (ToRequest a, ToBody a) => Service -> a -> Request a
Request.postBody Service
defaultService
response :: Logger
-> Service
-> Proxy PostToConnection
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PostToConnection)))
response =
AWSResponse PostToConnection
-> Logger
-> Service
-> Proxy PostToConnection
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PostToConnection)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PostToConnection
PostToConnectionResponse
PostToConnectionResponse'
instance Prelude.Hashable PostToConnection
instance Prelude.NFData PostToConnection
instance Core.ToBody PostToConnection where
toBody :: PostToConnection -> RequestBody
toBody PostToConnection' {ByteString
Text
data' :: ByteString
connectionId :: Text
$sel:data':PostToConnection' :: PostToConnection -> ByteString
$sel:connectionId:PostToConnection' :: PostToConnection -> Text
..} = ByteString -> RequestBody
forall a. ToBody a => a -> RequestBody
Core.toBody ByteString
data'
instance Core.ToHeaders PostToConnection where
toHeaders :: PostToConnection -> [Header]
toHeaders =
[Header] -> PostToConnection -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath PostToConnection where
toPath :: PostToConnection -> ByteString
toPath PostToConnection' {ByteString
Text
data' :: ByteString
connectionId :: Text
$sel:data':PostToConnection' :: PostToConnection -> ByteString
$sel:connectionId:PostToConnection' :: PostToConnection -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/@connections/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
connectionId]
instance Core.ToQuery PostToConnection where
toQuery :: PostToConnection -> QueryString
toQuery = QueryString -> PostToConnection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PostToConnectionResponse = PostToConnectionResponse'
{
}
deriving (PostToConnectionResponse -> PostToConnectionResponse -> Bool
(PostToConnectionResponse -> PostToConnectionResponse -> Bool)
-> (PostToConnectionResponse -> PostToConnectionResponse -> Bool)
-> Eq PostToConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostToConnectionResponse -> PostToConnectionResponse -> Bool
$c/= :: PostToConnectionResponse -> PostToConnectionResponse -> Bool
== :: PostToConnectionResponse -> PostToConnectionResponse -> Bool
$c== :: PostToConnectionResponse -> PostToConnectionResponse -> Bool
Prelude.Eq, ReadPrec [PostToConnectionResponse]
ReadPrec PostToConnectionResponse
Int -> ReadS PostToConnectionResponse
ReadS [PostToConnectionResponse]
(Int -> ReadS PostToConnectionResponse)
-> ReadS [PostToConnectionResponse]
-> ReadPrec PostToConnectionResponse
-> ReadPrec [PostToConnectionResponse]
-> Read PostToConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PostToConnectionResponse]
$creadListPrec :: ReadPrec [PostToConnectionResponse]
readPrec :: ReadPrec PostToConnectionResponse
$creadPrec :: ReadPrec PostToConnectionResponse
readList :: ReadS [PostToConnectionResponse]
$creadList :: ReadS [PostToConnectionResponse]
readsPrec :: Int -> ReadS PostToConnectionResponse
$creadsPrec :: Int -> ReadS PostToConnectionResponse
Prelude.Read, Int -> PostToConnectionResponse -> ShowS
[PostToConnectionResponse] -> ShowS
PostToConnectionResponse -> String
(Int -> PostToConnectionResponse -> ShowS)
-> (PostToConnectionResponse -> String)
-> ([PostToConnectionResponse] -> ShowS)
-> Show PostToConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostToConnectionResponse] -> ShowS
$cshowList :: [PostToConnectionResponse] -> ShowS
show :: PostToConnectionResponse -> String
$cshow :: PostToConnectionResponse -> String
showsPrec :: Int -> PostToConnectionResponse -> ShowS
$cshowsPrec :: Int -> PostToConnectionResponse -> ShowS
Prelude.Show, (forall x.
PostToConnectionResponse -> Rep PostToConnectionResponse x)
-> (forall x.
Rep PostToConnectionResponse x -> PostToConnectionResponse)
-> Generic PostToConnectionResponse
forall x.
Rep PostToConnectionResponse x -> PostToConnectionResponse
forall x.
PostToConnectionResponse -> Rep PostToConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PostToConnectionResponse x -> PostToConnectionResponse
$cfrom :: forall x.
PostToConnectionResponse -> Rep PostToConnectionResponse x
Prelude.Generic)
newPostToConnectionResponse ::
PostToConnectionResponse
newPostToConnectionResponse :: PostToConnectionResponse
newPostToConnectionResponse =
PostToConnectionResponse
PostToConnectionResponse'
instance Prelude.NFData PostToConnectionResponse