{-# 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.BackupRuns.Insert
(
BackupRunsInsertResource
, backupRunsInsert
, BackupRunsInsert
, briProject
, briPayload
, briInstance
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type BackupRunsInsertResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
Capture "instance" Text :>
"backupRuns" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] BackupRun :> Post '[JSON] Operation
data BackupRunsInsert = BackupRunsInsert'
{ _briProject :: !Text
, _briPayload :: !BackupRun
, _briInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
backupRunsInsert
:: Text
-> BackupRun
-> Text
-> BackupRunsInsert
backupRunsInsert pBriProject_ pBriPayload_ pBriInstance_ =
BackupRunsInsert'
{ _briProject = pBriProject_
, _briPayload = pBriPayload_
, _briInstance = pBriInstance_
}
briProject :: Lens' BackupRunsInsert Text
briProject
= lens _briProject (\ s a -> s{_briProject = a})
briPayload :: Lens' BackupRunsInsert BackupRun
briPayload
= lens _briPayload (\ s a -> s{_briPayload = a})
briInstance :: Lens' BackupRunsInsert Text
briInstance
= lens _briInstance (\ s a -> s{_briInstance = a})
instance GoogleRequest BackupRunsInsert where
type Rs BackupRunsInsert = Operation
type Scopes BackupRunsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient BackupRunsInsert'{..}
= go _briProject _briInstance (Just AltJSON)
_briPayload
sQLAdminService
where go
= buildClient
(Proxy :: Proxy BackupRunsInsertResource)
mempty