{-# 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.Devices.Patch
(
DevicesPatchResource
, devicesPatch
, DevicesPatch
, dpUpdateMask
, dpEnterpriseId
, dpPayload
, dpUserId
, dpDeviceId
) where
import Network.Google.AndroidEnterprise.Types
import Network.Google.Prelude
type DevicesPatchResource =
"androidenterprise" :>
"v1" :>
"enterprises" :>
Capture "enterpriseId" Text :>
"users" :>
Capture "userId" Text :>
"devices" :>
Capture "deviceId" Text :>
QueryParam "updateMask" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Device :> Patch '[JSON] Device
data DevicesPatch = DevicesPatch'
{ _dpUpdateMask :: !(Maybe Text)
, _dpEnterpriseId :: !Text
, _dpPayload :: !Device
, _dpUserId :: !Text
, _dpDeviceId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
devicesPatch
:: Text
-> Device
-> Text
-> Text
-> DevicesPatch
devicesPatch pDpEnterpriseId_ pDpPayload_ pDpUserId_ pDpDeviceId_ =
DevicesPatch'
{ _dpUpdateMask = Nothing
, _dpEnterpriseId = pDpEnterpriseId_
, _dpPayload = pDpPayload_
, _dpUserId = pDpUserId_
, _dpDeviceId = pDpDeviceId_
}
dpUpdateMask :: Lens' DevicesPatch (Maybe Text)
dpUpdateMask
= lens _dpUpdateMask (\ s a -> s{_dpUpdateMask = a})
dpEnterpriseId :: Lens' DevicesPatch Text
dpEnterpriseId
= lens _dpEnterpriseId
(\ s a -> s{_dpEnterpriseId = a})
dpPayload :: Lens' DevicesPatch Device
dpPayload
= lens _dpPayload (\ s a -> s{_dpPayload = a})
dpUserId :: Lens' DevicesPatch Text
dpUserId = lens _dpUserId (\ s a -> s{_dpUserId = a})
dpDeviceId :: Lens' DevicesPatch Text
dpDeviceId
= lens _dpDeviceId (\ s a -> s{_dpDeviceId = a})
instance GoogleRequest DevicesPatch where
type Rs DevicesPatch = Device
type Scopes DevicesPatch =
'["https://www.googleapis.com/auth/androidenterprise"]
requestClient DevicesPatch'{..}
= go _dpEnterpriseId _dpUserId _dpDeviceId
_dpUpdateMask
(Just AltJSON)
_dpPayload
androidEnterpriseService
where go
= buildClient (Proxy :: Proxy DevicesPatchResource)
mempty