/* * 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 { HTTPError, HTTPError$inboundSchema, HTTPError$Outbound, HTTPError$outboundSchema, } from "./httperror.js"; import { HTTPValidationError, HTTPValidationError$inboundSchema, HTTPValidationError$Outbound, HTTPValidationError$outboundSchema, } from "./httpvalidationerror.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; import { StudioApiError, StudioApiError$inboundSchema, StudioApiError$Outbound, StudioApiError$outboundSchema, } from "./studioapierror.js"; /** * Internal Server Error */ export type GenSegmentAnything2GenerateResponse500ResponseBody = | HTTPError | StudioApiError; /** * Validation Error */ export type GenSegmentAnything2GenerateResponseResponseBody = | HTTPValidationError | StudioApiError; /** * Unauthorized */ export type GenSegmentAnything2GenerateResponseBody = | HTTPError | StudioApiError; /** * Bad Request */ export type GenSegmentAnything2ResponseBody = HTTPError | StudioApiError; /** @internal */ export const GenSegmentAnything2GenerateResponse500ResponseBody$inboundSchema: z.ZodType< GenSegmentAnything2GenerateResponse500ResponseBody, z.ZodTypeDef, unknown > = z.union([HTTPError$inboundSchema, StudioApiError$inboundSchema]); /** @internal */ export type GenSegmentAnything2GenerateResponse500ResponseBody$Outbound = | HTTPError$Outbound | StudioApiError$Outbound; /** @internal */ export const GenSegmentAnything2GenerateResponse500ResponseBody$outboundSchema: z.ZodType< GenSegmentAnything2GenerateResponse500ResponseBody$Outbound, z.ZodTypeDef, GenSegmentAnything2GenerateResponse500ResponseBody > = z.union([HTTPError$outboundSchema, StudioApiError$outboundSchema]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GenSegmentAnything2GenerateResponse500ResponseBody$ { /** @deprecated use `GenSegmentAnything2GenerateResponse500ResponseBody$inboundSchema` instead. */ export const inboundSchema = GenSegmentAnything2GenerateResponse500ResponseBody$inboundSchema; /** @deprecated use `GenSegmentAnything2GenerateResponse500ResponseBody$outboundSchema` instead. */ export const outboundSchema = GenSegmentAnything2GenerateResponse500ResponseBody$outboundSchema; /** @deprecated use `GenSegmentAnything2GenerateResponse500ResponseBody$Outbound` instead. */ export type Outbound = GenSegmentAnything2GenerateResponse500ResponseBody$Outbound; } export function genSegmentAnything2GenerateResponse500ResponseBodyToJSON( genSegmentAnything2GenerateResponse500ResponseBody: GenSegmentAnything2GenerateResponse500ResponseBody, ): string { return JSON.stringify( GenSegmentAnything2GenerateResponse500ResponseBody$outboundSchema.parse( genSegmentAnything2GenerateResponse500ResponseBody, ), ); } export function genSegmentAnything2GenerateResponse500ResponseBodyFromJSON( jsonString: string, ): SafeParseResult< GenSegmentAnything2GenerateResponse500ResponseBody, SDKValidationError > { return safeParse( jsonString, (x) => GenSegmentAnything2GenerateResponse500ResponseBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GenSegmentAnything2GenerateResponse500ResponseBody' from JSON`, ); } /** @internal */ export const GenSegmentAnything2GenerateResponseResponseBody$inboundSchema: z.ZodType< GenSegmentAnything2GenerateResponseResponseBody, z.ZodTypeDef, unknown > = z.union([ HTTPValidationError$inboundSchema, StudioApiError$inboundSchema, ]); /** @internal */ export type GenSegmentAnything2GenerateResponseResponseBody$Outbound = | HTTPValidationError$Outbound | StudioApiError$Outbound; /** @internal */ export const GenSegmentAnything2GenerateResponseResponseBody$outboundSchema: z.ZodType< GenSegmentAnything2GenerateResponseResponseBody$Outbound, z.ZodTypeDef, GenSegmentAnything2GenerateResponseResponseBody > = z.union([ HTTPValidationError$outboundSchema, StudioApiError$outboundSchema, ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GenSegmentAnything2GenerateResponseResponseBody$ { /** @deprecated use `GenSegmentAnything2GenerateResponseResponseBody$inboundSchema` instead. */ export const inboundSchema = GenSegmentAnything2GenerateResponseResponseBody$inboundSchema; /** @deprecated use `GenSegmentAnything2GenerateResponseResponseBody$outboundSchema` instead. */ export const outboundSchema = GenSegmentAnything2GenerateResponseResponseBody$outboundSchema; /** @deprecated use `GenSegmentAnything2GenerateResponseResponseBody$Outbound` instead. */ export type Outbound = GenSegmentAnything2GenerateResponseResponseBody$Outbound; } export function genSegmentAnything2GenerateResponseResponseBodyToJSON( genSegmentAnything2GenerateResponseResponseBody: GenSegmentAnything2GenerateResponseResponseBody, ): string { return JSON.stringify( GenSegmentAnything2GenerateResponseResponseBody$outboundSchema.parse( genSegmentAnything2GenerateResponseResponseBody, ), ); } export function genSegmentAnything2GenerateResponseResponseBodyFromJSON( jsonString: string, ): SafeParseResult< GenSegmentAnything2GenerateResponseResponseBody, SDKValidationError > { return safeParse( jsonString, (x) => GenSegmentAnything2GenerateResponseResponseBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GenSegmentAnything2GenerateResponseResponseBody' from JSON`, ); } /** @internal */ export const GenSegmentAnything2GenerateResponseBody$inboundSchema: z.ZodType< GenSegmentAnything2GenerateResponseBody, z.ZodTypeDef, unknown > = z.union([HTTPError$inboundSchema, StudioApiError$inboundSchema]); /** @internal */ export type GenSegmentAnything2GenerateResponseBody$Outbound = | HTTPError$Outbound | StudioApiError$Outbound; /** @internal */ export const GenSegmentAnything2GenerateResponseBody$outboundSchema: z.ZodType< GenSegmentAnything2GenerateResponseBody$Outbound, z.ZodTypeDef, GenSegmentAnything2GenerateResponseBody > = z.union([HTTPError$outboundSchema, StudioApiError$outboundSchema]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GenSegmentAnything2GenerateResponseBody$ { /** @deprecated use `GenSegmentAnything2GenerateResponseBody$inboundSchema` instead. */ export const inboundSchema = GenSegmentAnything2GenerateResponseBody$inboundSchema; /** @deprecated use `GenSegmentAnything2GenerateResponseBody$outboundSchema` instead. */ export const outboundSchema = GenSegmentAnything2GenerateResponseBody$outboundSchema; /** @deprecated use `GenSegmentAnything2GenerateResponseBody$Outbound` instead. */ export type Outbound = GenSegmentAnything2GenerateResponseBody$Outbound; } export function genSegmentAnything2GenerateResponseBodyToJSON( genSegmentAnything2GenerateResponseBody: GenSegmentAnything2GenerateResponseBody, ): string { return JSON.stringify( GenSegmentAnything2GenerateResponseBody$outboundSchema.parse( genSegmentAnything2GenerateResponseBody, ), ); } export function genSegmentAnything2GenerateResponseBodyFromJSON( jsonString: string, ): SafeParseResult< GenSegmentAnything2GenerateResponseBody, SDKValidationError > { return safeParse( jsonString, (x) => GenSegmentAnything2GenerateResponseBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GenSegmentAnything2GenerateResponseBody' from JSON`, ); } /** @internal */ export const GenSegmentAnything2ResponseBody$inboundSchema: z.ZodType< GenSegmentAnything2ResponseBody, z.ZodTypeDef, unknown > = z.union([HTTPError$inboundSchema, StudioApiError$inboundSchema]); /** @internal */ export type GenSegmentAnything2ResponseBody$Outbound = | HTTPError$Outbound | StudioApiError$Outbound; /** @internal */ export const GenSegmentAnything2ResponseBody$outboundSchema: z.ZodType< GenSegmentAnything2ResponseBody$Outbound, z.ZodTypeDef, GenSegmentAnything2ResponseBody > = z.union([HTTPError$outboundSchema, StudioApiError$outboundSchema]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GenSegmentAnything2ResponseBody$ { /** @deprecated use `GenSegmentAnything2ResponseBody$inboundSchema` instead. */ export const inboundSchema = GenSegmentAnything2ResponseBody$inboundSchema; /** @deprecated use `GenSegmentAnything2ResponseBody$outboundSchema` instead. */ export const outboundSchema = GenSegmentAnything2ResponseBody$outboundSchema; /** @deprecated use `GenSegmentAnything2ResponseBody$Outbound` instead. */ export type Outbound = GenSegmentAnything2ResponseBody$Outbound; } export function genSegmentAnything2ResponseBodyToJSON( genSegmentAnything2ResponseBody: GenSegmentAnything2ResponseBody, ): string { return JSON.stringify( GenSegmentAnything2ResponseBody$outboundSchema.parse( genSegmentAnything2ResponseBody, ), ); } export function genSegmentAnything2ResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GenSegmentAnything2ResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenSegmentAnything2ResponseBody' from JSON`, ); }