commit 1d6ec56ff4082d49e429b88eb081b609d807d0ed
Author: hlavja <hlavjah@gmail.com>
Date:   Mon Mar 29 23:13:38 2021 +0200

    Re #8467 - Definice Open API 3.0
    
    + new Open API endpoints definitions

diff --git a/src/app/shared/api/endpoints/api.module.ts b/src/app/shared/api/endpoints/api.module.ts
index 1641b44..fb1c746 100644
--- a/src/app/shared/api/endpoints/api.module.ts
+++ b/src/app/shared/api/endpoints/api.module.ts
@@ -6,6 +6,7 @@ import { ApiConfiguration, ApiConfigurationParams } from './api-configuration';
 
 import { LoginService } from './services/login.service';
 import { GroupService } from './services/group.service';
+import { DataService } from './services/data.service';
 
 /**
  * Module that provides all services and configuration.
@@ -17,6 +18,7 @@ import { GroupService } from './services/group.service';
   providers: [
     LoginService,
     GroupService,
+    DataService,
     ApiConfiguration
   ],
 })
diff --git a/src/app/shared/api/endpoints/models.ts b/src/app/shared/api/endpoints/models.ts
index a2c361e..25851b6 100644
--- a/src/app/shared/api/endpoints/models.ts
+++ b/src/app/shared/api/endpoints/models.ts
@@ -1,2 +1,11 @@
 export { UserInfo } from './models/user-info';
 export { Group } from './models/group';
+export { Unit } from './models/unit';
+export { Phenomenon } from './models/phenomenon';
+export { Sensor } from './models/sensor';
+export { Position } from './models/position';
+export { Attributes } from './models/attributes';
+export { AlertEvents } from './models/alert-events';
+export { Lastpos } from './models/lastpos';
+export { GeneralInfo } from './models/general-info';
+export { Drivers } from './models/drivers';
diff --git a/src/app/shared/api/endpoints/models/alert-events.ts b/src/app/shared/api/endpoints/models/alert-events.ts
new file mode 100644
index 0000000..f89a398
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/alert-events.ts
@@ -0,0 +1,3 @@
+/* tslint:disable */
+/* eslint-disable */
+export type AlertEvents = Array<any>;
diff --git a/src/app/shared/api/endpoints/models/attributes.ts b/src/app/shared/api/endpoints/models/attributes.ts
new file mode 100644
index 0000000..2fcb709
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/attributes.ts
@@ -0,0 +1,6 @@
+/* tslint:disable */
+/* eslint-disable */
+export interface Attributes {
+  is_moving?: boolean;
+  is_online?: boolean;
+}
diff --git a/src/app/shared/api/endpoints/models/drivers.ts b/src/app/shared/api/endpoints/models/drivers.ts
new file mode 100644
index 0000000..f66dea9
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/drivers.ts
@@ -0,0 +1,3 @@
+/* tslint:disable */
+/* eslint-disable */
+export type Drivers = Array<any>;
diff --git a/src/app/shared/api/endpoints/models/general-info.ts b/src/app/shared/api/endpoints/models/general-info.ts
new file mode 100644
index 0000000..13444a0
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/general-info.ts
@@ -0,0 +1,3 @@
+/* tslint:disable */
+/* eslint-disable */
+export type GeneralInfo = Array<any>;
diff --git a/src/app/shared/api/endpoints/models/lastpos.ts b/src/app/shared/api/endpoints/models/lastpos.ts
new file mode 100644
index 0000000..0fd528a
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/lastpos.ts
@@ -0,0 +1,10 @@
+/* tslint:disable */
+/* eslint-disable */
+import { AlertEvents } from './alert-events';
+import { Attributes } from './attributes';
+import { Position } from './position';
+export interface Lastpos {
+  alertEvents?: AlertEvents;
+  attributes?: Attributes;
+  position?: Position;
+}
diff --git a/src/app/shared/api/endpoints/models/phenomenon.ts b/src/app/shared/api/endpoints/models/phenomenon.ts
new file mode 100644
index 0000000..eed597c
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/phenomenon.ts
@@ -0,0 +1,7 @@
+/* tslint:disable */
+/* eslint-disable */
+export interface Phenomenon {
+  phenomenonId?: string;
+  phenomenonName?: string;
+  unit?: string;
+}
diff --git a/src/app/shared/api/endpoints/models/position.ts b/src/app/shared/api/endpoints/models/position.ts
new file mode 100644
index 0000000..eca9dc0
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/position.ts
@@ -0,0 +1,14 @@
+/* tslint:disable */
+/* eslint-disable */
+export interface Position {
+  SRID?: string;
+  gid?: number;
+  group_id?: number;
+  postgisGeomString?: string;
+  postgisString?: string;
+  speed?: number;
+  time_stamp?: string;
+  unit_id?: number;
+  'x'?: number;
+  'y'?: number;
+}
diff --git a/src/app/shared/api/endpoints/models/sensor.ts b/src/app/shared/api/endpoints/models/sensor.ts
new file mode 100644
index 0000000..dbf828d
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/sensor.ts
@@ -0,0 +1,11 @@
+/* tslint:disable */
+/* eslint-disable */
+import { Phenomenon } from './phenomenon';
+export interface Sensor {
+  firstObservationTime?: string;
+  lastObservationTime?: string;
+  phenomenon?: Phenomenon;
+  sensorId?: number;
+  sensorName?: string;
+  sensorType?: string;
+}
diff --git a/src/app/shared/api/endpoints/models/unit.ts b/src/app/shared/api/endpoints/models/unit.ts
new file mode 100644
index 0000000..a0d592c
--- /dev/null
+++ b/src/app/shared/api/endpoints/models/unit.ts
@@ -0,0 +1,7 @@
+/* tslint:disable */
+/* eslint-disable */
+export interface Unit {
+  description?: string;
+  holderId?: number;
+  unitId?: number;
+}
diff --git a/src/app/shared/api/endpoints/models/user-info.ts b/src/app/shared/api/endpoints/models/user-info.ts
index 5619ffc..1d19d30 100644
--- a/src/app/shared/api/endpoints/models/user-info.ts
+++ b/src/app/shared/api/endpoints/models/user-info.ts
@@ -3,5 +3,6 @@
 export interface UserInfo {
   audio?: boolean;
   language?: string;
+  rights?: number;
   sessionid?: string;
 }
