{-# 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.Products.Get
(
ProductsGetResource
, productsGet
, ProductsGet
, pggMerchantId
, pggProductId
) where
import Network.Google.Prelude
import Network.Google.ShoppingContent.Types
type ProductsGetResource =
"content" :>
"v2.1" :>
Capture "merchantId" (Textual Word64) :>
"products" :>
Capture "productId" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Product
data ProductsGet = ProductsGet'
{ _pggMerchantId :: !(Textual Word64)
, _pggProductId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
productsGet
:: Word64
-> Text
-> ProductsGet
productsGet pPggMerchantId_ pPggProductId_ =
ProductsGet'
{ _pggMerchantId = _Coerce # pPggMerchantId_
, _pggProductId = pPggProductId_
}
pggMerchantId :: Lens' ProductsGet Word64
pggMerchantId
= lens _pggMerchantId
(\ s a -> s{_pggMerchantId = a})
. _Coerce
pggProductId :: Lens' ProductsGet Text
pggProductId
= lens _pggProductId (\ s a -> s{_pggProductId = a})
instance GoogleRequest ProductsGet where
type Rs ProductsGet = Product
type Scopes ProductsGet =
'["https://www.googleapis.com/auth/content"]
requestClient ProductsGet'{..}
= go _pggMerchantId _pggProductId (Just AltJSON)
shoppingContentService
where go
= buildClient (Proxy :: Proxy ProductsGetResource)
mempty