{-# 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.Reseller.Subscriptions.Insert
(
SubscriptionsInsertResource
, subscriptionsInsert
, SubscriptionsInsert
, siPayload
, siCustomerId
, siCustomerAuthToken
) where
import Network.Google.AppsReseller.Types
import Network.Google.Prelude
type SubscriptionsInsertResource =
"apps" :>
"reseller" :>
"v1" :>
"customers" :>
Capture "customerId" Text :>
"subscriptions" :>
QueryParam "customerAuthToken" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Subscription :>
Post '[JSON] Subscription
data SubscriptionsInsert = SubscriptionsInsert'
{ _siPayload :: !Subscription
, _siCustomerId :: !Text
, _siCustomerAuthToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
subscriptionsInsert
:: Subscription
-> Text
-> SubscriptionsInsert
subscriptionsInsert pSiPayload_ pSiCustomerId_ =
SubscriptionsInsert'
{ _siPayload = pSiPayload_
, _siCustomerId = pSiCustomerId_
, _siCustomerAuthToken = Nothing
}
siPayload :: Lens' SubscriptionsInsert Subscription
siPayload
= lens _siPayload (\ s a -> s{_siPayload = a})
siCustomerId :: Lens' SubscriptionsInsert Text
siCustomerId
= lens _siCustomerId (\ s a -> s{_siCustomerId = a})
siCustomerAuthToken :: Lens' SubscriptionsInsert (Maybe Text)
siCustomerAuthToken
= lens _siCustomerAuthToken
(\ s a -> s{_siCustomerAuthToken = a})
instance GoogleRequest SubscriptionsInsert where
type Rs SubscriptionsInsert = Subscription
type Scopes SubscriptionsInsert =
'["https://www.googleapis.com/auth/apps.order"]
requestClient SubscriptionsInsert'{..}
= go _siCustomerId _siCustomerAuthToken
(Just AltJSON)
_siPayload
appsResellerService
where go
= buildClient
(Proxy :: Proxy SubscriptionsInsertResource)
mempty