{-# 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.Entitlements.Update
(
EntitlementsUpdateResource
, entitlementsUpdate
, EntitlementsUpdate
, euEntitlementId
, euEnterpriseId
, euPayload
, euInstall
, euUserId
) where
import Network.Google.AndroidEnterprise.Types
import Network.Google.Prelude
type EntitlementsUpdateResource =
"androidenterprise" :>
"v1" :>
"enterprises" :>
Capture "enterpriseId" Text :>
"users" :>
Capture "userId" Text :>
"entitlements" :>
Capture "entitlementId" Text :>
QueryParam "install" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Entitlement :>
Put '[JSON] Entitlement
data EntitlementsUpdate = EntitlementsUpdate'
{ _euEntitlementId :: !Text
, _euEnterpriseId :: !Text
, _euPayload :: !Entitlement
, _euInstall :: !(Maybe Bool)
, _euUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
entitlementsUpdate
:: Text
-> Text
-> Entitlement
-> Text
-> EntitlementsUpdate
entitlementsUpdate pEuEntitlementId_ pEuEnterpriseId_ pEuPayload_ pEuUserId_ =
EntitlementsUpdate'
{ _euEntitlementId = pEuEntitlementId_
, _euEnterpriseId = pEuEnterpriseId_
, _euPayload = pEuPayload_
, _euInstall = Nothing
, _euUserId = pEuUserId_
}
euEntitlementId :: Lens' EntitlementsUpdate Text
euEntitlementId
= lens _euEntitlementId
(\ s a -> s{_euEntitlementId = a})
euEnterpriseId :: Lens' EntitlementsUpdate Text
euEnterpriseId
= lens _euEnterpriseId
(\ s a -> s{_euEnterpriseId = a})
euPayload :: Lens' EntitlementsUpdate Entitlement
euPayload
= lens _euPayload (\ s a -> s{_euPayload = a})
euInstall :: Lens' EntitlementsUpdate (Maybe Bool)
euInstall
= lens _euInstall (\ s a -> s{_euInstall = a})
euUserId :: Lens' EntitlementsUpdate Text
euUserId = lens _euUserId (\ s a -> s{_euUserId = a})
instance GoogleRequest EntitlementsUpdate where
type Rs EntitlementsUpdate = Entitlement
type Scopes EntitlementsUpdate =
'["https://www.googleapis.com/auth/androidenterprise"]
requestClient EntitlementsUpdate'{..}
= go _euEnterpriseId _euUserId _euEntitlementId
_euInstall
(Just AltJSON)
_euPayload
androidEnterpriseService
where go
= buildClient
(Proxy :: Proxy EntitlementsUpdateResource)
mempty