/* * 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 SubscribersControllerMarkAllNotificationsAsReadRequest = { /** * The identifier of the subscriber */ subscriberId: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto; }; export type SubscribersControllerMarkAllNotificationsAsReadResponse = { headers: { [k: string]: Array }; }; /** @internal */ export type SubscribersControllerMarkAllNotificationsAsReadRequest$Outbound = { subscriberId: string; "idempotency-key"?: string | undefined; UpdateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto$Outbound; }; /** @internal */ export const SubscribersControllerMarkAllNotificationsAsReadRequest$outboundSchema: z.ZodType< SubscribersControllerMarkAllNotificationsAsReadRequest$Outbound, z.ZodTypeDef, SubscribersControllerMarkAllNotificationsAsReadRequest > = z.object({ subscriberId: z.string(), idempotencyKey: z.string().optional(), updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto$outboundSchema, }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", updateAllSubscriberNotificationsDto: "UpdateAllSubscriberNotificationsDto", }); }); export function subscribersControllerMarkAllNotificationsAsReadRequestToJSON( subscribersControllerMarkAllNotificationsAsReadRequest: SubscribersControllerMarkAllNotificationsAsReadRequest, ): string { return JSON.stringify( SubscribersControllerMarkAllNotificationsAsReadRequest$outboundSchema.parse( subscribersControllerMarkAllNotificationsAsReadRequest, ), ); } /** @internal */ export const SubscribersControllerMarkAllNotificationsAsReadResponse$inboundSchema: z.ZodType< SubscribersControllerMarkAllNotificationsAsReadResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), }).transform((v) => { return remap$(v, { "Headers": "headers", }); }); export function subscribersControllerMarkAllNotificationsAsReadResponseFromJSON( jsonString: string, ): SafeParseResult< SubscribersControllerMarkAllNotificationsAsReadResponse, SDKValidationError > { return safeParse( jsonString, (x) => SubscribersControllerMarkAllNotificationsAsReadResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'SubscribersControllerMarkAllNotificationsAsReadResponse' from JSON`, ); }