patch method

Future<ProductCertification> patch(
  1. ProductCertification request,
  2. String name, {
  3. String? updateMask,
  4. String? $fields,
})

Updates (or creates if allow_missing = true) a product certification which links certifications with products.

This method can only be called by certification bodies.

request - The metadata request object.

Request parameters:

name - Required. The unique name identifier of a product certification Format: accounts/{account}/languages/{language_code}/productCertifications/{id} Where id is a some unique identifier and language_code is a 2-letter ISO 639-1 code of a Shopping supported language according to https://support.google.com/merchants/answer/160637. Value must have pattern ^accounts/\[^/\]+/languages/\[^/\]+/productCertifications/\[^/\]+$.

updateMask - Optional. The list of fields to update according to aip.dev/134. However, only full update is supported as of right now. Therefore, it can be either ignored or set to "*". Setting any other values will returns UNIMPLEMENTED error.

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

Completes with a ProductCertification.

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

  final url_ = 'v1/' + core.Uri.encodeFull('$name');

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