{-# 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.TestIAMPermissions
(
ObjectsTestIAMPermissionsResource
, objectsTestIAMPermissions
, ObjectsTestIAMPermissions
, otipBucket
, otipUserProject
, otipObject
, otipPermissions
, otipGeneration
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type ObjectsTestIAMPermissionsResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"o" :>
Capture "object" Text :>
"iam" :>
"testPermissions" :>
QueryParams "permissions" Text :>
QueryParam "userProject" Text :>
QueryParam "generation" (Textual Int64) :>
QueryParam "alt" AltJSON :>
Get '[JSON] TestIAMPermissionsResponse
data ObjectsTestIAMPermissions = ObjectsTestIAMPermissions'
{ _otipBucket :: !Text
, _otipUserProject :: !(Maybe Text)
, _otipObject :: !Text
, _otipPermissions :: ![Text]
, _otipGeneration :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
objectsTestIAMPermissions
:: Text
-> Text
-> [Text]
-> ObjectsTestIAMPermissions
objectsTestIAMPermissions pOtipBucket_ pOtipObject_ pOtipPermissions_ =
ObjectsTestIAMPermissions'
{ _otipBucket = pOtipBucket_
, _otipUserProject = Nothing
, _otipObject = pOtipObject_
, _otipPermissions = _Coerce # pOtipPermissions_
, _otipGeneration = Nothing
}
otipBucket :: Lens' ObjectsTestIAMPermissions Text
otipBucket
= lens _otipBucket (\ s a -> s{_otipBucket = a})
otipUserProject :: Lens' ObjectsTestIAMPermissions (Maybe Text)
otipUserProject
= lens _otipUserProject
(\ s a -> s{_otipUserProject = a})
otipObject :: Lens' ObjectsTestIAMPermissions Text
otipObject
= lens _otipObject (\ s a -> s{_otipObject = a})
otipPermissions :: Lens' ObjectsTestIAMPermissions [Text]
otipPermissions
= lens _otipPermissions
(\ s a -> s{_otipPermissions = a})
. _Coerce
otipGeneration :: Lens' ObjectsTestIAMPermissions (Maybe Int64)
otipGeneration
= lens _otipGeneration
(\ s a -> s{_otipGeneration = a})
. mapping _Coerce
instance GoogleRequest ObjectsTestIAMPermissions
where
type Rs ObjectsTestIAMPermissions =
TestIAMPermissionsResponse
type Scopes ObjectsTestIAMPermissions =
'["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 ObjectsTestIAMPermissions'{..}
= go _otipBucket _otipObject _otipPermissions
_otipUserProject
_otipGeneration
(Just AltJSON)
storageService
where go
= buildClient
(Proxy :: Proxy ObjectsTestIAMPermissionsResource)
mempty