{-# 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.AttachDisk
(
InstancesAttachDiskResource
, instancesAttachDisk
, InstancesAttachDisk
, insRequestId
, insProject
, insZone
, insPayload
, insForceAttach
, insInstance
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type InstancesAttachDiskResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"zones" :>
Capture "zone" Text :>
"instances" :>
Capture "instance" Text :>
"attachDisk" :>
QueryParam "requestId" Text :>
QueryParam "forceAttach" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AttachedDisk :>
Post '[JSON] Operation
data InstancesAttachDisk = InstancesAttachDisk'
{ _insRequestId :: !(Maybe Text)
, _insProject :: !Text
, _insZone :: !Text
, _insPayload :: !AttachedDisk
, _insForceAttach :: !(Maybe Bool)
, _insInstance :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
instancesAttachDisk
:: Text
-> Text
-> AttachedDisk
-> Text
-> InstancesAttachDisk
instancesAttachDisk pInsProject_ pInsZone_ pInsPayload_ pInsInstance_ =
InstancesAttachDisk'
{ _insRequestId = Nothing
, _insProject = pInsProject_
, _insZone = pInsZone_
, _insPayload = pInsPayload_
, _insForceAttach = Nothing
, _insInstance = pInsInstance_
}
insRequestId :: Lens' InstancesAttachDisk (Maybe Text)
insRequestId
= lens _insRequestId (\ s a -> s{_insRequestId = a})
insProject :: Lens' InstancesAttachDisk Text
insProject
= lens _insProject (\ s a -> s{_insProject = a})
insZone :: Lens' InstancesAttachDisk Text
insZone = lens _insZone (\ s a -> s{_insZone = a})
insPayload :: Lens' InstancesAttachDisk AttachedDisk
insPayload
= lens _insPayload (\ s a -> s{_insPayload = a})
insForceAttach :: Lens' InstancesAttachDisk (Maybe Bool)
insForceAttach
= lens _insForceAttach
(\ s a -> s{_insForceAttach = a})
insInstance :: Lens' InstancesAttachDisk Text
insInstance
= lens _insInstance (\ s a -> s{_insInstance = a})
instance GoogleRequest InstancesAttachDisk where
type Rs InstancesAttachDisk = Operation
type Scopes InstancesAttachDisk =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient InstancesAttachDisk'{..}
= go _insProject _insZone _insInstance _insRequestId
_insForceAttach
(Just AltJSON)
_insPayload
computeService
where go
= buildClient
(Proxy :: Proxy InstancesAttachDiskResource)
mempty