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

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";
import * as components from "../components/index.js";

export type GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest =
  {
    pageSize?: number | undefined;
    cursor?: string | null | undefined;
    getChatCompletionEventsInSchema: components.GetChatCompletionEventsInSchema;
  };

/** @internal */
export type GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest$Outbound =
  {
    page_size: number;
    cursor?: string | null | undefined;
    GetChatCompletionEventsInSchema:
      components.GetChatCompletionEventsInSchema$Outbound;
  };

/** @internal */
export const GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest$outboundSchema:
  z.ZodType<
    GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest$Outbound,
    z.ZodTypeDef,
    GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest
  > = z.object({
    pageSize: z.number().int().default(50),
    cursor: z.nullable(z.string()).optional(),
    getChatCompletionEventsInSchema:
      components.GetChatCompletionEventsInSchema$outboundSchema,
  }).transform((v) => {
    return remap$(v, {
      pageSize: "page_size",
      getChatCompletionEventsInSchema: "GetChatCompletionEventsInSchema",
    });
  });

export function getChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequestToJSON(
  getChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest:
    GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest,
): string {
  return JSON.stringify(
    GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest$outboundSchema
      .parse(
        getChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest,
      ),
  );
}
