{-# 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.TargetPools.Insert
(
TargetPoolsInsertResource
, targetPoolsInsert
, TargetPoolsInsert
, tpiRequestId
, tpiProject
, tpiPayload
, tpiRegion
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type TargetPoolsInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"regions" :>
Capture "region" Text :>
"targetPools" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TargetPool :> Post '[JSON] Operation
data TargetPoolsInsert = TargetPoolsInsert'
{ _tpiRequestId :: !(Maybe Text)
, _tpiProject :: !Text
, _tpiPayload :: !TargetPool
, _tpiRegion :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
targetPoolsInsert
:: Text
-> TargetPool
-> Text
-> TargetPoolsInsert
targetPoolsInsert pTpiProject_ pTpiPayload_ pTpiRegion_ =
TargetPoolsInsert'
{ _tpiRequestId = Nothing
, _tpiProject = pTpiProject_
, _tpiPayload = pTpiPayload_
, _tpiRegion = pTpiRegion_
}
tpiRequestId :: Lens' TargetPoolsInsert (Maybe Text)
tpiRequestId
= lens _tpiRequestId (\ s a -> s{_tpiRequestId = a})
tpiProject :: Lens' TargetPoolsInsert Text
tpiProject
= lens _tpiProject (\ s a -> s{_tpiProject = a})
tpiPayload :: Lens' TargetPoolsInsert TargetPool
tpiPayload
= lens _tpiPayload (\ s a -> s{_tpiPayload = a})
tpiRegion :: Lens' TargetPoolsInsert Text
tpiRegion
= lens _tpiRegion (\ s a -> s{_tpiRegion = a})
instance GoogleRequest TargetPoolsInsert where
type Rs TargetPoolsInsert = Operation
type Scopes TargetPoolsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient TargetPoolsInsert'{..}
= go _tpiProject _tpiRegion _tpiRequestId
(Just AltJSON)
_tpiPayload
computeService
where go
= buildClient
(Proxy :: Proxy TargetPoolsInsertResource)
mempty