{-# 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.Settings.Datasources.Create
(
SettingsDatasourcesCreateResource
, settingsDatasourcesCreate
, SettingsDatasourcesCreate
, sdcXgafv
, sdcUploadProtocol
, sdcAccessToken
, sdcUploadType
, sdcPayload
, sdcCallback
) where
import Network.Google.CloudSearch.Types
import Network.Google.Prelude
type SettingsDatasourcesCreateResource =
"v1" :>
"settings" :>
"datasources" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DataSource :> Post '[JSON] Operation
data SettingsDatasourcesCreate = SettingsDatasourcesCreate'
{ _sdcXgafv :: !(Maybe Xgafv)
, _sdcUploadProtocol :: !(Maybe Text)
, _sdcAccessToken :: !(Maybe Text)
, _sdcUploadType :: !(Maybe Text)
, _sdcPayload :: !DataSource
, _sdcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
settingsDatasourcesCreate
:: DataSource
-> SettingsDatasourcesCreate
settingsDatasourcesCreate pSdcPayload_ =
SettingsDatasourcesCreate'
{ _sdcXgafv = Nothing
, _sdcUploadProtocol = Nothing
, _sdcAccessToken = Nothing
, _sdcUploadType = Nothing
, _sdcPayload = pSdcPayload_
, _sdcCallback = Nothing
}
sdcXgafv :: Lens' SettingsDatasourcesCreate (Maybe Xgafv)
sdcXgafv = lens _sdcXgafv (\ s a -> s{_sdcXgafv = a})
sdcUploadProtocol :: Lens' SettingsDatasourcesCreate (Maybe Text)
sdcUploadProtocol
= lens _sdcUploadProtocol
(\ s a -> s{_sdcUploadProtocol = a})
sdcAccessToken :: Lens' SettingsDatasourcesCreate (Maybe Text)
sdcAccessToken
= lens _sdcAccessToken
(\ s a -> s{_sdcAccessToken = a})
sdcUploadType :: Lens' SettingsDatasourcesCreate (Maybe Text)
sdcUploadType
= lens _sdcUploadType
(\ s a -> s{_sdcUploadType = a})
sdcPayload :: Lens' SettingsDatasourcesCreate DataSource
sdcPayload
= lens _sdcPayload (\ s a -> s{_sdcPayload = a})
sdcCallback :: Lens' SettingsDatasourcesCreate (Maybe Text)
sdcCallback
= lens _sdcCallback (\ s a -> s{_sdcCallback = a})
instance GoogleRequest SettingsDatasourcesCreate
where
type Rs SettingsDatasourcesCreate = Operation
type Scopes SettingsDatasourcesCreate =
'["https://www.googleapis.com/auth/cloud_search",
"https://www.googleapis.com/auth/cloud_search.settings",
"https://www.googleapis.com/auth/cloud_search.settings.indexing"]
requestClient SettingsDatasourcesCreate'{..}
= go _sdcXgafv _sdcUploadProtocol _sdcAccessToken
_sdcUploadType
_sdcCallback
(Just AltJSON)
_sdcPayload
cloudSearchService
where go
= buildClient
(Proxy :: Proxy SettingsDatasourcesCreateResource)
mempty