{-# 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.Products.Insert
(
ProductsInsertResource
, productsInsert
, ProductsInsert
, piiMerchantId
, piiPayload
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type ProductsInsertResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"products" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Product :> Post '[JSON] Product
data ProductsInsert = ProductsInsert'
{ _piiMerchantId :: !(Textual Word64)
, _piiPayload :: !Product
} deriving (Eq,Show,Data,Typeable,Generic)
productsInsert
:: Word64
-> Product
-> ProductsInsert
productsInsert pPiiMerchantId_ pPiiPayload_ =
ProductsInsert'
{ _piiMerchantId = _Coerce # pPiiMerchantId_
, _piiPayload = pPiiPayload_
}
piiMerchantId :: Lens' ProductsInsert Word64
piiMerchantId
= lens _piiMerchantId
(\ s a -> s{_piiMerchantId = a})
. _Coerce
piiPayload :: Lens' ProductsInsert Product
piiPayload
= lens _piiPayload (\ s a -> s{_piiPayload = a})
instance GoogleRequest ProductsInsert where
type Rs ProductsInsert = Product
type Scopes ProductsInsert =
'["https://www.googleapis.com/auth/content"]
requestClient ProductsInsert'{..}
= go _piiMerchantId (Just AltJSON) _piiPayload
shoppingContentService
where go
= buildClient (Proxy :: Proxy ProductsInsertResource)
mempty