{-# 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.People.Search
(
PeopleSearchResource
, peopleSearch
, PeopleSearch
, psQuery
, psLanguage
, psPageToken
, psMaxResults
) where
import Network.Google.Plus.Types
import Network.Google.Prelude
type PeopleSearchResource =
"plus" :>
"v1" :>
"people" :>
QueryParam "query" Text :>
QueryParam "language" Text :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "alt" AltJSON :> Get '[JSON] PeopleFeed
data PeopleSearch = PeopleSearch'
{ _psQuery :: !Text
, _psLanguage :: !Text
, _psPageToken :: !(Maybe Text)
, _psMaxResults :: !(Textual Word32)
} deriving (Eq,Show,Data,Typeable,Generic)
peopleSearch
:: Text
-> PeopleSearch
peopleSearch pPsQuery_ =
PeopleSearch'
{ _psQuery = pPsQuery_
, _psLanguage = "en-US"
, _psPageToken = Nothing
, _psMaxResults = 25
}
psQuery :: Lens' PeopleSearch Text
psQuery = lens _psQuery (\ s a -> s{_psQuery = a})
psLanguage :: Lens' PeopleSearch Text
psLanguage
= lens _psLanguage (\ s a -> s{_psLanguage = a})
psPageToken :: Lens' PeopleSearch (Maybe Text)
psPageToken
= lens _psPageToken (\ s a -> s{_psPageToken = a})
psMaxResults :: Lens' PeopleSearch Word32
psMaxResults
= lens _psMaxResults (\ s a -> s{_psMaxResults = a})
. _Coerce
instance GoogleRequest PeopleSearch where
type Rs PeopleSearch = PeopleFeed
type Scopes PeopleSearch =
'["https://www.googleapis.com/auth/plus.login",
"https://www.googleapis.com/auth/plus.me"]
requestClient PeopleSearch'{..}
= go (Just _psQuery) (Just _psLanguage) _psPageToken
(Just _psMaxResults)
(Just AltJSON)
plusService
where go
= buildClient (Proxy :: Proxy PeopleSearchResource)
mempty