{-# 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.Upload
(
IndexingDatasourcesItemsUploadResource
, indexingDatasourcesItemsUpload
, IndexingDatasourcesItemsUpload
, indXgafv
, indUploadProtocol
, indAccessToken
, indUploadType
, indPayload
, indName
, indCallback
) where
import Network.Google.CloudSearch.Types
import Network.Google.Prelude
type IndexingDatasourcesItemsUploadResource =
"v1" :>
"indexing" :>
CaptureMode "name" "upload" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] StartUploadItemRequest :>
Post '[JSON] UploadItemRef
data IndexingDatasourcesItemsUpload = IndexingDatasourcesItemsUpload'
{ _indXgafv :: !(Maybe Xgafv)
, _indUploadProtocol :: !(Maybe Text)
, _indAccessToken :: !(Maybe Text)
, _indUploadType :: !(Maybe Text)
, _indPayload :: !StartUploadItemRequest
, _indName :: !Text
, _indCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
indexingDatasourcesItemsUpload
:: StartUploadItemRequest
-> Text
-> IndexingDatasourcesItemsUpload
indexingDatasourcesItemsUpload pIndPayload_ pIndName_ =
IndexingDatasourcesItemsUpload'
{ _indXgafv = Nothing
, _indUploadProtocol = Nothing
, _indAccessToken = Nothing
, _indUploadType = Nothing
, _indPayload = pIndPayload_
, _indName = pIndName_
, _indCallback = Nothing
}
indXgafv :: Lens' IndexingDatasourcesItemsUpload (Maybe Xgafv)
indXgafv = lens _indXgafv (\ s a -> s{_indXgafv = a})
indUploadProtocol :: Lens' IndexingDatasourcesItemsUpload (Maybe Text)
indUploadProtocol
= lens _indUploadProtocol
(\ s a -> s{_indUploadProtocol = a})
indAccessToken :: Lens' IndexingDatasourcesItemsUpload (Maybe Text)
indAccessToken
= lens _indAccessToken
(\ s a -> s{_indAccessToken = a})
indUploadType :: Lens' IndexingDatasourcesItemsUpload (Maybe Text)
indUploadType
= lens _indUploadType
(\ s a -> s{_indUploadType = a})
indPayload :: Lens' IndexingDatasourcesItemsUpload StartUploadItemRequest
indPayload
= lens _indPayload (\ s a -> s{_indPayload = a})
indName :: Lens' IndexingDatasourcesItemsUpload Text
indName = lens _indName (\ s a -> s{_indName = a})
indCallback :: Lens' IndexingDatasourcesItemsUpload (Maybe Text)
indCallback
= lens _indCallback (\ s a -> s{_indCallback = a})
instance GoogleRequest IndexingDatasourcesItemsUpload
where
type Rs IndexingDatasourcesItemsUpload =
UploadItemRef
type Scopes IndexingDatasourcesItemsUpload =
'["https://www.googleapis.com/auth/cloud_search",
"https://www.googleapis.com/auth/cloud_search.indexing"]
requestClient IndexingDatasourcesItemsUpload'{..}
= go _indName _indXgafv _indUploadProtocol
_indAccessToken
_indUploadType
_indCallback
(Just AltJSON)
_indPayload
cloudSearchService
where go
= buildClient
(Proxy ::
Proxy IndexingDatasourcesItemsUploadResource)
mempty