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

import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type TempoTraceAttributeArrayElement = {
  /**
   * A string element in the array
   */
  stringValue?: string | null | undefined;
  /**
   * An integer element in the array
   */
  intValue?: string | null | undefined;
  /**
   * A boolean element in the array
   */
  boolValue?: boolean | null | undefined;
};

/** @internal */
export const TempoTraceAttributeArrayElement$inboundSchema: z.ZodType<
  TempoTraceAttributeArrayElement,
  unknown
> = z.object({
  stringValue: z.nullable(z.string()).optional(),
  intValue: z.nullable(z.string()).optional(),
  boolValue: z.nullable(z.boolean()).optional(),
});

export function tempoTraceAttributeArrayElementFromJSON(
  jsonString: string,
): SafeParseResult<TempoTraceAttributeArrayElement, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TempoTraceAttributeArrayElement$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TempoTraceAttributeArrayElement' from JSON`,
  );
}
