Home Manual Reference Source Test Repository
import BaseProvision from 'opengate-js/src/provision/BaseProvision.js'
public class | source

BaseProvision

This is an abstract class, it must be extended to another class that defines the different actions of a specific provision. This class is responsible for managing the request to execute Norte OpenGate API

Constructor Summary

Public Constructor
public

constructor(ogapi: InternalOpenGateAPI, resource: string, timeout: number, requiredParameters: array, serviceBaseURL: string)

Constructor

Method Summary

Public Methods
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, resource: string, timeout: number, requiredParameters: array, serviceBaseURL: string) source

Constructor

Params:

NameTypeAttributeDescription
ogapi InternalOpenGateAPI
  • nullable: false

this is ogapi instance

resource string
  • nullable: false

this is a base url resource

timeout number
  • optional
  • nullable: false

timeout on request

requiredParameters array
serviceBaseURL string

base of the uri petition

Public Methods

public create(): Promise source

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

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

Example:

 ogapi.organizationsBuilder().create()

public delete(body: *): Promise source

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

Params:

NameTypeAttributeDescription
body *

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

Example:

ogapi.organizationsBuilder().withName('delete_organization').delete();
ogapi.usersBuilder().withEmail('delete@user.com').delete();
ogapi.certificatesBuilder().withId('d3l3t3-c3rt1f1c4t3').delete();

public update(): Promise source

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

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

Example:

 ogapi.organizationsBuilder().update()