{-# 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.PromoteReplica
(
InstancesPromoteReplicaResource
, instancesPromoteReplica
, InstancesPromoteReplica
, iprProject
, iprInstance
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type InstancesPromoteReplicaResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
Capture "instance" Text :>
"promoteReplica" :>
QueryParam "alt" AltJSON :> Post '[JSON] Operation
data InstancesPromoteReplica = InstancesPromoteReplica'
{ _iprProject :: !Text
, _iprInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
instancesPromoteReplica
:: Text
-> Text
-> InstancesPromoteReplica
instancesPromoteReplica pIprProject_ pIprInstance_ =
InstancesPromoteReplica'
{ _iprProject = pIprProject_
, _iprInstance = pIprInstance_
}
iprProject :: Lens' InstancesPromoteReplica Text
iprProject
= lens _iprProject (\ s a -> s{_iprProject = a})
iprInstance :: Lens' InstancesPromoteReplica Text
iprInstance
= lens _iprInstance (\ s a -> s{_iprInstance = a})
instance GoogleRequest InstancesPromoteReplica where
type Rs InstancesPromoteReplica = Operation
type Scopes InstancesPromoteReplica =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient InstancesPromoteReplica'{..}
= go _iprProject _iprInstance (Just AltJSON)
sQLAdminService
where go
= buildClient
(Proxy :: Proxy InstancesPromoteReplicaResource)
mempty