{-# 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.Media.Upload
(
MediaUploadResource
, mediaUpload
, MediaUpload'
, muXgafv
, muUploadProtocol
, muResourceName
, muAccessToken
, muUploadType
, muPayload
, muCallback
) where
import Network.Google.CloudSearch.Types
import Network.Google.Prelude
type MediaUploadResource =
"v1" :>
"media" :>
Capture "resourceName" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Media :> Post '[JSON] Media
:<|>
"upload" :>
"v1" :>
"media" :>
Capture "resourceName" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" Multipart :>
MultipartRelated '[JSON] Media :>
Post '[JSON] Media
data MediaUpload' = MediaUpload''
{ _muXgafv :: !(Maybe Xgafv)
, _muUploadProtocol :: !(Maybe Text)
, _muResourceName :: !Text
, _muAccessToken :: !(Maybe Text)
, _muUploadType :: !(Maybe Text)
, _muPayload :: !Media
, _muCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
mediaUpload
:: Text
-> Media
-> MediaUpload'
mediaUpload pMuResourceName_ pMuPayload_ =
MediaUpload''
{ _muXgafv = Nothing
, _muUploadProtocol = Nothing
, _muResourceName = pMuResourceName_
, _muAccessToken = Nothing
, _muUploadType = Nothing
, _muPayload = pMuPayload_
, _muCallback = Nothing
}
muXgafv :: Lens' MediaUpload' (Maybe Xgafv)
muXgafv = lens _muXgafv (\ s a -> s{_muXgafv = a})
muUploadProtocol :: Lens' MediaUpload' (Maybe Text)
muUploadProtocol
= lens _muUploadProtocol
(\ s a -> s{_muUploadProtocol = a})
muResourceName :: Lens' MediaUpload' Text
muResourceName
= lens _muResourceName
(\ s a -> s{_muResourceName = a})
muAccessToken :: Lens' MediaUpload' (Maybe Text)
muAccessToken
= lens _muAccessToken
(\ s a -> s{_muAccessToken = a})
muUploadType :: Lens' MediaUpload' (Maybe Text)
muUploadType
= lens _muUploadType (\ s a -> s{_muUploadType = a})
muPayload :: Lens' MediaUpload' Media
muPayload
= lens _muPayload (\ s a -> s{_muPayload = a})
muCallback :: Lens' MediaUpload' (Maybe Text)
muCallback
= lens _muCallback (\ s a -> s{_muCallback = a})
instance GoogleRequest MediaUpload' where
type Rs MediaUpload' = Media
type Scopes MediaUpload' =
'["https://www.googleapis.com/auth/cloud_search",
"https://www.googleapis.com/auth/cloud_search.indexing"]
requestClient MediaUpload''{..}
= go _muResourceName _muXgafv _muUploadProtocol
_muAccessToken
_muUploadType
_muCallback
(Just AltJSON)
_muPayload
cloudSearchService
where go :<|> _
= buildClient (Proxy :: Proxy MediaUploadResource)
mempty
instance GoogleRequest (MediaUpload MediaUpload')
where
type Rs (MediaUpload MediaUpload') = Media
type Scopes (MediaUpload MediaUpload') =
Scopes MediaUpload'
requestClient (MediaUpload MediaUpload''{..} body)
= go _muResourceName _muXgafv _muUploadProtocol
_muAccessToken
_muUploadType
_muCallback
(Just AltJSON)
(Just Multipart)
_muPayload
body
cloudSearchService
where _ :<|> go
= buildClient (Proxy :: Proxy MediaUploadResource)
mempty