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

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

export type FieldOptionCountsInSchema = {
  filterParams?: FilterPayload | null | undefined;
};

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

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

export function fieldOptionCountsInSchemaToJSON(
  fieldOptionCountsInSchema: FieldOptionCountsInSchema,
): string {
  return JSON.stringify(
    FieldOptionCountsInSchema$outboundSchema.parse(fieldOptionCountsInSchema),
  );
}
