{-# 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.Routers.Insert
(
RoutersInsertResource
, routersInsert
, RoutersInsert
, riRequestId
, riProject
, riPayload
, riRegion
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type RoutersInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"regions" :>
Capture "region" Text :>
"routers" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Router :> Post '[JSON] Operation
data RoutersInsert = RoutersInsert'
{ _riRequestId :: !(Maybe Text)
, _riProject :: !Text
, _riPayload :: !Router
, _riRegion :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
routersInsert
:: Text
-> Router
-> Text
-> RoutersInsert
routersInsert pRiProject_ pRiPayload_ pRiRegion_ =
RoutersInsert'
{ _riRequestId = Nothing
, _riProject = pRiProject_
, _riPayload = pRiPayload_
, _riRegion = pRiRegion_
}
riRequestId :: Lens' RoutersInsert (Maybe Text)
riRequestId
= lens _riRequestId (\ s a -> s{_riRequestId = a})
riProject :: Lens' RoutersInsert Text
riProject
= lens _riProject (\ s a -> s{_riProject = a})
riPayload :: Lens' RoutersInsert Router
riPayload
= lens _riPayload (\ s a -> s{_riPayload = a})
riRegion :: Lens' RoutersInsert Text
riRegion = lens _riRegion (\ s a -> s{_riRegion = a})
instance GoogleRequest RoutersInsert where
type Rs RoutersInsert = Operation
type Scopes RoutersInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient RoutersInsert'{..}
= go _riProject _riRegion _riRequestId (Just AltJSON)
_riPayload
computeService
where go
= buildClient (Proxy :: Proxy RoutersInsertResource)
mempty