{-# 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.Delete
(
SubscriptionsDeleteResource
, subscriptionsDelete
, SubscriptionsDelete
, sdCustomerId
, sdDeletionType
, sdSubscriptionId
) where
import Network.Google.AppsReseller.Types
import Network.Google.Prelude
type SubscriptionsDeleteResource =
"apps" :>
"reseller" :>
"v1" :>
"customers" :>
Capture "customerId" Text :>
"subscriptions" :>
Capture "subscriptionId" Text :>
QueryParam "deletionType"
SubscriptionsDeleteDeletionType
:> QueryParam "alt" AltJSON :> Delete '[JSON] ()
-- | Cancels\/Downgrades a subscription.
--
-- /See:/ 'subscriptionsDelete' smart constructor.
data SubscriptionsDelete = SubscriptionsDelete'
{ _sdCustomerId :: !Text
, _sdDeletionType :: !SubscriptionsDeleteDeletionType
, _sdSubscriptionId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'SubscriptionsDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sdCustomerId'
--
-- * 'sdDeletionType'
--
-- * 'sdSubscriptionId'
subscriptionsDelete
:: Text -- ^ 'sdCustomerId'
-> SubscriptionsDeleteDeletionType -- ^ 'sdDeletionType'
-> Text -- ^ 'sdSubscriptionId'
-> SubscriptionsDelete
subscriptionsDelete pSdCustomerId_ pSdDeletionType_ pSdSubscriptionId_ =
SubscriptionsDelete'
{ _sdCustomerId = pSdCustomerId_
, _sdDeletionType = pSdDeletionType_
, _sdSubscriptionId = pSdSubscriptionId_
}
-- | Id of the Customer
sdCustomerId :: Lens' SubscriptionsDelete Text
sdCustomerId
= lens _sdCustomerId (\ s a -> s{_sdCustomerId = a})
-- | Whether the subscription is to be fully cancelled or downgraded
sdDeletionType :: Lens' SubscriptionsDelete SubscriptionsDeleteDeletionType
sdDeletionType
= lens _sdDeletionType
(\ s a -> s{_sdDeletionType = a})
-- | Id of the subscription, which is unique for a customer
sdSubscriptionId :: Lens' SubscriptionsDelete Text
sdSubscriptionId
= lens _sdSubscriptionId
(\ s a -> s{_sdSubscriptionId = a})
instance GoogleRequest SubscriptionsDelete where
type Rs SubscriptionsDelete = ()
type Scopes SubscriptionsDelete =
'["https://www.googleapis.com/auth/apps.order"]
requestClient SubscriptionsDelete'{..}
= go _sdCustomerId _sdSubscriptionId
(Just _sdDeletionType)
(Just AltJSON)
appsResellerService
where go
= buildClient
(Proxy :: Proxy SubscriptionsDeleteResource)
mempty