{-# 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.Subnetworks.Insert
(
SubnetworksInsertResource
, subnetworksInsert
, SubnetworksInsert
, siRequestId
, siProject
, siPayload
, siRegion
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type SubnetworksInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"regions" :>
Capture "region" Text :>
"subnetworks" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Subnetwork :> Post '[JSON] Operation
data SubnetworksInsert = SubnetworksInsert'
{ _siRequestId :: !(Maybe Text)
, _siProject :: !Text
, _siPayload :: !Subnetwork
, _siRegion :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
subnetworksInsert
:: Text
-> Subnetwork
-> Text
-> SubnetworksInsert
subnetworksInsert pSiProject_ pSiPayload_ pSiRegion_ =
SubnetworksInsert'
{ _siRequestId = Nothing
, _siProject = pSiProject_
, _siPayload = pSiPayload_
, _siRegion = pSiRegion_
}
siRequestId :: Lens' SubnetworksInsert (Maybe Text)
siRequestId
= lens _siRequestId (\ s a -> s{_siRequestId = a})
siProject :: Lens' SubnetworksInsert Text
siProject
= lens _siProject (\ s a -> s{_siProject = a})
siPayload :: Lens' SubnetworksInsert Subnetwork
siPayload
= lens _siPayload (\ s a -> s{_siPayload = a})
siRegion :: Lens' SubnetworksInsert Text
siRegion = lens _siRegion (\ s a -> s{_siRegion = a})
instance GoogleRequest SubnetworksInsert where
type Rs SubnetworksInsert = Operation
type Scopes SubnetworksInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient SubnetworksInsert'{..}
= go _siProject _siRegion _siRequestId (Just AltJSON)
_siPayload
computeService
where go
= buildClient
(Proxy :: Proxy SubnetworksInsertResource)
mempty