{-# 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.Compute.Snapshots.GetIAMPolicy
(
SnapshotsGetIAMPolicyResource
, snapshotsGetIAMPolicy
, SnapshotsGetIAMPolicy
, sgiampProject
, sgiampResource
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type SnapshotsGetIAMPolicyResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"snapshots" :>
Capture "resource" Text :>
"getIamPolicy" :>
QueryParam "alt" AltJSON :> Get '[JSON] Policy
data SnapshotsGetIAMPolicy = SnapshotsGetIAMPolicy'
{ _sgiampProject :: !Text
, _sgiampResource :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
snapshotsGetIAMPolicy
:: Text
-> Text
-> SnapshotsGetIAMPolicy
snapshotsGetIAMPolicy pSgiampProject_ pSgiampResource_ =
SnapshotsGetIAMPolicy'
{ _sgiampProject = pSgiampProject_
, _sgiampResource = pSgiampResource_
}
sgiampProject :: Lens' SnapshotsGetIAMPolicy Text
sgiampProject
= lens _sgiampProject
(\ s a -> s{_sgiampProject = a})
sgiampResource :: Lens' SnapshotsGetIAMPolicy Text
sgiampResource
= lens _sgiampResource
(\ s a -> s{_sgiampResource = a})
instance GoogleRequest SnapshotsGetIAMPolicy where
type Rs SnapshotsGetIAMPolicy = Policy
type Scopes SnapshotsGetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"]
requestClient SnapshotsGetIAMPolicy'{..}
= go _sgiampProject _sgiampResource (Just AltJSON)
computeService
where go
= buildClient
(Proxy :: Proxy SnapshotsGetIAMPolicyResource)
mempty