updateCalendarEventWithHttpInfo method

Future<Response> updateCalendarEventWithHttpInfo(
  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.

Note: This method returns the HTTP Response.

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<Response> updateCalendarEventWithHttpInfo(String id, UpdateEventRequest updateEventRequest, { String? xWorkspaceID, String? accountId, }) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/calendar/events/{id}'
    .replaceAll('{id}', id);

  // ignore: prefer_final_locals
  Object? postBody = updateEventRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (accountId != null) {
    queryParams.addAll(_queryParams('', 'account_id', accountId));
  }

  if (xWorkspaceID != null) {
    headerParams[r'X-Workspace-ID'] = parameterToString(xWorkspaceID);
  }

  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'PATCH',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}