{-# 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.Failover
(
InstancesFailoverResource
, instancesFailover
, InstancesFailover
, ifProject
, ifPayload
, ifInstance
) where
import Network.Google.Prelude
import Network.Google.SQLAdmin.Types
type InstancesFailoverResource =
"sql" :>
"v1beta4" :>
"projects" :>
Capture "project" Text :>
"instances" :>
Capture "instance" Text :>
"failover" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] InstancesFailoverRequest :>
Post '[JSON] Operation
data InstancesFailover = InstancesFailover'
{ _ifProject :: !Text
, _ifPayload :: !InstancesFailoverRequest
, _ifInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
instancesFailover
:: Text
-> InstancesFailoverRequest
-> Text
-> InstancesFailover
instancesFailover pIfProject_ pIfPayload_ pIfInstance_ =
InstancesFailover'
{ _ifProject = pIfProject_
, _ifPayload = pIfPayload_
, _ifInstance = pIfInstance_
}
ifProject :: Lens' InstancesFailover Text
ifProject
= lens _ifProject (\ s a -> s{_ifProject = a})
ifPayload :: Lens' InstancesFailover InstancesFailoverRequest
ifPayload
= lens _ifPayload (\ s a -> s{_ifPayload = a})
ifInstance :: Lens' InstancesFailover Text
ifInstance
= lens _ifInstance (\ s a -> s{_ifInstance = a})
instance GoogleRequest InstancesFailover where
type Rs InstancesFailover = Operation
type Scopes InstancesFailover =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin"]
requestClient InstancesFailover'{..}
= go _ifProject _ifInstance (Just AltJSON) _ifPayload
sQLAdminService
where go
= buildClient
(Proxy :: Proxy InstancesFailoverResource)
mempty