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 :>
ReqBody '[OctetStream] RequestBody :>
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
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
requestClient
(MediaUpload ImageConfigurationsUpload{..} body)
= go _icuResourceId _icuImageType (Just AltJSON)
(Just AltMedia)
body
gamesConfigurationService
where _ :<|> go
= buildClient
(Proxy :: Proxy ImageConfigurationsUploadResource)
mempty