/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; /** * Standard error response object */ export type GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponseData = { error: string; code?: string | undefined; details?: any | null | undefined; }; /** * Standard error response object */ export class GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse extends Error { error: string; code?: string | undefined; details?: any | null | undefined; /** The original data that was passed to this error instance. */ data$: GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponseData; constructor( err: GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponseData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.error = err.error; if (err.code != null) this.code = err.code; if (err.details != null) this.details = err.details; this.name = "GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse"; } } /** @internal */ export const GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$inboundSchema: z.ZodType< GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse, z.ZodTypeDef, unknown > = z.object({ error: z.string(), code: z.string().optional(), details: z.nullable(z.any()).optional(), }) .transform((v) => { return new GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse( v, ); }); /** @internal */ export type GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$Outbound = { error: string; code?: string | undefined; details?: any | null | undefined; }; /** @internal */ export const GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$outboundSchema: z.ZodType< GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$Outbound, z.ZodTypeDef, GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse > = z.instanceof( GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse, ) .transform(v => v.data$) .pipe(z.object({ error: z.string(), code: z.string().optional(), details: z.nullable(z.any()).optional(), })); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$ { /** @deprecated use `GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$inboundSchema` instead. */ export const inboundSchema = GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$inboundSchema; /** @deprecated use `GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$outboundSchema` instead. */ export const outboundSchema = GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$outboundSchema; /** @deprecated use `GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$Outbound` instead. */ export type Outbound = GetApiWorkspaceServiceV1WorkspacesStorageStatsWorkspaceIdErrorResponse$Outbound; }