getInvalidProperties(args, allowedProperties) - used in object creation to validate constructor properties
778125
function (args, allowedProperties) {
  var props = [];
  for (var property in args) {
    if (args.hasOwnProperty(property)) {
      if (!contains(allowedProperties, property)) {
        props.push(property);
      }
    }
  }
  return props;
}
830642
def validate_get_arguments(kwargs):
    # type: (Dict[Text, Any]) -> None
    
    for arg in ("AttributesToGet", "ProjectionExpression"):
        if arg in kwargs:
            raise InvalidArgumentError('"{}" is not supported for this operation'.format(arg))

    if kwargs.get("Select", None) in ("SPECIFIC_ATTRIBUTES", "ALL_PROJECTED_ATTRIBUTES"):
        raise InvalidArgumentError('Scan "Select" value of "{}" is not supported'.format(kwargs["Select"]))
345561
def ValidOptions(cls):
    """"""
    valid_options = []
    for obj_name in dir(cls):
      obj = getattr(cls, obj_name)
      if inspect.isclass(obj) and issubclass(obj, cls.OptionBase):
        valid_options.append(obj_name)
    return valid_options
551736
private void validateArgumentValues()  {
        namedArgumentDefinitions = validatePluginArgumentValues(); // trim the list of plugin-derived argument definitions before validation
        for (final NamedArgumentDefinition argumentDefinition : namedArgumentDefinitions) {
            argumentDefinition.validateValues(this);
        }
        if (positionalArgumentDefinition != null) {
            positionalArgumentDefinition.validateValues(this);
        }
    }
