{-# 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.Patch
(
BucketsPatchResource
, bucketsPatch
, BucketsPatch
, bpIfMetagenerationMatch
, bpPredefinedACL
, bpBucket
, bpPayload
, bpPredefinedDefaultObjectACL
, bpUserProject
, bpIfMetagenerationNotMatch
, bpProjection
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsPatchResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
QueryParam "ifMetagenerationMatch" (Textual Int64) :>
QueryParam "predefinedAcl" BucketsPatchPredefinedACL
:>
QueryParam "predefinedDefaultObjectAcl"
BucketsPatchPredefinedDefaultObjectACL
:>
QueryParam "userProject" Text :>
QueryParam "ifMetagenerationNotMatch" (Textual Int64)
:>
QueryParam "projection" BucketsPatchProjection :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Bucket :> Patch '[JSON] Bucket
data BucketsPatch = BucketsPatch'
{ _bpIfMetagenerationMatch :: !(Maybe (Textual Int64))
, _bpPredefinedACL :: !(Maybe BucketsPatchPredefinedACL)
, _bpBucket :: !Text
, _bpPayload :: !Bucket
, _bpPredefinedDefaultObjectACL :: !(Maybe BucketsPatchPredefinedDefaultObjectACL)
, _bpUserProject :: !(Maybe Text)
, _bpIfMetagenerationNotMatch :: !(Maybe (Textual Int64))
, _bpProjection :: !(Maybe BucketsPatchProjection)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketsPatch
:: Text
-> Bucket
-> BucketsPatch
bucketsPatch pBpBucket_ pBpPayload_ =
BucketsPatch'
{ _bpIfMetagenerationMatch = Nothing
, _bpPredefinedACL = Nothing
, _bpBucket = pBpBucket_
, _bpPayload = pBpPayload_
, _bpPredefinedDefaultObjectACL = Nothing
, _bpUserProject = Nothing
, _bpIfMetagenerationNotMatch = Nothing
, _bpProjection = Nothing
}
bpIfMetagenerationMatch :: Lens' BucketsPatch (Maybe Int64)
bpIfMetagenerationMatch
= lens _bpIfMetagenerationMatch
(\ s a -> s{_bpIfMetagenerationMatch = a})
. mapping _Coerce
bpPredefinedACL :: Lens' BucketsPatch (Maybe BucketsPatchPredefinedACL)
bpPredefinedACL
= lens _bpPredefinedACL
(\ s a -> s{_bpPredefinedACL = a})
bpBucket :: Lens' BucketsPatch Text
bpBucket = lens _bpBucket (\ s a -> s{_bpBucket = a})
bpPayload :: Lens' BucketsPatch Bucket
bpPayload
= lens _bpPayload (\ s a -> s{_bpPayload = a})
bpPredefinedDefaultObjectACL :: Lens' BucketsPatch (Maybe BucketsPatchPredefinedDefaultObjectACL)
bpPredefinedDefaultObjectACL
= lens _bpPredefinedDefaultObjectACL
(\ s a -> s{_bpPredefinedDefaultObjectACL = a})
bpUserProject :: Lens' BucketsPatch (Maybe Text)
bpUserProject
= lens _bpUserProject
(\ s a -> s{_bpUserProject = a})
bpIfMetagenerationNotMatch :: Lens' BucketsPatch (Maybe Int64)
bpIfMetagenerationNotMatch
= lens _bpIfMetagenerationNotMatch
(\ s a -> s{_bpIfMetagenerationNotMatch = a})
. mapping _Coerce
bpProjection :: Lens' BucketsPatch (Maybe BucketsPatchProjection)
bpProjection
= lens _bpProjection (\ s a -> s{_bpProjection = a})
instance GoogleRequest BucketsPatch where
type Rs BucketsPatch = Bucket
type Scopes BucketsPatch =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control"]
requestClient BucketsPatch'{..}
= go _bpBucket _bpIfMetagenerationMatch
_bpPredefinedACL
_bpPredefinedDefaultObjectACL
_bpUserProject
_bpIfMetagenerationNotMatch
_bpProjection
(Just AltJSON)
_bpPayload
storageService
where go
= buildClient (Proxy :: Proxy BucketsPatchResource)
mempty