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

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

export interface Event {
  readonly id: string;
}

export const Event = {
};

export const api = {
  async http_POST_hooks_event(body: Event, deps: {}): Promise<HttpResult<string>> {
    return HttpResult.Ok("received");
  },
};

export function serialise_Event(value: Event): JsonValue {
  return {
    id: value.id as JsonValue,
  };
}

export function deserialise_Event(json: JsonValue, path: string = "$"): Result<Event, 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 Event);
}


