{-# 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.Insert
(
NetworksInsertResource
, networksInsert
, NetworksInsert
, niRequestId
, niProject
, niPayload
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type NetworksInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"networks" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Network :> Post '[JSON] Operation
data NetworksInsert = NetworksInsert'
{ _niRequestId :: !(Maybe Text)
, _niProject :: !Text
, _niPayload :: !Network
} deriving (Eq,Show,Data,Typeable,Generic)
networksInsert
:: Text
-> Network
-> NetworksInsert
networksInsert pNiProject_ pNiPayload_ =
NetworksInsert'
{ _niRequestId = Nothing
, _niProject = pNiProject_
, _niPayload = pNiPayload_
}
niRequestId :: Lens' NetworksInsert (Maybe Text)
niRequestId
= lens _niRequestId (\ s a -> s{_niRequestId = a})
niProject :: Lens' NetworksInsert Text
niProject
= lens _niProject (\ s a -> s{_niProject = a})
niPayload :: Lens' NetworksInsert Network
niPayload
= lens _niPayload (\ s a -> s{_niPayload = a})
instance GoogleRequest NetworksInsert where
type Rs NetworksInsert = Operation
type Scopes NetworksInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient NetworksInsert'{..}
= go _niProject _niRequestId (Just AltJSON)
_niPayload
computeService
where go
= buildClient (Proxy :: Proxy NetworksInsertResource)
mempty