1239778
public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['fuelBayView'] === null) {
            $invalidProperties[] = "'fuelBayView' can't be null";
        }
        $allowedValues = $this->getFuelBayViewAllowableValues();
        if (!in_array($this->container['fuelBayView'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'fuelBayView', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['fuelBayTake'] === null) {
            $invalidProperties[] = "'fuelBayTake' can't be null";
        }
        $allowedValues = $this->getFuelBayTakeAllowableValues();
        if (!in_array($this->container['fuelBayTake'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'fuelBayTake', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['anchor'] === null) {
            $invalidProperties[] = "'anchor' can't be null";
        }
        $allowedValues = $this->getAnchorAllowableValues();
        if (!in_array($this->container['anchor'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'anchor', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['unanchor'] === null) {
            $invalidProperties[] = "'unanchor' can't be null";
        }
        $allowedValues = $this->getUnanchorAllowableValues();
        if (!in_array($this->container['unanchor'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'unanchor', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['online'] === null) {
            $invalidProperties[] = "'online' can't be null";
        }
        $allowedValues = $this->getOnlineAllowableValues();
        if (!in_array($this->container['online'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'online', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['offline'] === null) {
            $invalidProperties[] = "'offline' can't be null";
        }
        $allowedValues = $this->getOfflineAllowableValues();
        if (!in_array($this->container['offline'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'offline', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['allowCorporationMembers'] === null) {
            $invalidProperties[] = "'allowCorporationMembers' can't be null";
        }
        if ($this->container['allowAllianceMembers'] === null) {
            $invalidProperties[] = "'allowAllianceMembers' can't be null";
        }
        if ($this->container['useAllianceStandings'] === null) {
            $invalidProperties[] = "'useAllianceStandings' can't be null";
        }
        if ($this->container['attackIfOtherSecurityStatusDropping'] === null) {
            $invalidProperties[] = "'attackIfOtherSecurityStatusDropping' can't be null";
        }
        if ($this->container['attackIfAtWar'] === null) {
            $invalidProperties[] = "'attackIfAtWar' can't be null";
        }
        return $invalidProperties;
    }
942712
public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['typeId'] === null) {
            $invalidProperties[] = "'typeId' can't be null";
        }
        if ($this->container['quantity'] === null) {
            $invalidProperties[] = "'quantity' can't be null";
        }
        if ($this->container['locationId'] === null) {
            $invalidProperties[] = "'locationId' can't be null";
        }
        if ($this->container['locationType'] === null) {
            $invalidProperties[] = "'locationType' can't be null";
        }
        $allowedValues = $this->getLocationTypeAllowableValues();
        if (!in_array($this->container['locationType'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'locationType', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['itemId'] === null) {
            $invalidProperties[] = "'itemId' can't be null";
        }
        if ($this->container['locationFlag'] === null) {
            $invalidProperties[] = "'locationFlag' can't be null";
        }
        $allowedValues = $this->getLocationFlagAllowableValues();
        if (!in_array($this->container['locationFlag'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'locationFlag', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['isSingleton'] === null) {
            $invalidProperties[] = "'isSingleton' can't be null";
        }
        return $invalidProperties;
    }
1262188
public function listInvalidProperties()
    {
        $invalidProperties = [];

        if (!is_null($this->container['picture']) && !preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['picture'])) {
            $invalidProperties[] = "invalid value for 'picture', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.";
        }

        if ($this->container['section'] === null) {
            $invalidProperties[] = "'section' can't be null";
        }
        return $invalidProperties;
    }
430218
public function listInvalidProperties()
    {
        $invalidProperties = [];

        $allowedValues = $this->getAuthTypeAllowableValues();
        if (!is_null($this->container['auth_type']) && !in_array($this->container['auth_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'auth_type', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getAuthSecondFactorTypeAllowableValues();
        if (!is_null($this->container['auth_second_factor_type']) && !in_array($this->container['auth_second_factor_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'auth_second_factor_type', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }
1334782
function _constructor(self, opts) {
			var tmp;

			// Check opts validity
			var validity = SchemaObject.validate(opts, copy_definition);
			if(!validity.valid) { throw new TypeError("bad argument: " + util.inspect(validity) ); }

			// Call parent constructors
			ParentType.call(self, opts);

			// Call custom constructors
			//util.debug( util.inspect( _user_defined_constructors ));
			if(Object.prototype.hasOwnProperty.call(_user_defined_constructors, type_name)) {
				tmp = _user_defined_constructors[type_name].call(self, opts);
				if(is.def(tmp)) {
					SchemaObject.prototype._setValueOf.call(self, tmp);
				}
				//util.debug( util.inspect( tmp ) );
			}

			// Setup getters and setters if schema has properties
			//util.debug( "\ndefinition = \n----\n" + util.inspect( definition ) + "\n----\n\n" );
			if(definition && definition.properties) {
				Object.getOwnPropertyNames(definition.properties).forEach(function(key) {
					self.__defineGetter__(key, function(){
						return self.valueOf()[key];
					});
					self.__defineSetter__(key, function(val){
						// FIXME: Implement value validation and do not use `.valueOf()`!
						self.valueOf()[key] = val;
					});
				});
			}

		}
268097
function (args) {
  var i;
  if (false === (this instanceof Model)) throw new Error('new operator required');
  this.attributes = [new Attribute('id', 'ID')];
  args = args || {};
  this.modelType = args.modelType || "Model";
  if (args.attributes) {
    for (i in args.attributes) {
      if (args.attributes.hasOwnProperty(i))
        this.attributes.push(args.attributes[i]);
    }
  }
  var unusedProperties = getInvalidProperties(args, ['modelType', 'attributes']);
  var errorList = this.getObjectStateErrors(); // before leaving make sure valid Model
  for (i = 0; i < unusedProperties.length; i++) errorList.push('invalid property: ' + unusedProperties[i]);
  if (errorList.length > 1) throw new Error('error creating Model: multiple errors');
  if (errorList.length) throw new Error('error creating Model: ' + errorList[0]);
  // Validations done
  this._eventListeners = [];
  this._errorConditions = {};
  for (i = 0; i < this.attributes.length; i++) {
   this.attributes[i].model = this;
  }
}
819673
def validate(self, data):
        '''
        
        '''
        for prop in self.properties:
            if prop.id in data:
                if prop.type == 'string':
                    if not isinstance(data[prop.id], basestring):
                        raise PresetFieldTypeException("property '{}' must be of type string".format(prop.id))
                elif prop.type == 'enum':
                    if not isinstance(data[prop.id], basestring):
                        raise PresetFieldTypeException("property '{}' must be of type string".format(prop.id))
                    if data[prop.id] not in prop.values:
                        raise PresetException("property '{}' can be one of {}".format(prop.id, prop.values))
            else:
                if prop.required:
                    raise PresetMissingFieldException("missing required property: '{}'".format(prop.id))
418509
public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['unit_price'] === null) {
            $invalidProperties[] = "'unit_price' can't be null";
        }
        if ($this->container['quantity'] === null) {
            $invalidProperties[] = "'quantity' can't be null";
        }
        if ($this->container['product'] === null) {
            $invalidProperties[] = "'product' can't be null";
        }
        if ($this->container['order'] === null) {
            $invalidProperties[] = "'order' can't be null";
        }
        return $invalidProperties;
    }
381718
public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['loggedAt'] === null) {
            $invalidProperties[] = "'loggedAt' can't be null";
        }
        if ($this->container['containerId'] === null) {
            $invalidProperties[] = "'containerId' can't be null";
        }
        if ($this->container['containerTypeId'] === null) {
            $invalidProperties[] = "'containerTypeId' can't be null";
        }
        if ($this->container['characterId'] === null) {
            $invalidProperties[] = "'characterId' can't be null";
        }
        if ($this->container['locationId'] === null) {
            $invalidProperties[] = "'locationId' can't be null";
        }
        if ($this->container['locationFlag'] === null) {
            $invalidProperties[] = "'locationFlag' can't be null";
        }
        $allowedValues = $this->getLocationFlagAllowableValues();
        if (!in_array($this->container['locationFlag'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'locationFlag', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['action'] === null) {
            $invalidProperties[] = "'action' can't be null";
        }
        $allowedValues = $this->getActionAllowableValues();
        if (!in_array($this->container['action'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'action', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getPasswordTypeAllowableValues();
        if (!in_array($this->container['passwordType'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'passwordType', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }
105238
function(instance_values){
    instance_values = instance_values || {};
    var _field_values = {};
    var fields = this.constructor._properties.schema.fields;
    var self = this;
    var default_setter = function(prop_name, new_value){
            this[prop_name] = new_value;
        },
        default_getter = function(prop_name){
            return this[prop_name];
        },
        validation_wrapper = function(setter, validation_func, prop_name, fieldtype){
            return function(value){
                if(!self._skip_validation){
                    var validation_result = validation_func(value);
                    if( validation_result !== true )
                        throw build_error('model.set.invalidvalue', validation_result(value, prop_name, fieldtype) );
                }
                setter(value);
            };
        },
        generic_validator_message_func = function(value, prop_name, fieldtype){return util.format('Invalid Value: "%s" for Field: %s (Type: %s)', value, prop_name, fieldtype); };
    this._validators = {};
    this._skip_validation = false;
    var validators;

    for(var fields_keys = Object.keys(fields), i = 0, len = fields_keys.length; i < len; i++){
        var property_name = fields_keys[i],
            field = fields[fields_keys[i]],
            fieldtype = schemer.get_field_type(this.constructor._properties.schema,fields_keys[i]),
            fieldvalue = instance_values[fields_keys[i]];


        var type_fieldvalidator = TYPE_MAP.generic_type_validator(TYPE_MAP[fieldtype].validator);
        validators = [type_fieldvalidator];
        if( typeof field.rule != 'undefined' ){
            if( typeof field.rule === 'function'){
                field.rule = {
                    validator : field.rule,
                    message   : generic_validator_message_func
                };
            }else{
                if( typeof field.rule != 'object' || typeof field.rule.validator == 'undefined' ){
                    throw 'Invalid validator';
                }
                if(!field.rule.message){
                    field.rule.message = generic_validator_message_func
                }else if( typeof field.rule.message == 'string' ){
                    field.rule.message = function(message, value, prop_name, fieldtype){return util.format(message, value, prop_name, fieldtype); }.bind(null, field.rule.message);
                }else if( typeof field.rule.message != 'function' ){
                    throw 'Invalid validator message';
                }
            }
            validators.push(field['rule']);
        }
        this._validators[property_name] = validators;

        var validation_func = this.constructor._validate.bind(this.constructor, validators);

        var setter = validation_wrapper( default_setter.bind(_field_values, property_name ), validation_func, property_name, fieldtype),
            getter = default_getter.bind(_field_values, property_name);

        if(field['virtual'] && typeof field['virtual']['set'] === 'function'){
            setter = validation_wrapper(field['virtual']['set'].bind(_field_values), validation_func, property_name, fieldtype);
            //field['virtual']['set'].bind(_field_values);
        }

        if(field['virtual'] && typeof field['virtual']['get'] === 'function'){
            getter = field['virtual']['get'].bind(_field_values);
        }


        var descriptor = {
            enumerable: true,
            set : setter,
            get : getter
        };

        Object.defineProperty(this, property_name, descriptor);
        this[property_name] = instance_values[property_name];
    }

}
29499
def validate_properties(props, required):
    

    props = set(props)
    required = set(required or _supported_props)

    if len(required.intersection(props)) < len(required):
        missing = required - props
        raise ValidationError(
            'Missing property names: {props}', props=','.join(missing), missing=missing
        )
16433
public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['created'] === null) {
            $invalidProperties[] = "'created' can't be null";
        }
        if ($this->container['id'] === null) {
            $invalidProperties[] = "'id' can't be null";
        }
        if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $this->container['id'])) {
            $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.";
        }

        if (!is_null($this->container['new_version']) && !preg_match("/^(([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?)?$/", $this->container['new_version'])) {
            $invalidProperties[] = "invalid value for 'new_version', must be conform to the pattern /^(([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?)?$/.";
        }

        if ($this->container['org_id'] === null) {
            $invalidProperties[] = "'org_id' can't be null";
        }
        if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $this->container['org_id'])) {
            $invalidProperties[] = "invalid value for 'org_id', must be conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.";
        }

        if ($this->container['services'] === null) {
            $invalidProperties[] = "'services' can't be null";
        }
        if ($this->container['title'] === null) {
            $invalidProperties[] = "'title' can't be null";
        }
        if ($this->container['updated'] === null) {
            $invalidProperties[] = "'updated' can't be null";
        }
        if (!is_null($this->container['version']) && !preg_match("/^(([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?)?$/", $this->container['version'])) {
            $invalidProperties[] = "invalid value for 'version', must be conform to the pattern /^(([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?)?$/.";
        }

        return $invalidProperties;
    }
586730
public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['orderId'] === null) {
            $invalidProperties[] = "'orderId' can't be null";
        }
        if ($this->container['typeId'] === null) {
            $invalidProperties[] = "'typeId' can't be null";
        }
        if ($this->container['regionId'] === null) {
            $invalidProperties[] = "'regionId' can't be null";
        }
        if ($this->container['locationId'] === null) {
            $invalidProperties[] = "'locationId' can't be null";
        }
        if ($this->container['range'] === null) {
            $invalidProperties[] = "'range' can't be null";
        }
        $allowedValues = $this->getRangeAllowableValues();
        if (!in_array($this->container['range'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'range', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['isBuyOrder'] === null) {
            $invalidProperties[] = "'isBuyOrder' can't be null";
        }
        if ($this->container['price'] === null) {
            $invalidProperties[] = "'price' can't be null";
        }
        if ($this->container['volumeTotal'] === null) {
            $invalidProperties[] = "'volumeTotal' can't be null";
        }
        if ($this->container['volumeRemain'] === null) {
            $invalidProperties[] = "'volumeRemain' can't be null";
        }
        if ($this->container['issued'] === null) {
            $invalidProperties[] = "'issued' can't be null";
        }
        if ($this->container['state'] === null) {
            $invalidProperties[] = "'state' can't be null";
        }
        $allowedValues = $this->getStateAllowableValues();
        if (!in_array($this->container['state'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'state', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['minVolume'] === null) {
            $invalidProperties[] = "'minVolume' can't be null";
        }
        if ($this->container['accountId'] === null) {
            $invalidProperties[] = "'accountId' can't be null";
        }
        if ($this->container['duration'] === null) {
            $invalidProperties[] = "'duration' can't be null";
        }
        if ($this->container['isCorp'] === null) {
            $invalidProperties[] = "'isCorp' can't be null";
        }
        if ($this->container['escrow'] === null) {
            $invalidProperties[] = "'escrow' can't be null";
        }
        return $invalidProperties;
    }