{-# 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.SQL.Databases.Insert
(
DatabasesInsertResource
, databasesInsert
, DatabasesInsert
, diProject
, diPayload
, diInstance
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type DatabasesInsertResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
Capture "instance" Text :>
"databases" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Database :> Post '[JSON] Operation
data DatabasesInsert = DatabasesInsert'
{ _diProject :: !Text
, _diPayload :: !Database
, _diInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
databasesInsert
:: Text
-> Database
-> Text
-> DatabasesInsert
databasesInsert pDiProject_ pDiPayload_ pDiInstance_ =
DatabasesInsert'
{ _diProject = pDiProject_
, _diPayload = pDiPayload_
, _diInstance = pDiInstance_
}
diProject :: Lens' DatabasesInsert Text
diProject
= lens _diProject (\ s a -> s{_diProject = a})
diPayload :: Lens' DatabasesInsert Database
diPayload
= lens _diPayload (\ s a -> s{_diPayload = a})
diInstance :: Lens' DatabasesInsert Text
diInstance
= lens _diInstance (\ s a -> s{_diInstance = a})
instance GoogleRequest DatabasesInsert where
type Rs DatabasesInsert = Operation
type Scopes DatabasesInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient DatabasesInsert'{..}
= go _diProject _diInstance (Just AltJSON) _diPayload
sQLAdminService
where go
= buildClient
(Proxy :: Proxy DatabasesInsertResource)
mempty