Datastream
Datastream
Datastream Objects
class Datastream()Defines the builder to configure a datastream of IoT datamodel. With this builder you can configure a datastream
constructor
function constructor()addQrating
function addQrating(qrating: Object) -> 'Datastream'Set the qrating attribute. Use {Qrating} utility for create this object
Arguments:
qratingObject
Returns:
Datastream
build
function build() -> 'Object'Build a Datastream json object
Returns:
Object- Datastream json object
Example:
ogapi.DatastreamsBuilder().build()withAccess
function withAccess(access: Array) -> 'Datastream'Set the access object. Possible values: [READ, WRITE], [READ], [WRITE], []
Arguments:
accessArray
Returns:
Datastream
withDescription
function withDescription(description: string) -> 'Datastream'Set the description attribute
Arguments:
descriptionstring
Returns:
Datastream
withId
function withId(id: string) -> 'Datastream'Set the id attribute
Arguments:
idstring - required field
Returns:
Datastream
withName
function withName(name: string) -> 'Datastream'Set the name attribute
Arguments:
namestring - required field
Returns:
Datastream
withPeriod
function withPeriod(period: string) -> 'Datastream'Set the period attribute. Possible values: PULSE, CUMULATIVE, INSTANT
Arguments:
periodstring - required field
Returns:
Datastream
withSchema
function withSchema(schema: Object) -> 'Datastream'Set the schema object attribute.
Arguments:
schemaObject
Returns:
Datastream
withStorage
function withStorage(period: string,total: number) -> 'Datastream'Set the storage object.
Arguments:
periodstringtotalnumber
Returns:
Datastream
withTags
function withTags(tags: Array) -> 'Datastream'Set the tags attribute.
Arguments:
tagsArray
Returns:
Datastream
withUnit
function withUnit(type: string,label: string,symbol: string) -> 'Datastream'Set the unit object attribute
Arguments:
typestring - required fieldlabelstring - required fieldsymbolstring - required field
Returns:
Datastream