/* * 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 SubscribersV1ControllerGetNotificationsFeedRequest = { subscriberId: string; page?: number | undefined; limit?: number | undefined; read?: boolean | undefined; seen?: boolean | undefined; /** * Base64 encoded string of the partial payload JSON object */ payload?: string | undefined; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type SubscribersV1ControllerGetNotificationsFeedResponse = { headers: { [k: string]: Array }; result: components.FeedResponseDto; }; /** @internal */ export type SubscribersV1ControllerGetNotificationsFeedRequest$Outbound = { subscriberId: string; page?: number | undefined; limit: number; read?: boolean | undefined; seen?: boolean | undefined; payload?: string | undefined; "idempotency-key"?: string | undefined; }; /** @internal */ export const SubscribersV1ControllerGetNotificationsFeedRequest$outboundSchema: z.ZodType< SubscribersV1ControllerGetNotificationsFeedRequest$Outbound, z.ZodTypeDef, SubscribersV1ControllerGetNotificationsFeedRequest > = z.object({ subscriberId: z.string(), page: z.number().optional(), limit: z.number().default(10), read: z.boolean().optional(), seen: z.boolean().optional(), payload: z.string().optional(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function subscribersV1ControllerGetNotificationsFeedRequestToJSON( subscribersV1ControllerGetNotificationsFeedRequest: SubscribersV1ControllerGetNotificationsFeedRequest, ): string { return JSON.stringify( SubscribersV1ControllerGetNotificationsFeedRequest$outboundSchema.parse( subscribersV1ControllerGetNotificationsFeedRequest, ), ); } /** @internal */ export const SubscribersV1ControllerGetNotificationsFeedResponse$inboundSchema: z.ZodType< SubscribersV1ControllerGetNotificationsFeedResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.FeedResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function subscribersV1ControllerGetNotificationsFeedResponseFromJSON( jsonString: string, ): SafeParseResult< SubscribersV1ControllerGetNotificationsFeedResponse, SDKValidationError > { return safeParse( jsonString, (x) => SubscribersV1ControllerGetNotificationsFeedResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SubscribersV1ControllerGetNotificationsFeedResponse' from JSON`, ); }