{-# 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.Orders.Cancel
(
OrdersCancelResource
, ordersCancel
, OrdersCancel
, o2MerchantId
, o2Payload
, o2OrderId
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type OrdersCancelResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"orders" :>
Capture "orderId" Text :>
"cancel" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] OrdersCancelRequest :>
Post '[JSON] OrdersCancelResponse
data OrdersCancel = OrdersCancel'
{ _o2MerchantId :: !(Textual Word64)
, _o2Payload :: !OrdersCancelRequest
, _o2OrderId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
ordersCancel
:: Word64
-> OrdersCancelRequest
-> Text
-> OrdersCancel
ordersCancel pO2MerchantId_ pO2Payload_ pO2OrderId_ =
OrdersCancel'
{ _o2MerchantId = _Coerce # pO2MerchantId_
, _o2Payload = pO2Payload_
, _o2OrderId = pO2OrderId_
}
o2MerchantId :: Lens' OrdersCancel Word64
o2MerchantId
= lens _o2MerchantId (\ s a -> s{_o2MerchantId = a})
. _Coerce
o2Payload :: Lens' OrdersCancel OrdersCancelRequest
o2Payload
= lens _o2Payload (\ s a -> s{_o2Payload = a})
o2OrderId :: Lens' OrdersCancel Text
o2OrderId
= lens _o2OrderId (\ s a -> s{_o2OrderId = a})
instance GoogleRequest OrdersCancel where
type Rs OrdersCancel = OrdersCancelResponse
type Scopes OrdersCancel =
'["https://www.googleapis.com/auth/content"]
requestClient OrdersCancel'{..}
= go _o2MerchantId _o2OrderId (Just AltJSON)
_o2Payload
shoppingContentService
where go
= buildClient (Proxy :: Proxy OrdersCancelResource)
mempty