{-# 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.Datafeeds.Insert
(
DatafeedsInsertResource
, datafeedsInsert
, DatafeedsInsert
, diMerchantId
, diPayload
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type DatafeedsInsertResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"datafeeds" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Datafeed :> Post '[JSON] Datafeed
data DatafeedsInsert = DatafeedsInsert'
{ _diMerchantId :: !(Textual Word64)
, _diPayload :: !Datafeed
} deriving (Eq,Show,Data,Typeable,Generic)
datafeedsInsert
:: Word64
-> Datafeed
-> DatafeedsInsert
datafeedsInsert pDiMerchantId_ pDiPayload_ =
DatafeedsInsert'
{ _diMerchantId = _Coerce # pDiMerchantId_
, _diPayload = pDiPayload_
}
diMerchantId :: Lens' DatafeedsInsert Word64
diMerchantId
= lens _diMerchantId (\ s a -> s{_diMerchantId = a})
. _Coerce
diPayload :: Lens' DatafeedsInsert Datafeed
diPayload
= lens _diPayload (\ s a -> s{_diPayload = a})
instance GoogleRequest DatafeedsInsert where
type Rs DatafeedsInsert = Datafeed
type Scopes DatafeedsInsert =
'["https://www.googleapis.com/auth/content"]
requestClient DatafeedsInsert'{..}
= go _diMerchantId (Just AltJSON) _diPayload
shoppingContentService
where go
= buildClient
(Proxy :: Proxy DatafeedsInsertResource)
mempty