{-# 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.Networks.AddPeering
(
NetworksAddPeeringResource
, networksAddPeering
, NetworksAddPeering
, napRequestId
, napProject
, napNetwork
, napPayload
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type NetworksAddPeeringResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"networks" :>
Capture "network" Text :>
"addPeering" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] NetworksAddPeeringRequest :>
Post '[JSON] Operation
data NetworksAddPeering = NetworksAddPeering'
{ _napRequestId :: !(Maybe Text)
, _napProject :: !Text
, _napNetwork :: !Text
, _napPayload :: !NetworksAddPeeringRequest
} deriving (Eq,Show,Data,Typeable,Generic)
networksAddPeering
:: Text
-> Text
-> NetworksAddPeeringRequest
-> NetworksAddPeering
networksAddPeering pNapProject_ pNapNetwork_ pNapPayload_ =
NetworksAddPeering'
{ _napRequestId = Nothing
, _napProject = pNapProject_
, _napNetwork = pNapNetwork_
, _napPayload = pNapPayload_
}
napRequestId :: Lens' NetworksAddPeering (Maybe Text)
napRequestId
= lens _napRequestId (\ s a -> s{_napRequestId = a})
napProject :: Lens' NetworksAddPeering Text
napProject
= lens _napProject (\ s a -> s{_napProject = a})
napNetwork :: Lens' NetworksAddPeering Text
napNetwork
= lens _napNetwork (\ s a -> s{_napNetwork = a})
napPayload :: Lens' NetworksAddPeering NetworksAddPeeringRequest
napPayload
= lens _napPayload (\ s a -> s{_napPayload = a})
instance GoogleRequest NetworksAddPeering where
type Rs NetworksAddPeering = Operation
type Scopes NetworksAddPeering =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient NetworksAddPeering'{..}
= go _napProject _napNetwork _napRequestId
(Just AltJSON)
_napPayload
computeService
where go
= buildClient
(Proxy :: Proxy NetworksAddPeeringResource)
mempty