{-# 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.Update
(
DatafeedsUpdateResource
, datafeedsUpdate
, DatafeedsUpdate
, duMerchantId
, duPayload
, duDatafeedId
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type DatafeedsUpdateResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"datafeeds" :>
Capture "datafeedId" (Textual Word64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Datafeed :> Put '[JSON] Datafeed
data DatafeedsUpdate = DatafeedsUpdate'
{ _duMerchantId :: !(Textual Word64)
, _duPayload :: !Datafeed
, _duDatafeedId :: !(Textual Word64)
} deriving (Eq,Show,Data,Typeable,Generic)
datafeedsUpdate
:: Word64
-> Datafeed
-> Word64
-> DatafeedsUpdate
datafeedsUpdate pDuMerchantId_ pDuPayload_ pDuDatafeedId_ =
DatafeedsUpdate'
{ _duMerchantId = _Coerce # pDuMerchantId_
, _duPayload = pDuPayload_
, _duDatafeedId = _Coerce # pDuDatafeedId_
}
duMerchantId :: Lens' DatafeedsUpdate Word64
duMerchantId
= lens _duMerchantId (\ s a -> s{_duMerchantId = a})
. _Coerce
duPayload :: Lens' DatafeedsUpdate Datafeed
duPayload
= lens _duPayload (\ s a -> s{_duPayload = a})
duDatafeedId :: Lens' DatafeedsUpdate Word64
duDatafeedId
= lens _duDatafeedId (\ s a -> s{_duDatafeedId = a})
. _Coerce
instance GoogleRequest DatafeedsUpdate where
type Rs DatafeedsUpdate = Datafeed
type Scopes DatafeedsUpdate =
'["https://www.googleapis.com/auth/content"]
requestClient DatafeedsUpdate'{..}
= go _duMerchantId _duDatafeedId (Just AltJSON)
_duPayload
shoppingContentService
where go
= buildClient
(Proxy :: Proxy DatafeedsUpdateResource)
mempty