/* * 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 SubscribersControllerUnarchiveNotificationRequest = { /** * The identifier of the subscriber */ subscriberId: string; /** * The identifier of the notification */ notificationId: string; /** * Context keys for filtering */ contextKeys?: Array | undefined; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type SubscribersControllerUnarchiveNotificationResponse = { headers: { [k: string]: Array }; result: components.InboxNotificationDto; }; /** @internal */ export type SubscribersControllerUnarchiveNotificationRequest$Outbound = { subscriberId: string; notificationId: string; contextKeys?: Array | undefined; "idempotency-key"?: string | undefined; }; /** @internal */ export const SubscribersControllerUnarchiveNotificationRequest$outboundSchema: z.ZodType< SubscribersControllerUnarchiveNotificationRequest$Outbound, z.ZodTypeDef, SubscribersControllerUnarchiveNotificationRequest > = z.object({ subscriberId: z.string(), notificationId: z.string(), contextKeys: z.array(z.string()).optional(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function subscribersControllerUnarchiveNotificationRequestToJSON( subscribersControllerUnarchiveNotificationRequest: SubscribersControllerUnarchiveNotificationRequest, ): string { return JSON.stringify( SubscribersControllerUnarchiveNotificationRequest$outboundSchema.parse( subscribersControllerUnarchiveNotificationRequest, ), ); } /** @internal */ export const SubscribersControllerUnarchiveNotificationResponse$inboundSchema: z.ZodType< SubscribersControllerUnarchiveNotificationResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.InboxNotificationDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function subscribersControllerUnarchiveNotificationResponseFromJSON( jsonString: string, ): SafeParseResult< SubscribersControllerUnarchiveNotificationResponse, SDKValidationError > { return safeParse( jsonString, (x) => SubscribersControllerUnarchiveNotificationResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SubscribersControllerUnarchiveNotificationResponse' from JSON`, ); }