code: function validate(attribute) {
    expect(arguments).to.have.length.below(
      2,
      'Invalid arguments length when validating an Entity (it has to be passed ' +
      'less than 2 arguments)'
    );
  
    var attributes = this.Entity.attributes;
  
    if (attribute) {
      expect(attribute).to.be.a(
        'string',
        'Invalid argument "attribute" when validating an Entity (it has to be ' +
        'a string)'
      );
  
      expect(attributes).to.have.ownProperty(
        attribute,
        'Invalid argument "attribute" when validating an Entity (this ' +
        'attribute does not exist in the Entity)'
      );
  
      var newAttributes = {};
      newAttributes[attribute] = attributes[attribute];
      attributes = newAttributes;
    }
  
    for (attribute in attributes) {
      if (this.isDirty(attribute)) {
        attributes[attribute].validate(this);
      }
    }
  }
docs: Validates an entity and throws a
  {@link module:back4app-entity/models/errors.ValidationError} if it is not
  validated.
  @name module:back4app-entity/models.Entity#validate
  @function
  @param {?string} [attribute] The name of the attribute to be validated. If no
  attribute is passed, all attributes will be validated.
  @throws {module:back4app-entity/models/errors.ValidationError}
  @example
  myEntity.validate('myAttribute'); // Validates attribute "myAttribute" of
  // Entity "myEntity"
  @example
  myEntity.validate(); // Validates all attributes of "myEntity"