{-# 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.Users.Insert
(
UsersInsertResource
, usersInsert
, UsersInsert
, uiProject
, uiPayload
, uiInstance
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type UsersInsertResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
Capture "instance" Text :>
"users" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] User :> Post '[JSON] Operation
data UsersInsert = UsersInsert'
{ _uiProject :: !Text
, _uiPayload :: !User
, _uiInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersInsert
:: Text
-> User
-> Text
-> UsersInsert
usersInsert pUiProject_ pUiPayload_ pUiInstance_ =
UsersInsert'
{ _uiProject = pUiProject_
, _uiPayload = pUiPayload_
, _uiInstance = pUiInstance_
}
uiProject :: Lens' UsersInsert Text
uiProject
= lens _uiProject (\ s a -> s{_uiProject = a})
uiPayload :: Lens' UsersInsert User
uiPayload
= lens _uiPayload (\ s a -> s{_uiPayload = a})
uiInstance :: Lens' UsersInsert Text
uiInstance
= lens _uiInstance (\ s a -> s{_uiInstance = a})
instance GoogleRequest UsersInsert where
type Rs UsersInsert = Operation
type Scopes UsersInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient UsersInsert'{..}
= go _uiProject _uiInstance (Just AltJSON) _uiPayload
sQLAdminService
where go
= buildClient (Proxy :: Proxy UsersInsertResource)
mempty