patch method

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

Updates the specified place action link and returns it.

request - The metadata request object.

Request parameters:

name - Optional. The resource name, in the format locations/{location_id}/placeActionLinks/{place_action_link_id}. The name field will only be considered in UpdatePlaceActionLink and DeletePlaceActionLink requests for updating and deleting links respectively. However, it will be ignored in CreatePlaceActionLink request, where place_action_link_id will be assigned by the server on successful creation of a new link and returned as part of the response. Value must have pattern ^locations/\[^/\]+/placeActionLinks/\[^/\]+$.

updateMask - Required. The specific fields to update. The only editable fields are uri, place_action_type and is_preferred. If the updated link already exists at the same location with the same place_action_type and uri, fails with an ALREADY_EXISTS error.

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

Completes with a PlaceActionLink.

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<PlaceActionLink> patch(
  PlaceActionLink 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 PlaceActionLink.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}