Pending Work Events

A PendingWorkEvent is a log record for pending file work failures, such as GPG Encryption and GPG Decryption.

List Pending Work Events

SDK Method

PendingWorkEvent.list()

Return Object

PendingWorkEvent[]

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import PendingWorkEvent from 'files.com/lib/models/PendingWorkEvent';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const pendingWorkEvents = await PendingWorkEvent.list();
  for (const pendingWorkEvent of pendingWorkEvents) {
    // Operate on pendingWorkEvent
  }
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Show Pending Work Event

SDK Method

PendingWorkEvent.find()

Return Object

PendingWorkEvent

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Method Arguments

ArgumentDescription
id
int64
Required
Pending Work Event ID.

Example Request

import PendingWorkEvent from 'files.com/lib/models/PendingWorkEvent';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const pendingWorkEvent = await PendingWorkEvent.find(id);
  // Operate on pendingWorkEvent
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

The PendingWorkEvent Object

Some of the methods above return a PendingWorkEvent object. The attributes of this object are listed below.

AttributeDescription
id
int64
Event ID
event_type
string
Type of pending work event being recorded.
status
string
Status of event.
Possible values: success, failure, partial_failure, in_progress, skipped
body
string
Event body.
event_errors
array(string)
Event errors.
created_at
date-time
Event create date/time.
body_url
string
Link to log file.
folder_behavior_id
int64
Folder Behavior ID.