constructor(sync = false, retries = undefined) {
    super();
    this.sync = sync;
    /** @type {function(!Object):boolean|undefined} */
    this.detectPartialError = undefined;

    if (retries != null) {
      this.retries = retries;
    } else if (sync) {
      this.retries = apiclient.MAX_SYNC_RETRIES_;
    } else {
      this.retries = apiclient.MAX_ASYNC_RETRIES_;
    }
  }
@param {boolean=} sync Run XmlHttpRequests in sync mode.  This blocks the
    main browser thread but is needed for legacy compatibility.
@param {number=} retries Overrides the default max retries value.