listPurchasableOffers method

Future<GoogleCloudChannelV1ListPurchasableOffersResponse> listPurchasableOffers(
  1. String customer, {
  2. String? changeOfferPurchase_billingAccount,
  3. String? changeOfferPurchase_entitlement,
  4. String? changeOfferPurchase_newSku,
  5. String? createEntitlementPurchase_billingAccount,
  6. String? createEntitlementPurchase_sku,
  7. String? languageCode,
  8. int? pageSize,
  9. String? pageToken,
  10. String? $fields,
})

Lists the following: * Offers that you can purchase for a customer.

  • Offers that you can change for an entitlement. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Request parameters:

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

changeOfferPurchase_billingAccount - Optional. Resource name of the new target Billing Account. Provide this Billing Account when setting up billing for a trial subscription. Format: accounts/{account_id}/billingAccounts/{billing_account_id}. This field is only relevant for multi-currency accounts. It should be left empty for single currency accounts.

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

changeOfferPurchase_newSku - Optional. Resource name of the new target SKU. Provide this SKU when upgrading or downgrading an entitlement. Format: products/{product_id}/skus/{sku_id}

createEntitlementPurchase_billingAccount - Optional. Billing account that the result should be restricted to. Format: accounts/{account_id}/billingAccounts/{billing_account_id}.

createEntitlementPurchase_sku - Required. SKU that the result should be restricted to. Format: products/{product_id}/skus/{sku_id}.

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 Offers. 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 GoogleCloudChannelV1ListPurchasableOffersResponse.

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<GoogleCloudChannelV1ListPurchasableOffersResponse>
    listPurchasableOffers(
  core.String customer, {
  core.String? changeOfferPurchase_billingAccount,
  core.String? changeOfferPurchase_entitlement,
  core.String? changeOfferPurchase_newSku,
  core.String? createEntitlementPurchase_billingAccount,
  core.String? createEntitlementPurchase_sku,
  core.String? languageCode,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (changeOfferPurchase_billingAccount != null)
      'changeOfferPurchase.billingAccount': [
        changeOfferPurchase_billingAccount
      ],
    if (changeOfferPurchase_entitlement != null)
      'changeOfferPurchase.entitlement': [changeOfferPurchase_entitlement],
    if (changeOfferPurchase_newSku != null)
      'changeOfferPurchase.newSku': [changeOfferPurchase_newSku],
    if (createEntitlementPurchase_billingAccount != null)
      'createEntitlementPurchase.billingAccount': [
        createEntitlementPurchase_billingAccount
      ],
    if (createEntitlementPurchase_sku != null)
      'createEntitlementPurchase.sku': [createEntitlementPurchase_sku],
    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') + ':listPurchasableOffers';

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