{-# 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.ChangePlan
(
SubscriptionsChangePlanResource
, subscriptionsChangePlan
, SubscriptionsChangePlan
, scpPayload
, scpCustomerId
, scpSubscriptionId
) where
import Network.Google.AppsReseller.Types
import Network.Google.Prelude
type SubscriptionsChangePlanResource =
"apps" :>
"reseller" :>
"v1" :>
"customers" :>
Capture "customerId" Text :>
"subscriptions" :>
Capture "subscriptionId" Text :>
"changePlan" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ChangePlanRequest :>
Post '[JSON] Subscription
data SubscriptionsChangePlan = SubscriptionsChangePlan'
{ _scpPayload :: !ChangePlanRequest
, _scpCustomerId :: !Text
, _scpSubscriptionId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
subscriptionsChangePlan
:: ChangePlanRequest
-> Text
-> Text
-> SubscriptionsChangePlan
subscriptionsChangePlan pScpPayload_ pScpCustomerId_ pScpSubscriptionId_ =
SubscriptionsChangePlan'
{ _scpPayload = pScpPayload_
, _scpCustomerId = pScpCustomerId_
, _scpSubscriptionId = pScpSubscriptionId_
}
scpPayload :: Lens' SubscriptionsChangePlan ChangePlanRequest
scpPayload
= lens _scpPayload (\ s a -> s{_scpPayload = a})
scpCustomerId :: Lens' SubscriptionsChangePlan Text
scpCustomerId
= lens _scpCustomerId
(\ s a -> s{_scpCustomerId = a})
scpSubscriptionId :: Lens' SubscriptionsChangePlan Text
scpSubscriptionId
= lens _scpSubscriptionId
(\ s a -> s{_scpSubscriptionId = a})
instance GoogleRequest SubscriptionsChangePlan where
type Rs SubscriptionsChangePlan = Subscription
type Scopes SubscriptionsChangePlan =
'["https://www.googleapis.com/auth/apps.order"]
requestClient SubscriptionsChangePlan'{..}
= go _scpCustomerId _scpSubscriptionId (Just AltJSON)
_scpPayload
appsResellerService
where go
= buildClient
(Proxy :: Proxy SubscriptionsChangePlanResource)
mempty