{-# 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.Update
(
UsersDataSourcesUpdateResource
, usersDataSourcesUpdate
, UsersDataSourcesUpdate
, udsuDataSourceId
, udsuPayload
, udsuUserId
) where
import Network.Google.Fitness.Types
import Network.Google.Prelude
type UsersDataSourcesUpdateResource =
"fitness" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"dataSources" :>
Capture "dataSourceId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DataSource :> Put '[JSON] DataSource
data UsersDataSourcesUpdate = UsersDataSourcesUpdate'
{ _udsuDataSourceId :: !Text
, _udsuPayload :: !DataSource
, _udsuUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersDataSourcesUpdate
:: Text
-> DataSource
-> Text
-> UsersDataSourcesUpdate
usersDataSourcesUpdate pUdsuDataSourceId_ pUdsuPayload_ pUdsuUserId_ =
UsersDataSourcesUpdate'
{ _udsuDataSourceId = pUdsuDataSourceId_
, _udsuPayload = pUdsuPayload_
, _udsuUserId = pUdsuUserId_
}
udsuDataSourceId :: Lens' UsersDataSourcesUpdate Text
udsuDataSourceId
= lens _udsuDataSourceId
(\ s a -> s{_udsuDataSourceId = a})
udsuPayload :: Lens' UsersDataSourcesUpdate DataSource
udsuPayload
= lens _udsuPayload (\ s a -> s{_udsuPayload = a})
udsuUserId :: Lens' UsersDataSourcesUpdate Text
udsuUserId
= lens _udsuUserId (\ s a -> s{_udsuUserId = a})
instance GoogleRequest UsersDataSourcesUpdate where
type Rs UsersDataSourcesUpdate = DataSource
type Scopes UsersDataSourcesUpdate =
'["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 UsersDataSourcesUpdate'{..}
= go _udsuUserId _udsuDataSourceId (Just AltJSON)
_udsuPayload
fitnessService
where go
= buildClient
(Proxy :: Proxy UsersDataSourcesUpdateResource)
mempty