{-# 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.Update
(
BucketsUpdateResource
, bucketsUpdate
, BucketsUpdate
, buIfMetagenerationMatch
, buPredefinedACL
, buBucket
, buPayload
, buPredefinedDefaultObjectACL
, buUserProject
, buIfMetagenerationNotMatch
, buProjection
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsUpdateResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
QueryParam "ifMetagenerationMatch" (Textual Int64) :>
QueryParam "predefinedAcl" BucketsUpdatePredefinedACL
:>
QueryParam "predefinedDefaultObjectAcl"
BucketsUpdatePredefinedDefaultObjectACL
:>
QueryParam "userProject" Text :>
QueryParam "ifMetagenerationNotMatch" (Textual Int64)
:>
QueryParam "projection" BucketsUpdateProjection :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Bucket :> Put '[JSON] Bucket
data BucketsUpdate = BucketsUpdate'
{ _buIfMetagenerationMatch :: !(Maybe (Textual Int64))
, _buPredefinedACL :: !(Maybe BucketsUpdatePredefinedACL)
, _buBucket :: !Text
, _buPayload :: !Bucket
, _buPredefinedDefaultObjectACL :: !(Maybe BucketsUpdatePredefinedDefaultObjectACL)
, _buUserProject :: !(Maybe Text)
, _buIfMetagenerationNotMatch :: !(Maybe (Textual Int64))
, _buProjection :: !(Maybe BucketsUpdateProjection)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketsUpdate
:: Text
-> Bucket
-> BucketsUpdate
bucketsUpdate pBuBucket_ pBuPayload_ =
BucketsUpdate'
{ _buIfMetagenerationMatch = Nothing
, _buPredefinedACL = Nothing
, _buBucket = pBuBucket_
, _buPayload = pBuPayload_
, _buPredefinedDefaultObjectACL = Nothing
, _buUserProject = Nothing
, _buIfMetagenerationNotMatch = Nothing
, _buProjection = Nothing
}
buIfMetagenerationMatch :: Lens' BucketsUpdate (Maybe Int64)
buIfMetagenerationMatch
= lens _buIfMetagenerationMatch
(\ s a -> s{_buIfMetagenerationMatch = a})
. mapping _Coerce
buPredefinedACL :: Lens' BucketsUpdate (Maybe BucketsUpdatePredefinedACL)
buPredefinedACL
= lens _buPredefinedACL
(\ s a -> s{_buPredefinedACL = a})
buBucket :: Lens' BucketsUpdate Text
buBucket = lens _buBucket (\ s a -> s{_buBucket = a})
buPayload :: Lens' BucketsUpdate Bucket
buPayload
= lens _buPayload (\ s a -> s{_buPayload = a})
buPredefinedDefaultObjectACL :: Lens' BucketsUpdate (Maybe BucketsUpdatePredefinedDefaultObjectACL)
buPredefinedDefaultObjectACL
= lens _buPredefinedDefaultObjectACL
(\ s a -> s{_buPredefinedDefaultObjectACL = a})
buUserProject :: Lens' BucketsUpdate (Maybe Text)
buUserProject
= lens _buUserProject
(\ s a -> s{_buUserProject = a})
buIfMetagenerationNotMatch :: Lens' BucketsUpdate (Maybe Int64)
buIfMetagenerationNotMatch
= lens _buIfMetagenerationNotMatch
(\ s a -> s{_buIfMetagenerationNotMatch = a})
. mapping _Coerce
buProjection :: Lens' BucketsUpdate (Maybe BucketsUpdateProjection)
buProjection
= lens _buProjection (\ s a -> s{_buProjection = a})
instance GoogleRequest BucketsUpdate where
type Rs BucketsUpdate = Bucket
type Scopes BucketsUpdate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control"]
requestClient BucketsUpdate'{..}
= go _buBucket _buIfMetagenerationMatch
_buPredefinedACL
_buPredefinedDefaultObjectACL
_buUserProject
_buIfMetagenerationNotMatch
_buProjection
(Just AltJSON)
_buPayload
storageService
where go
= buildClient (Proxy :: Proxy BucketsUpdateResource)
mempty