{-# 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.Fitness.Users.DataSources.Patch
(
UsersDataSourcesPatchResource
, usersDataSourcesPatch
, UsersDataSourcesPatch
, udspDataSourceId
, udspPayload
, udspUserId
) where
import Network.Google.Fitness.Types
import Network.Google.Prelude
type UsersDataSourcesPatchResource =
"fitness" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"dataSources" :>
Capture "dataSourceId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DataSource :>
Patch '[JSON] DataSource
data UsersDataSourcesPatch = UsersDataSourcesPatch'
{ _udspDataSourceId :: !Text
, _udspPayload :: !DataSource
, _udspUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersDataSourcesPatch
:: Text
-> DataSource
-> Text
-> UsersDataSourcesPatch
usersDataSourcesPatch pUdspDataSourceId_ pUdspPayload_ pUdspUserId_ =
UsersDataSourcesPatch'
{ _udspDataSourceId = pUdspDataSourceId_
, _udspPayload = pUdspPayload_
, _udspUserId = pUdspUserId_
}
udspDataSourceId :: Lens' UsersDataSourcesPatch Text
udspDataSourceId
= lens _udspDataSourceId
(\ s a -> s{_udspDataSourceId = a})
udspPayload :: Lens' UsersDataSourcesPatch DataSource
udspPayload
= lens _udspPayload (\ s a -> s{_udspPayload = a})
udspUserId :: Lens' UsersDataSourcesPatch Text
udspUserId
= lens _udspUserId (\ s a -> s{_udspUserId = a})
instance GoogleRequest UsersDataSourcesPatch where
type Rs UsersDataSourcesPatch = DataSource
type Scopes UsersDataSourcesPatch =
'["https://www.googleapis.com/auth/fitness.activity.write",
"https://www.googleapis.com/auth/fitness.blood_glucose.write",
"https://www.googleapis.com/auth/fitness.blood_pressure.write",
"https://www.googleapis.com/auth/fitness.body.write",
"https://www.googleapis.com/auth/fitness.body_temperature.write",
"https://www.googleapis.com/auth/fitness.location.write",
"https://www.googleapis.com/auth/fitness.nutrition.write",
"https://www.googleapis.com/auth/fitness.oxygen_saturation.write",
"https://www.googleapis.com/auth/fitness.reproductive_health.write"]
requestClient UsersDataSourcesPatch'{..}
= go _udspUserId _udspDataSourceId (Just AltJSON)
_udspPayload
fitnessService
where go
= buildClient
(Proxy :: Proxy UsersDataSourcesPatchResource)
mempty