docs: function (method, url, body, requestHeaders) {
          var _this = this;
          var data;
          var status;
          var headers;
          var request = Promise.resolve();
          var uppercaseMethod = method.toUpperCase();
          var isBodySupported = uppercaseMethod !== 'GET' && uppercaseMethod !== 'HEAD';
          return request
              .then(function () {
              var reqHeaders = utils_1.assign({}, exports.config.defaultHeaders, requestHeaders);
              var options = utils_1.assign({}, exports.config.defaultFetchOptions, {
                  body: isBodySupported && JSON.stringify(body) || undefined,
                  headers: reqHeaders,
                  method: method,
              });
              return _this.fetchReference(url, options);
          })
              .then(function (response) {
              status = response.status;
              headers = response.headers;
              return response.json();
          })
              .catch(function (e) {
              if (status === 204) {
                  return null;
              }
              throw e;
          })
              .then(function (responseData) {
              data = responseData;
              if (status >= 400) {
                  throw {
                      message: "Invalid HTTP status: " + status,
                      status: status,
                  };
              }
              return { data: data, headers: headers, requestHeaders: requestHeaders, status: status };
          })
              .catch(function (error) {
              return { data: data, error: error, headers: headers, requestHeaders: requestHeaders, status: status };
          });
      }