{-# 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.AndroidPublisher.Edits.APKs.Upload
(
EditsAPKsUploadResource
, editsAPKsUpload
, EditsAPKsUpload
, eapkuPackageName
, eapkuEditId
) where
import Network.Google.AndroidPublisher.Types
import Network.Google.Prelude
type EditsAPKsUploadResource =
"androidpublisher" :>
"v3" :>
"applications" :>
Capture "packageName" Text :>
"edits" :>
Capture "editId" Text :>
"apks" :>
QueryParam "alt" AltJSON :> Post '[JSON] APK
:<|>
"upload" :>
"androidpublisher" :>
"v3" :>
"applications" :>
Capture "packageName" Text :>
"edits" :>
Capture "editId" Text :>
"apks" :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" AltMedia :>
AltMedia :> Post '[JSON] APK
data EditsAPKsUpload = EditsAPKsUpload'
{ _eapkuPackageName :: !Text
, _eapkuEditId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
editsAPKsUpload
:: Text
-> Text
-> EditsAPKsUpload
editsAPKsUpload pEapkuPackageName_ pEapkuEditId_ =
EditsAPKsUpload'
{ _eapkuPackageName = pEapkuPackageName_
, _eapkuEditId = pEapkuEditId_
}
eapkuPackageName :: Lens' EditsAPKsUpload Text
eapkuPackageName
= lens _eapkuPackageName
(\ s a -> s{_eapkuPackageName = a})
eapkuEditId :: Lens' EditsAPKsUpload Text
eapkuEditId
= lens _eapkuEditId (\ s a -> s{_eapkuEditId = a})
instance GoogleRequest EditsAPKsUpload where
type Rs EditsAPKsUpload = APK
type Scopes EditsAPKsUpload =
'["https://www.googleapis.com/auth/androidpublisher"]
requestClient EditsAPKsUpload'{..}
= go _eapkuPackageName _eapkuEditId (Just AltJSON)
androidPublisherService
where go :<|> _
= buildClient
(Proxy :: Proxy EditsAPKsUploadResource)
mempty
instance GoogleRequest (MediaUpload EditsAPKsUpload)
where
type Rs (MediaUpload EditsAPKsUpload) = APK
type Scopes (MediaUpload EditsAPKsUpload) =
Scopes EditsAPKsUpload
requestClient (MediaUpload EditsAPKsUpload'{..} body)
= go _eapkuPackageName _eapkuEditId (Just AltJSON)
(Just AltMedia)
body
androidPublisherService
where _ :<|> go
= buildClient
(Proxy :: Proxy EditsAPKsUploadResource)
mempty