{-# 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.ObjectAccessControls.Patch
(
ObjectAccessControlsPatchResource
, objectAccessControlsPatch
, ObjectAccessControlsPatch
, oacpBucket
, oacpPayload
, oacpUserProject
, oacpObject
, oacpEntity
, oacpGeneration
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type ObjectAccessControlsPatchResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"o" :>
Capture "object" Text :>
"acl" :>
Capture "entity" Text :>
QueryParam "userProject" Text :>
QueryParam "generation" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ObjectAccessControl :>
Patch '[JSON] ObjectAccessControl
data ObjectAccessControlsPatch = ObjectAccessControlsPatch'
{ _oacpBucket :: !Text
, _oacpPayload :: !ObjectAccessControl
, _oacpUserProject :: !(Maybe Text)
, _oacpObject :: !Text
, _oacpEntity :: !Text
, _oacpGeneration :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
objectAccessControlsPatch
:: Text
-> ObjectAccessControl
-> Text
-> Text
-> ObjectAccessControlsPatch
objectAccessControlsPatch pOacpBucket_ pOacpPayload_ pOacpObject_ pOacpEntity_ =
ObjectAccessControlsPatch'
{ _oacpBucket = pOacpBucket_
, _oacpPayload = pOacpPayload_
, _oacpUserProject = Nothing
, _oacpObject = pOacpObject_
, _oacpEntity = pOacpEntity_
, _oacpGeneration = Nothing
}
oacpBucket :: Lens' ObjectAccessControlsPatch Text
oacpBucket
= lens _oacpBucket (\ s a -> s{_oacpBucket = a})
oacpPayload :: Lens' ObjectAccessControlsPatch ObjectAccessControl
oacpPayload
= lens _oacpPayload (\ s a -> s{_oacpPayload = a})
oacpUserProject :: Lens' ObjectAccessControlsPatch (Maybe Text)
oacpUserProject
= lens _oacpUserProject
(\ s a -> s{_oacpUserProject = a})
oacpObject :: Lens' ObjectAccessControlsPatch Text
oacpObject
= lens _oacpObject (\ s a -> s{_oacpObject = a})
oacpEntity :: Lens' ObjectAccessControlsPatch Text
oacpEntity
= lens _oacpEntity (\ s a -> s{_oacpEntity = a})
oacpGeneration :: Lens' ObjectAccessControlsPatch (Maybe Int64)
oacpGeneration
= lens _oacpGeneration
(\ s a -> s{_oacpGeneration = a})
. mapping _Coerce
instance GoogleRequest ObjectAccessControlsPatch
where
type Rs ObjectAccessControlsPatch =
ObjectAccessControl
type Scopes ObjectAccessControlsPatch =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control"]
requestClient ObjectAccessControlsPatch'{..}
= go _oacpBucket _oacpObject _oacpEntity
_oacpUserProject
_oacpGeneration
(Just AltJSON)
_oacpPayload
storageService
where go
= buildClient
(Proxy :: Proxy ObjectAccessControlsPatchResource)
mempty