{-# 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.GetIAMPolicy
(
ObjectsGetIAMPolicyResource
, objectsGetIAMPolicy
, ObjectsGetIAMPolicy
, ogipBucket
, ogipUserProject
, ogipObject
, ogipGeneration
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type ObjectsGetIAMPolicyResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
"o" :>
Capture "object" Text :>
"iam" :>
QueryParam "userProject" Text :>
QueryParam "generation" (Textual Int64) :>
QueryParam "alt" AltJSON :> Get '[JSON] Policy
data ObjectsGetIAMPolicy = ObjectsGetIAMPolicy'
{ _ogipBucket :: !Text
, _ogipUserProject :: !(Maybe Text)
, _ogipObject :: !Text
, _ogipGeneration :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
objectsGetIAMPolicy
:: Text
-> Text
-> ObjectsGetIAMPolicy
objectsGetIAMPolicy pOgipBucket_ pOgipObject_ =
ObjectsGetIAMPolicy'
{ _ogipBucket = pOgipBucket_
, _ogipUserProject = Nothing
, _ogipObject = pOgipObject_
, _ogipGeneration = Nothing
}
ogipBucket :: Lens' ObjectsGetIAMPolicy Text
ogipBucket
= lens _ogipBucket (\ s a -> s{_ogipBucket = a})
ogipUserProject :: Lens' ObjectsGetIAMPolicy (Maybe Text)
ogipUserProject
= lens _ogipUserProject
(\ s a -> s{_ogipUserProject = a})
ogipObject :: Lens' ObjectsGetIAMPolicy Text
ogipObject
= lens _ogipObject (\ s a -> s{_ogipObject = a})
ogipGeneration :: Lens' ObjectsGetIAMPolicy (Maybe Int64)
ogipGeneration
= lens _ogipGeneration
(\ s a -> s{_ogipGeneration = a})
. mapping _Coerce
instance GoogleRequest ObjectsGetIAMPolicy where
type Rs ObjectsGetIAMPolicy = Policy
type Scopes ObjectsGetIAMPolicy =
'["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 ObjectsGetIAMPolicy'{..}
= go _ogipBucket _ogipObject _ogipUserProject
_ogipGeneration
(Just AltJSON)
storageService
where go
= buildClient
(Proxy :: Proxy ObjectsGetIAMPolicyResource)
mempty