/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type NotificationsControllerGetNotificationRequest = { notificationId: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type NotificationsControllerGetNotificationResponse = { headers: { [k: string]: Array }; result: components.ActivityNotificationResponseDto; }; /** @internal */ export type NotificationsControllerGetNotificationRequest$Outbound = { notificationId: string; "idempotency-key"?: string | undefined; }; /** @internal */ export const NotificationsControllerGetNotificationRequest$outboundSchema: z.ZodType< NotificationsControllerGetNotificationRequest$Outbound, z.ZodTypeDef, NotificationsControllerGetNotificationRequest > = z.object({ notificationId: z.string(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function notificationsControllerGetNotificationRequestToJSON( notificationsControllerGetNotificationRequest: NotificationsControllerGetNotificationRequest, ): string { return JSON.stringify( NotificationsControllerGetNotificationRequest$outboundSchema.parse( notificationsControllerGetNotificationRequest, ), ); } /** @internal */ export const NotificationsControllerGetNotificationResponse$inboundSchema: z.ZodType< NotificationsControllerGetNotificationResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ActivityNotificationResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function notificationsControllerGetNotificationResponseFromJSON( jsonString: string, ): SafeParseResult< NotificationsControllerGetNotificationResponse, SDKValidationError > { return safeParse( jsonString, (x) => NotificationsControllerGetNotificationResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'NotificationsControllerGetNotificationResponse' from JSON`, ); }