Home Manual Reference Source Test Repository
public class | source

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

Set the qrating attribute.

public

Build a Datastream json object

public

Set the access object.

public

Set the description attribute

public

Set the id attribute

public

Set the name attribute

public

Set the period attribute.

public

Set the schema object attribute.

public

withStorage(period: string, total: number): Datastream

Set the storage object.

public

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:

NameTypeAttributeDescription
qrating Object

Return:

Datastream

public build(): Object source

Build a Datastream json object

Return:

Object

Datastream json object

Throw:

Error

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:

NameTypeAttributeDescription
access Array

Return:

Datastream

public withDescription(description: string): Datastream source

Set the description attribute

Params:

NameTypeAttributeDescription
description string

Return:

Datastream

public withId(id: string): Datastream source

Set the id attribute

Params:

NameTypeAttributeDescription
id string
  • nullable: false

required field

Return:

Datastream

public withName(name: string): Datastream source

Set the name attribute

Params:

NameTypeAttributeDescription
name string
  • nullable: false

required field

Return:

Datastream

public withPeriod(period: string): Datastream source

Set the period attribute. Possible values: PULSE, CUMULATIVE, INSTANT

Params:

NameTypeAttributeDescription
period string
  • nullable: false

required field

Return:

Datastream

public withSchema(schema: Object): Datastream source

Set the schema object attribute.

Params:

NameTypeAttributeDescription
schema Object
  • nullable: false

Return:

Datastream

public withStorage(period: string, total: number): Datastream source

Set the storage object.

Params:

NameTypeAttributeDescription
period string
  • nullable: false
total number
  • nullable: false

Return:

Datastream

public withTags(tags: Array): Datastream source

Set the tags attribute.

Params:

NameTypeAttributeDescription
tags Array

Return:

Datastream

public withUnit(type: string, label: string, symbol: string): Datastream source

Set the unit object attribute

Params:

NameTypeAttributeDescription
type string
  • nullable: false

required field

label string
  • nullable: false

required field

symbol string
  • nullable: false

required field

Return:

Datastream