patch method

Future<LicenseAssignment> patch(
  1. LicenseAssignment request,
  2. String productId,
  3. String skuId,
  4. String userId, {
  5. String? $fields,
})

Reassign a user's product SKU with a different SKU in the same product.

This method supports patch semantics.

request - The metadata request object.

Request parameters:

productId - A product's unique identifier. For more information about products in this version of the API, see Products and SKUs.

skuId - A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs.

userId - The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. If the userId is suspended, the license status changes.

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

Completes with a LicenseAssignment.

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<LicenseAssignment> patch(
  LicenseAssignment request,
  core.String productId,
  core.String skuId,
  core.String userId, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'apps/licensing/v1/product/' +
      commons.escapeVariable('$productId') +
      '/sku/' +
      commons.escapeVariable('$skuId') +
      '/user/' +
      commons.escapeVariable('$userId');

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