override buildRequest()

in mod.ts [487:505]


  override buildRequest(options: Core.FinalRequestOptions<unknown>): {
    req: RequestInit;
    url: string;
    timeout: number;
  } {
    if (
      _deployments_endpoints.has(options.path) && options.method === "post" &&
      options.body !== undefined
    ) {
      if (!Core.isObj(options.body)) {
        throw new Error("Expected request body to be an object");
      }
      const model = this._deployment || options.body["model"];
      if (model !== undefined && !this.baseURL.includes("/deployments")) {
        options.path = `/deployments/${model}${options.path}`;
      }
    }
    return super.buildRequest(options);
  }