{-# 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.DataSet.Aggregate
(
UsersDataSetAggregateResource
, usersDataSetAggregate
, UsersDataSetAggregate
, udsaPayload
, udsaUserId
) where
import Network.Google.Fitness.Types
import Network.Google.Prelude
type UsersDataSetAggregateResource =
"fitness" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"dataset:aggregate" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AggregateRequest :>
Post '[JSON] AggregateResponse
data UsersDataSetAggregate = UsersDataSetAggregate'
{ _udsaPayload :: !AggregateRequest
, _udsaUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersDataSetAggregate
:: AggregateRequest
-> Text
-> UsersDataSetAggregate
usersDataSetAggregate pUdsaPayload_ pUdsaUserId_ =
UsersDataSetAggregate'
{ _udsaPayload = pUdsaPayload_
, _udsaUserId = pUdsaUserId_
}
udsaPayload :: Lens' UsersDataSetAggregate AggregateRequest
udsaPayload
= lens _udsaPayload (\ s a -> s{_udsaPayload = a})
udsaUserId :: Lens' UsersDataSetAggregate Text
udsaUserId
= lens _udsaUserId (\ s a -> s{_udsaUserId = a})
instance GoogleRequest UsersDataSetAggregate where
type Rs UsersDataSetAggregate = AggregateResponse
type Scopes UsersDataSetAggregate =
'["https://www.googleapis.com/auth/fitness.activity.read",
"https://www.googleapis.com/auth/fitness.activity.write",
"https://www.googleapis.com/auth/fitness.blood_glucose.read",
"https://www.googleapis.com/auth/fitness.blood_glucose.write",
"https://www.googleapis.com/auth/fitness.blood_pressure.read",
"https://www.googleapis.com/auth/fitness.blood_pressure.write",
"https://www.googleapis.com/auth/fitness.body.read",
"https://www.googleapis.com/auth/fitness.body.write",
"https://www.googleapis.com/auth/fitness.body_temperature.read",
"https://www.googleapis.com/auth/fitness.body_temperature.write",
"https://www.googleapis.com/auth/fitness.location.read",
"https://www.googleapis.com/auth/fitness.location.write",
"https://www.googleapis.com/auth/fitness.nutrition.read",
"https://www.googleapis.com/auth/fitness.nutrition.write",
"https://www.googleapis.com/auth/fitness.oxygen_saturation.read",
"https://www.googleapis.com/auth/fitness.oxygen_saturation.write",
"https://www.googleapis.com/auth/fitness.reproductive_health.read",
"https://www.googleapis.com/auth/fitness.reproductive_health.write"]
requestClient UsersDataSetAggregate'{..}
= go _udsaUserId (Just AltJSON) _udsaPayload
fitnessService
where go
= buildClient
(Proxy :: Proxy UsersDataSetAggregateResource)
mempty