/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; /** * Standard error response object */ export type DeleteApiWorkspaceServiceV1AccountsIdErrorResponseData = { error: string; code?: string | undefined; details?: any | null | undefined; }; /** * Standard error response object */ export class DeleteApiWorkspaceServiceV1AccountsIdErrorResponse extends Error { error: string; code?: string | undefined; details?: any | null | undefined; /** The original data that was passed to this error instance. */ data$: DeleteApiWorkspaceServiceV1AccountsIdErrorResponseData; constructor(err: DeleteApiWorkspaceServiceV1AccountsIdErrorResponseData) { 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 = "DeleteApiWorkspaceServiceV1AccountsIdErrorResponse"; } } /** @internal */ export const DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$inboundSchema: z.ZodType< DeleteApiWorkspaceServiceV1AccountsIdErrorResponse, z.ZodTypeDef, unknown > = z.object({ error: z.string(), code: z.string().optional(), details: z.nullable(z.any()).optional(), }) .transform((v) => { return new DeleteApiWorkspaceServiceV1AccountsIdErrorResponse(v); }); /** @internal */ export type DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$Outbound = { error: string; code?: string | undefined; details?: any | null | undefined; }; /** @internal */ export const DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$outboundSchema: z.ZodType< DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$Outbound, z.ZodTypeDef, DeleteApiWorkspaceServiceV1AccountsIdErrorResponse > = z.instanceof(DeleteApiWorkspaceServiceV1AccountsIdErrorResponse) .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 DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$ { /** @deprecated use `DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$inboundSchema` instead. */ export const inboundSchema = DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$inboundSchema; /** @deprecated use `DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$outboundSchema` instead. */ export const outboundSchema = DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$outboundSchema; /** @deprecated use `DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$Outbound` instead. */ export type Outbound = DeleteApiWorkspaceServiceV1AccountsIdErrorResponse$Outbound; }