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

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

export type GetTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest =
  {
    fieldName: string;
    from?: Date | null | undefined;
    to?: Date | null | undefined;
  };

/** @internal */
export type GetTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest$Outbound =
  {
    field_name: string;
    from?: string | null | undefined;
    to?: string | null | undefined;
  };

/** @internal */
export const GetTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest$outboundSchema:
  z.ZodType<
    GetTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest$Outbound,
    GetTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest
  > = z.object({
    fieldName: z.string(),
    from: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    to: z.nullable(z.date().transform(v => v.toISOString())).optional(),
  }).transform((v) => {
    return remap$(v, {
      fieldName: "field_name",
    });
  });

export function getTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequestToJSON(
  getTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest:
    GetTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest,
): string {
  return JSON.stringify(
    GetTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest$outboundSchema
      .parse(
        getTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest,
      ),
  );
}
