{-# 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.Storage.Buckets.LockRetentionPolicy
(
BucketsLockRetentionPolicyResource
, bucketsLockRetentionPolicy
, BucketsLockRetentionPolicy
, blrpIfMetagenerationMatch
, blrpBucket
, blrpUserProject
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsLockRetentionPolicyResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"lockRetentionPolicy" :>
QueryParam "ifMetagenerationMatch" (Textual Int64) :>
QueryParam "userProject" Text :>
QueryParam "alt" AltJSON :> Post '[JSON] Bucket
data BucketsLockRetentionPolicy = BucketsLockRetentionPolicy'
{ _blrpIfMetagenerationMatch :: !(Textual Int64)
, _blrpBucket :: !Text
, _blrpUserProject :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketsLockRetentionPolicy
:: Int64
-> Text
-> BucketsLockRetentionPolicy
bucketsLockRetentionPolicy pBlrpIfMetagenerationMatch_ pBlrpBucket_ =
BucketsLockRetentionPolicy'
{ _blrpIfMetagenerationMatch = _Coerce # pBlrpIfMetagenerationMatch_
, _blrpBucket = pBlrpBucket_
, _blrpUserProject = Nothing
}
blrpIfMetagenerationMatch :: Lens' BucketsLockRetentionPolicy Int64
blrpIfMetagenerationMatch
= lens _blrpIfMetagenerationMatch
(\ s a -> s{_blrpIfMetagenerationMatch = a})
. _Coerce
blrpBucket :: Lens' BucketsLockRetentionPolicy Text
blrpBucket
= lens _blrpBucket (\ s a -> s{_blrpBucket = a})
blrpUserProject :: Lens' BucketsLockRetentionPolicy (Maybe Text)
blrpUserProject
= lens _blrpUserProject
(\ s a -> s{_blrpUserProject = a})
instance GoogleRequest BucketsLockRetentionPolicy
where
type Rs BucketsLockRetentionPolicy = Bucket
type Scopes BucketsLockRetentionPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient BucketsLockRetentionPolicy'{..}
= go _blrpBucket (Just _blrpIfMetagenerationMatch)
_blrpUserProject
(Just AltJSON)
storageService
where go
= buildClient
(Proxy :: Proxy BucketsLockRetentionPolicyResource)
mempty