list method

Future<Subscriptions> list({
  1. String? customerAuthToken,
  2. String? customerId,
  3. String? customerNamePrefix,
  4. int? maxResults,
  5. String? pageToken,
  6. String? $fields,
})

Lists of subscriptions managed by the reseller.

The list can be all subscriptions, all of a customer's subscriptions, or all of a customer's transferable subscriptions. Optionally, this method can filter the response by a customerNamePrefix. For more information, see [manage subscriptions](/admin-sdk/reseller/v1/how-tos/manage_subscriptions).

Request parameters:

customerAuthToken - The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center.

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.

customerNamePrefix - When retrieving all of your subscriptions and filtering for specific customers, you can enter a prefix for a customer name. Using an example customer group that includes exam.com, example20.com and example.com: - exa -- Returns all customer names that start with 'exa' which could include exam.com, example20.com, and example.com. A name prefix is similar to using a regular expression's asterisk, exa*. - example -- Returns example20.com and example.com.

maxResults - When retrieving a large list, the maxResults is the maximum number of results per page. The nextPageToken value takes you to the next page. The default is 20. Value must be between "1" and "100".

pageToken - Token to specify next page in the list

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

Completes with a Subscriptions.

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<Subscriptions> list({
  core.String? customerAuthToken,
  core.String? customerId,
  core.String? customerNamePrefix,
  core.int? maxResults,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (customerAuthToken != null) 'customerAuthToken': [customerAuthToken],
    if (customerId != null) 'customerId': [customerId],
    if (customerNamePrefix != null)
      'customerNamePrefix': [customerNamePrefix],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'apps/reseller/v1/subscriptions';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return Subscriptions.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}