{-# 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.Create
(
UsersDataSourcesCreateResource
, usersDataSourcesCreate
, UsersDataSourcesCreate
, udscPayload
, udscUserId
) where
import Network.Google.Fitness.Types
import Network.Google.Prelude
type UsersDataSourcesCreateResource =
"fitness" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"dataSources" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DataSource :> Post '[JSON] DataSource
data UsersDataSourcesCreate = UsersDataSourcesCreate'
{ _udscPayload :: !DataSource
, _udscUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersDataSourcesCreate
:: DataSource
-> Text
-> UsersDataSourcesCreate
usersDataSourcesCreate pUdscPayload_ pUdscUserId_ =
UsersDataSourcesCreate'
{ _udscPayload = pUdscPayload_
, _udscUserId = pUdscUserId_
}
udscPayload :: Lens' UsersDataSourcesCreate DataSource
udscPayload
= lens _udscPayload (\ s a -> s{_udscPayload = a})
udscUserId :: Lens' UsersDataSourcesCreate Text
udscUserId
= lens _udscUserId (\ s a -> s{_udscUserId = a})
instance GoogleRequest UsersDataSourcesCreate where
type Rs UsersDataSourcesCreate = DataSource
type Scopes UsersDataSourcesCreate =
'["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 UsersDataSourcesCreate'{..}
= go _udscUserId (Just AltJSON) _udscPayload
fitnessService
where go
= buildClient
(Proxy :: Proxy UsersDataSourcesCreateResource)
mempty