{-# 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.Patch
(
ProjectsDatabasesDocumentsPatchResource
, projectsDatabasesDocumentsPatch
, ProjectsDatabasesDocumentsPatch
, pddpXgafv
, pddpUpdateMaskFieldPaths
, pddpUploadProtocol
, pddpCurrentDocumentExists
, pddpAccessToken
, pddpUploadType
, pddpPayload
, pddpCurrentDocumentUpdateTime
, pddpName
, pddpMaskFieldPaths
, pddpCallback
) where
import Network.Google.FireStore.Types
import Network.Google.Prelude
type ProjectsDatabasesDocumentsPatchResource =
"v1" :>
Capture "name" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParams "updateMask.fieldPaths" Text :>
QueryParam "upload_protocol" Text :>
QueryParam "currentDocument.exists" Bool :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "currentDocument.updateTime" DateTime' :>
QueryParams "mask.fieldPaths" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Document :> Patch '[JSON] Document
data ProjectsDatabasesDocumentsPatch = ProjectsDatabasesDocumentsPatch'
{ _pddpXgafv :: !(Maybe Xgafv)
, _pddpUpdateMaskFieldPaths :: !(Maybe [Text])
, _pddpUploadProtocol :: !(Maybe Text)
, _pddpCurrentDocumentExists :: !(Maybe Bool)
, _pddpAccessToken :: !(Maybe Text)
, _pddpUploadType :: !(Maybe Text)
, _pddpPayload :: !Document
, _pddpCurrentDocumentUpdateTime :: !(Maybe DateTime')
, _pddpName :: !Text
, _pddpMaskFieldPaths :: !(Maybe [Text])
, _pddpCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsDatabasesDocumentsPatch
:: Document
-> Text
-> ProjectsDatabasesDocumentsPatch
projectsDatabasesDocumentsPatch pPddpPayload_ pPddpName_ =
ProjectsDatabasesDocumentsPatch'
{ _pddpXgafv = Nothing
, _pddpUpdateMaskFieldPaths = Nothing
, _pddpUploadProtocol = Nothing
, _pddpCurrentDocumentExists = Nothing
, _pddpAccessToken = Nothing
, _pddpUploadType = Nothing
, _pddpPayload = pPddpPayload_
, _pddpCurrentDocumentUpdateTime = Nothing
, _pddpName = pPddpName_
, _pddpMaskFieldPaths = Nothing
, _pddpCallback = Nothing
}
pddpXgafv :: Lens' ProjectsDatabasesDocumentsPatch (Maybe Xgafv)
pddpXgafv
= lens _pddpXgafv (\ s a -> s{_pddpXgafv = a})
pddpUpdateMaskFieldPaths :: Lens' ProjectsDatabasesDocumentsPatch [Text]
pddpUpdateMaskFieldPaths
= lens _pddpUpdateMaskFieldPaths
(\ s a -> s{_pddpUpdateMaskFieldPaths = a})
. _Default
. _Coerce
pddpUploadProtocol :: Lens' ProjectsDatabasesDocumentsPatch (Maybe Text)
pddpUploadProtocol
= lens _pddpUploadProtocol
(\ s a -> s{_pddpUploadProtocol = a})
pddpCurrentDocumentExists :: Lens' ProjectsDatabasesDocumentsPatch (Maybe Bool)
pddpCurrentDocumentExists
= lens _pddpCurrentDocumentExists
(\ s a -> s{_pddpCurrentDocumentExists = a})
pddpAccessToken :: Lens' ProjectsDatabasesDocumentsPatch (Maybe Text)
pddpAccessToken
= lens _pddpAccessToken
(\ s a -> s{_pddpAccessToken = a})
pddpUploadType :: Lens' ProjectsDatabasesDocumentsPatch (Maybe Text)
pddpUploadType
= lens _pddpUploadType
(\ s a -> s{_pddpUploadType = a})
pddpPayload :: Lens' ProjectsDatabasesDocumentsPatch Document
pddpPayload
= lens _pddpPayload (\ s a -> s{_pddpPayload = a})
pddpCurrentDocumentUpdateTime :: Lens' ProjectsDatabasesDocumentsPatch (Maybe UTCTime)
pddpCurrentDocumentUpdateTime
= lens _pddpCurrentDocumentUpdateTime
(\ s a -> s{_pddpCurrentDocumentUpdateTime = a})
. mapping _DateTime
pddpName :: Lens' ProjectsDatabasesDocumentsPatch Text
pddpName = lens _pddpName (\ s a -> s{_pddpName = a})
pddpMaskFieldPaths :: Lens' ProjectsDatabasesDocumentsPatch [Text]
pddpMaskFieldPaths
= lens _pddpMaskFieldPaths
(\ s a -> s{_pddpMaskFieldPaths = a})
. _Default
. _Coerce
pddpCallback :: Lens' ProjectsDatabasesDocumentsPatch (Maybe Text)
pddpCallback
= lens _pddpCallback (\ s a -> s{_pddpCallback = a})
instance GoogleRequest
ProjectsDatabasesDocumentsPatch where
type Rs ProjectsDatabasesDocumentsPatch = Document
type Scopes ProjectsDatabasesDocumentsPatch =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"]
requestClient ProjectsDatabasesDocumentsPatch'{..}
= go _pddpName _pddpXgafv
(_pddpUpdateMaskFieldPaths ^. _Default)
_pddpUploadProtocol
_pddpCurrentDocumentExists
_pddpAccessToken
_pddpUploadType
_pddpCurrentDocumentUpdateTime
(_pddpMaskFieldPaths ^. _Default)
_pddpCallback
(Just AltJSON)
_pddpPayload
fireStoreService
where go
= buildClient
(Proxy ::
Proxy ProjectsDatabasesDocumentsPatchResource)
mempty