/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 461fd7b73124 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Collection, Collection$inboundSchema } from "./collection.js"; import { CollectionError, CollectionError$inboundSchema, } from "./collectionerror.js"; export type GetCollectionResponse = { collection?: Collection | undefined; rootCollection?: Collection | undefined; /** * An opaque token that represents this particular Collection. To be used for `/feedback` reporting. */ trackingToken?: string | undefined; error?: CollectionError | undefined; }; /** @internal */ export const GetCollectionResponse$inboundSchema: z.ZodType< GetCollectionResponse, z.ZodTypeDef, unknown > = z.object({ collection: Collection$inboundSchema.optional(), rootCollection: Collection$inboundSchema.optional(), trackingToken: z.string().optional(), error: CollectionError$inboundSchema.optional(), }); export function getCollectionResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetCollectionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCollectionResponse' from JSON`, ); }