Home Manual Reference Source Test Repository
public class | source

DatamodelsHelper

Extends:

BaseProvision → DatamodelsHelper

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

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

Set the description attribute

public

Set the identifier attribute

public

Set the name attribute

public

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

delete(body: *): Promise

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#constructor

Params:

NameTypeAttributeDescription
ogapi InternalOpenGateAPI
  • nullable: false

this is ogapi instance

organization string
  • nullable: false

Organization where the IoT datamodel was create

datamodel object
  • nullable: false

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

Params:

NameTypeAttributeDescription
category Object
  • nullable: false
datastreams Array

public addDatastream(category: string, datastream: object): DatamodelsHelper source

Add a datastream to the indicated category

Params:

NameTypeAttributeDescription
category string
  • nullable: false
datastream object
  • nullable: false

public create() source

Create not supported on this builder. Use IoTDatamodelHelper instead.

Override:

BaseProvision#create

public removeCategory(category: string): DatamodelsHelper source

Remove category

Params:

NameTypeAttributeDescription
category string
  • nullable: false

public removeDatastream(category: string, id_datastream: string): DatamodelsHelper source

Remove datastream to the indicated category

Params:

NameTypeAttributeDescription
category string
  • nullable: false
id_datastream string
  • nullable: false

of datastream

public updateCategory(old_category: string, new_category: string): DatamodelsHelper source

Update category name

Params:

NameTypeAttributeDescription
old_category string
  • nullable: false

name

new_category string
  • nullable: false

name

public updateDatastream(category: string, id_datastream: string, datastream: Object): DatamodelsHelper source

Update datastream to the indicated category

Params:

NameTypeAttributeDescription
category string
  • nullable: false
id_datastream string
  • nullable: false

of datastream

datastream Object
  • nullable: false

json object

public withDescription(description: string): DatamodelsHelper source

Set the description attribute

Params:

NameTypeAttributeDescription
description string

public withIdentifier(identifier: string): Datamodels source

Set the identifier attribute

Params:

NameTypeAttributeDescription
identifier string
  • nullable: false

required field

Return:

Datamodels

public withName(name: string): DatamodelsHelper source

Set the name attribute

Params:

NameTypeAttributeDescription
name string
  • nullable: false

required field

public withVersion(version: string): DatamodelsHelper source

Set the version attribute

Params:

NameTypeAttributeDescription
version string
  • nullable: false

required field