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

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

export type BenefitDownloadablesSubscriberProperties = {
  activeFiles: Array<string>;
};

/** @internal */
export const BenefitDownloadablesSubscriberProperties$inboundSchema:
  z.ZodMiniType<BenefitDownloadablesSubscriberProperties, unknown> = z.pipe(
    z.object({
      active_files: z.array(z.string()),
    }),
    z.transform((v) => {
      return remap$(v, {
        "active_files": "activeFiles",
      });
    }),
  );

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