/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; 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/sdk-validation-error.js"; import * as models from "../index.js"; export type ListChannelsRequest = { /** * The ID of the project. */ projectId: string; page?: number | undefined; pageSize?: number | undefined; }; /** * Channels retrieved successfully */ export type ListChannelsResponseBody = { /** * The items on this page. */ data: Array; /** * Where this page is in the full list. */ pagination: models.Pagination; }; export type ListChannelsResponse = { result: ListChannelsResponseBody; }; /** @internal */ export type ListChannelsRequest$Outbound = { projectId: string; page: number; pageSize: number; }; /** @internal */ export const ListChannelsRequest$outboundSchema: z.ZodMiniType< ListChannelsRequest$Outbound, ListChannelsRequest > = z.object({ projectId: z.string(), page: z._default(z.int(), 1), pageSize: z._default(z.int(), 20), }); export function listChannelsRequestToJSON( listChannelsRequest: ListChannelsRequest, ): string { return JSON.stringify( ListChannelsRequest$outboundSchema.parse(listChannelsRequest), ); } /** @internal */ export const ListChannelsResponseBody$inboundSchema: z.ZodMiniType< ListChannelsResponseBody, unknown > = z.object({ data: z.array(models.Channel$inboundSchema), pagination: models.Pagination$inboundSchema, }); export function listChannelsResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListChannelsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChannelsResponseBody' from JSON`, ); } /** @internal */ export const ListChannelsResponse$inboundSchema: z.ZodMiniType< ListChannelsResponse, unknown > = z.pipe( z.object({ Result: z.lazy(() => ListChannelsResponseBody$inboundSchema), }), z.transform((v) => { return remap$(v, { "Result": "result", }); }), ); export function listChannelsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListChannelsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChannelsResponse' from JSON`, ); }