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