/* * 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 SubscribersControllerSnoozeNotificationRequest = { /** * 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; snoozeSubscriberNotificationDto: components.SnoozeSubscriberNotificationDto; }; export type SubscribersControllerSnoozeNotificationResponse = { headers: { [k: string]: Array }; result: components.InboxNotificationDto; }; /** @internal */ export type SubscribersControllerSnoozeNotificationRequest$Outbound = { subscriberId: string; notificationId: string; contextKeys?: Array | undefined; "idempotency-key"?: string | undefined; SnoozeSubscriberNotificationDto: components.SnoozeSubscriberNotificationDto$Outbound; }; /** @internal */ export const SubscribersControllerSnoozeNotificationRequest$outboundSchema: z.ZodType< SubscribersControllerSnoozeNotificationRequest$Outbound, z.ZodTypeDef, SubscribersControllerSnoozeNotificationRequest > = z.object({ subscriberId: z.string(), notificationId: z.string(), contextKeys: z.array(z.string()).optional(), idempotencyKey: z.string().optional(), snoozeSubscriberNotificationDto: components.SnoozeSubscriberNotificationDto$outboundSchema, }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", snoozeSubscriberNotificationDto: "SnoozeSubscriberNotificationDto", }); }); export function subscribersControllerSnoozeNotificationRequestToJSON( subscribersControllerSnoozeNotificationRequest: SubscribersControllerSnoozeNotificationRequest, ): string { return JSON.stringify( SubscribersControllerSnoozeNotificationRequest$outboundSchema.parse( subscribersControllerSnoozeNotificationRequest, ), ); } /** @internal */ export const SubscribersControllerSnoozeNotificationResponse$inboundSchema: z.ZodType< SubscribersControllerSnoozeNotificationResponse, 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 subscribersControllerSnoozeNotificationResponseFromJSON( jsonString: string, ): SafeParseResult< SubscribersControllerSnoozeNotificationResponse, SDKValidationError > { return safeParse( jsonString, (x) => SubscribersControllerSnoozeNotificationResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SubscribersControllerSnoozeNotificationResponse' from JSON`, ); }