{-# 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.Content.Regionalinventory.Insert
(
RegionalinventoryInsertResource
, regionalinventoryInsert
, RegionalinventoryInsert
, riMerchantId
, riPayload
, riProductId
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type RegionalinventoryInsertResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"products" :>
Capture "productId" Text :>
"regionalinventory" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] RegionalInventory :>
Post '[JSON] RegionalInventory
data RegionalinventoryInsert =
RegionalinventoryInsert'
{ _riMerchantId :: !(Textual Word64)
, _riPayload :: !RegionalInventory
, _riProductId :: !Text
}
deriving (Eq, Show, Data, Typeable, Generic)
regionalinventoryInsert
:: Word64
-> RegionalInventory
-> Text
-> RegionalinventoryInsert
regionalinventoryInsert pRiMerchantId_ pRiPayload_ pRiProductId_ =
RegionalinventoryInsert'
{ _riMerchantId = _Coerce # pRiMerchantId_
, _riPayload = pRiPayload_
, _riProductId = pRiProductId_
}
riMerchantId :: Lens' RegionalinventoryInsert Word64
riMerchantId
= lens _riMerchantId (\ s a -> s{_riMerchantId = a})
. _Coerce
riPayload :: Lens' RegionalinventoryInsert RegionalInventory
riPayload
= lens _riPayload (\ s a -> s{_riPayload = a})
riProductId :: Lens' RegionalinventoryInsert Text
riProductId
= lens _riProductId (\ s a -> s{_riProductId = a})
instance GoogleRequest RegionalinventoryInsert where
type Rs RegionalinventoryInsert = RegionalInventory
type Scopes RegionalinventoryInsert =
'["https://www.googleapis.com/auth/content"]
requestClient RegionalinventoryInsert'{..}
= go _riMerchantId _riProductId (Just AltJSON)
_riPayload
shoppingContentService
where go
= buildClient
(Proxy :: Proxy RegionalinventoryInsertResource)
mempty