/* * 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 OrganizationNotificationSettings = { newOrder: boolean; newSubscription: boolean; }; /** @internal */ export const OrganizationNotificationSettings$inboundSchema: z.ZodMiniType< OrganizationNotificationSettings, unknown > = z.pipe( z.object({ new_order: z.boolean(), new_subscription: z.boolean(), }), z.transform((v) => { return remap$(v, { "new_order": "newOrder", "new_subscription": "newSubscription", }); }), ); /** @internal */ export type OrganizationNotificationSettings$Outbound = { new_order: boolean; new_subscription: boolean; }; /** @internal */ export const OrganizationNotificationSettings$outboundSchema: z.ZodMiniType< OrganizationNotificationSettings$Outbound, OrganizationNotificationSettings > = z.pipe( z.object({ newOrder: z.boolean(), newSubscription: z.boolean(), }), z.transform((v) => { return remap$(v, { newOrder: "new_order", newSubscription: "new_subscription", }); }), ); export function organizationNotificationSettingsToJSON( organizationNotificationSettings: OrganizationNotificationSettings, ): string { return JSON.stringify( OrganizationNotificationSettings$outboundSchema.parse( organizationNotificationSettings, ), ); } export function organizationNotificationSettingsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OrganizationNotificationSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrganizationNotificationSettings' from JSON`, ); }