modifyPushConfig method

Future<Empty> modifyPushConfig(
  1. ModifyPushConfigRequest request,
  2. String subscription, {
  3. String? $fields,
})

Modifies the PushConfig for a specified subscription.

This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.

request - The metadata request object.

Request parameters:

subscription - Required. The name of the subscription. Format is projects/{project}/subscriptions/{sub}. Value must have pattern ^projects/\[^/\]+/subscriptions/\[^/\]+$.

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

Completes with a Empty.

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<Empty> modifyPushConfig(
  ModifyPushConfigRequest request,
  core.String subscription, {
  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_ =
      'v1/' + core.Uri.encodeFull('$subscription') + ':modifyPushConfig';

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