{-# 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.Compute.GlobalForwardingRules.SetTarget
(
GlobalForwardingRulesSetTargetResource
, globalForwardingRulesSetTarget
, GlobalForwardingRulesSetTarget
, gfrstRequestId
, gfrstProject
, gfrstForwardingRule
, gfrstPayload
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type GlobalForwardingRulesSetTargetResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"forwardingRules" :>
Capture "forwardingRule" Text :>
"setTarget" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TargetReference :>
Post '[JSON] Operation
data GlobalForwardingRulesSetTarget = GlobalForwardingRulesSetTarget'
{ _gfrstRequestId :: !(Maybe Text)
, _gfrstProject :: !Text
, _gfrstForwardingRule :: !Text
, _gfrstPayload :: !TargetReference
} deriving (Eq,Show,Data,Typeable,Generic)
globalForwardingRulesSetTarget
:: Text
-> Text
-> TargetReference
-> GlobalForwardingRulesSetTarget
globalForwardingRulesSetTarget pGfrstProject_ pGfrstForwardingRule_ pGfrstPayload_ =
GlobalForwardingRulesSetTarget'
{ _gfrstRequestId = Nothing
, _gfrstProject = pGfrstProject_
, _gfrstForwardingRule = pGfrstForwardingRule_
, _gfrstPayload = pGfrstPayload_
}
gfrstRequestId :: Lens' GlobalForwardingRulesSetTarget (Maybe Text)
gfrstRequestId
= lens _gfrstRequestId
(\ s a -> s{_gfrstRequestId = a})
gfrstProject :: Lens' GlobalForwardingRulesSetTarget Text
gfrstProject
= lens _gfrstProject (\ s a -> s{_gfrstProject = a})
gfrstForwardingRule :: Lens' GlobalForwardingRulesSetTarget Text
gfrstForwardingRule
= lens _gfrstForwardingRule
(\ s a -> s{_gfrstForwardingRule = a})
gfrstPayload :: Lens' GlobalForwardingRulesSetTarget TargetReference
gfrstPayload
= lens _gfrstPayload (\ s a -> s{_gfrstPayload = a})
instance GoogleRequest GlobalForwardingRulesSetTarget
where
type Rs GlobalForwardingRulesSetTarget = Operation
type Scopes GlobalForwardingRulesSetTarget =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient GlobalForwardingRulesSetTarget'{..}
= go _gfrstProject _gfrstForwardingRule
_gfrstRequestId
(Just AltJSON)
_gfrstPayload
computeService
where go
= buildClient
(Proxy ::
Proxy GlobalForwardingRulesSetTargetResource)
mempty