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

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

export type GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest =
  {
    fieldName: string;
    fetchFieldOptionCountsRequest: components.FetchFieldOptionCountsRequest;
  };

/** @internal */
export type GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest$Outbound =
  {
    field_name: string;
    FetchFieldOptionCountsRequest:
      components.FetchFieldOptionCountsRequest$Outbound;
  };

/** @internal */
export const GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest$outboundSchema:
  z.ZodType<
    GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest$Outbound,
    GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest
  > = z.object({
    fieldName: z.string(),
    fetchFieldOptionCountsRequest:
      components.FetchFieldOptionCountsRequest$outboundSchema,
  }).transform((v) => {
    return remap$(v, {
      fieldName: "field_name",
      fetchFieldOptionCountsRequest: "FetchFieldOptionCountsRequest",
    });
  });

export function getChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequestToJSON(
  getChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest:
    GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest,
): string {
  return JSON.stringify(
    GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest$outboundSchema
      .parse(
        getChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest,
      ),
  );
}
