Datastream
Defines the builder to configure a datastream of IoT datamodel. With this builder you can configure a datastream
Constructor Summary
| Public Constructor | ||
| public |
|
|
Method Summary
| Public Methods | ||
| public |
addQrating(qrating: Object): Datastream Set the qrating attribute. |
|
| public |
Build a Datastream json object |
|
| public |
withAccess(access: Array): Datastream Set the access object. |
|
| public |
withDescription(description: string): Datastream Set the description attribute |
|
| public |
withId(id: string): Datastream Set the id attribute |
|
| public |
withName(name: string): Datastream Set the name attribute |
|
| public |
withPeriod(period: string): Datastream Set the period attribute. |
|
| public |
withSchema(schema: Object): Datastream Set the schema object attribute. |
|
| public |
withStorage(period: string, total: number): Datastream Set the storage object. |
|
| public |
withTags(tags: Array): Datastream Set the tags attribute. |
|
| public |
withUnit(type: string, label: string, symbol: string): Datastream Set the unit object attribute |
|
Public Constructors
public constructor() source
Public Methods
public addQrating(qrating: Object): Datastream source
Set the qrating attribute. Use {Qrating} utility for create this object
Params:
| Name | Type | Attribute | Description |
| qrating | Object |
public build(): Object source
Build a Datastream json object
Throw:
Throw error if there is not id, name, unit and period |
Example:
ogapi.DatastreamsBuilder().build()
public withAccess(access: Array): Datastream source
Set the access object. Possible values: [READ, WRITE], [READ], [WRITE], []
Params:
| Name | Type | Attribute | Description |
| access | Array |
public withDescription(description: string): Datastream source
Set the description attribute
Params:
| Name | Type | Attribute | Description |
| description | string |
public withId(id: string): Datastream source
Set the id attribute
Params:
| Name | Type | Attribute | Description |
| id | string |
|
required field |
public withName(name: string): Datastream source
Set the name attribute
Params:
| Name | Type | Attribute | Description |
| name | string |
|
required field |
public withPeriod(period: string): Datastream source
Set the period attribute. Possible values: PULSE, CUMULATIVE, INSTANT
Params:
| Name | Type | Attribute | Description |
| period | string |
|
required field |
public withSchema(schema: Object): Datastream source
Set the schema object attribute.
Params:
| Name | Type | Attribute | Description |
| schema | Object |
|
public withStorage(period: string, total: number): Datastream source
Set the storage object.
public withTags(tags: Array): Datastream source
Set the tags attribute.
Params:
| Name | Type | Attribute | Description |
| tags | Array |
public withUnit(type: string, label: string, symbol: string): Datastream source
Set the unit object attribute