/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { EntityErrorObject, EntityErrorObject$inboundSchema, } from "../components/entityerrorobject.js"; import { GustoEmbeddedError } from "./gustoembeddederror.js"; /** * Forbidden * * @remarks * * The targeted company has been archived because its EIN was reassigned to a replacement company. Use the replacement company referenced in the error metadata. */ export type ForbiddenErrorObjectData = { errors: Array; }; /** * Forbidden * * @remarks * * The targeted company has been archived because its EIN was reassigned to a replacement company. Use the replacement company referenced in the error metadata. */ export class ForbiddenErrorObject extends GustoEmbeddedError { errors: Array; /** The original data that was passed to this error instance. */ data$: ForbiddenErrorObjectData; constructor( err: ForbiddenErrorObjectData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; this.errors = err.errors; this.name = "ForbiddenErrorObject"; } } /** @internal */ export const ForbiddenErrorObject$inboundSchema: z.ZodType< ForbiddenErrorObject, z.ZodTypeDef, unknown > = z.object({ errors: z.array(EntityErrorObject$inboundSchema), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new ForbiddenErrorObject(v, { request: v.request$, response: v.response$, body: v.body$, }); });