{-# 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.Plus.Activities.Search
(
ActivitiesSearchResource
, activitiesSearch
, ActivitiesSearch
, asOrderBy
, asQuery
, asLanguage
, asPageToken
, asMaxResults
) where
import Network.Google.Plus.Types
import Network.Google.Prelude
type ActivitiesSearchResource =
"plus" :>
"v1" :>
"activities" :>
QueryParam "query" Text :>
QueryParam "orderBy" ActivitiesSearchOrderBy :>
QueryParam "language" Text :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "alt" AltJSON :> Get '[JSON] ActivityFeed
data ActivitiesSearch = ActivitiesSearch'
{ _asOrderBy :: !ActivitiesSearchOrderBy
, _asQuery :: !Text
, _asLanguage :: !Text
, _asPageToken :: !(Maybe Text)
, _asMaxResults :: !(Textual Word32)
} deriving (Eq,Show,Data,Typeable,Generic)
activitiesSearch
:: Text
-> ActivitiesSearch
activitiesSearch pAsQuery_ =
ActivitiesSearch'
{ _asOrderBy = ASOBRecent
, _asQuery = pAsQuery_
, _asLanguage = "en-US"
, _asPageToken = Nothing
, _asMaxResults = 10
}
asOrderBy :: Lens' ActivitiesSearch ActivitiesSearchOrderBy
asOrderBy
= lens _asOrderBy (\ s a -> s{_asOrderBy = a})
asQuery :: Lens' ActivitiesSearch Text
asQuery = lens _asQuery (\ s a -> s{_asQuery = a})
asLanguage :: Lens' ActivitiesSearch Text
asLanguage
= lens _asLanguage (\ s a -> s{_asLanguage = a})
asPageToken :: Lens' ActivitiesSearch (Maybe Text)
asPageToken
= lens _asPageToken (\ s a -> s{_asPageToken = a})
asMaxResults :: Lens' ActivitiesSearch Word32
asMaxResults
= lens _asMaxResults (\ s a -> s{_asMaxResults = a})
. _Coerce
instance GoogleRequest ActivitiesSearch where
type Rs ActivitiesSearch = ActivityFeed
type Scopes ActivitiesSearch =
'["https://www.googleapis.com/auth/plus.login",
"https://www.googleapis.com/auth/plus.me"]
requestClient ActivitiesSearch'{..}
= go (Just _asQuery) (Just _asOrderBy)
(Just _asLanguage)
_asPageToken
(Just _asMaxResults)
(Just AltJSON)
plusService
where go
= buildClient
(Proxy :: Proxy ActivitiesSearchResource)
mempty