import { AxiosResponseHeaders } from 'axios' ; import { ExtendableError } from 'ts-error' ; export interface ModelErrorContainer { errors : ModelError [ ] ; } export interface ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export class SellingPartnerGenericError extends ExtendableError { public code : string ; public message : string ; public details ? : string ; public requestId : string ; public constructor ( error , headers ) { super ( error . details ) ; this . code = error . code ; this . message = error . message ; this . details = error . details ; this . requestId = headers [ 'x-amzn-RequestId' ] || headers [ 'x-amzn-requestid' ] || '' ; } } export class SellingPartnerBadRequestError extends SellingPartnerGenericError { } export class SellingPartnerForbiddenError extends SellingPartnerGenericError { } export class SellingPartnerNotFoundError extends SellingPartnerGenericError { } export class SellingPartnerRequestTooLongError extends SellingPartnerGenericError { } export class SellingPartnerUnsupportedMediaTypeError extends SellingPartnerGenericError { } export class SellingPartnerTooManyRequestsError extends SellingPartnerGenericError { public rateLimit ? : number ; public constructor ( error , headers ) { super ( error , headers ) ; this . rateLimit = Number ( headers [ 'x-amzn-RateLimit-Limit' ] ) || Number ( headers [ 'x-amzn-ratelimit-limit' ] ) || undefined ; } } export class SellingPartnerInternalServerError extends SellingPartnerGenericError { } export class SellingPartnerServiceUnavailableError extends SellingPartnerGenericError { } export class SellingPartnerUnknownError extends SellingPartnerGenericError { }