{-# 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.InAppProducts.Insert
(
InAppProductsInsertResource
, inAppProductsInsert
, InAppProductsInsert
, iapiAutoConvertMissingPrices
, iapiPackageName
, iapiPayload
) where
import Network.Google.AndroidPublisher.Types
import Network.Google.Prelude
type InAppProductsInsertResource =
"androidpublisher" :>
"v3" :>
"applications" :>
Capture "packageName" Text :>
"inappproducts" :>
QueryParam "autoConvertMissingPrices" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] InAppProduct :>
Post '[JSON] InAppProduct
data InAppProductsInsert = InAppProductsInsert'
{ _iapiAutoConvertMissingPrices :: !(Maybe Bool)
, _iapiPackageName :: !Text
, _iapiPayload :: !InAppProduct
} deriving (Eq,Show,Data,Typeable,Generic)
inAppProductsInsert
:: Text
-> InAppProduct
-> InAppProductsInsert
inAppProductsInsert pIapiPackageName_ pIapiPayload_ =
InAppProductsInsert'
{ _iapiAutoConvertMissingPrices = Nothing
, _iapiPackageName = pIapiPackageName_
, _iapiPayload = pIapiPayload_
}
iapiAutoConvertMissingPrices :: Lens' InAppProductsInsert (Maybe Bool)
iapiAutoConvertMissingPrices
= lens _iapiAutoConvertMissingPrices
(\ s a -> s{_iapiAutoConvertMissingPrices = a})
iapiPackageName :: Lens' InAppProductsInsert Text
iapiPackageName
= lens _iapiPackageName
(\ s a -> s{_iapiPackageName = a})
iapiPayload :: Lens' InAppProductsInsert InAppProduct
iapiPayload
= lens _iapiPayload (\ s a -> s{_iapiPayload = a})
instance GoogleRequest InAppProductsInsert where
type Rs InAppProductsInsert = InAppProduct
type Scopes InAppProductsInsert =
'["https://www.googleapis.com/auth/androidpublisher"]
requestClient InAppProductsInsert'{..}
= go _iapiPackageName _iapiAutoConvertMissingPrices
(Just AltJSON)
_iapiPayload
androidPublisherService
where go
= buildClient
(Proxy :: Proxy InAppProductsInsertResource)
mempty