createComponentObjectNote function

Future<ApiResponse<ComponentObjectNote>> createComponentObjectNote(
  1. ExsitedClient client,
  2. Object componentUuid,
  3. Object componentObjectId,
  4. String note, {
  5. Map<String, Object?>? files,
  6. bool? raiseOnError,
  7. String? responseFormat,
})

POST /api/{api_version}/components/{component_uuid}/objects/{component_object_id}/notes

Attach a note; a form, the text as the note field with any files beside it.

Implementation

Future<ApiResponse<ComponentObjectNote>> createComponentObjectNote(
  ExsitedClient client,
  Object componentUuid,
  Object componentObjectId,
  String note, {
  Map<String, Object?>? files,
  bool? raiseOnError,
  String? responseFormat,
}) {
  if (note.isEmpty) {
    throw SdkUsageError(
        'note is required: the note text is the body of this request');
  }
  return client.sendPostRequest(CustomComponentsUrls.componentObjectNotes,
      pathParams: {
        'component_uuid': componentUuid,
        'component_object_id': componentObjectId
      },
      formData: {'note': note},
      files: files,
      raiseOnError: raiseOnError,
      responseFormat: responseFormat,
      dtoDecoder: ComponentObjectNote.fromMap);
}