{-# 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.Insert
(
InstancesInsertResource
, instancesInsert
, InstancesInsert
, iiiProject
, iiiPayload
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type InstancesInsertResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DatabaseInstance :>
Post '[JSON] Operation
data InstancesInsert = InstancesInsert'
{ _iiiProject :: !Text
, _iiiPayload :: !DatabaseInstance
} deriving (Eq,Show,Data,Typeable,Generic)
instancesInsert
:: Text
-> DatabaseInstance
-> InstancesInsert
instancesInsert pIiiProject_ pIiiPayload_ =
InstancesInsert'
{ _iiiProject = pIiiProject_
, _iiiPayload = pIiiPayload_
}
iiiProject :: Lens' InstancesInsert Text
iiiProject
= lens _iiiProject (\ s a -> s{_iiiProject = a})
iiiPayload :: Lens' InstancesInsert DatabaseInstance
iiiPayload
= lens _iiiPayload (\ s a -> s{_iiiPayload = a})
instance GoogleRequest InstancesInsert where
type Rs InstancesInsert = Operation
type Scopes InstancesInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient InstancesInsert'{..}
= go _iiiProject (Just AltJSON) _iiiPayload
sQLAdminService
where go
= buildClient
(Proxy :: Proxy InstancesInsertResource)
mempty