{-# 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.CreateDocument
(
ProjectsDatabasesDocumentsCreateDocumentResource
, projectsDatabasesDocumentsCreateDocument
, ProjectsDatabasesDocumentsCreateDocument
, pddcdParent
, pddcdXgafv
, pddcdDocumentId
, pddcdUploadProtocol
, pddcdAccessToken
, pddcdCollectionId
, pddcdUploadType
, pddcdPayload
, pddcdMaskFieldPaths
, pddcdCallback
) where
import Network.Google.FireStore.Types
import Network.Google.Prelude
type ProjectsDatabasesDocumentsCreateDocumentResource
=
"v1" :>
Capture "parent" Text :>
Capture "collectionId" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "documentId" Text :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParams "mask.fieldPaths" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Document :> Post '[JSON] Document
data ProjectsDatabasesDocumentsCreateDocument = ProjectsDatabasesDocumentsCreateDocument'
{ _pddcdParent :: !Text
, _pddcdXgafv :: !(Maybe Xgafv)
, _pddcdDocumentId :: !(Maybe Text)
, _pddcdUploadProtocol :: !(Maybe Text)
, _pddcdAccessToken :: !(Maybe Text)
, _pddcdCollectionId :: !Text
, _pddcdUploadType :: !(Maybe Text)
, _pddcdPayload :: !Document
, _pddcdMaskFieldPaths :: !(Maybe [Text])
, _pddcdCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsDatabasesDocumentsCreateDocument
:: Text
-> Text
-> Document
-> ProjectsDatabasesDocumentsCreateDocument
projectsDatabasesDocumentsCreateDocument pPddcdParent_ pPddcdCollectionId_ pPddcdPayload_ =
ProjectsDatabasesDocumentsCreateDocument'
{ _pddcdParent = pPddcdParent_
, _pddcdXgafv = Nothing
, _pddcdDocumentId = Nothing
, _pddcdUploadProtocol = Nothing
, _pddcdAccessToken = Nothing
, _pddcdCollectionId = pPddcdCollectionId_
, _pddcdUploadType = Nothing
, _pddcdPayload = pPddcdPayload_
, _pddcdMaskFieldPaths = Nothing
, _pddcdCallback = Nothing
}
pddcdParent :: Lens' ProjectsDatabasesDocumentsCreateDocument Text
pddcdParent
= lens _pddcdParent (\ s a -> s{_pddcdParent = a})
pddcdXgafv :: Lens' ProjectsDatabasesDocumentsCreateDocument (Maybe Xgafv)
pddcdXgafv
= lens _pddcdXgafv (\ s a -> s{_pddcdXgafv = a})
pddcdDocumentId :: Lens' ProjectsDatabasesDocumentsCreateDocument (Maybe Text)
pddcdDocumentId
= lens _pddcdDocumentId
(\ s a -> s{_pddcdDocumentId = a})
pddcdUploadProtocol :: Lens' ProjectsDatabasesDocumentsCreateDocument (Maybe Text)
pddcdUploadProtocol
= lens _pddcdUploadProtocol
(\ s a -> s{_pddcdUploadProtocol = a})
pddcdAccessToken :: Lens' ProjectsDatabasesDocumentsCreateDocument (Maybe Text)
pddcdAccessToken
= lens _pddcdAccessToken
(\ s a -> s{_pddcdAccessToken = a})
pddcdCollectionId :: Lens' ProjectsDatabasesDocumentsCreateDocument Text
pddcdCollectionId
= lens _pddcdCollectionId
(\ s a -> s{_pddcdCollectionId = a})
pddcdUploadType :: Lens' ProjectsDatabasesDocumentsCreateDocument (Maybe Text)
pddcdUploadType
= lens _pddcdUploadType
(\ s a -> s{_pddcdUploadType = a})
pddcdPayload :: Lens' ProjectsDatabasesDocumentsCreateDocument Document
pddcdPayload
= lens _pddcdPayload (\ s a -> s{_pddcdPayload = a})
pddcdMaskFieldPaths :: Lens' ProjectsDatabasesDocumentsCreateDocument [Text]
pddcdMaskFieldPaths
= lens _pddcdMaskFieldPaths
(\ s a -> s{_pddcdMaskFieldPaths = a})
. _Default
. _Coerce
pddcdCallback :: Lens' ProjectsDatabasesDocumentsCreateDocument (Maybe Text)
pddcdCallback
= lens _pddcdCallback
(\ s a -> s{_pddcdCallback = a})
instance GoogleRequest
ProjectsDatabasesDocumentsCreateDocument where
type Rs ProjectsDatabasesDocumentsCreateDocument =
Document
type Scopes ProjectsDatabasesDocumentsCreateDocument
=
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"]
requestClient
ProjectsDatabasesDocumentsCreateDocument'{..}
= go _pddcdParent _pddcdCollectionId _pddcdXgafv
_pddcdDocumentId
_pddcdUploadProtocol
_pddcdAccessToken
_pddcdUploadType
(_pddcdMaskFieldPaths ^. _Default)
_pddcdCallback
(Just AltJSON)
_pddcdPayload
fireStoreService
where go
= buildClient
(Proxy ::
Proxy
ProjectsDatabasesDocumentsCreateDocumentResource)
mempty