createCalendarEventWithHttpInfo method

Future<Response> createCalendarEventWithHttpInfo(
  1. CreateEventRequest createEventRequest, {
  2. String? xWorkspaceID,
})

Create a calendar event.

Single-account create. account_id is required (no auto-resolve for write operations). Reminder array is mirrored into native tasks under the hood; conference data is auto-attached when conference_type is supplied.

Note: This method returns the HTTP Response.

Parameters:

  • CreateEventRequest createEventRequest (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.

Implementation

Future<Response> createCalendarEventWithHttpInfo(CreateEventRequest createEventRequest, { String? xWorkspaceID, }) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/calendar/events';

  // ignore: prefer_final_locals
  Object? postBody = createEventRequest;

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

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

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


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