{-# 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.Indexing.Datasources.Items.Push
(
IndexingDatasourcesItemsPushResource
, indexingDatasourcesItemsPush
, IndexingDatasourcesItemsPush
, idipXgafv
, idipUploadProtocol
, idipAccessToken
, idipUploadType
, idipPayload
, idipName
, idipCallback
) where
import Network.Google.CloudSearch.Types
import Network.Google.Prelude
type IndexingDatasourcesItemsPushResource =
"v1" :>
"indexing" :>
CaptureMode "name" "push" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PushItemRequest :> Post '[JSON] Item
data IndexingDatasourcesItemsPush = IndexingDatasourcesItemsPush'
{ _idipXgafv :: !(Maybe Xgafv)
, _idipUploadProtocol :: !(Maybe Text)
, _idipAccessToken :: !(Maybe Text)
, _idipUploadType :: !(Maybe Text)
, _idipPayload :: !PushItemRequest
, _idipName :: !Text
, _idipCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
indexingDatasourcesItemsPush
:: PushItemRequest
-> Text
-> IndexingDatasourcesItemsPush
indexingDatasourcesItemsPush pIdipPayload_ pIdipName_ =
IndexingDatasourcesItemsPush'
{ _idipXgafv = Nothing
, _idipUploadProtocol = Nothing
, _idipAccessToken = Nothing
, _idipUploadType = Nothing
, _idipPayload = pIdipPayload_
, _idipName = pIdipName_
, _idipCallback = Nothing
}
idipXgafv :: Lens' IndexingDatasourcesItemsPush (Maybe Xgafv)
idipXgafv
= lens _idipXgafv (\ s a -> s{_idipXgafv = a})
idipUploadProtocol :: Lens' IndexingDatasourcesItemsPush (Maybe Text)
idipUploadProtocol
= lens _idipUploadProtocol
(\ s a -> s{_idipUploadProtocol = a})
idipAccessToken :: Lens' IndexingDatasourcesItemsPush (Maybe Text)
idipAccessToken
= lens _idipAccessToken
(\ s a -> s{_idipAccessToken = a})
idipUploadType :: Lens' IndexingDatasourcesItemsPush (Maybe Text)
idipUploadType
= lens _idipUploadType
(\ s a -> s{_idipUploadType = a})
idipPayload :: Lens' IndexingDatasourcesItemsPush PushItemRequest
idipPayload
= lens _idipPayload (\ s a -> s{_idipPayload = a})
idipName :: Lens' IndexingDatasourcesItemsPush Text
idipName = lens _idipName (\ s a -> s{_idipName = a})
idipCallback :: Lens' IndexingDatasourcesItemsPush (Maybe Text)
idipCallback
= lens _idipCallback (\ s a -> s{_idipCallback = a})
instance GoogleRequest IndexingDatasourcesItemsPush
where
type Rs IndexingDatasourcesItemsPush = Item
type Scopes IndexingDatasourcesItemsPush =
'["https://www.googleapis.com/auth/cloud_search",
"https://www.googleapis.com/auth/cloud_search.indexing"]
requestClient IndexingDatasourcesItemsPush'{..}
= go _idipName _idipXgafv _idipUploadProtocol
_idipAccessToken
_idipUploadType
_idipCallback
(Just AltJSON)
_idipPayload
cloudSearchService
where go
= buildClient
(Proxy :: Proxy IndexingDatasourcesItemsPushResource)
mempty