/* * This code was auto generated by AfterShip SDK Generator. * Do not edit the class manually. */ import { Request } from "../lib/request"; import { AftershipError, AfterShipErrorCodes } from "../error"; import { PredictBatchRequest } from "../model/PredictBatchRequest"; import { PredictBatchResponse } from "../model/PredictBatchResponse"; import { EstimatedDeliveryDateRequest } from "../model/EstimatedDeliveryDateRequest"; import { PredictResponse } from "../model/PredictResponse"; export class EstimatedDeliveryDateApi { private readonly request: Request; constructor(request: Request) { this.request = request; } /** * > The estimated delivery date is provided by AfterShip, based on its AI-predictive model. You can display the EDD on the product page, cart, and order checkout page. It indicates when a customer will receive the order.You can use to activate this feature. */ public async predict( body: EstimatedDeliveryDateRequest, headers?: { [key: string]: any }, ): Promise { const url = `/tracking/2026-07/estimated-delivery-date/predict`; return this.request.makeRequest({ url: url, method: "POST", body, headers, }); } /** * > The estimated delivery date is provided by AfterShip, based on its AI-predictive model. You can display the EDD on the product page, cart, and order checkout page. It indicates when a customer will receive the order.You can use to activate this feature.Supported functionalities require:1. One `EstimatedDeliveryDate` object for one prediction result.2. Maximum 5 `EstimatedDeliveryDate` objects are allowed.3. API call will fail if any of the requests `EstimatedDeliveryDate` objects do not meet the specification requirement. */ public async predictBatch( body: PredictBatchRequest, headers?: { [key: string]: any }, ): Promise { const url = `/tracking/2026-07/estimated-delivery-date/predict-batch`; return this.request.makeRequest({ url: url, method: "POST", body, headers, }); } }