{-# 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.Suggest
(
QuerySuggestResource
, querySuggest
, QuerySuggest
, qsXgafv
, qsUploadProtocol
, qsAccessToken
, qsUploadType
, qsPayload
, qsCallback
) where
import Network.Google.CloudSearch.Types
import Network.Google.Prelude
type QuerySuggestResource =
"v1" :>
"query" :>
"suggest" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SuggestRequest :>
Post '[JSON] SuggestResponse
data QuerySuggest = QuerySuggest'
{ _qsXgafv :: !(Maybe Xgafv)
, _qsUploadProtocol :: !(Maybe Text)
, _qsAccessToken :: !(Maybe Text)
, _qsUploadType :: !(Maybe Text)
, _qsPayload :: !SuggestRequest
, _qsCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
querySuggest
:: SuggestRequest
-> QuerySuggest
querySuggest pQsPayload_ =
QuerySuggest'
{ _qsXgafv = Nothing
, _qsUploadProtocol = Nothing
, _qsAccessToken = Nothing
, _qsUploadType = Nothing
, _qsPayload = pQsPayload_
, _qsCallback = Nothing
}
qsXgafv :: Lens' QuerySuggest (Maybe Xgafv)
qsXgafv = lens _qsXgafv (\ s a -> s{_qsXgafv = a})
qsUploadProtocol :: Lens' QuerySuggest (Maybe Text)
qsUploadProtocol
= lens _qsUploadProtocol
(\ s a -> s{_qsUploadProtocol = a})
qsAccessToken :: Lens' QuerySuggest (Maybe Text)
qsAccessToken
= lens _qsAccessToken
(\ s a -> s{_qsAccessToken = a})
qsUploadType :: Lens' QuerySuggest (Maybe Text)
qsUploadType
= lens _qsUploadType (\ s a -> s{_qsUploadType = a})
qsPayload :: Lens' QuerySuggest SuggestRequest
qsPayload
= lens _qsPayload (\ s a -> s{_qsPayload = a})
qsCallback :: Lens' QuerySuggest (Maybe Text)
qsCallback
= lens _qsCallback (\ s a -> s{_qsCallback = a})
instance GoogleRequest QuerySuggest where
type Rs QuerySuggest = SuggestResponse
type Scopes QuerySuggest =
'["https://www.googleapis.com/auth/cloud_search",
"https://www.googleapis.com/auth/cloud_search.query"]
requestClient QuerySuggest'{..}
= go _qsXgafv _qsUploadProtocol _qsAccessToken
_qsUploadType
_qsCallback
(Just AltJSON)
_qsPayload
cloudSearchService
where go
= buildClient (Proxy :: Proxy QuerySuggestResource)
mempty