{-# 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.GamesConfiguration.ImageConfigurations.Upload
(
ImageConfigurationsUploadResource
, imageConfigurationsUpload
, ImageConfigurationsUpload
, icuResourceId
, icuImageType
) where
import Network.Google.GamesConfiguration.Types
import Network.Google.Prelude
type ImageConfigurationsUploadResource =
"games" :>
"v1configuration" :>
"images" :>
Capture "resourceId" Text :>
"imageType" :>
Capture "imageType"
ImageConfigurationsUploadImageType
:>
QueryParam "alt" AltJSON :>
Post '[JSON] ImageConfiguration
:<|>
"upload" :>
"games" :>
"v1configuration" :>
"images" :>
Capture "resourceId" Text :>
"imageType" :>
Capture "imageType"
ImageConfigurationsUploadImageType
:>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" AltMedia :>
AltMedia :> Post '[JSON] ImageConfiguration
data ImageConfigurationsUpload = ImageConfigurationsUpload'
{ _icuResourceId :: !Text
, _icuImageType :: !ImageConfigurationsUploadImageType
} deriving (Eq,Show,Data,Typeable,Generic)
imageConfigurationsUpload
:: Text
-> ImageConfigurationsUploadImageType
-> ImageConfigurationsUpload
imageConfigurationsUpload pIcuResourceId_ pIcuImageType_ =
ImageConfigurationsUpload'
{ _icuResourceId = pIcuResourceId_
, _icuImageType = pIcuImageType_
}
icuResourceId :: Lens' ImageConfigurationsUpload Text
icuResourceId
= lens _icuResourceId
(\ s a -> s{_icuResourceId = a})
icuImageType :: Lens' ImageConfigurationsUpload ImageConfigurationsUploadImageType
icuImageType
= lens _icuImageType (\ s a -> s{_icuImageType = a})
instance GoogleRequest ImageConfigurationsUpload
where
type Rs ImageConfigurationsUpload =
ImageConfiguration
type Scopes ImageConfigurationsUpload =
'["https://www.googleapis.com/auth/androidpublisher"]
requestClient ImageConfigurationsUpload'{..}
= go _icuResourceId _icuImageType (Just AltJSON)
gamesConfigurationService
where go :<|> _
= buildClient
(Proxy :: Proxy ImageConfigurationsUploadResource)
mempty
instance GoogleRequest
(MediaUpload ImageConfigurationsUpload) where
type Rs (MediaUpload ImageConfigurationsUpload) =
ImageConfiguration
type Scopes (MediaUpload ImageConfigurationsUpload) =
Scopes ImageConfigurationsUpload
requestClient
(MediaUpload ImageConfigurationsUpload'{..} body)
= go _icuResourceId _icuImageType (Just AltJSON)
(Just AltMedia)
body
gamesConfigurationService
where _ :<|> go
= buildClient
(Proxy :: Proxy ImageConfigurationsUploadResource)
mempty