{-# 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.SetIAMPolicy
(
BucketsSetIAMPolicyResource
, bucketsSetIAMPolicy
, BucketsSetIAMPolicy
, bsipBucket
, bsipPayload
, bsipUserProject
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsSetIAMPolicyResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"iam" :>
QueryParam "userProject" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Policy :> Put '[JSON] Policy
data BucketsSetIAMPolicy = BucketsSetIAMPolicy'
{ _bsipBucket :: !Text
, _bsipPayload :: !Policy
, _bsipUserProject :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketsSetIAMPolicy
:: Text
-> Policy
-> BucketsSetIAMPolicy
bucketsSetIAMPolicy pBsipBucket_ pBsipPayload_ =
BucketsSetIAMPolicy'
{ _bsipBucket = pBsipBucket_
, _bsipPayload = pBsipPayload_
, _bsipUserProject = Nothing
}
bsipBucket :: Lens' BucketsSetIAMPolicy Text
bsipBucket
= lens _bsipBucket (\ s a -> s{_bsipBucket = a})
bsipPayload :: Lens' BucketsSetIAMPolicy Policy
bsipPayload
= lens _bsipPayload (\ s a -> s{_bsipPayload = a})
bsipUserProject :: Lens' BucketsSetIAMPolicy (Maybe Text)
bsipUserProject
= lens _bsipUserProject
(\ s a -> s{_bsipUserProject = a})
instance GoogleRequest BucketsSetIAMPolicy where
type Rs BucketsSetIAMPolicy = Policy
type Scopes BucketsSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient BucketsSetIAMPolicy'{..}
= go _bsipBucket _bsipUserProject (Just AltJSON)
_bsipPayload
storageService
where go
= buildClient
(Proxy :: Proxy BucketsSetIAMPolicyResource)
mempty