{-# 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.IAM.Projects.Roles.Create
(
ProjectsRolesCreateResource
, projectsRolesCreate
, ProjectsRolesCreate
, prcParent
, prcXgafv
, prcUploadProtocol
, prcAccessToken
, prcUploadType
, prcPayload
, prcCallback
) where
import Network.Google.IAM.Types
import Network.Google.Prelude
type ProjectsRolesCreateResource =
"v1" :>
Capture "parent" Text :>
"roles" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateRoleRequest :>
Post '[JSON] Role
data ProjectsRolesCreate = ProjectsRolesCreate'
{ _prcParent :: !Text
, _prcXgafv :: !(Maybe Xgafv)
, _prcUploadProtocol :: !(Maybe Text)
, _prcAccessToken :: !(Maybe Text)
, _prcUploadType :: !(Maybe Text)
, _prcPayload :: !CreateRoleRequest
, _prcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsRolesCreate
:: Text
-> CreateRoleRequest
-> ProjectsRolesCreate
projectsRolesCreate pPrcParent_ pPrcPayload_ =
ProjectsRolesCreate'
{ _prcParent = pPrcParent_
, _prcXgafv = Nothing
, _prcUploadProtocol = Nothing
, _prcAccessToken = Nothing
, _prcUploadType = Nothing
, _prcPayload = pPrcPayload_
, _prcCallback = Nothing
}
prcParent :: Lens' ProjectsRolesCreate Text
prcParent
= lens _prcParent (\ s a -> s{_prcParent = a})
prcXgafv :: Lens' ProjectsRolesCreate (Maybe Xgafv)
prcXgafv = lens _prcXgafv (\ s a -> s{_prcXgafv = a})
prcUploadProtocol :: Lens' ProjectsRolesCreate (Maybe Text)
prcUploadProtocol
= lens _prcUploadProtocol
(\ s a -> s{_prcUploadProtocol = a})
prcAccessToken :: Lens' ProjectsRolesCreate (Maybe Text)
prcAccessToken
= lens _prcAccessToken
(\ s a -> s{_prcAccessToken = a})
prcUploadType :: Lens' ProjectsRolesCreate (Maybe Text)
prcUploadType
= lens _prcUploadType
(\ s a -> s{_prcUploadType = a})
prcPayload :: Lens' ProjectsRolesCreate CreateRoleRequest
prcPayload
= lens _prcPayload (\ s a -> s{_prcPayload = a})
prcCallback :: Lens' ProjectsRolesCreate (Maybe Text)
prcCallback
= lens _prcCallback (\ s a -> s{_prcCallback = a})
instance GoogleRequest ProjectsRolesCreate where
type Rs ProjectsRolesCreate = Role
type Scopes ProjectsRolesCreate =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient ProjectsRolesCreate'{..}
= go _prcParent _prcXgafv _prcUploadProtocol
_prcAccessToken
_prcUploadType
_prcCallback
(Just AltJSON)
_prcPayload
iAMService
where go
= buildClient
(Proxy :: Proxy ProjectsRolesCreateResource)
mempty