/* * 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 { Activity, Activity$inboundSchema, Activity$Outbound, Activity$outboundSchema, } from "./activity.js"; /** * A response to the list activity method */ export type ListActivitiesResponse = { /** * an array of activities Returns empty array if no results are found */ activities?: Array | undefined; /** * The next page token returned by this call. Can be provided in another request to retrieve the subsequent page */ nextPageToken?: string | undefined; }; /** @internal */ export const ListActivitiesResponse$inboundSchema: z.ZodType< ListActivitiesResponse, z.ZodTypeDef, unknown > = z.object({ activities: z.array(Activity$inboundSchema).optional(), next_page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListActivitiesResponse$Outbound = { activities?: Array | undefined; next_page_token?: string | undefined; }; /** @internal */ export const ListActivitiesResponse$outboundSchema: z.ZodType< ListActivitiesResponse$Outbound, z.ZodTypeDef, ListActivitiesResponse > = z.object({ activities: z.array(Activity$outboundSchema).optional(), nextPageToken: z.string().optional(), }).transform((v) => { return remap$(v, { nextPageToken: "next_page_token", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListActivitiesResponse$ { /** @deprecated use `ListActivitiesResponse$inboundSchema` instead. */ export const inboundSchema = ListActivitiesResponse$inboundSchema; /** @deprecated use `ListActivitiesResponse$outboundSchema` instead. */ export const outboundSchema = ListActivitiesResponse$outboundSchema; /** @deprecated use `ListActivitiesResponse$Outbound` instead. */ export type Outbound = ListActivitiesResponse$Outbound; } export function listActivitiesResponseToJSON( listActivitiesResponse: ListActivitiesResponse, ): string { return JSON.stringify( ListActivitiesResponse$outboundSchema.parse(listActivitiesResponse), ); } export function listActivitiesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListActivitiesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListActivitiesResponse' from JSON`, ); }