import DatamodelsHelper from 'opengate-js/src/iot/datamodels/DatamodelsHelper.js'DatamodelsHelper
Extends:
This is a base object for update and delete a IoT Datamodel
Constructor Summary
| Public Constructor | ||
| public |
constructor(ogapi: InternalOpenGateAPI, organization: string, datamodel: object) Constructor |
|
Method Summary
| Public Methods | ||
| public |
addCategory(category: Object, datastreams: Array): DatamodelsHelper Add a category. |
|
| public |
addDatastream(category: string, datastream: object): DatamodelsHelper Add a datastream to the indicated category |
|
| public |
create() Create not supported on this builder. |
|
| public |
removeCategory(category: string): DatamodelsHelper Remove category |
|
| public |
removeDatastream(category: string, id_datastream: string): DatamodelsHelper Remove datastream to the indicated category |
|
| public |
updateCategory(old_category: string, new_category: string): DatamodelsHelper Update category name |
|
| public |
updateDatastream(category: string, id_datastream: string, datastream: Object): DatamodelsHelper Update datastream to the indicated category |
|
| public |
withDescription(description: string): DatamodelsHelper Set the description attribute |
|
| public |
withIdentifier(identifier: string): Datamodels Set the identifier attribute |
|
| public |
withName(name: string): DatamodelsHelper Set the name attribute |
|
| public |
withVersion(version: string): DatamodelsHelper Set the version attribute |
|
Inherited Summary
| From class BaseProvision | ||
| public |
This invoke a request to OpenGate North API and the callback is managed by promises This function create a entity of provision |
|
| public |
This invoke a request to OpenGate North API and the callback is managed by promises This function deletes a entity of provision |
|
| public |
This invoke a request to OpenGate North API and the callback is managed by promises This function updates a entity of provision |
|
Public Constructors
public constructor(ogapi: InternalOpenGateAPI, organization: string, datamodel: object) source
Constructor
Override:
BaseProvision#constructorParams:
| Name | Type | Attribute | Description |
| ogapi | InternalOpenGateAPI |
|
this is ogapi instance |
| organization | string |
|
Organization where the IoT datamodel was create |
| datamodel | object |
|
Json object of IoT datamodel to modify or delete. |
Public Methods
public addCategory(category: Object, datastreams: Array): DatamodelsHelper source
Add a category. If the field datastreams have value, they will add to this category
public addDatastream(category: string, datastream: object): DatamodelsHelper source
Add a datastream to the indicated category
public create() source
Create not supported on this builder. Use IoTDatamodelHelper instead.
Override:
BaseProvision#createpublic removeCategory(category: string): DatamodelsHelper source
Remove category
Params:
| Name | Type | Attribute | Description |
| category | string |
|
public removeDatastream(category: string, id_datastream: string): DatamodelsHelper source
Remove datastream to the indicated category
public updateCategory(old_category: string, new_category: string): DatamodelsHelper source
Update category name
public updateDatastream(category: string, id_datastream: string, datastream: Object): DatamodelsHelper source
Update datastream to the indicated category
public withDescription(description: string): DatamodelsHelper source
Set the description attribute
Params:
| Name | Type | Attribute | Description |
| description | string |
public withIdentifier(identifier: string): Datamodels source
Set the identifier attribute
Params:
| Name | Type | Attribute | Description |
| identifier | string |
|
required field |
public withName(name: string): DatamodelsHelper source
Set the name attribute
Params:
| Name | Type | Attribute | Description |
| name | string |
|
required field |
public withVersion(version: string): DatamodelsHelper source
Set the version attribute
Params:
| Name | Type | Attribute | Description |
| version | string |
|
required field |