{-# 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.Insert
(
GlobalForwardingRulesInsertResource
, globalForwardingRulesInsert
, GlobalForwardingRulesInsert
, gfriRequestId
, gfriProject
, gfriPayload
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type GlobalForwardingRulesInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"forwardingRules" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ForwardingRule :>
Post '[JSON] Operation
data GlobalForwardingRulesInsert = GlobalForwardingRulesInsert'
{ _gfriRequestId :: !(Maybe Text)
, _gfriProject :: !Text
, _gfriPayload :: !ForwardingRule
} deriving (Eq,Show,Data,Typeable,Generic)
globalForwardingRulesInsert
:: Text
-> ForwardingRule
-> GlobalForwardingRulesInsert
globalForwardingRulesInsert pGfriProject_ pGfriPayload_ =
GlobalForwardingRulesInsert'
{ _gfriRequestId = Nothing
, _gfriProject = pGfriProject_
, _gfriPayload = pGfriPayload_
}
gfriRequestId :: Lens' GlobalForwardingRulesInsert (Maybe Text)
gfriRequestId
= lens _gfriRequestId
(\ s a -> s{_gfriRequestId = a})
gfriProject :: Lens' GlobalForwardingRulesInsert Text
gfriProject
= lens _gfriProject (\ s a -> s{_gfriProject = a})
gfriPayload :: Lens' GlobalForwardingRulesInsert ForwardingRule
gfriPayload
= lens _gfriPayload (\ s a -> s{_gfriPayload = a})
instance GoogleRequest GlobalForwardingRulesInsert
where
type Rs GlobalForwardingRulesInsert = Operation
type Scopes GlobalForwardingRulesInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient GlobalForwardingRulesInsert'{..}
= go _gfriProject _gfriRequestId (Just AltJSON)
_gfriPayload
computeService
where go
= buildClient
(Proxy :: Proxy GlobalForwardingRulesInsertResource)
mempty