{-# 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.ForwardingRules.Insert
(
ForwardingRulesInsertResource
, forwardingRulesInsert
, ForwardingRulesInsert
, friRequestId
, friProject
, friPayload
, friRegion
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type ForwardingRulesInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"regions" :>
Capture "region" Text :>
"forwardingRules" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ForwardingRule :>
Post '[JSON] Operation
data ForwardingRulesInsert = ForwardingRulesInsert'
{ _friRequestId :: !(Maybe Text)
, _friProject :: !Text
, _friPayload :: !ForwardingRule
, _friRegion :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
forwardingRulesInsert
:: Text
-> ForwardingRule
-> Text
-> ForwardingRulesInsert
forwardingRulesInsert pFriProject_ pFriPayload_ pFriRegion_ =
ForwardingRulesInsert'
{ _friRequestId = Nothing
, _friProject = pFriProject_
, _friPayload = pFriPayload_
, _friRegion = pFriRegion_
}
friRequestId :: Lens' ForwardingRulesInsert (Maybe Text)
friRequestId
= lens _friRequestId (\ s a -> s{_friRequestId = a})
friProject :: Lens' ForwardingRulesInsert Text
friProject
= lens _friProject (\ s a -> s{_friProject = a})
friPayload :: Lens' ForwardingRulesInsert ForwardingRule
friPayload
= lens _friPayload (\ s a -> s{_friPayload = a})
friRegion :: Lens' ForwardingRulesInsert Text
friRegion
= lens _friRegion (\ s a -> s{_friRegion = a})
instance GoogleRequest ForwardingRulesInsert where
type Rs ForwardingRulesInsert = Operation
type Scopes ForwardingRulesInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient ForwardingRulesInsert'{..}
= go _friProject _friRegion _friRequestId
(Just AltJSON)
_friPayload
computeService
where go
= buildClient
(Proxy :: Proxy ForwardingRulesInsertResource)
mempty