/* * 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 { BenefitCustom, BenefitCustom$inboundSchema, BenefitCustom$Outbound, BenefitCustom$outboundSchema, } from "./benefitcustom.js"; import { BenefitDiscord, BenefitDiscord$inboundSchema, BenefitDiscord$Outbound, BenefitDiscord$outboundSchema, } from "./benefitdiscord.js"; import { BenefitDownloadables, BenefitDownloadables$inboundSchema, BenefitDownloadables$Outbound, BenefitDownloadables$outboundSchema, } from "./benefitdownloadables.js"; import { BenefitFeatureFlag, BenefitFeatureFlag$inboundSchema, BenefitFeatureFlag$Outbound, BenefitFeatureFlag$outboundSchema, } from "./benefitfeatureflag.js"; import { BenefitGitHubRepository, BenefitGitHubRepository$inboundSchema, BenefitGitHubRepository$Outbound, BenefitGitHubRepository$outboundSchema, } from "./benefitgithubrepository.js"; import { BenefitLicenseKeys, BenefitLicenseKeys$inboundSchema, BenefitLicenseKeys$Outbound, BenefitLicenseKeys$outboundSchema, } from "./benefitlicensekeys.js"; import { BenefitMeterCredit, BenefitMeterCredit$inboundSchema, BenefitMeterCredit$Outbound, BenefitMeterCredit$outboundSchema, } from "./benefitmetercredit.js"; export type Benefit = | BenefitCustom | BenefitDiscord | BenefitDownloadables | BenefitFeatureFlag | BenefitGitHubRepository | BenefitLicenseKeys | BenefitMeterCredit; /** @internal */ export const Benefit$inboundSchema: z.ZodMiniType = z.union([ BenefitCustom$inboundSchema, BenefitDiscord$inboundSchema, BenefitDownloadables$inboundSchema, BenefitFeatureFlag$inboundSchema, BenefitGitHubRepository$inboundSchema, BenefitLicenseKeys$inboundSchema, BenefitMeterCredit$inboundSchema, ]); /** @internal */ export type Benefit$Outbound = | BenefitCustom$Outbound | BenefitDiscord$Outbound | BenefitDownloadables$Outbound | BenefitFeatureFlag$Outbound | BenefitGitHubRepository$Outbound | BenefitLicenseKeys$Outbound | BenefitMeterCredit$Outbound; /** @internal */ export const Benefit$outboundSchema: z.ZodMiniType = z.union([ BenefitCustom$outboundSchema, BenefitDiscord$outboundSchema, BenefitDownloadables$outboundSchema, BenefitFeatureFlag$outboundSchema, BenefitGitHubRepository$outboundSchema, BenefitLicenseKeys$outboundSchema, BenefitMeterCredit$outboundSchema, ]); export function benefitToJSON(benefit: Benefit): string { return JSON.stringify(Benefit$outboundSchema.parse(benefit)); } export function benefitFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Benefit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Benefit' from JSON`, ); }