{-# 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.Instances.RestoreBackup
(
InstancesRestoreBackupResource
, instancesRestoreBackup
, InstancesRestoreBackup
, irbProject
, irbPayload
, irbInstance
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type InstancesRestoreBackupResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
Capture "instance" Text :>
"restoreBackup" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] InstancesRestoreBackupRequest :>
Post '[JSON] Operation
data InstancesRestoreBackup = InstancesRestoreBackup'
{ _irbProject :: !Text
, _irbPayload :: !InstancesRestoreBackupRequest
, _irbInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
instancesRestoreBackup
:: Text
-> InstancesRestoreBackupRequest
-> Text
-> InstancesRestoreBackup
instancesRestoreBackup pIrbProject_ pIrbPayload_ pIrbInstance_ =
InstancesRestoreBackup'
{ _irbProject = pIrbProject_
, _irbPayload = pIrbPayload_
, _irbInstance = pIrbInstance_
}
irbProject :: Lens' InstancesRestoreBackup Text
irbProject
= lens _irbProject (\ s a -> s{_irbProject = a})
irbPayload :: Lens' InstancesRestoreBackup InstancesRestoreBackupRequest
irbPayload
= lens _irbPayload (\ s a -> s{_irbPayload = a})
irbInstance :: Lens' InstancesRestoreBackup Text
irbInstance
= lens _irbInstance (\ s a -> s{_irbInstance = a})
instance GoogleRequest InstancesRestoreBackup where
type Rs InstancesRestoreBackup = Operation
type Scopes InstancesRestoreBackup =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient InstancesRestoreBackup'{..}
= go _irbProject _irbInstance (Just AltJSON)
_irbPayload
sQLAdminService
where go
= buildClient
(Proxy :: Proxy InstancesRestoreBackupResource)
mempty