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

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 FetchFieldOptionCountsRequest = {
  filterParams?: FilterPayload | null | undefined;
};

/** @internal */
export type FetchFieldOptionCountsRequest$Outbound = {
  filter_params?: FilterPayload$Outbound | null | undefined;
};

/** @internal */
export const FetchFieldOptionCountsRequest$outboundSchema: z.ZodType<
  FetchFieldOptionCountsRequest$Outbound,
  FetchFieldOptionCountsRequest
> = z.object({
  filterParams: z.nullable(FilterPayload$outboundSchema).optional(),
}).transform((v) => {
  return remap$(v, {
    filterParams: "filter_params",
  });
});

export function fetchFieldOptionCountsRequestToJSON(
  fetchFieldOptionCountsRequest: FetchFieldOptionCountsRequest,
): string {
  return JSON.stringify(
    FetchFieldOptionCountsRequest$outboundSchema.parse(
      fetchFieldOptionCountsRequest,
    ),
  );
}
