{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.Chat.Spaces.Messages.Create
(
SpacesMessagesCreateResource
, spacesMessagesCreate
, SpacesMessagesCreate
, smcParent
, smcXgafv
, smcUploadProtocol
, smcAccessToken
, smcUploadType
, smcPayload
, smcCallback
, smcThreadKey
) where
import Network.Google.Chat.Types
import Network.Google.Prelude
type SpacesMessagesCreateResource =
"v1" :>
Capture "parent" Text :>
"messages" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "threadKey" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Message :> Post '[JSON] Message
data SpacesMessagesCreate = SpacesMessagesCreate'
{ _smcParent :: !Text
, _smcXgafv :: !(Maybe Xgafv)
, _smcUploadProtocol :: !(Maybe Text)
, _smcAccessToken :: !(Maybe Text)
, _smcUploadType :: !(Maybe Text)
, _smcPayload :: !Message
, _smcCallback :: !(Maybe Text)
, _smcThreadKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
spacesMessagesCreate
:: Text
-> Message
-> SpacesMessagesCreate
spacesMessagesCreate pSmcParent_ pSmcPayload_ =
SpacesMessagesCreate'
{ _smcParent = pSmcParent_
, _smcXgafv = Nothing
, _smcUploadProtocol = Nothing
, _smcAccessToken = Nothing
, _smcUploadType = Nothing
, _smcPayload = pSmcPayload_
, _smcCallback = Nothing
, _smcThreadKey = Nothing
}
smcParent :: Lens' SpacesMessagesCreate Text
smcParent
= lens _smcParent (\ s a -> s{_smcParent = a})
smcXgafv :: Lens' SpacesMessagesCreate (Maybe Xgafv)
smcXgafv = lens _smcXgafv (\ s a -> s{_smcXgafv = a})
smcUploadProtocol :: Lens' SpacesMessagesCreate (Maybe Text)
smcUploadProtocol
= lens _smcUploadProtocol
(\ s a -> s{_smcUploadProtocol = a})
smcAccessToken :: Lens' SpacesMessagesCreate (Maybe Text)
smcAccessToken
= lens _smcAccessToken
(\ s a -> s{_smcAccessToken = a})
smcUploadType :: Lens' SpacesMessagesCreate (Maybe Text)
smcUploadType
= lens _smcUploadType
(\ s a -> s{_smcUploadType = a})
smcPayload :: Lens' SpacesMessagesCreate Message
smcPayload
= lens _smcPayload (\ s a -> s{_smcPayload = a})
smcCallback :: Lens' SpacesMessagesCreate (Maybe Text)
smcCallback
= lens _smcCallback (\ s a -> s{_smcCallback = a})
smcThreadKey :: Lens' SpacesMessagesCreate (Maybe Text)
smcThreadKey
= lens _smcThreadKey (\ s a -> s{_smcThreadKey = a})
instance GoogleRequest SpacesMessagesCreate where
type Rs SpacesMessagesCreate = Message
type Scopes SpacesMessagesCreate = '[]
requestClient SpacesMessagesCreate'{..}
= go _smcParent _smcXgafv _smcUploadProtocol
_smcAccessToken
_smcUploadType
_smcCallback
_smcThreadKey
(Just AltJSON)
_smcPayload
chatService
where go
= buildClient
(Proxy :: Proxy SpacesMessagesCreateResource)
mempty