/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { ShippoError } from "./shippoerror.js"; /** * Invalid carrier account provided by the user */ export type InitiateOauth2SigninCarrierAccountsResponseResponseBodyData = { title?: string | undefined; detail?: string | undefined; }; /** * Invalid carrier account provided by the user */ export class InitiateOauth2SigninCarrierAccountsResponseResponseBody extends ShippoError { title?: string | undefined; detail?: string | undefined; /** The original data that was passed to this error instance. */ data$: InitiateOauth2SigninCarrierAccountsResponseResponseBodyData; constructor( err: InitiateOauth2SigninCarrierAccountsResponseResponseBodyData, 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.title != null) this.title = err.title; if (err.detail != null) this.detail = err.detail; this.name = "InitiateOauth2SigninCarrierAccountsResponseResponseBody"; } } /** * Invalid ShippoToken or unsupported carrier account provided by the user */ export type InitiateOauth2SigninCarrierAccountsResponseBodyData = { title?: string | undefined; detail?: string | undefined; }; /** * Invalid ShippoToken or unsupported carrier account provided by the user */ export class InitiateOauth2SigninCarrierAccountsResponseBody extends ShippoError { title?: string | undefined; detail?: string | undefined; /** The original data that was passed to this error instance. */ data$: InitiateOauth2SigninCarrierAccountsResponseBodyData; constructor( err: InitiateOauth2SigninCarrierAccountsResponseBodyData, 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.title != null) this.title = err.title; if (err.detail != null) this.detail = err.detail; this.name = "InitiateOauth2SigninCarrierAccountsResponseBody"; } } /** * Invalid parameters provided by the user */ export type InitiateOauth2SigninResponseBodyData = { title?: string | undefined; detail?: string | undefined; }; /** * Invalid parameters provided by the user */ export class InitiateOauth2SigninResponseBody extends ShippoError { title?: string | undefined; detail?: string | undefined; /** The original data that was passed to this error instance. */ data$: InitiateOauth2SigninResponseBodyData; constructor( err: InitiateOauth2SigninResponseBodyData, 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.title != null) this.title = err.title; if (err.detail != null) this.detail = err.detail; this.name = "InitiateOauth2SigninResponseBody"; } } /** @internal */ export const InitiateOauth2SigninCarrierAccountsResponseResponseBody$inboundSchema: z.ZodMiniType< InitiateOauth2SigninCarrierAccountsResponseResponseBody, unknown > = z.pipe( z.object({ title: z.optional(z.string()), detail: z.optional(z.string()), request$: z.custom(x => x instanceof Request), response$: z.custom(x => x instanceof Response), body$: z.string(), }), z.transform((v) => { return new InitiateOauth2SigninCarrierAccountsResponseResponseBody(v, { request: v.request$, response: v.response$, body: v.body$, }); }), ); /** @internal */ export const InitiateOauth2SigninCarrierAccountsResponseBody$inboundSchema: z.ZodMiniType = z .pipe( z.object({ title: z.optional(z.string()), detail: z.optional(z.string()), request$: z.custom(x => x instanceof Request), response$: z.custom(x => x instanceof Response), body$: z.string(), }), z.transform((v) => { return new InitiateOauth2SigninCarrierAccountsResponseBody(v, { request: v.request$, response: v.response$, body: v.body$, }); }), ); /** @internal */ export const InitiateOauth2SigninResponseBody$inboundSchema: z.ZodMiniType< InitiateOauth2SigninResponseBody, unknown > = z.pipe( z.object({ title: z.optional(z.string()), detail: z.optional(z.string()), request$: z.custom(x => x instanceof Request), response$: z.custom(x => x instanceof Response), body$: z.string(), }), z.transform((v) => { return new InitiateOauth2SigninResponseBody(v, { request: v.request$, response: v.response$, body: v.body$, }); }), );