/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { Field, Field$inboundSchema, Field$Outbound, Field$outboundSchema, } from "./field.js"; import { ProviderMessage, ProviderMessage$inboundSchema, ProviderMessage$Outbound, ProviderMessage$outboundSchema, } from "./providermessage.js"; export type NotificationResource = { id?: number | undefined; name?: string | null | undefined; fields?: Array | null | undefined; implementationName?: string | null | undefined; implementation?: string | null | undefined; configContract?: string | null | undefined; infoLink?: string | null | undefined; message?: ProviderMessage | undefined; tags?: Array | null | undefined; presets?: Array | null | undefined; link?: string | null | undefined; onGrab?: boolean | undefined; onHealthIssue?: boolean | undefined; onHealthRestored?: boolean | undefined; onApplicationUpdate?: boolean | undefined; supportsOnGrab?: boolean | undefined; includeManualGrabs?: boolean | undefined; supportsOnHealthIssue?: boolean | undefined; supportsOnHealthRestored?: boolean | undefined; includeHealthWarnings?: boolean | undefined; supportsOnApplicationUpdate?: boolean | undefined; testCommand?: string | null | undefined; }; /** @internal */ export const NotificationResource$inboundSchema: z.ZodType< NotificationResource, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), name: z.nullable(z.string()).optional(), fields: z.nullable(z.array(Field$inboundSchema)).optional(), implementationName: z.nullable(z.string()).optional(), implementation: z.nullable(z.string()).optional(), configContract: z.nullable(z.string()).optional(), infoLink: z.nullable(z.string()).optional(), message: ProviderMessage$inboundSchema.optional(), tags: z.nullable(z.array(z.number().int())).optional(), presets: z.nullable(z.array(z.lazy(() => NotificationResource$inboundSchema))) .optional(), link: z.nullable(z.string()).optional(), onGrab: z.boolean().optional(), onHealthIssue: z.boolean().optional(), onHealthRestored: z.boolean().optional(), onApplicationUpdate: z.boolean().optional(), supportsOnGrab: z.boolean().optional(), includeManualGrabs: z.boolean().optional(), supportsOnHealthIssue: z.boolean().optional(), supportsOnHealthRestored: z.boolean().optional(), includeHealthWarnings: z.boolean().optional(), supportsOnApplicationUpdate: z.boolean().optional(), testCommand: z.nullable(z.string()).optional(), }); /** @internal */ export type NotificationResource$Outbound = { id?: number | undefined; name?: string | null | undefined; fields?: Array | null | undefined; implementationName?: string | null | undefined; implementation?: string | null | undefined; configContract?: string | null | undefined; infoLink?: string | null | undefined; message?: ProviderMessage$Outbound | undefined; tags?: Array | null | undefined; presets?: Array | null | undefined; link?: string | null | undefined; onGrab?: boolean | undefined; onHealthIssue?: boolean | undefined; onHealthRestored?: boolean | undefined; onApplicationUpdate?: boolean | undefined; supportsOnGrab?: boolean | undefined; includeManualGrabs?: boolean | undefined; supportsOnHealthIssue?: boolean | undefined; supportsOnHealthRestored?: boolean | undefined; includeHealthWarnings?: boolean | undefined; supportsOnApplicationUpdate?: boolean | undefined; testCommand?: string | null | undefined; }; /** @internal */ export const NotificationResource$outboundSchema: z.ZodType< NotificationResource$Outbound, z.ZodTypeDef, NotificationResource > = z.object({ id: z.number().int().optional(), name: z.nullable(z.string()).optional(), fields: z.nullable(z.array(Field$outboundSchema)).optional(), implementationName: z.nullable(z.string()).optional(), implementation: z.nullable(z.string()).optional(), configContract: z.nullable(z.string()).optional(), infoLink: z.nullable(z.string()).optional(), message: ProviderMessage$outboundSchema.optional(), tags: z.nullable(z.array(z.number().int())).optional(), presets: z.nullable( z.array(z.lazy(() => NotificationResource$outboundSchema)), ).optional(), link: z.nullable(z.string()).optional(), onGrab: z.boolean().optional(), onHealthIssue: z.boolean().optional(), onHealthRestored: z.boolean().optional(), onApplicationUpdate: z.boolean().optional(), supportsOnGrab: z.boolean().optional(), includeManualGrabs: z.boolean().optional(), supportsOnHealthIssue: z.boolean().optional(), supportsOnHealthRestored: z.boolean().optional(), includeHealthWarnings: z.boolean().optional(), supportsOnApplicationUpdate: z.boolean().optional(), testCommand: z.nullable(z.string()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace NotificationResource$ { /** @deprecated use `NotificationResource$inboundSchema` instead. */ export const inboundSchema = NotificationResource$inboundSchema; /** @deprecated use `NotificationResource$outboundSchema` instead. */ export const outboundSchema = NotificationResource$outboundSchema; /** @deprecated use `NotificationResource$Outbound` instead. */ export type Outbound = NotificationResource$Outbound; } export function notificationResourceToJSON( notificationResource: NotificationResource, ): string { return JSON.stringify( NotificationResource$outboundSchema.parse(notificationResource), ); } export function notificationResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NotificationResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NotificationResource' from JSON`, ); }