/* * 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 SubscribersControllerGetSubscriberNotificationsCountRequest = { /** * The identifier of the subscriber */ subscriberId: string; /** * Array of filter objects (max 30) to count notifications by different criteria */ filters: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type SubscribersControllerGetSubscriberNotificationsCountResponse = { headers: { [k: string]: Array }; result: Array; }; /** @internal */ export type SubscribersControllerGetSubscriberNotificationsCountRequest$Outbound = { subscriberId: string; filters: string; "idempotency-key"?: string | undefined; }; /** @internal */ export const SubscribersControllerGetSubscriberNotificationsCountRequest$outboundSchema: z.ZodType< SubscribersControllerGetSubscriberNotificationsCountRequest$Outbound, z.ZodTypeDef, SubscribersControllerGetSubscriberNotificationsCountRequest > = z.object({ subscriberId: z.string(), filters: z.string(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function subscribersControllerGetSubscriberNotificationsCountRequestToJSON( subscribersControllerGetSubscriberNotificationsCountRequest: SubscribersControllerGetSubscriberNotificationsCountRequest, ): string { return JSON.stringify( SubscribersControllerGetSubscriberNotificationsCountRequest$outboundSchema .parse(subscribersControllerGetSubscriberNotificationsCountRequest), ); } /** @internal */ export const SubscribersControllerGetSubscriberNotificationsCountResponse$inboundSchema: z.ZodType< SubscribersControllerGetSubscriberNotificationsCountResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: z.array( components.GetSubscriberNotificationsCountResponseDto$inboundSchema, ), }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function subscribersControllerGetSubscriberNotificationsCountResponseFromJSON( jsonString: string, ): SafeParseResult< SubscribersControllerGetSubscriberNotificationsCountResponse, SDKValidationError > { return safeParse( jsonString, (x) => SubscribersControllerGetSubscriberNotificationsCountResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'SubscribersControllerGetSubscriberNotificationsCountResponse' from JSON`, ); }