/*
 * 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";
import { Pagination, Pagination$inboundSchema } from "./pagination.js";
import { Refund, Refund$inboundSchema } from "./refund.js";

export type ListResourceRefund = {
  items: Array<Refund>;
  pagination: Pagination;
};

/** @internal */
export const ListResourceRefund$inboundSchema: z.ZodMiniType<
  ListResourceRefund,
  unknown
> = z.object({
  items: z.array(Refund$inboundSchema),
  pagination: Pagination$inboundSchema,
});

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