/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { LoqateError } from "./loqateerror.js"; /** * InternalServerError */ export type LocationServicesDistanceFinderNearbyInternalServerErrorErrorResponseSelfContainedData = { number?: number | undefined; description?: string | undefined; cause?: string | undefined; resolution?: string | undefined; }; /** * InternalServerError */ export class LocationServicesDistanceFinderNearbyInternalServerErrorErrorResponseSelfContained extends LoqateError { number?: number | undefined; description?: string | undefined; resolution?: string | undefined; /** The original data that was passed to this error instance. */ data$: LocationServicesDistanceFinderNearbyInternalServerErrorErrorResponseSelfContainedData; constructor( err: LocationServicesDistanceFinderNearbyInternalServerErrorErrorResponseSelfContainedData, 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; if (err.number != null) this.number = err.number; if (err.description != null) this.description = err.description; if (err.resolution != null) this.resolution = err.resolution; this.name = "LocationServicesDistanceFinderNearbyInternalServerErrorErrorResponseSelfContained"; } } /** * Forbidden */ export type LocationServicesDistanceFinderNearbyForbiddenErrorResponseSelfContainedData = { number?: number | undefined; description?: string | undefined; cause?: string | undefined; resolution?: string | undefined; }; /** * Forbidden */ export class LocationServicesDistanceFinderNearbyForbiddenErrorResponseSelfContained extends LoqateError { number?: number | undefined; description?: string | undefined; resolution?: string | undefined; /** The original data that was passed to this error instance. */ data$: LocationServicesDistanceFinderNearbyForbiddenErrorResponseSelfContainedData; constructor( err: LocationServicesDistanceFinderNearbyForbiddenErrorResponseSelfContainedData, 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; if (err.number != null) this.number = err.number; if (err.description != null) this.description = err.description; if (err.resolution != null) this.resolution = err.resolution; this.name = "LocationServicesDistanceFinderNearbyForbiddenErrorResponseSelfContained"; } } /** * Unauthorized */ export type LocationServicesDistanceFinderNearbyUnauthorizedErrorResponseSelfContainedData = { number?: number | undefined; description?: string | undefined; cause?: string | undefined; resolution?: string | undefined; }; /** * Unauthorized */ export class LocationServicesDistanceFinderNearbyUnauthorizedErrorResponseSelfContained extends LoqateError { number?: number | undefined; description?: string | undefined; resolution?: string | undefined; /** The original data that was passed to this error instance. */ data$: LocationServicesDistanceFinderNearbyUnauthorizedErrorResponseSelfContainedData; constructor( err: LocationServicesDistanceFinderNearbyUnauthorizedErrorResponseSelfContainedData, 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; if (err.number != null) this.number = err.number; if (err.description != null) this.description = err.description; if (err.resolution != null) this.resolution = err.resolution; this.name = "LocationServicesDistanceFinderNearbyUnauthorizedErrorResponseSelfContained"; } } /** * BadRequest */ export type LocationServicesDistanceFinderNearbyBadRequestErrorResponseSelfContainedData = { number?: number | undefined; description?: string | undefined; cause?: string | undefined; resolution?: string | undefined; }; /** * BadRequest */ export class LocationServicesDistanceFinderNearbyBadRequestErrorResponseSelfContained extends LoqateError { number?: number | undefined; description?: string | undefined; resolution?: string | undefined; /** The original data that was passed to this error instance. */ data$: LocationServicesDistanceFinderNearbyBadRequestErrorResponseSelfContainedData; constructor( err: LocationServicesDistanceFinderNearbyBadRequestErrorResponseSelfContainedData, 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; if (err.number != null) this.number = err.number; if (err.description != null) this.description = err.description; if (err.resolution != null) this.resolution = err.resolution; this.name = "LocationServicesDistanceFinderNearbyBadRequestErrorResponseSelfContained"; } } /** @internal */ export const LocationServicesDistanceFinderNearbyInternalServerErrorErrorResponseSelfContained$inboundSchema: z.ZodType< LocationServicesDistanceFinderNearbyInternalServerErrorErrorResponseSelfContained, z.ZodTypeDef, unknown > = z.object({ Number: z.number().int().optional(), Description: z.string().optional(), Cause: z.string().optional(), Resolution: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { const remapped = remap$(v, { "Number": "number", "Description": "description", "Cause": "cause", "Resolution": "resolution", }); return new LocationServicesDistanceFinderNearbyInternalServerErrorErrorResponseSelfContained( remapped, { request: v.request$, response: v.response$, body: v.body$ }, ); }); /** @internal */ export const LocationServicesDistanceFinderNearbyForbiddenErrorResponseSelfContained$inboundSchema: z.ZodType< LocationServicesDistanceFinderNearbyForbiddenErrorResponseSelfContained, z.ZodTypeDef, unknown > = z.object({ Number: z.number().int().optional(), Description: z.string().optional(), Cause: z.string().optional(), Resolution: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { const remapped = remap$(v, { "Number": "number", "Description": "description", "Cause": "cause", "Resolution": "resolution", }); return new LocationServicesDistanceFinderNearbyForbiddenErrorResponseSelfContained( remapped, { request: v.request$, response: v.response$, body: v.body$ }, ); }); /** @internal */ export const LocationServicesDistanceFinderNearbyUnauthorizedErrorResponseSelfContained$inboundSchema: z.ZodType< LocationServicesDistanceFinderNearbyUnauthorizedErrorResponseSelfContained, z.ZodTypeDef, unknown > = z.object({ Number: z.number().int().optional(), Description: z.string().optional(), Cause: z.string().optional(), Resolution: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { const remapped = remap$(v, { "Number": "number", "Description": "description", "Cause": "cause", "Resolution": "resolution", }); return new LocationServicesDistanceFinderNearbyUnauthorizedErrorResponseSelfContained( remapped, { request: v.request$, response: v.response$, body: v.body$ }, ); }); /** @internal */ export const LocationServicesDistanceFinderNearbyBadRequestErrorResponseSelfContained$inboundSchema: z.ZodType< LocationServicesDistanceFinderNearbyBadRequestErrorResponseSelfContained, z.ZodTypeDef, unknown > = z.object({ Number: z.number().int().optional(), Description: z.string().optional(), Cause: z.string().optional(), Resolution: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { const remapped = remap$(v, { "Number": "number", "Description": "description", "Cause": "cause", "Resolution": "resolution", }); return new LocationServicesDistanceFinderNearbyBadRequestErrorResponseSelfContained( remapped, { request: v.request$, response: v.response$, body: v.body$ }, ); });