{-# 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.Disks.CreateSnapshot
(
DisksCreateSnapshotResource
, disksCreateSnapshot
, DisksCreateSnapshot
, dcsGuestFlush
, dcsRequestId
, dcsProject
, dcsDisk
, dcsZone
, dcsPayload
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type DisksCreateSnapshotResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"zones" :>
Capture "zone" Text :>
"disks" :>
Capture "disk" Text :>
"createSnapshot" :>
QueryParam "guestFlush" Bool :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Snapshot :> Post '[JSON] Operation
data DisksCreateSnapshot = DisksCreateSnapshot'
{ _dcsGuestFlush :: !(Maybe Bool)
, _dcsRequestId :: !(Maybe Text)
, _dcsProject :: !Text
, _dcsDisk :: !Text
, _dcsZone :: !Text
, _dcsPayload :: !Snapshot
} deriving (Eq,Show,Data,Typeable,Generic)
disksCreateSnapshot
:: Text
-> Text
-> Text
-> Snapshot
-> DisksCreateSnapshot
disksCreateSnapshot pDcsProject_ pDcsDisk_ pDcsZone_ pDcsPayload_ =
DisksCreateSnapshot'
{ _dcsGuestFlush = Nothing
, _dcsRequestId = Nothing
, _dcsProject = pDcsProject_
, _dcsDisk = pDcsDisk_
, _dcsZone = pDcsZone_
, _dcsPayload = pDcsPayload_
}
dcsGuestFlush :: Lens' DisksCreateSnapshot (Maybe Bool)
dcsGuestFlush
= lens _dcsGuestFlush
(\ s a -> s{_dcsGuestFlush = a})
dcsRequestId :: Lens' DisksCreateSnapshot (Maybe Text)
dcsRequestId
= lens _dcsRequestId (\ s a -> s{_dcsRequestId = a})
dcsProject :: Lens' DisksCreateSnapshot Text
dcsProject
= lens _dcsProject (\ s a -> s{_dcsProject = a})
dcsDisk :: Lens' DisksCreateSnapshot Text
dcsDisk = lens _dcsDisk (\ s a -> s{_dcsDisk = a})
dcsZone :: Lens' DisksCreateSnapshot Text
dcsZone = lens _dcsZone (\ s a -> s{_dcsZone = a})
dcsPayload :: Lens' DisksCreateSnapshot Snapshot
dcsPayload
= lens _dcsPayload (\ s a -> s{_dcsPayload = a})
instance GoogleRequest DisksCreateSnapshot where
type Rs DisksCreateSnapshot = Operation
type Scopes DisksCreateSnapshot =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient DisksCreateSnapshot'{..}
= go _dcsProject _dcsZone _dcsDisk _dcsGuestFlush
_dcsRequestId
(Just AltJSON)
_dcsPayload
computeService
where go
= buildClient
(Proxy :: Proxy DisksCreateSnapshotResource)
mempty