{-# 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.Update
(
SettingsDatasourcesUpdateResource
, settingsDatasourcesUpdate
, SettingsDatasourcesUpdate
, sduXgafv
, sduUploadProtocol
, sduAccessToken
, sduUploadType
, sduPayload
, sduName
, sduCallback
) where
import Network.Google.CloudSearch.Types
import Network.Google.Prelude
type SettingsDatasourcesUpdateResource =
"v1" :>
"settings" :>
Capture "name" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] UpdateDataSourceRequest :>
Put '[JSON] Operation
data SettingsDatasourcesUpdate = SettingsDatasourcesUpdate'
{ _sduXgafv :: !(Maybe Xgafv)
, _sduUploadProtocol :: !(Maybe Text)
, _sduAccessToken :: !(Maybe Text)
, _sduUploadType :: !(Maybe Text)
, _sduPayload :: !UpdateDataSourceRequest
, _sduName :: !Text
, _sduCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
settingsDatasourcesUpdate
:: UpdateDataSourceRequest
-> Text
-> SettingsDatasourcesUpdate
settingsDatasourcesUpdate pSduPayload_ pSduName_ =
SettingsDatasourcesUpdate'
{ _sduXgafv = Nothing
, _sduUploadProtocol = Nothing
, _sduAccessToken = Nothing
, _sduUploadType = Nothing
, _sduPayload = pSduPayload_
, _sduName = pSduName_
, _sduCallback = Nothing
}
sduXgafv :: Lens' SettingsDatasourcesUpdate (Maybe Xgafv)
sduXgafv = lens _sduXgafv (\ s a -> s{_sduXgafv = a})
sduUploadProtocol :: Lens' SettingsDatasourcesUpdate (Maybe Text)
sduUploadProtocol
= lens _sduUploadProtocol
(\ s a -> s{_sduUploadProtocol = a})
sduAccessToken :: Lens' SettingsDatasourcesUpdate (Maybe Text)
sduAccessToken
= lens _sduAccessToken
(\ s a -> s{_sduAccessToken = a})
sduUploadType :: Lens' SettingsDatasourcesUpdate (Maybe Text)
sduUploadType
= lens _sduUploadType
(\ s a -> s{_sduUploadType = a})
sduPayload :: Lens' SettingsDatasourcesUpdate UpdateDataSourceRequest
sduPayload
= lens _sduPayload (\ s a -> s{_sduPayload = a})
sduName :: Lens' SettingsDatasourcesUpdate Text
sduName = lens _sduName (\ s a -> s{_sduName = a})
sduCallback :: Lens' SettingsDatasourcesUpdate (Maybe Text)
sduCallback
= lens _sduCallback (\ s a -> s{_sduCallback = a})
instance GoogleRequest SettingsDatasourcesUpdate
where
type Rs SettingsDatasourcesUpdate = Operation
type Scopes SettingsDatasourcesUpdate =
'["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 SettingsDatasourcesUpdate'{..}
= go _sduName _sduXgafv _sduUploadProtocol
_sduAccessToken
_sduUploadType
_sduCallback
(Just AltJSON)
_sduPayload
cloudSearchService
where go
= buildClient
(Proxy :: Proxy SettingsDatasourcesUpdateResource)
mempty