{-# 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.Instances.Insert
(
InstancesInsertResource
, instancesInsert
, InstancesInsert
, iiiRequestId
, iiiProject
, iiiZone
, iiiPayload
, iiiSourceInstanceTemplate
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type InstancesInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"zones" :>
Capture "zone" Text :>
"instances" :>
QueryParam "requestId" Text :>
QueryParam "sourceInstanceTemplate" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Instance :> Post '[JSON] Operation
data InstancesInsert = InstancesInsert'
{ _iiiRequestId :: !(Maybe Text)
, _iiiProject :: !Text
, _iiiZone :: !Text
, _iiiPayload :: !Instance
, _iiiSourceInstanceTemplate :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
instancesInsert
:: Text
-> Text
-> Instance
-> InstancesInsert
instancesInsert pIiiProject_ pIiiZone_ pIiiPayload_ =
InstancesInsert'
{ _iiiRequestId = Nothing
, _iiiProject = pIiiProject_
, _iiiZone = pIiiZone_
, _iiiPayload = pIiiPayload_
, _iiiSourceInstanceTemplate = Nothing
}
iiiRequestId :: Lens' InstancesInsert (Maybe Text)
iiiRequestId
= lens _iiiRequestId (\ s a -> s{_iiiRequestId = a})
iiiProject :: Lens' InstancesInsert Text
iiiProject
= lens _iiiProject (\ s a -> s{_iiiProject = a})
iiiZone :: Lens' InstancesInsert Text
iiiZone = lens _iiiZone (\ s a -> s{_iiiZone = a})
iiiPayload :: Lens' InstancesInsert Instance
iiiPayload
= lens _iiiPayload (\ s a -> s{_iiiPayload = a})
iiiSourceInstanceTemplate :: Lens' InstancesInsert (Maybe Text)
iiiSourceInstanceTemplate
= lens _iiiSourceInstanceTemplate
(\ s a -> s{_iiiSourceInstanceTemplate = a})
instance GoogleRequest InstancesInsert where
type Rs InstancesInsert = Operation
type Scopes InstancesInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient InstancesInsert'{..}
= go _iiiProject _iiiZone _iiiRequestId
_iiiSourceInstanceTemplate
(Just AltJSON)
_iiiPayload
computeService
where go
= buildClient
(Proxy :: Proxy InstancesInsertResource)
mempty