{-# 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.RegionAutoscalers.Insert
(
RegionAutoscalersInsertResource
, regionAutoscalersInsert
, RegionAutoscalersInsert
, raiRequestId
, raiProject
, raiPayload
, raiRegion
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type RegionAutoscalersInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"regions" :>
Capture "region" Text :>
"autoscalers" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Autoscaler :> Post '[JSON] Operation
data RegionAutoscalersInsert = RegionAutoscalersInsert'
{ _raiRequestId :: !(Maybe Text)
, _raiProject :: !Text
, _raiPayload :: !Autoscaler
, _raiRegion :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
regionAutoscalersInsert
:: Text
-> Autoscaler
-> Text
-> RegionAutoscalersInsert
regionAutoscalersInsert pRaiProject_ pRaiPayload_ pRaiRegion_ =
RegionAutoscalersInsert'
{ _raiRequestId = Nothing
, _raiProject = pRaiProject_
, _raiPayload = pRaiPayload_
, _raiRegion = pRaiRegion_
}
raiRequestId :: Lens' RegionAutoscalersInsert (Maybe Text)
raiRequestId
= lens _raiRequestId (\ s a -> s{_raiRequestId = a})
raiProject :: Lens' RegionAutoscalersInsert Text
raiProject
= lens _raiProject (\ s a -> s{_raiProject = a})
raiPayload :: Lens' RegionAutoscalersInsert Autoscaler
raiPayload
= lens _raiPayload (\ s a -> s{_raiPayload = a})
raiRegion :: Lens' RegionAutoscalersInsert Text
raiRegion
= lens _raiRegion (\ s a -> s{_raiRegion = a})
instance GoogleRequest RegionAutoscalersInsert where
type Rs RegionAutoscalersInsert = Operation
type Scopes RegionAutoscalersInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient RegionAutoscalersInsert'{..}
= go _raiProject _raiRegion _raiRequestId
(Just AltJSON)
_raiPayload
computeService
where go
= buildClient
(Proxy :: Proxy RegionAutoscalersInsertResource)
mempty