{-# 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.Objects.SetIAMPolicy
(
ObjectsSetIAMPolicyResource
, objectsSetIAMPolicy
, ObjectsSetIAMPolicy
, osipBucket
, osipPayload
, osipUserProject
, osipObject
, osipGeneration
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type ObjectsSetIAMPolicyResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"o" :>
Capture "object" Text :>
"iam" :>
QueryParam "userProject" Text :>
QueryParam "generation" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Policy :> Put '[JSON] Policy
data ObjectsSetIAMPolicy = ObjectsSetIAMPolicy'
{ _osipBucket :: !Text
, _osipPayload :: !Policy
, _osipUserProject :: !(Maybe Text)
, _osipObject :: !Text
, _osipGeneration :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
objectsSetIAMPolicy
:: Text
-> Policy
-> Text
-> ObjectsSetIAMPolicy
objectsSetIAMPolicy pOsipBucket_ pOsipPayload_ pOsipObject_ =
ObjectsSetIAMPolicy'
{ _osipBucket = pOsipBucket_
, _osipPayload = pOsipPayload_
, _osipUserProject = Nothing
, _osipObject = pOsipObject_
, _osipGeneration = Nothing
}
osipBucket :: Lens' ObjectsSetIAMPolicy Text
osipBucket
= lens _osipBucket (\ s a -> s{_osipBucket = a})
osipPayload :: Lens' ObjectsSetIAMPolicy Policy
osipPayload
= lens _osipPayload (\ s a -> s{_osipPayload = a})
osipUserProject :: Lens' ObjectsSetIAMPolicy (Maybe Text)
osipUserProject
= lens _osipUserProject
(\ s a -> s{_osipUserProject = a})
osipObject :: Lens' ObjectsSetIAMPolicy Text
osipObject
= lens _osipObject (\ s a -> s{_osipObject = a})
osipGeneration :: Lens' ObjectsSetIAMPolicy (Maybe Int64)
osipGeneration
= lens _osipGeneration
(\ s a -> s{_osipGeneration = a})
. mapping _Coerce
instance GoogleRequest ObjectsSetIAMPolicy where
type Rs ObjectsSetIAMPolicy = Policy
type Scopes ObjectsSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient ObjectsSetIAMPolicy'{..}
= go _osipBucket _osipObject _osipUserProject
_osipGeneration
(Just AltJSON)
_osipPayload
storageService
where go
= buildClient
(Proxy :: Proxy ObjectsSetIAMPolicyResource)
mempty