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

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

/**
 * The operator to use for filtering options
 */
export const Operator = {
  Lt: "lt",
  Lte: "lte",
  Gt: "gt",
  Gte: "gte",
  Startswith: "startswith",
  Istartswith: "istartswith",
  Endswith: "endswith",
  Iendswith: "iendswith",
  Contains: "contains",
  Icontains: "icontains",
  Matches: "matches",
  Notcontains: "notcontains",
  Inotcontains: "inotcontains",
  Eq: "eq",
  Neq: "neq",
  Isnull: "isnull",
  Includes: "includes",
  Excludes: "excludes",
  LenEq: "len_eq",
} as const;
/**
 * The operator to use for filtering options
 */
export type Operator = ClosedEnum<typeof Operator>;

export type GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest =
  {
    fieldName: string;
    /**
     * The operator to use for filtering options
     */
    operator: Operator;
  };

/** @internal */
export const Operator$outboundSchema: z.ZodEnum<typeof Operator> = z.enum(
  Operator,
);

/** @internal */
export type GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest$Outbound =
  {
    field_name: string;
    operator: string;
  };

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

export function getChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequestToJSON(
  getChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest:
    GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest,
): string {
  return JSON.stringify(
    GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest$outboundSchema
      .parse(
        getChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest,
      ),
  );
}
