/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * A single external-notification subscription row returned by the auditor * * @remarks * organization notifications API. Represents one mailing-list address + * notification-category pairing. */ export type AuditOrganizationNotificationSubscription = { /** * Subscription record identifier. */ id: string; /** * Email address that receives notifications for this category. */ address: string; /** * Cadence of summary notifications for this subscription, or null for * * @remarks * non-summary (immediate / reminder) subscriptions. */ cadence: string | null; /** * Notification category the subscription belongs to (e.g. * * @remarks * `SUMMARY_EMPLOYEE`, `NEW_VENDORS_DISCOVERED_EMAIL`, * `TRUST_REPORT_ACCESS_REQUEST_EMAIL`). */ unsubSettingsKey: string; /** * Whether the address is currently subscribed to receive this category's * * @remarks * notifications. */ toggleIsSubscribed: boolean; }; /** @internal */ export const AuditOrganizationNotificationSubscription$inboundSchema: z.ZodType< AuditOrganizationNotificationSubscription, z.ZodTypeDef, unknown > = z.object({ id: z.string(), address: z.string(), cadence: z.nullable(z.string()), unsubSettingsKey: z.string(), toggleIsSubscribed: z.boolean(), }); export function auditOrganizationNotificationSubscriptionFromJSON( jsonString: string, ): SafeParseResult< AuditOrganizationNotificationSubscription, SDKValidationError > { return safeParse( jsonString, (x) => AuditOrganizationNotificationSubscription$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AuditOrganizationNotificationSubscription' from JSON`, ); }