{-# 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.Create
(
ProjectsInstancesDatabasesSessionsCreateResource
, projectsInstancesDatabasesSessionsCreate
, ProjectsInstancesDatabasesSessionsCreate
, pXgafv
, pUploadProtocol
, pDatabase
, pAccessToken
, pUploadType
, pPayload
, pCallback
) where
import Network.Google.Prelude
import Network.Google.Spanner.Types
type ProjectsInstancesDatabasesSessionsCreateResource
=
"v1" :>
Capture "database" Text :>
"sessions" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateSessionRequest :>
Post '[JSON] Session
data ProjectsInstancesDatabasesSessionsCreate = ProjectsInstancesDatabasesSessionsCreate'
{ _pXgafv :: !(Maybe Xgafv)
, _pUploadProtocol :: !(Maybe Text)
, _pDatabase :: !Text
, _pAccessToken :: !(Maybe Text)
, _pUploadType :: !(Maybe Text)
, _pPayload :: !CreateSessionRequest
, _pCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsInstancesDatabasesSessionsCreate
:: Text
-> CreateSessionRequest
-> ProjectsInstancesDatabasesSessionsCreate
projectsInstancesDatabasesSessionsCreate pPDatabase_ pPPayload_ =
ProjectsInstancesDatabasesSessionsCreate'
{ _pXgafv = Nothing
, _pUploadProtocol = Nothing
, _pDatabase = pPDatabase_
, _pAccessToken = Nothing
, _pUploadType = Nothing
, _pPayload = pPPayload_
, _pCallback = Nothing
}
pXgafv :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Xgafv)
pXgafv = lens _pXgafv (\ s a -> s{_pXgafv = a})
pUploadProtocol :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text)
pUploadProtocol
= lens _pUploadProtocol
(\ s a -> s{_pUploadProtocol = a})
pDatabase :: Lens' ProjectsInstancesDatabasesSessionsCreate Text
pDatabase
= lens _pDatabase (\ s a -> s{_pDatabase = a})
pAccessToken :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text)
pAccessToken
= lens _pAccessToken (\ s a -> s{_pAccessToken = a})
pUploadType :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text)
pUploadType
= lens _pUploadType (\ s a -> s{_pUploadType = a})
pPayload :: Lens' ProjectsInstancesDatabasesSessionsCreate CreateSessionRequest
pPayload = lens _pPayload (\ s a -> s{_pPayload = a})
pCallback :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text)
pCallback
= lens _pCallback (\ s a -> s{_pCallback = a})
instance GoogleRequest
ProjectsInstancesDatabasesSessionsCreate where
type Rs ProjectsInstancesDatabasesSessionsCreate =
Session
type Scopes ProjectsInstancesDatabasesSessionsCreate
=
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/spanner.data"]
requestClient
ProjectsInstancesDatabasesSessionsCreate'{..}
= go _pDatabase _pXgafv _pUploadProtocol
_pAccessToken
_pUploadType
_pCallback
(Just AltJSON)
_pPayload
spannerService
where go
= buildClient
(Proxy ::
Proxy
ProjectsInstancesDatabasesSessionsCreateResource)
mempty