{-# 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.Pos.Sale
(
PosSaleResource
, posSale'
, PosSale'
, psMerchantId
, psTargetMerchantId
, psPayload
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type PosSaleResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"pos" :>
Capture "targetMerchantId" (Textual Word64) :>
"sale" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PosSaleRequest :>
Post '[JSON] PosSaleResponse
data PosSale' = PosSale''
{ _psMerchantId :: !(Textual Word64)
, _psTargetMerchantId :: !(Textual Word64)
, _psPayload :: !PosSaleRequest
} deriving (Eq,Show,Data,Typeable,Generic)
posSale'
:: Word64
-> Word64
-> PosSaleRequest
-> PosSale'
posSale' pPsMerchantId_ pPsTargetMerchantId_ pPsPayload_ =
PosSale''
{ _psMerchantId = _Coerce # pPsMerchantId_
, _psTargetMerchantId = _Coerce # pPsTargetMerchantId_
, _psPayload = pPsPayload_
}
psMerchantId :: Lens' PosSale' Word64
psMerchantId
= lens _psMerchantId (\ s a -> s{_psMerchantId = a})
. _Coerce
psTargetMerchantId :: Lens' PosSale' Word64
psTargetMerchantId
= lens _psTargetMerchantId
(\ s a -> s{_psTargetMerchantId = a})
. _Coerce
psPayload :: Lens' PosSale' PosSaleRequest
psPayload
= lens _psPayload (\ s a -> s{_psPayload = a})
instance GoogleRequest PosSale' where
type Rs PosSale' = PosSaleResponse
type Scopes PosSale' =
'["https://www.googleapis.com/auth/content"]
requestClient PosSale''{..}
= go _psMerchantId _psTargetMerchantId (Just AltJSON)
_psPayload
shoppingContentService
where go
= buildClient (Proxy :: Proxy PosSaleResource) mempty