{-# 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.List
(
UsersDataSourcesListResource
, usersDataSourcesList
, UsersDataSourcesList
, udslDataTypeName
, udslUserId
) where
import Network.Google.Fitness.Types
import Network.Google.Prelude
type UsersDataSourcesListResource =
"fitness" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"dataSources" :>
QueryParams "dataTypeName" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] ListDataSourcesResponse
data UsersDataSourcesList = UsersDataSourcesList'
{ _udslDataTypeName :: !(Maybe [Text])
, _udslUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersDataSourcesList
:: Text
-> UsersDataSourcesList
usersDataSourcesList pUdslUserId_ =
UsersDataSourcesList'
{ _udslDataTypeName = Nothing
, _udslUserId = pUdslUserId_
}
udslDataTypeName :: Lens' UsersDataSourcesList [Text]
udslDataTypeName
= lens _udslDataTypeName
(\ s a -> s{_udslDataTypeName = a})
. _Default
. _Coerce
udslUserId :: Lens' UsersDataSourcesList Text
udslUserId
= lens _udslUserId (\ s a -> s{_udslUserId = a})
instance GoogleRequest UsersDataSourcesList where
type Rs UsersDataSourcesList =
ListDataSourcesResponse
type Scopes UsersDataSourcesList =
'["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 UsersDataSourcesList'{..}
= go _udslUserId (_udslDataTypeName ^. _Default)
(Just AltJSON)
fitnessService
where go
= buildClient
(Proxy :: Proxy UsersDataSourcesListResource)
mempty