{-# 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.Enterprises.CreateWebToken
(
EnterprisesCreateWebTokenResource
, enterprisesCreateWebToken
, EnterprisesCreateWebToken
, ecwtEnterpriseId
, ecwtPayload
) where
import Network.Google.AndroidEnterprise.Types
import Network.Google.Prelude
type EnterprisesCreateWebTokenResource =
"androidenterprise" :>
"v1" :>
"enterprises" :>
Capture "enterpriseId" Text :>
"createWebToken" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AdministratorWebTokenSpec :>
Post '[JSON] AdministratorWebToken
data EnterprisesCreateWebToken = EnterprisesCreateWebToken'
{ _ecwtEnterpriseId :: !Text
, _ecwtPayload :: !AdministratorWebTokenSpec
} deriving (Eq,Show,Data,Typeable,Generic)
enterprisesCreateWebToken
:: Text
-> AdministratorWebTokenSpec
-> EnterprisesCreateWebToken
enterprisesCreateWebToken pEcwtEnterpriseId_ pEcwtPayload_ =
EnterprisesCreateWebToken'
{ _ecwtEnterpriseId = pEcwtEnterpriseId_
, _ecwtPayload = pEcwtPayload_
}
ecwtEnterpriseId :: Lens' EnterprisesCreateWebToken Text
ecwtEnterpriseId
= lens _ecwtEnterpriseId
(\ s a -> s{_ecwtEnterpriseId = a})
ecwtPayload :: Lens' EnterprisesCreateWebToken AdministratorWebTokenSpec
ecwtPayload
= lens _ecwtPayload (\ s a -> s{_ecwtPayload = a})
instance GoogleRequest EnterprisesCreateWebToken
where
type Rs EnterprisesCreateWebToken =
AdministratorWebToken
type Scopes EnterprisesCreateWebToken =
'["https://www.googleapis.com/auth/androidenterprise"]
requestClient EnterprisesCreateWebToken'{..}
= go _ecwtEnterpriseId (Just AltJSON) _ecwtPayload
androidEnterpriseService
where go
= buildClient
(Proxy :: Proxy EnterprisesCreateWebTokenResource)
mempty