{-# 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.GetIAMPolicy
(
BucketsGetIAMPolicyResource
, bucketsGetIAMPolicy
, BucketsGetIAMPolicy
, bgipBucket
, bgipUserProject
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsGetIAMPolicyResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"iam" :>
QueryParam "userProject" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Policy
data BucketsGetIAMPolicy = BucketsGetIAMPolicy'
{ _bgipBucket :: !Text
, _bgipUserProject :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketsGetIAMPolicy
:: Text
-> BucketsGetIAMPolicy
bucketsGetIAMPolicy pBgipBucket_ =
BucketsGetIAMPolicy'
{ _bgipBucket = pBgipBucket_
, _bgipUserProject = Nothing
}
bgipBucket :: Lens' BucketsGetIAMPolicy Text
bgipBucket
= lens _bgipBucket (\ s a -> s{_bgipBucket = a})
bgipUserProject :: Lens' BucketsGetIAMPolicy (Maybe Text)
bgipUserProject
= lens _bgipUserProject
(\ s a -> s{_bgipUserProject = a})
instance GoogleRequest BucketsGetIAMPolicy where
type Rs BucketsGetIAMPolicy = Policy
type Scopes BucketsGetIAMPolicy =
'["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 BucketsGetIAMPolicy'{..}
= go _bgipBucket _bgipUserProject (Just AltJSON)
storageService
where go
= buildClient
(Proxy :: Proxy BucketsGetIAMPolicyResource)
mempty