Simple Builder

SimpleBuilder

SimpleBuilder Objects

class SimpleBuilder()

This class allow set simple values.

constructor
function constructor()

Constructor

Arguments:

  • ogapi InternalOpenGateAPI - this is ogapi instance
  • resource string - this is the resource url where can be create/delete/update/read the entity
  • allowedDatastreams array (optional) - Allowed datastreams to add into the new entity
  • definedSchemas array (optional) - Jsonschema about all OpenGate specific types
  • jsonSchemaValidator Validator (optional) - Json schema validator tool

deleteAll
function deleteAll() -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function deletes a entity of provision

Returns:

  • Promise

getAllowedDatastreams
function getAllowedDatastreams() -> 'array'

Returns:

  • array - Allowed Datastream definition array

getEntityKey
function getEntityKey() -> 'string'

Returns:

  • string - Entity identifier

initFromFlattened
function initFromFlattened()

Arguments:

  • _flattenedEntityData *

initFromJson
function initFromJson()

Arguments:

  • _jsonEntityData *

patch
function patch() -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function patch a entity of provision

Returns:

  • Promise

Example:

 ogapi.organizationsBuilder().update()

update
function update() -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a entity of provision

Returns:

  • Promise

Example:

 ogapi.organizationsBuilder().update()

with
function with(_id: string,val: objecr) -> '*'

Set new datastream value

Arguments:

  • _id string - Datastream identifier
  • val objecr - Datastream value. If this value is null then datastream value will be removed.

Returns:

  • *