{-# 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.Directory.RoleAssignments.Insert
(
RoleAssignmentsInsertResource
, roleAssignmentsInsert
, RoleAssignmentsInsert
, raiPayload
, raiCustomer
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type RoleAssignmentsInsertResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customer" Text :>
"roleassignments" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] RoleAssignment :>
Post '[JSON] RoleAssignment
data RoleAssignmentsInsert = RoleAssignmentsInsert'
{ _raiPayload :: !RoleAssignment
, _raiCustomer :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
roleAssignmentsInsert
:: RoleAssignment
-> Text
-> RoleAssignmentsInsert
roleAssignmentsInsert pRaiPayload_ pRaiCustomer_ =
RoleAssignmentsInsert'
{ _raiPayload = pRaiPayload_
, _raiCustomer = pRaiCustomer_
}
raiPayload :: Lens' RoleAssignmentsInsert RoleAssignment
raiPayload
= lens _raiPayload (\ s a -> s{_raiPayload = a})
raiCustomer :: Lens' RoleAssignmentsInsert Text
raiCustomer
= lens _raiCustomer (\ s a -> s{_raiCustomer = a})
instance GoogleRequest RoleAssignmentsInsert where
type Rs RoleAssignmentsInsert = RoleAssignment
type Scopes RoleAssignmentsInsert =
'["https://www.googleapis.com/auth/admin.directory.rolemanagement"]
requestClient RoleAssignmentsInsert'{..}
= go _raiCustomer (Just AltJSON) _raiPayload
directoryService
where go
= buildClient
(Proxy :: Proxy RoleAssignmentsInsertResource)
mempty