/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: aaf596fa2790
 */

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";
import {
  FilterPayload,
  FilterPayload$Outbound,
  FilterPayload$outboundSchema,
} from "./filterpayload.js";

export type GetChatCompletionEventsInSchema = {
  searchParams: FilterPayload;
  extraFields?: Array<string> | null | undefined;
};

/** @internal */
export type GetChatCompletionEventsInSchema$Outbound = {
  search_params: FilterPayload$Outbound;
  extra_fields?: Array<string> | null | undefined;
};

/** @internal */
export const GetChatCompletionEventsInSchema$outboundSchema: z.ZodType<
  GetChatCompletionEventsInSchema$Outbound,
  z.ZodTypeDef,
  GetChatCompletionEventsInSchema
> = z.object({
  searchParams: FilterPayload$outboundSchema,
  extraFields: z.nullable(z.array(z.string())).optional(),
}).transform((v) => {
  return remap$(v, {
    searchParams: "search_params",
    extraFields: "extra_fields",
  });
});

export function getChatCompletionEventsInSchemaToJSON(
  getChatCompletionEventsInSchema: GetChatCompletionEventsInSchema,
): string {
  return JSON.stringify(
    GetChatCompletionEventsInSchema$outboundSchema.parse(
      getChatCompletionEventsInSchema,
    ),
  );
}
