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

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

/**
 * Order's invoice data.
 */
export type OrderInvoice = {
  /**
   * The URL to the invoice.
   */
  url: string;
};

/** @internal */
export const OrderInvoice$inboundSchema: z.ZodMiniType<OrderInvoice, unknown> =
  z.object({
    url: z.string(),
  });

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