Home Manual Reference Source Test Repository
public class | source

EntityBuilder

This is a base object that contains all you can do about Devices.

Constructor Summary

Public Constructor
public

Constructor

Method Summary

Public Methods
public

assetsBuilder(organization: string, timeout: number): Promise

Get a AssetBuilder for operate with entities of type asset

public

devicesBuilder(organization: string, timeout: number): Promise

Get a DeviceBuilder for operate with entities of type device

public

newCsvBulkBuilder(organization: string, resource: string, timeout: number, async: boolean): CsvBulkBuilder

Get a new CsvBulkBuilder

public

newJsonBulkBuilder(organization: string, resource: string, timeout: number, async: boolean): JsonBulkBuilder

Get a new JsonBulkBuilder

public

newJsonFlattenedBulkBuilder(organization: string, resource: string, timeout: number, async: boolean): JsonFlattenedBulkBuilder

Get a new JsonFlattenedBulkBuilder

public

subscribersBuilder(organization: string, timeout: number): Promise

Get a SubscriberBuilder for operate with entities of type subscriber

public

subscriptionsBuilder(organization: string, timeout: number): Promise

Get a SubscriptionBuilder for operate with entities of type subscription

public

ticketsBuilder(organization: string, timeout: number): Promise

Get a TicketBuilder for operate with entities of type ticket

Public Constructors

public constructor(Reference: InternalOpenGateAPI) source

Constructor

Params:

NameTypeAttributeDescription
Reference InternalOpenGateAPI

to the API object.

Public Methods

public assetsBuilder(organization: string, timeout: number): Promise source

Get a AssetBuilder for operate with entities of type asset

Params:

NameTypeAttributeDescription
organization string

required field

timeout number
  • optional
  • nullable: false

timeout on request

Return:

Promise

Example:

ogapi.assetsBuilder('orgname').then(function(assetBuilder){//...}).catch()

public devicesBuilder(organization: string, timeout: number): Promise source

Get a DeviceBuilder for operate with entities of type device

Params:

NameTypeAttributeDescription
organization string

required field

timeout number
  • optional
  • nullable: false

timeout on request

Return:

Promise

Example:

ogapi.devicesBuilder('orgname').then(function(deviceBuilder){//...}).catch()

public newCsvBulkBuilder(organization: string, resource: string, timeout: number, async: boolean): CsvBulkBuilder source

Get a new CsvBulkBuilder

Params:

NameTypeAttributeDescription
organization string

required field.

resource string

required field. Type of resource: entities or tickets

timeout number
  • optional

timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception

async boolean
  • optional

forces async execution for the bulk operation

Return:

CsvBulkBuilder

Example:

 ogapi.newCsvBulkBuilder('orgname', 'entities', 10000, false)
 ogapi.newCsvBulkBuilder('orgname', 'entities', 10000, true)

public newJsonBulkBuilder(organization: string, resource: string, timeout: number, async: boolean): JsonBulkBuilder source

Get a new JsonBulkBuilder

Params:

NameTypeAttributeDescription
organization string

required field.

resource string

required field. Type of resource: entities or tickets

timeout number
  • optional

timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception

async boolean
  • optional

forces async execution for the bulk operation

Return:

JsonBulkBuilder

Example:

 ogapi.newJsonBulkBuilder('orgname', 'entities', 10000)

public newJsonFlattenedBulkBuilder(organization: string, resource: string, timeout: number, async: boolean): JsonFlattenedBulkBuilder source

Get a new JsonFlattenedBulkBuilder

Params:

NameTypeAttributeDescription
organization string

required field.

resource string

required field. Type of resource: entities or tickets

timeout number
  • optional

timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception

async boolean
  • optional

forces async execution for the bulk operation

Example:

 ogapi.newJsonFlattenedBulkBuilder('orgname', 'entities', 10000)

public subscribersBuilder(organization: string, timeout: number): Promise source

Get a SubscriberBuilder for operate with entities of type subscriber

Params:

NameTypeAttributeDescription
organization string

required field

timeout number
  • optional
  • nullable: false

timeout on request

Return:

Promise

Example:

ogapi.subscribersBuilder('orgname').then(function(subscriberBuilder){//...}).catch()

public subscriptionsBuilder(organization: string, timeout: number): Promise source

Get a SubscriptionBuilder for operate with entities of type subscription

Params:

NameTypeAttributeDescription
organization string

required field

timeout number
  • optional
  • nullable: false

timeout on request

Return:

Promise

Example:

ogapi.subscriptionsBuilder('orgname').then(function(subscriptionBuilder){//...}).catch()

public ticketsBuilder(organization: string, timeout: number): Promise source

Get a TicketBuilder for operate with entities of type ticket

Params:

NameTypeAttributeDescription
organization string

required field

timeout number
  • optional
  • nullable: false

timeout on request

Return:

Promise

Example:

ogapi.ticketsBuilder('orgname').then(function(ticketBuilder){//...}).catch()