diff --git a/src/app/shared/api/endpoints/services.ts b/src/app/shared/api/endpoints/services.ts
index 71e3fca..031f978 100644
--- a/src/app/shared/api/endpoints/services.ts
+++ b/src/app/shared/api/endpoints/services.ts
@@ -1,2 +1,3 @@
 export { LoginService } from './services/login.service';
 export { GroupService } from './services/group.service';
+export { DataService } from './services/data.service';
diff --git a/src/app/shared/api/endpoints/services/data.service.ts b/src/app/shared/api/endpoints/services/data.service.ts
new file mode 100644
index 0000000..63f4ed7
--- /dev/null
+++ b/src/app/shared/api/endpoints/services/data.service.ts
@@ -0,0 +1,84 @@
+/* tslint:disable */
+/* eslint-disable */
+import { Injectable } from '@angular/core';
+import { HttpClient, HttpResponse } from '@angular/common/http';
+import { BaseService } from '../base-service';
+import { ApiConfiguration } from '../api-configuration';
+import { StrictHttpResponse } from '../strict-http-response';
+import { RequestBuilder } from '../request-builder';
+import { Observable } from 'rxjs';
+import { map, filter } from 'rxjs/operators';
+
+import { Drivers } from '../models/drivers';
+import { GeneralInfo } from '../models/general-info';
+import { Lastpos } from '../models/lastpos';
+import { Sensor } from '../models/sensor';
+import { Unit } from '../models/unit';
+
+
+/**
+ * Data endpoints
+ */
+@Injectable({
+  providedIn: 'root',
+})
+export class DataService extends BaseService {
+  constructor(
+    config: ApiConfiguration,
+    http: HttpClient
+  ) {
+    super(config, http);
+  }
+
+  /**
+   * Path part for operation getData
+   */
+  static readonly GetDataPath = '/senslog1/DataService?Operation=GetUnits';
+
+  /**
+   * Get data.
+   *
+   *
+   *
+   * This method provides access to the full `HttpResponse`, allowing access to response headers.
+   * To access only the response body, use `getData()` instead.
+   *
+   * This method doesn't expect any request body.
+   */
+  getData$Response(params?: {
+  }): Observable<StrictHttpResponse<Array<{ 'drivers'?: Drivers, 'generalInfo'?: GeneralInfo, 'holder'?: any, 'lastpos'?: Lastpos, 'sensors'?: Array<Sensor>, 'unit'?: Unit }>>> {
+
+    const rb = new RequestBuilder(this.rootUrl, DataService.GetDataPath, 'get');
+    if (params) {
+    }
+
+    return this.http.request(rb.build({
+      responseType: 'json',
+      accept: 'application/json'
+    })).pipe(
+      filter((r: any) => r instanceof HttpResponse),
+      map((r: HttpResponse<any>) => {
+        return r as StrictHttpResponse<Array<{ 'drivers'?: Drivers, 'generalInfo'?: GeneralInfo, 'holder'?: any, 'lastpos'?: Lastpos, 'sensors'?: Array<Sensor>, 'unit'?: Unit }>>;
+      })
+    );
+  }
+
+  /**
+   * Get data.
+   *
+   *
+   *
+   * This method provides access to only to the response body.
+   * To access the full response (for headers, for example), `getData$Response()` instead.
+   *
+   * This method doesn't expect any request body.
+   */
+  getData(params?: {
+  }): Observable<Array<{ 'drivers'?: Drivers, 'generalInfo'?: GeneralInfo, 'holder'?: any, 'lastpos'?: Lastpos, 'sensors'?: Array<Sensor>, 'unit'?: Unit }>> {
+
+    return this.getData$Response(params).pipe(
+      map((r: StrictHttpResponse<Array<{ 'drivers'?: Drivers, 'generalInfo'?: GeneralInfo, 'holder'?: any, 'lastpos'?: Lastpos, 'sensors'?: Array<Sensor>, 'unit'?: Unit }>>) => r.body as Array<{ 'drivers'?: Drivers, 'generalInfo'?: GeneralInfo, 'holder'?: any, 'lastpos'?: Lastpos, 'sensors'?: Array<Sensor>, 'unit'?: Unit }>)
+    );
+  }
+
+}
diff --git a/src/app/shared/api/openapi.yaml b/src/app/shared/api/openapi.yaml
index 0116ba5..9ab301f 100644
--- a/src/app/shared/api/openapi.yaml
+++ b/src/app/shared/api/openapi.yaml
@@ -17,6 +17,9 @@ tags:
     url: https://www.senslog.org/api/v1/
 - name: group
   description: Groups endpoints
