/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Response model for object segmentation. */ export type MasksResponse = { /** * The generated masks. */ masks: string; /** * The model's confidence scores for each generated mask. */ scores: string; /** * The raw, unnormalized predictions (logits) for the masks. */ logits: string; }; /** @internal */ export const MasksResponse$inboundSchema: z.ZodType< MasksResponse, z.ZodTypeDef, unknown > = z.object({ masks: z.string(), scores: z.string(), logits: z.string(), }); /** @internal */ export type MasksResponse$Outbound = { masks: string; scores: string; logits: string; }; /** @internal */ export const MasksResponse$outboundSchema: z.ZodType< MasksResponse$Outbound, z.ZodTypeDef, MasksResponse > = z.object({ masks: z.string(), scores: z.string(), logits: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace MasksResponse$ { /** @deprecated use `MasksResponse$inboundSchema` instead. */ export const inboundSchema = MasksResponse$inboundSchema; /** @deprecated use `MasksResponse$outboundSchema` instead. */ export const outboundSchema = MasksResponse$outboundSchema; /** @deprecated use `MasksResponse$Outbound` instead. */ export type Outbound = MasksResponse$Outbound; } export function masksResponseToJSON(masksResponse: MasksResponse): string { return JSON.stringify(MasksResponse$outboundSchema.parse(masksResponse)); } export function masksResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MasksResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MasksResponse' from JSON`, ); }