{-# 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.DemoteMaster
(
InstancesDemoteMasterResource
, instancesDemoteMaster
, InstancesDemoteMaster
, idmProject
, idmPayload
, idmInstance
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type InstancesDemoteMasterResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
Capture "instance" Text :>
"demoteMaster" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] InstancesDemoteMasterRequest :>
Post '[JSON] Operation
data InstancesDemoteMaster = InstancesDemoteMaster'
{ _idmProject :: !Text
, _idmPayload :: !InstancesDemoteMasterRequest
, _idmInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
instancesDemoteMaster
:: Text
-> InstancesDemoteMasterRequest
-> Text
-> InstancesDemoteMaster
instancesDemoteMaster pIdmProject_ pIdmPayload_ pIdmInstance_ =
InstancesDemoteMaster'
{ _idmProject = pIdmProject_
, _idmPayload = pIdmPayload_
, _idmInstance = pIdmInstance_
}
idmProject :: Lens' InstancesDemoteMaster Text
idmProject
= lens _idmProject (\ s a -> s{_idmProject = a})
idmPayload :: Lens' InstancesDemoteMaster InstancesDemoteMasterRequest
idmPayload
= lens _idmPayload (\ s a -> s{_idmPayload = a})
idmInstance :: Lens' InstancesDemoteMaster Text
idmInstance
= lens _idmInstance (\ s a -> s{_idmInstance = a})
instance GoogleRequest InstancesDemoteMaster where
type Rs InstancesDemoteMaster = Operation
type Scopes InstancesDemoteMaster =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient InstancesDemoteMaster'{..}
= go _idmProject _idmInstance (Just AltJSON)
_idmPayload
sQLAdminService
where go
= buildClient
(Proxy :: Proxy InstancesDemoteMasterResource)
mempty