{-# 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.Organizations.Roles.Create
(
OrganizationsRolesCreateResource
, organizationsRolesCreate
, OrganizationsRolesCreate
, orcParent
, orcXgafv
, orcUploadProtocol
, orcAccessToken
, orcUploadType
, orcPayload
, orcCallback
) where
import Network.Google.IAM.Types
import Network.Google.Prelude
type OrganizationsRolesCreateResource =
"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 OrganizationsRolesCreate = OrganizationsRolesCreate'
{ _orcParent :: !Text
, _orcXgafv :: !(Maybe Xgafv)
, _orcUploadProtocol :: !(Maybe Text)
, _orcAccessToken :: !(Maybe Text)
, _orcUploadType :: !(Maybe Text)
, _orcPayload :: !CreateRoleRequest
, _orcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
organizationsRolesCreate
:: Text
-> CreateRoleRequest
-> OrganizationsRolesCreate
organizationsRolesCreate pOrcParent_ pOrcPayload_ =
OrganizationsRolesCreate'
{ _orcParent = pOrcParent_
, _orcXgafv = Nothing
, _orcUploadProtocol = Nothing
, _orcAccessToken = Nothing
, _orcUploadType = Nothing
, _orcPayload = pOrcPayload_
, _orcCallback = Nothing
}
orcParent :: Lens' OrganizationsRolesCreate Text
orcParent
= lens _orcParent (\ s a -> s{_orcParent = a})
orcXgafv :: Lens' OrganizationsRolesCreate (Maybe Xgafv)
orcXgafv = lens _orcXgafv (\ s a -> s{_orcXgafv = a})
orcUploadProtocol :: Lens' OrganizationsRolesCreate (Maybe Text)
orcUploadProtocol
= lens _orcUploadProtocol
(\ s a -> s{_orcUploadProtocol = a})
orcAccessToken :: Lens' OrganizationsRolesCreate (Maybe Text)
orcAccessToken
= lens _orcAccessToken
(\ s a -> s{_orcAccessToken = a})
orcUploadType :: Lens' OrganizationsRolesCreate (Maybe Text)
orcUploadType
= lens _orcUploadType
(\ s a -> s{_orcUploadType = a})
orcPayload :: Lens' OrganizationsRolesCreate CreateRoleRequest
orcPayload
= lens _orcPayload (\ s a -> s{_orcPayload = a})
orcCallback :: Lens' OrganizationsRolesCreate (Maybe Text)
orcCallback
= lens _orcCallback (\ s a -> s{_orcCallback = a})
instance GoogleRequest OrganizationsRolesCreate where
type Rs OrganizationsRolesCreate = Role
type Scopes OrganizationsRolesCreate =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient OrganizationsRolesCreate'{..}
= go _orcParent _orcXgafv _orcUploadProtocol
_orcAccessToken
_orcUploadType
_orcCallback
(Just AltJSON)
_orcPayload
iAMService
where go
= buildClient
(Proxy :: Proxy OrganizationsRolesCreateResource)
mempty