{-# 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.FireStore.Projects.Databases.Documents.Write
(
ProjectsDatabasesDocumentsWriteResource
, projectsDatabasesDocumentsWrite
, ProjectsDatabasesDocumentsWrite
, pddwXgafv
, pddwUploadProtocol
, pddwDatabase
, pddwAccessToken
, pddwUploadType
, pddwPayload
, pddwCallback
) where
import Network.Google.FireStore.Types
import Network.Google.Prelude
type ProjectsDatabasesDocumentsWriteResource =
"v1" :>
Capture "database" Text :>
"documents:write" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] WriteRequest :>
Post '[JSON] WriteResponse
data ProjectsDatabasesDocumentsWrite = ProjectsDatabasesDocumentsWrite'
{ _pddwXgafv :: !(Maybe Xgafv)
, _pddwUploadProtocol :: !(Maybe Text)
, _pddwDatabase :: !Text
, _pddwAccessToken :: !(Maybe Text)
, _pddwUploadType :: !(Maybe Text)
, _pddwPayload :: !WriteRequest
, _pddwCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsDatabasesDocumentsWrite
:: Text
-> WriteRequest
-> ProjectsDatabasesDocumentsWrite
projectsDatabasesDocumentsWrite pPddwDatabase_ pPddwPayload_ =
ProjectsDatabasesDocumentsWrite'
{ _pddwXgafv = Nothing
, _pddwUploadProtocol = Nothing
, _pddwDatabase = pPddwDatabase_
, _pddwAccessToken = Nothing
, _pddwUploadType = Nothing
, _pddwPayload = pPddwPayload_
, _pddwCallback = Nothing
}
pddwXgafv :: Lens' ProjectsDatabasesDocumentsWrite (Maybe Xgafv)
pddwXgafv
= lens _pddwXgafv (\ s a -> s{_pddwXgafv = a})
pddwUploadProtocol :: Lens' ProjectsDatabasesDocumentsWrite (Maybe Text)
pddwUploadProtocol
= lens _pddwUploadProtocol
(\ s a -> s{_pddwUploadProtocol = a})
pddwDatabase :: Lens' ProjectsDatabasesDocumentsWrite Text
pddwDatabase
= lens _pddwDatabase (\ s a -> s{_pddwDatabase = a})
pddwAccessToken :: Lens' ProjectsDatabasesDocumentsWrite (Maybe Text)
pddwAccessToken
= lens _pddwAccessToken
(\ s a -> s{_pddwAccessToken = a})
pddwUploadType :: Lens' ProjectsDatabasesDocumentsWrite (Maybe Text)
pddwUploadType
= lens _pddwUploadType
(\ s a -> s{_pddwUploadType = a})
pddwPayload :: Lens' ProjectsDatabasesDocumentsWrite WriteRequest
pddwPayload
= lens _pddwPayload (\ s a -> s{_pddwPayload = a})
pddwCallback :: Lens' ProjectsDatabasesDocumentsWrite (Maybe Text)
pddwCallback
= lens _pddwCallback (\ s a -> s{_pddwCallback = a})
instance GoogleRequest
ProjectsDatabasesDocumentsWrite where
type Rs ProjectsDatabasesDocumentsWrite =
WriteResponse
type Scopes ProjectsDatabasesDocumentsWrite =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"]
requestClient ProjectsDatabasesDocumentsWrite'{..}
= go _pddwDatabase _pddwXgafv _pddwUploadProtocol
_pddwAccessToken
_pddwUploadType
_pddwCallback
(Just AltJSON)
_pddwPayload
fireStoreService
where go
= buildClient
(Proxy ::
Proxy ProjectsDatabasesDocumentsWriteResource)
mempty