Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OperationService

Hierarchy

Index

Constructors

Methods

Constructors

constructor

Methods

create

  • Parameters

    Returns Promise<IResult<IOperation>>

    Response wrapped in IResult

    Example

    
     const mandantoryObject: IOperation = {
       com_cumulocity_model_WebCamDevice: {
         name: 'take picture',
         parameters: {
            duration: '5s',
            quality: 'HD'
         }
       },
       deviceId: device.id,
     };
    
     (async () => {
       const {data, res} = await operationService.create(mandantoryObject);
     })();
    

detail

  • Parameters

    Returns Promise<IResult<IOperation>>

    Response wrapped in IResult

    Example

    
       const operationId: number = 1;
    
       (async () => {
         const {data, res} = await operationService.detail(operationId);
      })();
    

list

list$

  • Parameters

    Returns Observable<IOperation[]>

    Data wrapped as Observable.

    Example

    
      const list$ = operationService.list$();
      list$.subscribe((data) => console.log(data));
    

    Deprecated This function will be removed soon in favor of decoupling this library from rxjs. Use Realtime for realtime connection and rxjs defer() or from() to composite an observable on your own.

update

  • Parameters

    Returns Promise<IResult<IOperation>>

    Response wrapped in IResult

    Example

    
     const partialUpdateObject: Partial<IOperation> = {
       com_cumulocity_model_WebCamDevice: {
         name: 'take picture',
         parameters: {
            duration: '2s',
            quality: 'HD',
            ratio: '16:9'
         }
       },
       deviceId: device.id,
     };
    
     (async () => {
       const {data, res} = await operationService.update(partialUpdateObject);
     })();
    

Generated using TypeDoc