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

/**
 * Properties available to subscribers for a benefit of type `custom`.
 */
export type BenefitCustomSubscriberProperties = {
  note: string | null;
};

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

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