{-# 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
-- | create user.
--
-- /See:/ 'usersInsert' smart constructor.
newtype UsersInsert = UsersInsert'
{ _uiPayload :: User
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'UsersInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'uiPayload'
usersInsert
:: User -- ^ 'uiPayload'
-> UsersInsert
usersInsert pUiPayload_ =
UsersInsert'
{ _uiPayload = pUiPayload_
}
-- | Multipart request metadata.
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