/* * 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"; import { AuditOrganizationNotificationSubscription, AuditOrganizationNotificationSubscription$inboundSchema, } from "./auditorganizationnotificationsubscription.js"; /** * Organization notifications record returned by the auditor API. * * @remarks * * Ad-hoc single-row payload per domain mirroring the shape of the * Organization → Notifications page. Only `id` is guaranteed; every other * field is optional because controlled audit views can strip any column * from the response. */ export type AuditOrganizationNotifications = { /** * Domain identifier of the audited organization. */ id: string; /** * IANA timezone identifier that determines when scheduled reminder * * @remarks * notifications are sent. `null` means the organization has no configured * preference ("Anytime" in the UI). */ preferredTimeZone?: string | null | undefined; /** * Frequency at which personnel reminder digests are sent (e.g. `DAILY`, * * @remarks * `WEEKLY`, or `NEVER`). `null` when no notification settings have been * configured for the organization. */ employeeDigestFrequency?: string | null | undefined; /** * Channels on which the personnel reminder digest is delivered (e.g. * * @remarks * `["EMAIL"]` or `["EMAIL", "SLACK"]`). */ subscribedChannelTypes?: Array | undefined; /** * External notification subscriptions — one row per mailing-list address * * @remarks * plus category pairing. Covers Compliance, Vendors, Access Reviews, and * Trust Center categories. */ externalNotifications?: | Array | undefined; }; /** @internal */ export const AuditOrganizationNotifications$inboundSchema: z.ZodType< AuditOrganizationNotifications, z.ZodTypeDef, unknown > = z.object({ id: z.string(), preferredTimeZone: z.nullable(z.string()).optional(), employeeDigestFrequency: z.nullable(z.string()).optional(), subscribedChannelTypes: z.array(z.string()).optional(), externalNotifications: z.array( AuditOrganizationNotificationSubscription$inboundSchema, ).optional(), }); export function auditOrganizationNotificationsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuditOrganizationNotifications$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuditOrganizationNotifications' from JSON`, ); }