{-# 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.Sessions.List
(
UsersSessionsListResource
, usersSessionsList
, UsersSessionsList
, uslStartTime
, uslUserId
, uslEndTime
, uslPageToken
, uslIncludeDeleted
) where
import Network.Google.Fitness.Types
import Network.Google.Prelude
type UsersSessionsListResource =
"fitness" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"sessions" :>
QueryParam "startTime" Text :>
QueryParam "endTime" Text :>
QueryParam "pageToken" Text :>
QueryParam "includeDeleted" Bool :>
QueryParam "alt" AltJSON :>
Get '[JSON] ListSessionsResponse
data UsersSessionsList = UsersSessionsList'
{ _uslStartTime :: !(Maybe Text)
, _uslUserId :: !Text
, _uslEndTime :: !(Maybe Text)
, _uslPageToken :: !(Maybe Text)
, _uslIncludeDeleted :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
usersSessionsList
:: Text
-> UsersSessionsList
usersSessionsList pUslUserId_ =
UsersSessionsList'
{ _uslStartTime = Nothing
, _uslUserId = pUslUserId_
, _uslEndTime = Nothing
, _uslPageToken = Nothing
, _uslIncludeDeleted = Nothing
}
uslStartTime :: Lens' UsersSessionsList (Maybe Text)
uslStartTime
= lens _uslStartTime (\ s a -> s{_uslStartTime = a})
uslUserId :: Lens' UsersSessionsList Text
uslUserId
= lens _uslUserId (\ s a -> s{_uslUserId = a})
uslEndTime :: Lens' UsersSessionsList (Maybe Text)
uslEndTime
= lens _uslEndTime (\ s a -> s{_uslEndTime = a})
uslPageToken :: Lens' UsersSessionsList (Maybe Text)
uslPageToken
= lens _uslPageToken (\ s a -> s{_uslPageToken = a})
uslIncludeDeleted :: Lens' UsersSessionsList (Maybe Bool)
uslIncludeDeleted
= lens _uslIncludeDeleted
(\ s a -> s{_uslIncludeDeleted = a})
instance GoogleRequest UsersSessionsList where
type Rs UsersSessionsList = ListSessionsResponse
type Scopes UsersSessionsList =
'["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 UsersSessionsList'{..}
= go _uslUserId _uslStartTime _uslEndTime
_uslPageToken
_uslIncludeDeleted
(Just AltJSON)
fitnessService
where go
= buildClient
(Proxy :: Proxy UsersSessionsListResource)
mempty