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

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

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

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

/** @internal */
export const SearchChatCompletionEventsRequest$outboundSchema: z.ZodType<
  SearchChatCompletionEventsRequest$Outbound,
  SearchChatCompletionEventsRequest
> = 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 searchChatCompletionEventsRequestToJSON(
  searchChatCompletionEventsRequest: SearchChatCompletionEventsRequest,
): string {
  return JSON.stringify(
    SearchChatCompletionEventsRequest$outboundSchema.parse(
      searchChatCompletionEventsRequest,
    ),
  );
}
