{-# 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.AndroidPublisher.Purchases.Subscriptions.Get
(
PurchasesSubscriptionsGetResource
, purchasesSubscriptionsGet
, PurchasesSubscriptionsGet
, psgPackageName
, psgToken
, psgSubscriptionId
) where
import Network.Google.AndroidPublisher.Types
import Network.Google.Prelude
type PurchasesSubscriptionsGetResource =
"androidpublisher" :>
"v3" :>
"applications" :>
Capture "packageName" Text :>
"purchases" :>
"subscriptions" :>
Capture "subscriptionId" Text :>
"tokens" :>
Capture "token" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] SubscriptionPurchase
data PurchasesSubscriptionsGet = PurchasesSubscriptionsGet'
{ _psgPackageName :: !Text
, _psgToken :: !Text
, _psgSubscriptionId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
purchasesSubscriptionsGet
:: Text
-> Text
-> Text
-> PurchasesSubscriptionsGet
purchasesSubscriptionsGet pPsgPackageName_ pPsgToken_ pPsgSubscriptionId_ =
PurchasesSubscriptionsGet'
{ _psgPackageName = pPsgPackageName_
, _psgToken = pPsgToken_
, _psgSubscriptionId = pPsgSubscriptionId_
}
psgPackageName :: Lens' PurchasesSubscriptionsGet Text
psgPackageName
= lens _psgPackageName
(\ s a -> s{_psgPackageName = a})
psgToken :: Lens' PurchasesSubscriptionsGet Text
psgToken = lens _psgToken (\ s a -> s{_psgToken = a})
psgSubscriptionId :: Lens' PurchasesSubscriptionsGet Text
psgSubscriptionId
= lens _psgSubscriptionId
(\ s a -> s{_psgSubscriptionId = a})
instance GoogleRequest PurchasesSubscriptionsGet
where
type Rs PurchasesSubscriptionsGet =
SubscriptionPurchase
type Scopes PurchasesSubscriptionsGet =
'["https://www.googleapis.com/auth/androidpublisher"]
requestClient PurchasesSubscriptionsGet'{..}
= go _psgPackageName _psgSubscriptionId _psgToken
(Just AltJSON)
androidPublisherService
where go
= buildClient
(Proxy :: Proxy PurchasesSubscriptionsGetResource)
mempty