/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PushSubscription, PushSubscription$inboundSchema, PushSubscription$Outbound, PushSubscription$outboundSchema, } from "./pushsubscription.js"; /** * A response to a list push subscriptions method */ export type ListPushSubscriptionsResponse = { /** * Page token used for pagination; Supplying a page token returns the next page of results */ nextPageToken?: string | undefined; /** * The returned collection of subscriptions */ pushSubscriptions?: Array | undefined; }; /** @internal */ export const ListPushSubscriptionsResponse$inboundSchema: z.ZodType< ListPushSubscriptionsResponse, z.ZodTypeDef, unknown > = z.object({ next_page_token: z.string().optional(), push_subscriptions: z.array(PushSubscription$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", "push_subscriptions": "pushSubscriptions", }); }); /** @internal */ export type ListPushSubscriptionsResponse$Outbound = { next_page_token?: string | undefined; push_subscriptions?: Array | undefined; }; /** @internal */ export const ListPushSubscriptionsResponse$outboundSchema: z.ZodType< ListPushSubscriptionsResponse$Outbound, z.ZodTypeDef, ListPushSubscriptionsResponse > = z.object({ nextPageToken: z.string().optional(), pushSubscriptions: z.array(PushSubscription$outboundSchema).optional(), }).transform((v) => { return remap$(v, { nextPageToken: "next_page_token", pushSubscriptions: "push_subscriptions", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListPushSubscriptionsResponse$ { /** @deprecated use `ListPushSubscriptionsResponse$inboundSchema` instead. */ export const inboundSchema = ListPushSubscriptionsResponse$inboundSchema; /** @deprecated use `ListPushSubscriptionsResponse$outboundSchema` instead. */ export const outboundSchema = ListPushSubscriptionsResponse$outboundSchema; /** @deprecated use `ListPushSubscriptionsResponse$Outbound` instead. */ export type Outbound = ListPushSubscriptionsResponse$Outbound; } export function listPushSubscriptionsResponseToJSON( listPushSubscriptionsResponse: ListPushSubscriptionsResponse, ): string { return JSON.stringify( ListPushSubscriptionsResponse$outboundSchema.parse( listPushSubscriptionsResponse, ), ); } export function listPushSubscriptionsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListPushSubscriptionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListPushSubscriptionsResponse' from JSON`, ); }