/*
 * 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";

export type BenefitDownloadablesProperties = {
  archived: { [k: string]: boolean };
  files: Array<string>;
};

/** @internal */
export const BenefitDownloadablesProperties$inboundSchema: z.ZodMiniType<
  BenefitDownloadablesProperties,
  unknown
> = z.object({
  archived: z.record(z.string(), z.boolean()),
  files: z.array(z.string()),
});
/** @internal */
export type BenefitDownloadablesProperties$Outbound = {
  archived: { [k: string]: boolean };
  files: Array<string>;
};

/** @internal */
export const BenefitDownloadablesProperties$outboundSchema: z.ZodMiniType<
  BenefitDownloadablesProperties$Outbound,
  BenefitDownloadablesProperties
> = z.object({
  archived: z.record(z.string(), z.boolean()),
  files: z.array(z.string()),
});

export function benefitDownloadablesPropertiesToJSON(
  benefitDownloadablesProperties: BenefitDownloadablesProperties,
): string {
  return JSON.stringify(
    BenefitDownloadablesProperties$outboundSchema.parse(
      benefitDownloadablesProperties,
    ),
  );
}
export function benefitDownloadablesPropertiesFromJSON(
  jsonString: string,
): SafeParseResult<BenefitDownloadablesProperties, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => BenefitDownloadablesProperties$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'BenefitDownloadablesProperties' from JSON`,
  );
}
