{-# 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.Update
(
UsersSessionsUpdateResource
, usersSessionsUpdate
, UsersSessionsUpdate
, usuPayload
, usuUserId
, usuCurrentTimeMillis
, usuSessionId
) where
import Network.Google.Fitness.Types
import Network.Google.Prelude
type UsersSessionsUpdateResource =
"fitness" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"sessions" :>
Capture "sessionId" Text :>
QueryParam "currentTimeMillis" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Session :> Put '[JSON] Session
data UsersSessionsUpdate = UsersSessionsUpdate'
{ _usuPayload :: !Session
, _usuUserId :: !Text
, _usuCurrentTimeMillis :: !(Maybe (Textual Int64))
, _usuSessionId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSessionsUpdate
:: Session
-> Text
-> Text
-> UsersSessionsUpdate
usersSessionsUpdate pUsuPayload_ pUsuUserId_ pUsuSessionId_ =
UsersSessionsUpdate'
{ _usuPayload = pUsuPayload_
, _usuUserId = pUsuUserId_
, _usuCurrentTimeMillis = Nothing
, _usuSessionId = pUsuSessionId_
}
usuPayload :: Lens' UsersSessionsUpdate Session
usuPayload
= lens _usuPayload (\ s a -> s{_usuPayload = a})
usuUserId :: Lens' UsersSessionsUpdate Text
usuUserId
= lens _usuUserId (\ s a -> s{_usuUserId = a})
usuCurrentTimeMillis :: Lens' UsersSessionsUpdate (Maybe Int64)
usuCurrentTimeMillis
= lens _usuCurrentTimeMillis
(\ s a -> s{_usuCurrentTimeMillis = a})
. mapping _Coerce
usuSessionId :: Lens' UsersSessionsUpdate Text
usuSessionId
= lens _usuSessionId (\ s a -> s{_usuSessionId = a})
instance GoogleRequest UsersSessionsUpdate where
type Rs UsersSessionsUpdate = Session
type Scopes UsersSessionsUpdate =
'["https://www.googleapis.com/auth/fitness.activity.write"]
requestClient UsersSessionsUpdate'{..}
= go _usuUserId _usuSessionId _usuCurrentTimeMillis
(Just AltJSON)
_usuPayload
fitnessService
where go
= buildClient
(Proxy :: Proxy UsersSessionsUpdateResource)
mempty