toolsOzoneReportCreateActivity function

Future<XRPCResponse<ReportCreateActivityOutput>> toolsOzoneReportCreateActivity({
  1. int? reportId,
  2. int? eventId,
  3. required UReportCreateActivityActivity activity,
  4. String? internalNote,
  5. String? publicNote,
  6. bool? isAutomated,
  7. required ServiceContext $ctx,
  8. String? $service,
  9. Map<String, String>? $headers,
  10. Map<String, String>? $unknown,
})

Register an activity on a report. For state-change activity types, validates the transition and updates report.status atomically.

Implementation

Future<XRPCResponse<ReportCreateActivityOutput>>
toolsOzoneReportCreateActivity({
  int? reportId,
  int? eventId,
  required UReportCreateActivityActivity activity,
  String? internalNote,
  String? publicNote,
  bool? isAutomated,
  required ServiceContext $ctx,
  String? $service,
  Map<String, String>? $headers,
  Map<String, String>? $unknown,
}) async => await $ctx.post(
  ns.toolsOzoneReportCreateActivity,
  service: $service,
  headers: {'Content-type': 'application/json', ...?$headers},
  body: {
    ...?$unknown,
    if (reportId != null) 'reportId': reportId,
    if (eventId != null) 'eventId': eventId,
    'activity': activity.toJson(),
    if (internalNote != null) 'internalNote': internalNote,
    if (publicNote != null) 'publicNote': publicNote,
    if (isAutomated != null) 'isAutomated': isAutomated,
  },
  to: const ReportCreateActivityOutputConverter().fromJson,
);