@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
44 lines • 1.69 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import * as components from "../components/index.js";
export class NotFoundErrorResponse extends Error {
constructor(err) {
const message = "message" in err && typeof err.message === "string"
? err.message
: `API error occurred: ${JSON.stringify(err)}`;
super(message);
this.data$ = err;
this.meta = err.meta;
this.error = err.error;
this.name = "NotFoundErrorResponse";
}
}
/** @internal */
export const NotFoundErrorResponse$inboundSchema = z.object({
meta: components.Meta$inboundSchema,
error: components.BaseError$inboundSchema,
})
.transform((v) => {
return new NotFoundErrorResponse(v);
});
/** @internal */
export const NotFoundErrorResponse$outboundSchema = z.instanceof(NotFoundErrorResponse)
.transform(v => v.data$)
.pipe(z.object({
meta: components.Meta$outboundSchema,
error: components.BaseError$outboundSchema,
}));
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var NotFoundErrorResponse$;
(function (NotFoundErrorResponse$) {
/** @deprecated use `NotFoundErrorResponse$inboundSchema` instead. */
NotFoundErrorResponse$.inboundSchema = NotFoundErrorResponse$inboundSchema;
/** @deprecated use `NotFoundErrorResponse$outboundSchema` instead. */
NotFoundErrorResponse$.outboundSchema = NotFoundErrorResponse$outboundSchema;
})(NotFoundErrorResponse$ || (NotFoundErrorResponse$ = {}));
//# sourceMappingURL=notfounderrorresponse.js.map