listPurchasableSkus method

Future<GoogleCloudChannelV1ListPurchasableSkusResponse> listPurchasableSkus(
  1. String customer, {
  2. String? changeOfferPurchase_changeType,
  3. String? changeOfferPurchase_entitlement,
  4. String? createEntitlementPurchase_product,
  5. String? languageCode,
  6. int? pageSize,
  7. String? pageToken,
  8. String? $fields,
})

Lists the following: * SKUs that you can purchase for a customer * SKUs that you can upgrade or downgrade for an entitlement.

Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Request parameters:

customer - Required. The resource name of the customer to list SKUs for. Format: accounts/{account_id}/customers/{customer_id}. Value must have pattern ^accounts/\[^/\]+/customers/\[^/\]+$.

changeOfferPurchase_changeType - Required. Change Type for the entitlement. Possible string values are:

  • "CHANGE_TYPE_UNSPECIFIED" : Not used.
  • "UPGRADE" : SKU is an upgrade on the current entitlement.
  • "DOWNGRADE" : SKU is a downgrade on the current entitlement.

changeOfferPurchase_entitlement - Required. Resource name of the entitlement. Format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

createEntitlementPurchase_product - Required. List SKUs belonging to this Product. Format: products/{product_id}. Supports products/- to retrieve SKUs for all products.

languageCode - Optional. The BCP-47 language code. For example, "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US".

pageSize - Optional. Requested page size. Server might return fewer results than requested. If unspecified, returns at most 100 SKUs. The maximum value is 1000; the server will coerce values above 1000.

pageToken - Optional. A token for a page of results other than the first page.

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

Completes with a GoogleCloudChannelV1ListPurchasableSkusResponse.

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<GoogleCloudChannelV1ListPurchasableSkusResponse>
    listPurchasableSkus(
  core.String customer, {
  core.String? changeOfferPurchase_changeType,
  core.String? changeOfferPurchase_entitlement,
  core.String? createEntitlementPurchase_product,
  core.String? languageCode,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (changeOfferPurchase_changeType != null)
      'changeOfferPurchase.changeType': [changeOfferPurchase_changeType],
    if (changeOfferPurchase_entitlement != null)
      'changeOfferPurchase.entitlement': [changeOfferPurchase_entitlement],
    if (createEntitlementPurchase_product != null)
      'createEntitlementPurchase.product': [
        createEntitlementPurchase_product
      ],
    if (languageCode != null) 'languageCode': [languageCode],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' + core.Uri.encodeFull('$customer') + ':listPurchasableSkus';

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