/* * 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 SubscribersV1ControllerGetUnseenCountRequest = { subscriberId: string; /** * Indicates whether to count seen notifications. */ seen?: boolean | undefined; /** * The maximum number of notifications to return. */ limit?: number | undefined; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type SubscribersV1ControllerGetUnseenCountResponse = { headers: { [k: string]: Array }; result: components.UnseenCountResponse; }; /** @internal */ export type SubscribersV1ControllerGetUnseenCountRequest$Outbound = { subscriberId: string; seen: boolean; limit: number; "idempotency-key"?: string | undefined; }; /** @internal */ export const SubscribersV1ControllerGetUnseenCountRequest$outboundSchema: z.ZodType< SubscribersV1ControllerGetUnseenCountRequest$Outbound, z.ZodTypeDef, SubscribersV1ControllerGetUnseenCountRequest > = z.object({ subscriberId: z.string(), seen: z.boolean().default(false), limit: z.number().default(100), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function subscribersV1ControllerGetUnseenCountRequestToJSON( subscribersV1ControllerGetUnseenCountRequest: SubscribersV1ControllerGetUnseenCountRequest, ): string { return JSON.stringify( SubscribersV1ControllerGetUnseenCountRequest$outboundSchema.parse( subscribersV1ControllerGetUnseenCountRequest, ), ); } /** @internal */ export const SubscribersV1ControllerGetUnseenCountResponse$inboundSchema: z.ZodType< SubscribersV1ControllerGetUnseenCountResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.UnseenCountResponse$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function subscribersV1ControllerGetUnseenCountResponseFromJSON( jsonString: string, ): SafeParseResult< SubscribersV1ControllerGetUnseenCountResponse, SDKValidationError > { return safeParse( jsonString, (x) => SubscribersV1ControllerGetUnseenCountResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SubscribersV1ControllerGetUnseenCountResponse' from JSON`, ); }