delete method

Future<void> delete(
  1. String customerId,
  2. String subscriptionId,
  3. String deletionType, {
  4. String? $fields,
})

Cancels, suspends, or transfers a subscription to direct.

Request parameters:

customerId - This can be either the customer's primary domain name or the customer's unique identifier. If the domain name for a customer changes, the old domain name cannot be used to access the customer, but the customer's unique identifier (as returned by the API) can always be used. We recommend storing the unique identifier in your systems where applicable.

subscriptionId - This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method.

deletionType - The deletionType query string enables the cancellation, downgrade, or suspension of a subscription. Possible string values are:

  • "deletion_type_undefined"
  • "cancel" : Cancels the subscription immediately. This does not apply to a G Suite subscription.
  • "transfer_to_direct" : Transfers a subscription directly to Google. The customer is immediately transferred to a direct billing relationship with Google and is given a short amount of time with no service interruption. The customer can then choose to set up billing directly with Google by using a credit card, or they can transfer to another reseller.

$fields - Selector specifying which fields to include in a partial response.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<void> delete(
  core.String customerId,
  core.String subscriptionId,
  core.String deletionType, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'deletionType': [deletionType],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'apps/reseller/v1/customers/' +
      commons.escapeVariable('$customerId') +
      '/subscriptions/' +
      commons.escapeVariable('$subscriptionId');

  await _requester.request(
    url_,
    'DELETE',
    queryParams: queryParams_,
    downloadOptions: null,
  );
}