+- name: data
+  description: Data endpoints
+
 paths:
   /senslog1/ControllerServlet:
     post:
@@ -75,6 +78,38 @@ paths:
                 items:
                   $ref: '#/components/schemas/Group'
 
+  /senslog1/DataService?Operation=GetUnits:
+    get:
+      tags:
+        - data
+      summary: Get data
+      operationId: getData
+      responses:
+        200:
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                type: array
+                items:
+                  oneOf:
+                    - type: object
+                      properties:
+                        drivers:
+                          $ref: '#/components/schemas/Drivers'
+                        generalInfo:
+                          $ref: '#/components/schemas/GeneralInfo'
+                        holder:
+                          nullable: true
+                        lastpos:
+                          $ref: '#/components/schemas/Lastpos'
+                        sensors:
+                          type: array
+                          items:
+                            $ref: '#/components/schemas/Sensor'
+                        unit:
+                          $ref: '#/components/schemas/Unit'
+
 components:
   schemas:
     UserInfo:
@@ -82,28 +117,112 @@ components:
       properties:
         sessionid:
           type: string
-          example: rv6pe5o30091
         language:
           type: string
-          example: en
         audio:
           type: boolean
-          default: false
+        rights:
+          type: integer
 
     Group:
       type: object
       properties:
         id:
           type: integer
-          format: int64
-          example: 1
         parent_group_id:
           type: integer
-          format: int64
-          example: 2
         group_name:
           type: string
-          example: testGroup
         has_children:
           type: boolean
-          default: false
+
+    Unit:
+      type: object
+      properties:
+        description:
+          type: string
+        holderId:
+          type: integer
+        unitId:
+          type: integer
+
+    Phenomenon:
+      type: object
+      properties:
+        phenomenonId:
+          type: string
+        phenomenonName:
+          type: string
+        unit:
+          type: string
+
+    Sensor:
+      type: object
+      properties:
+        firstObservationTime:
+          type: string
+          format: date-time
+        lastObservationTime:
+          type: string
+          format: date-time
+        phenomenon:
+          $ref: '#/components/schemas/Phenomenon'
+        sensorId:
+          type: integer
+        sensorName:
+          type: string
+        sensorType:
+          type: string
+
+    Position:
+      type: object
+      properties:
+        SRID:
+          type: string
+        gid:
+          type: integer
+        group_id:
+          type: integer
+        postgisGeomString:
+          type: string
+        postgisString:
+          type: string
+        speed:
+          type: integer
+        time_stamp:
+          type: string
+          format: date-time
+        unit_id:
+          type: integer
+        x:
+          type: number
+        y:
+          type: number
+
+    Attributes:
+      type: object
+      properties:
+        is_online:
+          type: boolean
+        is_moving:
+          type: boolean
+    #TODO
+    AlertEvents:
+      type: array
+
+    Lastpos:
+      type: object
+      properties:
+        alertEvents:
+          $ref: '#/components/schemas/AlertEvents'
+        attributes:
+          $ref: '#/components/schemas/Attributes'
+        position:
+          $ref: '#/components/schemas/Position'
+    #TODO
+    GeneralInfo:
+      type: array
+    #TODO
+    Drivers:
+      type: array
+
