{-# 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.AndroidEnterprise.Users.GenerateToken
(
UsersGenerateTokenResource
, usersGenerateToken
, UsersGenerateToken
, ugtEnterpriseId
, ugtUserId
) where
import Network.Google.AndroidEnterprise.Types
import Network.Google.Prelude
type UsersGenerateTokenResource =
"androidenterprise" :>
"v1" :>
"enterprises" :>
Capture "enterpriseId" Text :>
"users" :>
Capture "userId" Text :>
"token" :>
QueryParam "alt" AltJSON :> Post '[JSON] UserToken
data UsersGenerateToken = UsersGenerateToken'
{ _ugtEnterpriseId :: !Text
, _ugtUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersGenerateToken
:: Text
-> Text
-> UsersGenerateToken
usersGenerateToken pUgtEnterpriseId_ pUgtUserId_ =
UsersGenerateToken'
{ _ugtEnterpriseId = pUgtEnterpriseId_
, _ugtUserId = pUgtUserId_
}
ugtEnterpriseId :: Lens' UsersGenerateToken Text
ugtEnterpriseId
= lens _ugtEnterpriseId
(\ s a -> s{_ugtEnterpriseId = a})
ugtUserId :: Lens' UsersGenerateToken Text
ugtUserId
= lens _ugtUserId (\ s a -> s{_ugtUserId = a})
instance GoogleRequest UsersGenerateToken where
type Rs UsersGenerateToken = UserToken
type Scopes UsersGenerateToken =
'["https://www.googleapis.com/auth/androidenterprise"]
requestClient UsersGenerateToken'{..}
= go _ugtEnterpriseId _ugtUserId (Just AltJSON)
androidEnterpriseService
where go
= buildClient
(Proxy :: Proxy UsersGenerateTokenResource)
mempty