{-# 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.Create
(
ProjectsInstancesDatabasesCreateResource
, projectsInstancesDatabasesCreate
, ProjectsInstancesDatabasesCreate
, pidcParent
, pidcXgafv
, pidcUploadProtocol
, pidcAccessToken
, pidcUploadType
, pidcPayload
, pidcCallback
) where
import Network.Google.Prelude
import Network.Google.Spanner.Types
type ProjectsInstancesDatabasesCreateResource =
"v1" :>
Capture "parent" Text :>
"databases" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateDatabaseRequest :>
Post '[JSON] Operation
data ProjectsInstancesDatabasesCreate = ProjectsInstancesDatabasesCreate'
{ _pidcParent :: !Text
, _pidcXgafv :: !(Maybe Xgafv)
, _pidcUploadProtocol :: !(Maybe Text)
, _pidcAccessToken :: !(Maybe Text)
, _pidcUploadType :: !(Maybe Text)
, _pidcPayload :: !CreateDatabaseRequest
, _pidcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsInstancesDatabasesCreate
:: Text
-> CreateDatabaseRequest
-> ProjectsInstancesDatabasesCreate
projectsInstancesDatabasesCreate pPidcParent_ pPidcPayload_ =
ProjectsInstancesDatabasesCreate'
{ _pidcParent = pPidcParent_
, _pidcXgafv = Nothing
, _pidcUploadProtocol = Nothing
, _pidcAccessToken = Nothing
, _pidcUploadType = Nothing
, _pidcPayload = pPidcPayload_
, _pidcCallback = Nothing
}
pidcParent :: Lens' ProjectsInstancesDatabasesCreate Text
pidcParent
= lens _pidcParent (\ s a -> s{_pidcParent = a})
pidcXgafv :: Lens' ProjectsInstancesDatabasesCreate (Maybe Xgafv)
pidcXgafv
= lens _pidcXgafv (\ s a -> s{_pidcXgafv = a})
pidcUploadProtocol :: Lens' ProjectsInstancesDatabasesCreate (Maybe Text)
pidcUploadProtocol
= lens _pidcUploadProtocol
(\ s a -> s{_pidcUploadProtocol = a})
pidcAccessToken :: Lens' ProjectsInstancesDatabasesCreate (Maybe Text)
pidcAccessToken
= lens _pidcAccessToken
(\ s a -> s{_pidcAccessToken = a})
pidcUploadType :: Lens' ProjectsInstancesDatabasesCreate (Maybe Text)
pidcUploadType
= lens _pidcUploadType
(\ s a -> s{_pidcUploadType = a})
pidcPayload :: Lens' ProjectsInstancesDatabasesCreate CreateDatabaseRequest
pidcPayload
= lens _pidcPayload (\ s a -> s{_pidcPayload = a})
pidcCallback :: Lens' ProjectsInstancesDatabasesCreate (Maybe Text)
pidcCallback
= lens _pidcCallback (\ s a -> s{_pidcCallback = a})
instance GoogleRequest
ProjectsInstancesDatabasesCreate where
type Rs ProjectsInstancesDatabasesCreate = Operation
type Scopes ProjectsInstancesDatabasesCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/spanner.admin"]
requestClient ProjectsInstancesDatabasesCreate'{..}
= go _pidcParent _pidcXgafv _pidcUploadProtocol
_pidcAccessToken
_pidcUploadType
_pidcCallback
(Just AltJSON)
_pidcPayload
spannerService
where go
= buildClient
(Proxy ::
Proxy ProjectsInstancesDatabasesCreateResource)
mempty