{-# 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.CloudSearch.Query.Search
(
QuerySearchResource
, querySearch
, QuerySearch
, qXgafv
, qUploadProtocol
, qAccessToken
, qUploadType
, qPayload
, qCallback
) where
import Network.Google.CloudSearch.Types
import Network.Google.Prelude
type QuerySearchResource =
"v1" :>
"query" :>
"search" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SearchRequest :>
Post '[JSON] SearchResponse
data QuerySearch = QuerySearch'
{ _qXgafv :: !(Maybe Xgafv)
, _qUploadProtocol :: !(Maybe Text)
, _qAccessToken :: !(Maybe Text)
, _qUploadType :: !(Maybe Text)
, _qPayload :: !SearchRequest
, _qCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
querySearch
:: SearchRequest
-> QuerySearch
querySearch pQPayload_ =
QuerySearch'
{ _qXgafv = Nothing
, _qUploadProtocol = Nothing
, _qAccessToken = Nothing
, _qUploadType = Nothing
, _qPayload = pQPayload_
, _qCallback = Nothing
}
qXgafv :: Lens' QuerySearch (Maybe Xgafv)
qXgafv = lens _qXgafv (\ s a -> s{_qXgafv = a})
qUploadProtocol :: Lens' QuerySearch (Maybe Text)
qUploadProtocol
= lens _qUploadProtocol
(\ s a -> s{_qUploadProtocol = a})
qAccessToken :: Lens' QuerySearch (Maybe Text)
qAccessToken
= lens _qAccessToken (\ s a -> s{_qAccessToken = a})
qUploadType :: Lens' QuerySearch (Maybe Text)
qUploadType
= lens _qUploadType (\ s a -> s{_qUploadType = a})
qPayload :: Lens' QuerySearch SearchRequest
qPayload = lens _qPayload (\ s a -> s{_qPayload = a})
qCallback :: Lens' QuerySearch (Maybe Text)
qCallback
= lens _qCallback (\ s a -> s{_qCallback = a})
instance GoogleRequest QuerySearch where
type Rs QuerySearch = SearchResponse
type Scopes QuerySearch =
'["https://www.googleapis.com/auth/cloud_search",
"https://www.googleapis.com/auth/cloud_search.query"]
requestClient QuerySearch'{..}
= go _qXgafv _qUploadProtocol _qAccessToken
_qUploadType
_qCallback
(Just AltJSON)
_qPayload
cloudSearchService
where go
= buildClient (Proxy :: Proxy QuerySearchResource)
mempty