{-# 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.SetDeletionProtection
(
InstancesSetDeletionProtectionResource
, instancesSetDeletionProtection
, InstancesSetDeletionProtection
, isdpRequestId
, isdpDeletionProtection
, isdpProject
, isdpZone
, isdpResource
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type InstancesSetDeletionProtectionResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"zones" :>
Capture "zone" Text :>
"instances" :>
Capture "resource" Text :>
"setDeletionProtection" :>
QueryParam "requestId" Text :>
QueryParam "deletionProtection" Bool :>
QueryParam "alt" AltJSON :> Post '[JSON] Operation
data InstancesSetDeletionProtection = InstancesSetDeletionProtection'
{ _isdpRequestId :: !(Maybe Text)
, _isdpDeletionProtection :: !Bool
, _isdpProject :: !Text
, _isdpZone :: !Text
, _isdpResource :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
instancesSetDeletionProtection
:: Text
-> Text
-> Text
-> InstancesSetDeletionProtection
instancesSetDeletionProtection pIsdpProject_ pIsdpZone_ pIsdpResource_ =
InstancesSetDeletionProtection'
{ _isdpRequestId = Nothing
, _isdpDeletionProtection = True
, _isdpProject = pIsdpProject_
, _isdpZone = pIsdpZone_
, _isdpResource = pIsdpResource_
}
isdpRequestId :: Lens' InstancesSetDeletionProtection (Maybe Text)
isdpRequestId
= lens _isdpRequestId
(\ s a -> s{_isdpRequestId = a})
isdpDeletionProtection :: Lens' InstancesSetDeletionProtection Bool
isdpDeletionProtection
= lens _isdpDeletionProtection
(\ s a -> s{_isdpDeletionProtection = a})
isdpProject :: Lens' InstancesSetDeletionProtection Text
isdpProject
= lens _isdpProject (\ s a -> s{_isdpProject = a})
isdpZone :: Lens' InstancesSetDeletionProtection Text
isdpZone = lens _isdpZone (\ s a -> s{_isdpZone = a})
isdpResource :: Lens' InstancesSetDeletionProtection Text
isdpResource
= lens _isdpResource (\ s a -> s{_isdpResource = a})
instance GoogleRequest InstancesSetDeletionProtection
where
type Rs InstancesSetDeletionProtection = Operation
type Scopes InstancesSetDeletionProtection =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient InstancesSetDeletionProtection'{..}
= go _isdpProject _isdpZone _isdpResource
_isdpRequestId
(Just _isdpDeletionProtection)
(Just AltJSON)
computeService
where go
= buildClient
(Proxy ::
Proxy InstancesSetDeletionProtectionResource)
mempty