{-# 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.Users.Insert
(
UsersInsertResource
, usersInsert
, UsersInsert
, uiPayload
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type UsersInsertResource =
"admin" :>
"directory" :>
"v1" :>
"users" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] User :> Post '[JSON] User
newtype UsersInsert = UsersInsert'
{ _uiPayload :: User
} deriving (Eq,Show,Data,Typeable,Generic)
usersInsert
:: User
-> UsersInsert
usersInsert pUiPayload_ =
UsersInsert'
{ _uiPayload = pUiPayload_
}
uiPayload :: Lens' UsersInsert User
uiPayload
= lens _uiPayload (\ s a -> s{_uiPayload = a})
instance GoogleRequest UsersInsert where
type Rs UsersInsert = User
type Scopes UsersInsert =
'["https://www.googleapis.com/auth/admin.directory.user"]
requestClient UsersInsert'{..}
= go (Just AltJSON) _uiPayload directoryService
where go
= buildClient (Proxy :: Proxy UsersInsertResource)
mempty