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

export type ListResourceCustomerCustomerMeter = {
  items: Array<CustomerCustomerMeter>;
  pagination: Pagination;
};

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

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