{-# 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.DataSets.Patch
(
UsersDataSourcesDataSetsPatchResource
, usersDataSourcesDataSetsPatch
, UsersDataSourcesDataSetsPatch
, udsdspDataSourceId
, udsdspPayload
, udsdspUserId
, udsdspDataSetId
, udsdspCurrentTimeMillis
) where
import Network.Google.Fitness.Types
import Network.Google.Prelude
type UsersDataSourcesDataSetsPatchResource =
"fitness" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"dataSources" :>
Capture "dataSourceId" Text :>
"datasets" :>
Capture "datasetId" Text :>
QueryParam "currentTimeMillis" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DataSet :> Patch '[JSON] DataSet
data UsersDataSourcesDataSetsPatch = UsersDataSourcesDataSetsPatch'
{ _udsdspDataSourceId :: !Text
, _udsdspPayload :: !DataSet
, _udsdspUserId :: !Text
, _udsdspDataSetId :: !Text
, _udsdspCurrentTimeMillis :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
usersDataSourcesDataSetsPatch
:: Text
-> DataSet
-> Text
-> Text
-> UsersDataSourcesDataSetsPatch
usersDataSourcesDataSetsPatch pUdsdspDataSourceId_ pUdsdspPayload_ pUdsdspUserId_ pUdsdspDataSetId_ =
UsersDataSourcesDataSetsPatch'
{ _udsdspDataSourceId = pUdsdspDataSourceId_
, _udsdspPayload = pUdsdspPayload_
, _udsdspUserId = pUdsdspUserId_
, _udsdspDataSetId = pUdsdspDataSetId_
, _udsdspCurrentTimeMillis = Nothing
}
udsdspDataSourceId :: Lens' UsersDataSourcesDataSetsPatch Text
udsdspDataSourceId
= lens _udsdspDataSourceId
(\ s a -> s{_udsdspDataSourceId = a})
udsdspPayload :: Lens' UsersDataSourcesDataSetsPatch DataSet
udsdspPayload
= lens _udsdspPayload
(\ s a -> s{_udsdspPayload = a})
udsdspUserId :: Lens' UsersDataSourcesDataSetsPatch Text
udsdspUserId
= lens _udsdspUserId (\ s a -> s{_udsdspUserId = a})
udsdspDataSetId :: Lens' UsersDataSourcesDataSetsPatch Text
udsdspDataSetId
= lens _udsdspDataSetId
(\ s a -> s{_udsdspDataSetId = a})
udsdspCurrentTimeMillis :: Lens' UsersDataSourcesDataSetsPatch (Maybe Int64)
udsdspCurrentTimeMillis
= lens _udsdspCurrentTimeMillis
(\ s a -> s{_udsdspCurrentTimeMillis = a})
. mapping _Coerce
instance GoogleRequest UsersDataSourcesDataSetsPatch
where
type Rs UsersDataSourcesDataSetsPatch = DataSet
type Scopes UsersDataSourcesDataSetsPatch =
'["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 UsersDataSourcesDataSetsPatch'{..}
= go _udsdspUserId _udsdspDataSourceId
_udsdspDataSetId
_udsdspCurrentTimeMillis
(Just AltJSON)
_udsdspPayload
fitnessService
where go
= buildClient
(Proxy ::
Proxy UsersDataSourcesDataSetsPatchResource)
mempty