# system.kanoa.inventory.addModel(modelInfo, userId)

Adds a new model to the inventory catalog, or updates an existing one when `modelId` is included in `modelInfo`. 
A model represents a specific equipment/asset model made by a manufacturer (e.g. a catalog entry for a pump or motor model), 
distinct from a Part, which is an individual replaceable component. 
This upsert behavior is the only mechanism for modifying an existing model as there is no separate `updateModel` or `updateModelField` function.

---
### Parameters
**modelInfo** `Dictionary`<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - assetTypeId</td><td>Integer</td><td>Not required</td></tr>	
 	<tr><td> - description</td><td>String</td><td>Not required</td></tr>	
 	<tr><td> - enabled</td><td>Boolean</td><td>Not required</td></tr>	
 	<tr><td> - manufacturerId</td><td>Integer</td><td></td></tr>	
 	<tr><td> - modelId</td><td>Integer</td><td>Not required, pass to update</td></tr>	
 	<tr><td> - modelNumber</td><td>String</td><td></td></tr>	
 	<tr><td> - notes</td><td>String</td><td>Not required</td></tr>	
	</tbody>
</table>

**userId** `Integer`:Id of the user executing the function<br />

---
### Returns
**modelId** `Integer`<br />
**message** `String` None if success<br />

---
### Example
```python
modelInfo = {
				'manufacturerId': 42,
				'modelNumber': '6205-2RS',
				'assetTypeId': 7,
				'description': 'Sealed ball bearing',
				'notes': 'Standard replacement bearing for conveyor rollers',
				'enabled': True
			}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
modelId, message = system.kanoa.inventory.addModel(modelInfo, userId)
print modelId, message
```
