{-# 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.Link
(
AccountsLinkResource
, accountsLink
, AccountsLink
, alMerchantId
, alPayload
, alAccountId
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type AccountsLinkResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"accounts" :>
Capture "accountId" (Textual Word64) :>
"link" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AccountsLinkRequest :>
Post '[JSON] AccountsLinkResponse
data AccountsLink = AccountsLink'
{ _alMerchantId :: !(Textual Word64)
, _alPayload :: !AccountsLinkRequest
, _alAccountId :: !(Textual Word64)
} deriving (Eq,Show,Data,Typeable,Generic)
accountsLink
:: Word64
-> AccountsLinkRequest
-> Word64
-> AccountsLink
accountsLink pAlMerchantId_ pAlPayload_ pAlAccountId_ =
AccountsLink'
{ _alMerchantId = _Coerce # pAlMerchantId_
, _alPayload = pAlPayload_
, _alAccountId = _Coerce # pAlAccountId_
}
alMerchantId :: Lens' AccountsLink Word64
alMerchantId
= lens _alMerchantId (\ s a -> s{_alMerchantId = a})
. _Coerce
alPayload :: Lens' AccountsLink AccountsLinkRequest
alPayload
= lens _alPayload (\ s a -> s{_alPayload = a})
alAccountId :: Lens' AccountsLink Word64
alAccountId
= lens _alAccountId (\ s a -> s{_alAccountId = a}) .
_Coerce
instance GoogleRequest AccountsLink where
type Rs AccountsLink = AccountsLinkResponse
type Scopes AccountsLink =
'["https://www.googleapis.com/auth/content"]
requestClient AccountsLink'{..}
= go _alMerchantId _alAccountId (Just AltJSON)
_alPayload
shoppingContentService
where go
= buildClient (Proxy :: Proxy AccountsLinkResource)
mempty