{-# 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.TargetInstances.Insert
(
TargetInstancesInsertResource
, targetInstancesInsert
, TargetInstancesInsert
, tiiRequestId
, tiiProject
, tiiZone
, tiiPayload
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type TargetInstancesInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"zones" :>
Capture "zone" Text :>
"targetInstances" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TargetInstance :>
Post '[JSON] Operation
data TargetInstancesInsert = TargetInstancesInsert'
{ _tiiRequestId :: !(Maybe Text)
, _tiiProject :: !Text
, _tiiZone :: !Text
, _tiiPayload :: !TargetInstance
} deriving (Eq,Show,Data,Typeable,Generic)
targetInstancesInsert
:: Text
-> Text
-> TargetInstance
-> TargetInstancesInsert
targetInstancesInsert pTiiProject_ pTiiZone_ pTiiPayload_ =
TargetInstancesInsert'
{ _tiiRequestId = Nothing
, _tiiProject = pTiiProject_
, _tiiZone = pTiiZone_
, _tiiPayload = pTiiPayload_
}
tiiRequestId :: Lens' TargetInstancesInsert (Maybe Text)
tiiRequestId
= lens _tiiRequestId (\ s a -> s{_tiiRequestId = a})
tiiProject :: Lens' TargetInstancesInsert Text
tiiProject
= lens _tiiProject (\ s a -> s{_tiiProject = a})
tiiZone :: Lens' TargetInstancesInsert Text
tiiZone = lens _tiiZone (\ s a -> s{_tiiZone = a})
tiiPayload :: Lens' TargetInstancesInsert TargetInstance
tiiPayload
= lens _tiiPayload (\ s a -> s{_tiiPayload = a})
instance GoogleRequest TargetInstancesInsert where
type Rs TargetInstancesInsert = Operation
type Scopes TargetInstancesInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient TargetInstancesInsert'{..}
= go _tiiProject _tiiZone _tiiRequestId
(Just AltJSON)
_tiiPayload
computeService
where go
= buildClient
(Proxy :: Proxy TargetInstancesInsertResource)
mempty