{-# 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.RegionCommitments.Insert
(
RegionCommitmentsInsertResource
, regionCommitmentsInsert
, RegionCommitmentsInsert
, rciRequestId
, rciProject
, rciPayload
, rciRegion
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type RegionCommitmentsInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"regions" :>
Capture "region" Text :>
"commitments" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Commitment :> Post '[JSON] Operation
data RegionCommitmentsInsert = RegionCommitmentsInsert'
{ _rciRequestId :: !(Maybe Text)
, _rciProject :: !Text
, _rciPayload :: !Commitment
, _rciRegion :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
regionCommitmentsInsert
:: Text
-> Commitment
-> Text
-> RegionCommitmentsInsert
regionCommitmentsInsert pRciProject_ pRciPayload_ pRciRegion_ =
RegionCommitmentsInsert'
{ _rciRequestId = Nothing
, _rciProject = pRciProject_
, _rciPayload = pRciPayload_
, _rciRegion = pRciRegion_
}
rciRequestId :: Lens' RegionCommitmentsInsert (Maybe Text)
rciRequestId
= lens _rciRequestId (\ s a -> s{_rciRequestId = a})
rciProject :: Lens' RegionCommitmentsInsert Text
rciProject
= lens _rciProject (\ s a -> s{_rciProject = a})
rciPayload :: Lens' RegionCommitmentsInsert Commitment
rciPayload
= lens _rciPayload (\ s a -> s{_rciPayload = a})
rciRegion :: Lens' RegionCommitmentsInsert Text
rciRegion
= lens _rciRegion (\ s a -> s{_rciRegion = a})
instance GoogleRequest RegionCommitmentsInsert where
type Rs RegionCommitmentsInsert = Operation
type Scopes RegionCommitmentsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient RegionCommitmentsInsert'{..}
= go _rciProject _rciRegion _rciRequestId
(Just AltJSON)
_rciPayload
computeService
where go
= buildClient
(Proxy :: Proxy RegionCommitmentsInsertResource)
mempty