{-# 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.Spanner.Projects.Instances.Databases.Sessions.BeginTransaction
(
ProjectsInstancesDatabasesSessionsBeginTransactionResource
, projectsInstancesDatabasesSessionsBeginTransaction
, ProjectsInstancesDatabasesSessionsBeginTransaction
, pidsbtXgafv
, pidsbtUploadProtocol
, pidsbtAccessToken
, pidsbtUploadType
, pidsbtPayload
, pidsbtSession
, pidsbtCallback
) where
import Network.Google.Prelude
import Network.Google.Spanner.Types
type ProjectsInstancesDatabasesSessionsBeginTransactionResource
=
"v1" :>
CaptureMode "session" "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] Transaction
data ProjectsInstancesDatabasesSessionsBeginTransaction = ProjectsInstancesDatabasesSessionsBeginTransaction'
{ _pidsbtXgafv :: !(Maybe Xgafv)
, _pidsbtUploadProtocol :: !(Maybe Text)
, _pidsbtAccessToken :: !(Maybe Text)
, _pidsbtUploadType :: !(Maybe Text)
, _pidsbtPayload :: !BeginTransactionRequest
, _pidsbtSession :: !Text
, _pidsbtCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsInstancesDatabasesSessionsBeginTransaction
:: BeginTransactionRequest
-> Text
-> ProjectsInstancesDatabasesSessionsBeginTransaction
projectsInstancesDatabasesSessionsBeginTransaction pPidsbtPayload_ pPidsbtSession_ =
ProjectsInstancesDatabasesSessionsBeginTransaction'
{ _pidsbtXgafv = Nothing
, _pidsbtUploadProtocol = Nothing
, _pidsbtAccessToken = Nothing
, _pidsbtUploadType = Nothing
, _pidsbtPayload = pPidsbtPayload_
, _pidsbtSession = pPidsbtSession_
, _pidsbtCallback = Nothing
}
pidsbtXgafv :: Lens' ProjectsInstancesDatabasesSessionsBeginTransaction (Maybe Xgafv)
pidsbtXgafv
= lens _pidsbtXgafv (\ s a -> s{_pidsbtXgafv = a})
pidsbtUploadProtocol :: Lens' ProjectsInstancesDatabasesSessionsBeginTransaction (Maybe Text)
pidsbtUploadProtocol
= lens _pidsbtUploadProtocol
(\ s a -> s{_pidsbtUploadProtocol = a})
pidsbtAccessToken :: Lens' ProjectsInstancesDatabasesSessionsBeginTransaction (Maybe Text)
pidsbtAccessToken
= lens _pidsbtAccessToken
(\ s a -> s{_pidsbtAccessToken = a})
pidsbtUploadType :: Lens' ProjectsInstancesDatabasesSessionsBeginTransaction (Maybe Text)
pidsbtUploadType
= lens _pidsbtUploadType
(\ s a -> s{_pidsbtUploadType = a})
pidsbtPayload :: Lens' ProjectsInstancesDatabasesSessionsBeginTransaction BeginTransactionRequest
pidsbtPayload
= lens _pidsbtPayload
(\ s a -> s{_pidsbtPayload = a})
pidsbtSession :: Lens' ProjectsInstancesDatabasesSessionsBeginTransaction Text
pidsbtSession
= lens _pidsbtSession
(\ s a -> s{_pidsbtSession = a})
pidsbtCallback :: Lens' ProjectsInstancesDatabasesSessionsBeginTransaction (Maybe Text)
pidsbtCallback
= lens _pidsbtCallback
(\ s a -> s{_pidsbtCallback = a})
instance GoogleRequest
ProjectsInstancesDatabasesSessionsBeginTransaction
where
type Rs
ProjectsInstancesDatabasesSessionsBeginTransaction
= Transaction
type Scopes
ProjectsInstancesDatabasesSessionsBeginTransaction
=
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/spanner.data"]
requestClient
ProjectsInstancesDatabasesSessionsBeginTransaction'{..}
= go _pidsbtSession _pidsbtXgafv
_pidsbtUploadProtocol
_pidsbtAccessToken
_pidsbtUploadType
_pidsbtCallback
(Just AltJSON)
_pidsbtPayload
spannerService
where go
= buildClient
(Proxy ::
Proxy
ProjectsInstancesDatabasesSessionsBeginTransactionResource)
mempty