{-# 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.TestIAMPermissions
(
BucketsTestIAMPermissionsResource
, bucketsTestIAMPermissions
, BucketsTestIAMPermissions
, btipBucket
, btipUserProject
, btipPermissions
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsTestIAMPermissionsResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"iam" :>
"testPermissions" :>
QueryParams "permissions" Text :>
QueryParam "userProject" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] TestIAMPermissionsResponse
data BucketsTestIAMPermissions = BucketsTestIAMPermissions'
{ _btipBucket :: !Text
, _btipUserProject :: !(Maybe Text)
, _btipPermissions :: ![Text]
} deriving (Eq,Show,Data,Typeable,Generic)
bucketsTestIAMPermissions
:: Text
-> [Text]
-> BucketsTestIAMPermissions
bucketsTestIAMPermissions pBtipBucket_ pBtipPermissions_ =
BucketsTestIAMPermissions'
{ _btipBucket = pBtipBucket_
, _btipUserProject = Nothing
, _btipPermissions = _Coerce # pBtipPermissions_
}
btipBucket :: Lens' BucketsTestIAMPermissions Text
btipBucket
= lens _btipBucket (\ s a -> s{_btipBucket = a})
btipUserProject :: Lens' BucketsTestIAMPermissions (Maybe Text)
btipUserProject
= lens _btipUserProject
(\ s a -> s{_btipUserProject = a})
btipPermissions :: Lens' BucketsTestIAMPermissions [Text]
btipPermissions
= lens _btipPermissions
(\ s a -> s{_btipPermissions = a})
. _Coerce
instance GoogleRequest BucketsTestIAMPermissions
where
type Rs BucketsTestIAMPermissions =
TestIAMPermissionsResponse
type Scopes BucketsTestIAMPermissions =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient BucketsTestIAMPermissions'{..}
= go _btipBucket _btipPermissions _btipUserProject
(Just AltJSON)
storageService
where go
= buildClient
(Proxy :: Proxy BucketsTestIAMPermissionsResource)
mempty