{-# 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.Datastore.Projects.BeginTransaction
(
ProjectsBeginTransactionResource
, projectsBeginTransaction
, ProjectsBeginTransaction
, pbtXgafv
, pbtUploadProtocol
, pbtAccessToken
, pbtUploadType
, pbtPayload
, pbtProjectId
, pbtCallback
) where
import Network.Google.Datastore.Types
import Network.Google.Prelude
type ProjectsBeginTransactionResource =
"v1" :>
"projects" :>
CaptureMode "projectId" "beginTransaction" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] BeginTransactionRequest :>
Post '[JSON] BeginTransactionResponse
data ProjectsBeginTransaction = ProjectsBeginTransaction'
{ _pbtXgafv :: !(Maybe Xgafv)
, _pbtUploadProtocol :: !(Maybe Text)
, _pbtAccessToken :: !(Maybe Text)
, _pbtUploadType :: !(Maybe Text)
, _pbtPayload :: !BeginTransactionRequest
, _pbtProjectId :: !Text
, _pbtCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsBeginTransaction
:: BeginTransactionRequest
-> Text
-> ProjectsBeginTransaction
projectsBeginTransaction pPbtPayload_ pPbtProjectId_ =
ProjectsBeginTransaction'
{ _pbtXgafv = Nothing
, _pbtUploadProtocol = Nothing
, _pbtAccessToken = Nothing
, _pbtUploadType = Nothing
, _pbtPayload = pPbtPayload_
, _pbtProjectId = pPbtProjectId_
, _pbtCallback = Nothing
}
pbtXgafv :: Lens' ProjectsBeginTransaction (Maybe Xgafv)
pbtXgafv = lens _pbtXgafv (\ s a -> s{_pbtXgafv = a})
pbtUploadProtocol :: Lens' ProjectsBeginTransaction (Maybe Text)
pbtUploadProtocol
= lens _pbtUploadProtocol
(\ s a -> s{_pbtUploadProtocol = a})
pbtAccessToken :: Lens' ProjectsBeginTransaction (Maybe Text)
pbtAccessToken
= lens _pbtAccessToken
(\ s a -> s{_pbtAccessToken = a})
pbtUploadType :: Lens' ProjectsBeginTransaction (Maybe Text)
pbtUploadType
= lens _pbtUploadType
(\ s a -> s{_pbtUploadType = a})
pbtPayload :: Lens' ProjectsBeginTransaction BeginTransactionRequest
pbtPayload
= lens _pbtPayload (\ s a -> s{_pbtPayload = a})
pbtProjectId :: Lens' ProjectsBeginTransaction Text
pbtProjectId
= lens _pbtProjectId (\ s a -> s{_pbtProjectId = a})
pbtCallback :: Lens' ProjectsBeginTransaction (Maybe Text)
pbtCallback
= lens _pbtCallback (\ s a -> s{_pbtCallback = a})
instance GoogleRequest ProjectsBeginTransaction where
type Rs ProjectsBeginTransaction =
BeginTransactionResponse
type Scopes ProjectsBeginTransaction =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"]
requestClient ProjectsBeginTransaction'{..}
= go _pbtProjectId _pbtXgafv _pbtUploadProtocol
_pbtAccessToken
_pbtUploadType
_pbtCallback
(Just AltJSON)
_pbtPayload
datastoreService
where go
= buildClient
(Proxy :: Proxy ProjectsBeginTransactionResource)
mempty