{-# 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.Roles.Insert
(
RolesInsertResource
, rolesInsert
, RolesInsert
, riPayload
, riCustomer
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type RolesInsertResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customer" Text :>
"roles" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Role :> Post '[JSON] Role
data RolesInsert = RolesInsert'
{ _riPayload :: !Role
, _riCustomer :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
rolesInsert
:: Role
-> Text
-> RolesInsert
rolesInsert pRiPayload_ pRiCustomer_ =
RolesInsert'
{ _riPayload = pRiPayload_
, _riCustomer = pRiCustomer_
}
riPayload :: Lens' RolesInsert Role
riPayload
= lens _riPayload (\ s a -> s{_riPayload = a})
riCustomer :: Lens' RolesInsert Text
riCustomer
= lens _riCustomer (\ s a -> s{_riCustomer = a})
instance GoogleRequest RolesInsert where
type Rs RolesInsert = Role
type Scopes RolesInsert =
'["https://www.googleapis.com/auth/admin.directory.rolemanagement"]
requestClient RolesInsert'{..}
= go _riCustomer (Just AltJSON) _riPayload
directoryService
where go
= buildClient (Proxy :: Proxy RolesInsertResource)
mempty