patch method

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

Updates a support event subscription.

EXAMPLES: cURL: shell support_event_subscription="organizations/123456789/supportEventSubscriptions/abcdef123456" curl \ --request PATCH \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header "Content-Type: application/json" \ --data '{ "pub_sub_topic": "projects/my-project/topics/new-topic" }' \ "https://cloudsupport.googleapis.com/v2/$support_event_subscription?updateMask=pub_sub_topic" Python: python import googleapiclient.discovery api_version = "v2" supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", ) request = supportApiService.supportEventSubscriptions().patch( name="organizations/123456789/supportEventSubscriptions/abcdef123456", body={ "pub_sub_topic": "projects/my-project/topics/new-topic" }, ) print(request.execute())

request - The metadata request object.

Request parameters:

name - Identifier. The resource name of the support event subscription. Value must have pattern ^organizations/\[^/\]+/supportEventSubscriptions/\[^/\]+$.

updateMask - Optional. The list of fields to update. The only supported value is pub_sub_topic.

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

Completes with a SupportEventSubscription.

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<SupportEventSubscription> patch(
  SupportEventSubscription 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>>{
    'updateMask': ?updateMask == null ? null : [updateMask],
    'fields': ?$fields == null ? null : [$fields],
  };

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

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