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