code: function (requestPromise) {
    var that = this;
  
    // this will be bound to Client instance later in the Client constructor
    if (!this.isValid) {
      return Promise.reject(new Model({Errors: this.errors.join(',')}));
    }
  
    return requestPromise.apply(null, slice.call(arguments, 1))
      .then(function (response) {
        return new Model(response);
      }, function (reason) {
        var errors = that.errors;
        if (reason.statusCode >= 400 && reason.statusCode < 500) {
          errors.push(ClientError.HTTP_CLIENT_ERROR);
        } else if (reason.statusCode >= 500 && reason.statusCode < 600) {
          errors.push(ClientError.HTTP_SERVER_ERROR);
        } else {
          errors.push(ClientError.EXCEPTION);
        }
        return Promise.reject(new Model({Errors: errors.join(',')}));
      });
  }
docs: <editor-fold desc="Internal Functions">