{-# 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.PlusDomains.Activities.Insert
(
ActivitiesInsertResource
, activitiesInsert
, ActivitiesInsert
, aiPayload
, aiUserId
, aiPreview
) where
import Network.Google.PlusDomains.Types
import Network.Google.Prelude
type ActivitiesInsertResource =
"plusDomains" :>
"v1" :>
"people" :>
Capture "userId" Text :>
"activities" :>
QueryParam "preview" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Activity :> Post '[JSON] Activity
data ActivitiesInsert = ActivitiesInsert'
{ _aiPayload :: !Activity
, _aiUserId :: !Text
, _aiPreview :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
activitiesInsert
:: Activity
-> Text
-> ActivitiesInsert
activitiesInsert pAiPayload_ pAiUserId_ =
ActivitiesInsert'
{ _aiPayload = pAiPayload_
, _aiUserId = pAiUserId_
, _aiPreview = Nothing
}
aiPayload :: Lens' ActivitiesInsert Activity
aiPayload
= lens _aiPayload (\ s a -> s{_aiPayload = a})
aiUserId :: Lens' ActivitiesInsert Text
aiUserId = lens _aiUserId (\ s a -> s{_aiUserId = a})
aiPreview :: Lens' ActivitiesInsert (Maybe Bool)
aiPreview
= lens _aiPreview (\ s a -> s{_aiPreview = a})
instance GoogleRequest ActivitiesInsert where
type Rs ActivitiesInsert = Activity
type Scopes ActivitiesInsert =
'["https://www.googleapis.com/auth/plus.login",
"https://www.googleapis.com/auth/plus.me",
"https://www.googleapis.com/auth/plus.stream.write"]
requestClient ActivitiesInsert'{..}
= go _aiUserId _aiPreview (Just AltJSON) _aiPayload
plusDomainsService
where go
= buildClient
(Proxy :: Proxy ActivitiesInsertResource)
mempty