{-# 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.Accounts.Insert
(
AccountsInsertResource
, accountsInsert
, AccountsInsert
, aMerchantId
, aPayload
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type AccountsInsertResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"accounts" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Account :> Post '[JSON] Account
data AccountsInsert = AccountsInsert'
{ _aMerchantId :: !(Textual Word64)
, _aPayload :: !Account
} deriving (Eq,Show,Data,Typeable,Generic)
accountsInsert
:: Word64
-> Account
-> AccountsInsert
accountsInsert pAMerchantId_ pAPayload_ =
AccountsInsert'
{ _aMerchantId = _Coerce # pAMerchantId_
, _aPayload = pAPayload_
}
aMerchantId :: Lens' AccountsInsert Word64
aMerchantId
= lens _aMerchantId (\ s a -> s{_aMerchantId = a}) .
_Coerce
aPayload :: Lens' AccountsInsert Account
aPayload = lens _aPayload (\ s a -> s{_aPayload = a})
instance GoogleRequest AccountsInsert where
type Rs AccountsInsert = Account
type Scopes AccountsInsert =
'["https://www.googleapis.com/auth/content"]
requestClient AccountsInsert'{..}
= go _aMerchantId (Just AltJSON) _aPayload
shoppingContentService
where go
= buildClient (Proxy :: Proxy AccountsInsertResource)
mempty