// Generated by bynkc — do not edit by hand.
// context jobs

import { Ok, Err, Some, None, type Result, type Option, type ValidationError, QueueResult, type JsonValue, type BoundaryError, type ServiceBinding, callService, boundaryError } from "../../runtime.js";

export interface Job {
  readonly id: string;
}

export const Job = {
};

export const highWorker = {
  async queue_highWorker_0(message: Job, deps: {}): Promise<QueueResult> {
    return QueueResult.Ack;
  },
};

export const lowWorker = {
  async queue_lowWorker_0(message: Job, deps: {}): Promise<QueueResult> {
    return QueueResult.Ack;
  },
};

export function serialise_Job(value: Job): JsonValue {
  return {
    id: value.id as JsonValue,
  };
}

export function deserialise_Job(json: JsonValue, path: string = "$"): Result<Job, BoundaryError> {
  if (typeof json !== "object" || json === null || Array.isArray(json)) {
    return Err({ kind: "StructuralMismatch", path, expected: "object", actual: typeof json });
  }
  const obj = json as { [k: string]: JsonValue };
  if (typeof obj["id"] !== "string") {
    return Err({ kind: "StructuralMismatch", path: `${path}.id`, expected: "string", actual: typeof obj["id"] });
  }
  const __id = obj["id"];
  return Ok({ id: __id } as Job);
}


