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

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

export const ping = {
  async call(deps: {}): Promise<Result<void, void>> {
    return Ok(undefined);
  },
};

export function serialise_Result_Unit_Unit(value: Result<void, void>): JsonValue {
  if (value.tag === "Ok") return { kind: "Ok", value: null };
  return { kind: "Err", error: null };
}

export function deserialise_Result_Unit_Unit(json: JsonValue, path: string = "$"): Result<Result<void, void>, 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 (obj["kind"] === "Ok") {
  const __v = undefined;
    return Ok(Ok(__v) as Result<void, void>);
  } else if (obj["kind"] === "Err") {
  const __e = undefined;
    return Ok(Err(__e) as Result<void, void>);
  }
  return Err({ kind: "StructuralMismatch", path, expected: "Ok | Err", actual: String(obj["kind"]) });
}

