updateCalendarEvent method

Future<CreateCalendarEvent201Response?> updateCalendarEvent(
  1. String id,
  2. UpdateEventRequest updateEventRequest, {
  3. String? xWorkspaceID,
  4. String? accountId,
})

Update an event (sparse).

Partial update. account_id may be supplied in the body (preferred) or as ?account_id= query param — the renderer's update path puts it in the URL while create puts it in the body. updates is a free-form map; the platform's capability gate rejects fields the provider doesn't support.

Parameters:

  • String id (required): Event id.

  • UpdateEventRequest updateEventRequest (required):

  • String xWorkspaceID: Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

  • String accountId: Optional account-id filter (snake_case).

Implementation

Future<CreateCalendarEvent201Response?> updateCalendarEvent(String id, UpdateEventRequest updateEventRequest, { String? xWorkspaceID, String? accountId, }) async {
  final response = await updateCalendarEventWithHttpInfo(id, updateEventRequest,  xWorkspaceID: xWorkspaceID, accountId: accountId, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CreateCalendarEvent201Response',) as CreateCalendarEvent201Response;

  }
  return null;
}