Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DeviceRegistrationService

This class allows registration of a new device.

Hierarchy

Index

Constructors

constructor

Methods

accept

  • Accepts the device registration for given id.

    example
    
      const id = 'abc';
    
      (async () => {
        const {data, res} = await deviceRegistrationService.accept(id);
      })();
    

    Parameters

    • entityOrId: string | number | IIdentified

      entity or id of registration.

    Returns Promise<IResult<IDeviceRegistration>>

    Response wrapped in IResult

bootstrap

  • Bootstraps the device with given id.

    example
    
      const id: 'abc';
      const options: IDeviceBootstrapOptions = {
        basicAuthToken: 'Basic dGVuYW50L3VzZXJuYW1lOnBhc3N3b3Jk',
        basicAuth: {
          user: 'username',
          pass: 'password'
        }
      };
    
      (async () => {
        const {data, res} = await deviceRegistrationService.bootstrap(id, options);
      })();
    

    Parameters

    Returns Promise<IResult<IDeviceCredentials>>

create

  • Creates a new device registration.

    example
    
       const mandantoryObject: IDeviceRegistrationCreate = {
         id: 1,
       };
    
       (async () => {
         const {data, res} = await deviceRegistrationService.create(mandantoryObject);
       })();
    

    Parameters

    Returns Promise<IResult<IDeviceRegistration>>

    Response wrapped in IResult

delete

  • Removes an registration with given id.

    example
    
      const id = 'abc';
    
      (async () => {
        const {data, res} = await deviceRegistrationService.delete(id);
        // data will be null
      })();
    

    Parameters

    • entityOrId: string | number | IIdentified

      entity or id of the registration.

    Returns Promise<IResult<null>>

    Response wrapped in IResult

detail

  • Gets the details of device registration.

    example
    
       const entityId: number = 1;
    
       (async () => {
         const {data, res} = await deviceRegistrationService.detail(entityId);
       })();
    

    Parameters

    • entityOrId: string | number | IIdentified

      Entity or Id of the entity.

    Returns Promise<IResult<IDeviceRegistration>>

    Response wrapped in IResult

list

  • Gets the list of device registrations by parameters.

    example
    
      const filter: object = {
        pageSize: 100,
        withTotalPages: true
      };
    
      (async () => {
        const {data, res, paging} = await deviceRegistrationService.list(filter);
      })();
    

    Parameters

    • Default value filter: object = {}

      Object containing filters for querying registrations.

    Returns Promise<IResultList<IDeviceRegistration>>

    Response wrapped in IResultList

Generated using TypeDoc