{-# 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.Patch
(
DatabasesPatchResource
, databasesPatch
, DatabasesPatch
, dpProject
, dpDatabase
, dpPayload
, dpInstance
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type DatabasesPatchResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
Capture "instance" Text :>
"databases" :>
Capture "database" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Database :> Patch '[JSON] Operation
data DatabasesPatch = DatabasesPatch'
{ _dpProject :: !Text
, _dpDatabase :: !Text
, _dpPayload :: !Database
, _dpInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
databasesPatch
:: Text
-> Text
-> Database
-> Text
-> DatabasesPatch
databasesPatch pDpProject_ pDpDatabase_ pDpPayload_ pDpInstance_ =
DatabasesPatch'
{ _dpProject = pDpProject_
, _dpDatabase = pDpDatabase_
, _dpPayload = pDpPayload_
, _dpInstance = pDpInstance_
}
dpProject :: Lens' DatabasesPatch Text
dpProject
= lens _dpProject (\ s a -> s{_dpProject = a})
dpDatabase :: Lens' DatabasesPatch Text
dpDatabase
= lens _dpDatabase (\ s a -> s{_dpDatabase = a})
dpPayload :: Lens' DatabasesPatch Database
dpPayload
= lens _dpPayload (\ s a -> s{_dpPayload = a})
dpInstance :: Lens' DatabasesPatch Text
dpInstance
= lens _dpInstance (\ s a -> s{_dpInstance = a})
instance GoogleRequest DatabasesPatch where
type Rs DatabasesPatch = Operation
type Scopes DatabasesPatch =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient DatabasesPatch'{..}
= go _dpProject _dpInstance _dpDatabase
(Just AltJSON)
_dpPayload
sQLAdminService
where go
= buildClient (Proxy :: Proxy DatabasesPatchResource)
mempty