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

import * as z from "zod/v4";
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;
    searchChatCompletionEventsRequest:
      components.SearchChatCompletionEventsRequest;
  };

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

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

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