/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Category, Category$inboundSchema } from "./category.js"; import { Links, Links$inboundSchema } from "./links.js"; import { Meta, Meta$inboundSchema } from "./meta.js"; /** * Categories */ export type GetCategoriesResponse = { /** * HTTP Response Status Code */ statusCode: number; /** * HTTP Response Status */ status: string; /** * Apideck ID of service provider */ service: string; /** * Unified API resource name */ resource: string; /** * Operation performed */ operation: string; data: Array; /** * Response metadata */ meta?: Meta | undefined; /** * Links to navigate to previous or next pages through the API */ links?: Links | undefined; /** * Raw response from the integration when raw=true query param is provided */ raw?: { [k: string]: any } | null | undefined; }; /** @internal */ export const GetCategoriesResponse$inboundSchema: z.ZodType< GetCategoriesResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ status_code: types.number(), status: types.string(), service: types.string(), resource: types.string(), operation: types.string(), data: z.array(Category$inboundSchema), meta: types.optional(Meta$inboundSchema), links: types.optional(Links$inboundSchema), _raw: z.nullable(z.record(z.any())).optional(), }).transform((v) => { return remap$(v, { "status_code": "statusCode", "_raw": "raw", }); }) ); export function getCategoriesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetCategoriesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCategoriesResponse' from JSON`, ); }