diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 8ec7612..11f53d0 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-29 18:26:21.662024","version":"3.0.3"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-10-19 16:40:10.000329","version":"3.0.3"} \ No newline at end of file diff --git a/lib/Helpers/modelsHelper.dart b/lib/Helpers/modelsHelper.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/Screens/Home/configurations_list.dart b/lib/Screens/Home/configurations_list.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/Services/apiService.dart b/lib/Services/apiService.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/Services/downloadConfiguration.dart b/lib/Services/downloadConfiguration.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/api/openApiTest.dart b/lib/api/openApiTest.dart index 9d4fd32..7f98cd3 100644 --- a/lib/api/openApiTest.dart +++ b/lib/api/openApiTest.dart @@ -5,5 +5,11 @@ import 'package:openapi_generator_annotations/openapi_generator_annotations.dart AdditionalProperties(pubName: 'manager_api', pubAuthor: 'Fransolet Thomas', useEnumExtension: true), inputSpecFile: 'lib/api/swagger.yaml', generatorName: Generator.dart, + alwaysRun: true, outputDirectory: 'manager_api') -class Example extends OpenapiGeneratorConfig {} \ No newline at end of file +class Example extends OpenapiGeneratorConfig {} + +/* + RUN + >flutter pub run build_runner build --delete-conflicting-outputs +*/ \ No newline at end of file diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index 2dadf26..dab5c5a 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -5,13 +5,20 @@ info: description: API Manager Service version: Version Alpha servers: - - url: http://localhost:5000 + - url: https://api.mymuseum.be paths: /api/Configuration: get: tags: - Configuration operationId: Configuration_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 responses: '200': description: '' @@ -266,6 +273,13 @@ paths: tags: - Device operationId: Device_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 responses: '200': description: '' @@ -477,11 +491,191 @@ paths: type: string security: - bearer: [] + /api/Instance: + get: + tags: + - Instance + operationId: Instance_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Instance' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Instance + operationId: Instance_CreateInstance + requestBody: + x-name: newInstance + content: + application/json: + schema: + $ref: '#/components/schemas/Instance' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Instance + operationId: Instance_Updateinstance + requestBody: + x-name: updatedInstance + content: + application/json: + schema: + $ref: '#/components/schemas/Instance' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Instance/{id}: + get: + tags: + - Instance + operationId: Instance_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - Instance + operationId: Instance_DeleteInstance + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] /api/Resource: get: tags: - Resource operationId: Resource_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 responses: '200': description: '' @@ -697,6 +891,9 @@ paths: type: type: string nullable: true + instanceId: + type: string + nullable: true responses: '200': description: '' @@ -723,6 +920,13 @@ paths: tags: - Section operationId: Section_Get + parameters: + - name: instanceId + in: query + schema: + type: string + nullable: true + x-position: 1 responses: '200': description: '' @@ -1204,6 +1408,8 @@ paths: application/json: schema: type: string + security: + - bearer: [] put: tags: - User @@ -1435,6 +1641,9 @@ components: type: boolean isOffline: type: boolean + instanceId: + type: string + nullable: true TranslationDTO: type: object additionalProperties: false @@ -1506,9 +1715,19 @@ components: order: type: integer format: int32 + instanceId: + type: string + nullable: true SectionType: - type: string - description: '' + type: integer + description: |- + 0 = Map + 1 = Slider + 2 = Video + 3 = Web + 4 = Menu + 5 = Quizz + 6 = Article x-enumNames: - Map - Slider @@ -1518,13 +1737,13 @@ components: - Quizz - Article enum: - - Map - - Slider - - Video - - Web - - Menu - - Quizz - - Article + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 ResourceDTO: type: object additionalProperties: false @@ -1543,19 +1762,26 @@ components: data: type: string nullable: true + instanceId: + type: string + nullable: true ResourceType: - type: string - description: '' + type: integer + description: |- + 0 = Image + 1 = Video + 2 = ImageUrl + 3 = VideoUrl x-enumNames: - Image - Video - ImageUrl - VideoUrl enum: - - Image - - Video - - ImageUrl - - VideoUrl + - 0 + - 1 + - 2 + - 3 DeviceDTO: type: object additionalProperties: false @@ -1589,6 +1815,9 @@ components: dateUpdate: type: string format: date-time + instanceId: + type: string + nullable: true DeviceDetailDTO: allOf: - $ref: '#/components/schemas/DeviceDTO' @@ -1607,6 +1836,32 @@ components: lastBatteryLevel: type: string format: date-time + Instance: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + dateCreation: + type: string + format: date-time + InstanceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + dateCreation: + type: string + format: date-time MapDTO: type: object additionalProperties: false @@ -1628,8 +1883,13 @@ components: type: string nullable: true MapTypeApp: - type: string - description: '' + type: integer + description: |- + 0 = none + 1 = normal + 2 = satellite + 3 = terrain + 4 = hybrid x-enumNames: - none - normal @@ -1637,11 +1897,11 @@ components: - terrain - hybrid enum: - - none - - normal - - satellite - - terrain - - hybrid + - 0 + - 1 + - 2 + - 3 + - 4 GeoPointDTO: type: object additionalProperties: false @@ -1869,6 +2129,9 @@ components: dateCreation: type: string format: date-time + instanceId: + type: string + nullable: true UserDetailDTO: type: object additionalProperties: false @@ -1907,6 +2170,9 @@ components: expiration: type: string format: date-time + instanceId: + type: string + nullable: true LoginDTO: type: object additionalProperties: false @@ -1934,6 +2200,8 @@ tags: description: Configuration management - name: Device description: Device management + - name: Instance + description: Instance management - name: Resource description: Resource management - name: Section diff --git a/lib/api/swagger.yaml.bak2 b/lib/api/swagger.yaml.bak2 new file mode 100644 index 0000000..2dadf26 --- /dev/null +++ b/lib/api/swagger.yaml.bak2 @@ -0,0 +1,1944 @@ +x-generator: NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v10.0.0.0)) +openapi: 3.0.0 +info: + title: Manager Service + description: API Manager Service + version: Version Alpha +servers: + - url: http://localhost:5000 +paths: + /api/Configuration: + get: + tags: + - Configuration + operationId: Configuration_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ConfigurationDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + post: + tags: + - Configuration + operationId: Configuration_Create + requestBody: + x-name: newConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Configuration + operationId: Configuration_Update + requestBody: + x-name: updatedConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}: + get: + tags: + - Configuration + operationId: Configuration_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Configuration + operationId: Configuration_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Configuration/{id}/export: + get: + tags: + - Configuration + operationId: Configuration_Export + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Configuration/import: + post: + tags: + - Configuration + operationId: Configuration_Import + requestBody: + x-name: exportConfiguration + content: + application/json: + schema: + $ref: '#/components/schemas/ExportConfigurationDTO' + required: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device: + get: + tags: + - Device + operationId: Device_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Device + operationId: Device_Create + requestBody: + x-name: newDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + put: + tags: + - Device + operationId: Device_Update + requestBody: + x-name: updatedDevice + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}/detail: + get: + tags: + - Device + operationId: Device_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Device/mainInfos: + put: + tags: + - Device + operationId: Device_UpdateMainInfos + requestBody: + x-name: deviceIn + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Device/{id}: + delete: + tags: + - Device + operationId: Device_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource: + get: + tags: + - Resource + operationId: Resource_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ResourceDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Resource + operationId: Resource_Create + requestBody: + x-name: newResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Resource + operationId: Resource_Update + requestBody: + x-name: updatedResource + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/{id}/detail: + get: + tags: + - Resource + operationId: Resource_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Resource/{id}: + get: + tags: + - Resource + operationId: Resource_Show + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Resource + operationId: Resource_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Resource/upload: + post: + tags: + - Resource + operationId: Resource_Upload + requestBody: + content: + multipart/form-data: + schema: + properties: + label: + type: string + nullable: true + type: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section: + get: + tags: + - Section + operationId: Section_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - Section + operationId: Section_Create + requestBody: + x-name: newSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Section + operationId: Section_Update + requestBody: + x-name: updatedSection + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/configuration/{id}: + get: + tags: + - Section + operationId: Section_GetFromConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_DeleteAllForConfiguration + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}/subsections: + get: + tags: + - Section + operationId: Section_GetAllSectionSubSections + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: {} + '400': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/{id}: + get: + tags: + - Section + operationId: Section_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SectionDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + delete: + tags: + - Section + operationId: Section_Delete + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/order: + put: + tags: + - Section + operationId: Section_UpdateOrder + requestBody: + x-name: updatedSectionsOrder + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SectionDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Section/MapDTO: + get: + tags: + - Section + operationId: Section_GetMapDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MapDTO' + security: + - bearer: [] + /api/Section/SliderDTO: + get: + tags: + - Section + operationId: Section_GetSliderDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SliderDTO' + security: + - bearer: [] + /api/Section/VideoDTO: + get: + tags: + - Section + operationId: Section_GetVideoDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoDTO' + security: + - bearer: [] + /api/Section/WebDTO: + get: + tags: + - Section + operationId: Section_GetWebDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/WebDTO' + security: + - bearer: [] + /api/Section/MenuDTO: + get: + tags: + - Section + operationId: Section_GetMenuDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MenuDTO' + security: + - bearer: [] + /api/Section/PlayerMessageDTO: + get: + tags: + - Section + operationId: Section_PlayerMessageDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PlayerMessageDTO' + security: + - bearer: [] + /api/Section/QuizzDTO: + get: + tags: + - Section + operationId: Section_GetQuizzDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/QuizzDTO' + security: + - bearer: [] + /api/Section/ArticleDTO: + get: + tags: + - Section + operationId: Section_GetArticleDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ArticleDTO' + security: + - bearer: [] + /api/User: + get: + tags: + - User + operationId: User_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + post: + tags: + - User + operationId: User_CreateUser + requestBody: + x-name: newUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '409': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + put: + tags: + - User + operationId: User_UpdateUser + requestBody: + x-name: updatedUser + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/User/{id}: + get: + tags: + - User + operationId: User_GetDetail + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserDetailDTO' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + delete: + tags: + - User + operationId: User_DeleteUser + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '202': + description: '' + content: + application/json: + schema: + type: string + '400': + description: '' + content: + application/json: + schema: + type: string + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + /api/Authentication/Token: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithForm + requestBody: + content: + multipart/form-data: + schema: + properties: + grant_type: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + client_id: + type: string + nullable: true + client_secret: + type: string + nullable: true + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + /api/Authentication/Authenticate: + post: + tags: + - Authentication + operationId: Authentication_AuthenticateWithJson + requestBody: + x-name: login + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TokenDTO' + '401': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string +components: + schemas: + ConfigurationDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true + primaryColor: + type: string + nullable: true + secondaryColor: + type: string + nullable: true + languages: + type: array + nullable: true + items: + type: string + dateCreation: + type: string + format: date-time + isMobile: + type: boolean + isTablet: + type: boolean + isOffline: + type: boolean + TranslationDTO: + type: object + additionalProperties: false + properties: + language: + type: string + nullable: true + value: + type: string + nullable: true + ExportConfigurationDTO: + allOf: + - $ref: '#/components/schemas/ConfigurationDTO' + - type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + resources: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResourceDTO' + SectionDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + label: + type: string + nullable: true + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + imageId: + type: string + nullable: true + imageSource: + type: string + nullable: true + configurationId: + type: string + nullable: true + isSubSection: + type: boolean + parentId: + type: string + nullable: true + type: + $ref: '#/components/schemas/SectionType' + data: + type: string + nullable: true + dateCreation: + type: string + format: date-time + order: + type: integer + format: int32 + SectionType: + type: string + description: '' + x-enumNames: + - Map + - Slider + - Video + - Web + - Menu + - Quizz + - Article + enum: + - Map + - Slider + - Video + - Web + - Menu + - Quizz + - Article + ResourceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + $ref: '#/components/schemas/ResourceType' + label: + type: string + nullable: true + dateCreation: + type: string + format: date-time + data: + type: string + nullable: true + ResourceType: + type: string + description: '' + x-enumNames: + - Image + - Video + - ImageUrl + - VideoUrl + enum: + - Image + - Video + - ImageUrl + - VideoUrl + DeviceDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + identifier: + type: string + nullable: true + name: + type: string + nullable: true + ipAddressWLAN: + type: string + nullable: true + ipAddressETH: + type: string + nullable: true + configurationId: + type: string + nullable: true + configuration: + type: string + nullable: true + connected: + type: boolean + dateCreation: + type: string + format: date-time + dateUpdate: + type: string + format: date-time + DeviceDetailDTO: + allOf: + - $ref: '#/components/schemas/DeviceDTO' + - type: object + additionalProperties: false + properties: + connectionLevel: + type: string + nullable: true + lastConnectionLevel: + type: string + format: date-time + batteryLevel: + type: string + nullable: true + lastBatteryLevel: + type: string + format: date-time + MapDTO: + type: object + additionalProperties: false + properties: + zoom: + type: integer + format: int32 + mapType: + $ref: '#/components/schemas/MapTypeApp' + points: + type: array + nullable: true + items: + $ref: '#/components/schemas/GeoPointDTO' + iconResourceId: + type: string + nullable: true + iconSource: + type: string + nullable: true + MapTypeApp: + type: string + description: '' + x-enumNames: + - none + - normal + - satellite + - terrain + - hybrid + enum: + - none + - normal + - satellite + - terrain + - hybrid + GeoPointDTO: + type: object + additionalProperties: false + properties: + id: + type: integer + format: int32 + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageGeoPoint' + latitude: + type: string + nullable: true + longitude: + type: string + nullable: true + ImageGeoPoint: + type: object + additionalProperties: false + properties: + imageResourceId: + type: string + nullable: true + imageSource: + type: string + nullable: true + SliderDTO: + type: object + additionalProperties: false + properties: + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + ImageDTO: + type: object + additionalProperties: false + properties: + title: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + description: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + VideoDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + WebDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + MenuDTO: + type: object + additionalProperties: false + properties: + sections: + type: array + nullable: true + items: + $ref: '#/components/schemas/SectionDTO' + PlayerMessageDTO: + type: object + additionalProperties: false + properties: + configChanged: + type: boolean + isDeleted: + type: boolean + QuizzDTO: + type: object + additionalProperties: false + properties: + questions: + type: array + nullable: true + items: + $ref: '#/components/schemas/QuestionDTO' + bad_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + medium_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + good_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + great_level: + nullable: true + oneOf: + - $ref: '#/components/schemas/LevelDTO' + QuestionDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + responses: + type: array + nullable: true + items: + $ref: '#/components/schemas/ResponseDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + order: + type: integer + format: int32 + ResponseDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + isGood: + type: boolean + order: + type: integer + format: int32 + LevelDTO: + type: object + additionalProperties: false + properties: + label: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + resourceId: + type: string + nullable: true + source: + type: string + nullable: true + ArticleDTO: + type: object + additionalProperties: false + properties: + content: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + qrCode: + type: string + nullable: true + isContentTop: + type: boolean + audioId: + type: string + nullable: true + isReadAudioAuto: + type: boolean + images: + type: array + nullable: true + items: + $ref: '#/components/schemas/ImageDTO' + User: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + password: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + token: + type: string + nullable: true + dateCreation: + type: string + format: date-time + UserDetailDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + TokenDTO: + type: object + additionalProperties: false + properties: + access_token: + type: string + nullable: true + refresh_token: + type: string + nullable: true + scope: + type: string + nullable: true + token_type: + type: string + nullable: true + expires_in: + type: integer + format: int32 + expiration: + type: string + format: date-time + LoginDTO: + type: object + additionalProperties: false + properties: + email: + type: string + nullable: true + password: + type: string + nullable: true + securitySchemes: + bearer: + type: oauth2 + description: Manager Authentication + flows: + password: + authorizationUrl: /authentication/Token + tokenUrl: /api/authentication/Token + scopes: + Manager-api: Manager WebAPI +security: + - bearer: [] +tags: + - name: Configuration + description: Configuration management + - name: Device + description: Device management + - name: Resource + description: Resource management + - name: Section + description: Section management + - name: User + description: User management + - name: Authentication + description: Authentication management diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index 17323c5..a052da1 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -15,6 +15,9 @@ doc/ExportConfigurationDTOAllOf.md doc/GeoPointDTO.md doc/ImageDTO.md doc/ImageGeoPoint.md +doc/Instance.md +doc/InstanceApi.md +doc/InstanceDTO.md doc/LevelDTO.md doc/LoginDTO.md doc/MapDTO.md @@ -44,6 +47,7 @@ lib/api.dart lib/api/authentication_api.dart lib/api/configuration_api.dart lib/api/device_api.dart +lib/api/instance_api.dart lib/api/resource_api.dart lib/api/section_api.dart lib/api/user_api.dart @@ -65,6 +69,8 @@ lib/model/export_configuration_dto_all_of.dart lib/model/geo_point_dto.dart lib/model/image_dto.dart lib/model/image_geo_point.dart +lib/model/instance.dart +lib/model/instance_dto.dart lib/model/level_dto.dart lib/model/login_dto.dart lib/model/map_dto.dart @@ -87,3 +93,6 @@ lib/model/user_detail_dto.dart lib/model/video_dto.dart lib/model/web_dto.dart pubspec.yaml +test/instance_api_test.dart +test/instance_dto_test.dart +test/instance_test.dart diff --git a/manager_api/README.md b/manager_api/README.md index 35a2fbc..93893f7 100644 --- a/manager_api/README.md +++ b/manager_api/README.md @@ -60,7 +60,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://localhost:5000* +All URIs are relative to *https://api.mymuseum.be* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -79,6 +79,11 @@ Class | Method | HTTP request | Description *DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | *DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device | *DeviceApi* | [**deviceUpdateMainInfos**](doc\/DeviceApi.md#deviceupdatemaininfos) | **PUT** /api/Device/mainInfos | +*InstanceApi* | [**instanceCreateInstance**](doc\/InstanceApi.md#instancecreateinstance) | **POST** /api/Instance | +*InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | +*InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance | +*InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | +*InstanceApi* | [**instanceUpdateinstance**](doc\/InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | *ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource | *ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} | *ResourceApi* | [**resourceGet**](doc\/ResourceApi.md#resourceget) | **GET** /api/Resource | @@ -122,6 +127,8 @@ Class | Method | HTTP request | Description - [GeoPointDTO](doc\/GeoPointDTO.md) - [ImageDTO](doc\/ImageDTO.md) - [ImageGeoPoint](doc\/ImageGeoPoint.md) + - [Instance](doc\/Instance.md) + - [InstanceDTO](doc\/InstanceDTO.md) - [LevelDTO](doc\/LevelDTO.md) - [LoginDTO](doc\/LoginDTO.md) - [MapDTO](doc\/MapDTO.md) diff --git a/manager_api/doc/AuthenticationApi.md b/manager_api/doc/AuthenticationApi.md index 8fdf05d..be64641 100644 --- a/manager_api/doc/AuthenticationApi.md +++ b/manager_api/doc/AuthenticationApi.md @@ -5,7 +5,7 @@ import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/doc/ConfigurationApi.md b/manager_api/doc/ConfigurationApi.md index 320d458..751fdea 100644 --- a/manager_api/doc/ConfigurationApi.md +++ b/manager_api/doc/ConfigurationApi.md @@ -5,7 +5,7 @@ import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -148,7 +148,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **configurationGet** -> List configurationGet() +> List configurationGet(instanceId) @@ -159,9 +159,10 @@ import 'package:manager_api/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ConfigurationApi(); +final instanceId = instanceId_example; // String | try { - final result = api_instance.configurationGet(); + final result = api_instance.configurationGet(instanceId); print(result); } catch (e) { print('Exception when calling ConfigurationApi->configurationGet: $e\n'); @@ -169,7 +170,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/ConfigurationDTO.md b/manager_api/doc/ConfigurationDTO.md index b54d692..1856cc4 100644 --- a/manager_api/doc/ConfigurationDTO.md +++ b/manager_api/doc/ConfigurationDTO.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **isMobile** | **bool** | | [optional] **isTablet** | **bool** | | [optional] **isOffline** | **bool** | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/DeviceApi.md b/manager_api/doc/DeviceApi.md index ec76847..30e9574 100644 --- a/manager_api/doc/DeviceApi.md +++ b/manager_api/doc/DeviceApi.md @@ -5,7 +5,7 @@ import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -104,7 +104,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceGet** -> List deviceGet() +> List deviceGet(instanceId) @@ -115,9 +115,10 @@ import 'package:manager_api/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); +final instanceId = instanceId_example; // String | try { - final result = api_instance.deviceGet(); + final result = api_instance.deviceGet(instanceId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceGet: $e\n'); @@ -125,7 +126,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/DeviceDTO.md b/manager_api/doc/DeviceDTO.md index 22114af..0f99dac 100644 --- a/manager_api/doc/DeviceDTO.md +++ b/manager_api/doc/DeviceDTO.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **connected** | **bool** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/DeviceDetailDTO.md b/manager_api/doc/DeviceDetailDTO.md index c222dca..2d9ed26 100644 --- a/manager_api/doc/DeviceDetailDTO.md +++ b/manager_api/doc/DeviceDetailDTO.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **connected** | **bool** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] **connectionLevel** | **String** | | [optional] **lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] **batteryLevel** | **String** | | [optional] diff --git a/manager_api/doc/ExportConfigurationDTO.md b/manager_api/doc/ExportConfigurationDTO.md index db97809..4e16206 100644 --- a/manager_api/doc/ExportConfigurationDTO.md +++ b/manager_api/doc/ExportConfigurationDTO.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **isMobile** | **bool** | | [optional] **isTablet** | **bool** | | [optional] **isOffline** | **bool** | | [optional] +**instanceId** | **String** | | [optional] **sections** | [**List**](SectionDTO.md) | | [optional] [default to const []] **resources** | [**List**](ResourceDTO.md) | | [optional] [default to const []] diff --git a/manager_api/doc/Instance.md b/manager_api/doc/Instance.md new file mode 100644 index 0000000..dd6770c --- /dev/null +++ b/manager_api/doc/Instance.md @@ -0,0 +1,17 @@ +# manager_api.model.Instance + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/InstanceApi.md b/manager_api/doc/InstanceApi.md new file mode 100644 index 0000000..cf81e4a --- /dev/null +++ b/manager_api/doc/InstanceApi.md @@ -0,0 +1,229 @@ +# manager_api.api.InstanceApi + +## Load the API package +```dart +import 'package:manager_api/api.dart'; +``` + +All URIs are relative to *https://api.mymuseum.be* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**instanceCreateInstance**](InstanceApi.md#instancecreateinstance) | **POST** /api/Instance | +[**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | +[**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance | +[**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | +[**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | + + +# **instanceCreateInstance** +> InstanceDTO instanceCreateInstance(instance) + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final instance = Instance(); // Instance | + +try { + final result = api_instance.instanceCreateInstance(instance); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceCreateInstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance** | [**Instance**](Instance.md)| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceDeleteInstance** +> String instanceDeleteInstance(id) + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final id = id_example; // String | + +try { + final result = api_instance.instanceDeleteInstance(id); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceDeleteInstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +**String** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceGet** +> List instanceGet() + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); + +try { + final result = api_instance.instanceGet(); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](Instance.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceGetDetail** +> InstanceDTO instanceGetDetail(id) + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final id = id_example; // String | + +try { + final result = api_instance.instanceGetDetail(id); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instanceUpdateinstance** +> InstanceDTO instanceUpdateinstance(instance) + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final instance = Instance(); // Instance | + +try { + final result = api_instance.instanceUpdateinstance(instance); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceUpdateinstance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance** | [**Instance**](Instance.md)| | + +### Return type + +[**InstanceDTO**](InstanceDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api/doc/InstanceDTO.md b/manager_api/doc/InstanceDTO.md new file mode 100644 index 0000000..1f678ff --- /dev/null +++ b/manager_api/doc/InstanceDTO.md @@ -0,0 +1,17 @@ +# manager_api.model.InstanceDTO + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/ResourceApi.md b/manager_api/doc/ResourceApi.md index e27c6d3..fbce49e 100644 --- a/manager_api/doc/ResourceApi.md +++ b/manager_api/doc/ResourceApi.md @@ -5,7 +5,7 @@ import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -105,7 +105,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **resourceGet** -> List resourceGet() +> List resourceGet(instanceId) @@ -116,9 +116,10 @@ import 'package:manager_api/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = ResourceApi(); +final instanceId = instanceId_example; // String | try { - final result = api_instance.resourceGet(); + final result = api_instance.resourceGet(instanceId); print(result); } catch (e) { print('Exception when calling ResourceApi->resourceGet: $e\n'); @@ -126,7 +127,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type @@ -273,7 +277,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **resourceUpload** -> String resourceUpload(label, type) +> String resourceUpload(label, type, instanceId) @@ -286,9 +290,10 @@ import 'package:manager_api/api.dart'; final api_instance = ResourceApi(); final label = label_example; // String | final type = type_example; // String | +final instanceId = instanceId_example; // String | try { - final result = api_instance.resourceUpload(label, type); + final result = api_instance.resourceUpload(label, type, instanceId); print(result); } catch (e) { print('Exception when calling ResourceApi->resourceUpload: $e\n'); @@ -301,6 +306,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **label** | **String**| | [optional] **type** | **String**| | [optional] + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/ResourceDTO.md b/manager_api/doc/ResourceDTO.md index 88ccdfc..9a1516c 100644 --- a/manager_api/doc/ResourceDTO.md +++ b/manager_api/doc/ResourceDTO.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **label** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **data** | **String** | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/SectionApi.md b/manager_api/doc/SectionApi.md index 691b7c9..93873b6 100644 --- a/manager_api/doc/SectionApi.md +++ b/manager_api/doc/SectionApi.md @@ -5,7 +5,7 @@ import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -158,7 +158,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **sectionGet** -> List sectionGet() +> List sectionGet(instanceId) @@ -169,9 +169,10 @@ import 'package:manager_api/api.dart'; //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = SectionApi(); +final instanceId = instanceId_example; // String | try { - final result = api_instance.sectionGet(); + final result = api_instance.sectionGet(instanceId); print(result); } catch (e) { print('Exception when calling SectionApi->sectionGet: $e\n'); @@ -179,7 +180,10 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instanceId** | **String**| | [optional] ### Return type diff --git a/manager_api/doc/SectionDTO.md b/manager_api/doc/SectionDTO.md index 731765e..e7c16dd 100644 --- a/manager_api/doc/SectionDTO.md +++ b/manager_api/doc/SectionDTO.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **data** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] **order** | **int** | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/TokenDTO.md b/manager_api/doc/TokenDTO.md index a59d2a5..f8a2124 100644 --- a/manager_api/doc/TokenDTO.md +++ b/manager_api/doc/TokenDTO.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **tokenType** | **String** | | [optional] **expiresIn** | **int** | | [optional] **expiration** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/User.md b/manager_api/doc/User.md index eda3562..b51b3d3 100644 --- a/manager_api/doc/User.md +++ b/manager_api/doc/User.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **lastName** | **String** | | [optional] **token** | **String** | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**instanceId** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api/doc/UserApi.md b/manager_api/doc/UserApi.md index 6a55295..5963708 100644 --- a/manager_api/doc/UserApi.md +++ b/manager_api/doc/UserApi.md @@ -5,7 +5,7 @@ import 'package:manager_api/api.dart'; ``` -All URIs are relative to *http://localhost:5000* +All URIs are relative to *https://api.mymuseum.be* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api/lib/api.dart b/manager_api/lib/api.dart index c2191b4..3d214e5 100644 --- a/manager_api/lib/api.dart +++ b/manager_api/lib/api.dart @@ -30,6 +30,7 @@ part 'auth/http_bearer_auth.dart'; part 'api/authentication_api.dart'; part 'api/configuration_api.dart'; part 'api/device_api.dart'; +part 'api/instance_api.dart'; part 'api/resource_api.dart'; part 'api/section_api.dart'; part 'api/user_api.dart'; @@ -44,6 +45,8 @@ part 'model/export_configuration_dto_all_of.dart'; part 'model/geo_point_dto.dart'; part 'model/image_dto.dart'; part 'model/image_geo_point.dart'; +part 'model/instance.dart'; +part 'model/instance_dto.dart'; part 'model/level_dto.dart'; part 'model/login_dto.dart'; part 'model/map_dto.dart'; diff --git a/manager_api/lib/api/configuration_api.dart b/manager_api/lib/api/configuration_api.dart index 15757c7..ffc3cf0 100644 --- a/manager_api/lib/api/configuration_api.dart +++ b/manager_api/lib/api/configuration_api.dart @@ -160,7 +160,10 @@ class ConfigurationApi { } /// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response]. - Future configurationGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future configurationGetWithHttpInfo({ String? instanceId, }) async { // ignore: prefer_const_declarations final path = r'/api/Configuration'; @@ -171,6 +174,10 @@ class ConfigurationApi { final headerParams = {}; final formParams = {}; + if (instanceId != null) { + queryParams.addAll(_queryParams('', 'instanceId', instanceId)); + } + const contentTypes = []; @@ -185,8 +192,11 @@ class ConfigurationApi { ); } - Future?> configurationGet() async { - final response = await configurationGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future?> configurationGet({ String? instanceId, }) async { + final response = await configurationGetWithHttpInfo( instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/manager_api/lib/api/device_api.dart b/manager_api/lib/api/device_api.dart index c2a3e2e..7bb84ed 100644 --- a/manager_api/lib/api/device_api.dart +++ b/manager_api/lib/api/device_api.dart @@ -112,7 +112,10 @@ class DeviceApi { } /// Performs an HTTP 'GET /api/Device' operation and returns the [Response]. - Future deviceGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future deviceGetWithHttpInfo({ String? instanceId, }) async { // ignore: prefer_const_declarations final path = r'/api/Device'; @@ -123,6 +126,10 @@ class DeviceApi { final headerParams = {}; final formParams = {}; + if (instanceId != null) { + queryParams.addAll(_queryParams('', 'instanceId', instanceId)); + } + const contentTypes = []; @@ -137,8 +144,11 @@ class DeviceApi { ); } - Future?> deviceGet() async { - final response = await deviceGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future?> deviceGet({ String? instanceId, }) async { + final response = await deviceGetWithHttpInfo( instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/manager_api/lib/api/instance_api.dart b/manager_api/lib/api/instance_api.dart new file mode 100644 index 0000000..ef652ce --- /dev/null +++ b/manager_api/lib/api/instance_api.dart @@ -0,0 +1,252 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class InstanceApi { + InstanceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/Instance' operation and returns the [Response]. + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceCreateInstanceWithHttpInfo(Instance instance,) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance'; + + // ignore: prefer_final_locals + Object? postBody = instance; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceCreateInstance(Instance instance,) async { + final response = await instanceCreateInstanceWithHttpInfo(instance,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO; + + } + return null; + } + + /// Performs an HTTP 'DELETE /api/Instance/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future instanceDeleteInstanceWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance/{id}' + .replaceAll('{id}', id); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future instanceDeleteInstance(String id,) async { + final response = await instanceDeleteInstanceWithHttpInfo(id,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String; + + } + return null; + } + + /// Performs an HTTP 'GET /api/Instance' operation and returns the [Response]. + Future instanceGetWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Instance'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future?> instanceGet() async { + final response = await instanceGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) + .cast() + .toList(); + + } + return null; + } + + /// Performs an HTTP 'GET /api/Instance/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future instanceGetDetailWithHttpInfo(String id,) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance/{id}' + .replaceAll('{id}', id); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future instanceGetDetail(String id,) async { + final response = await instanceGetDetailWithHttpInfo(id,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO; + + } + return null; + } + + /// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response]. + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceUpdateinstanceWithHttpInfo(Instance instance,) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance'; + + // ignore: prefer_final_locals + Object? postBody = instance; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [Instance] instance (required): + Future instanceUpdateinstance(Instance instance,) async { + final response = await instanceUpdateinstanceWithHttpInfo(instance,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO; + + } + return null; + } +} diff --git a/manager_api/lib/api/resource_api.dart b/manager_api/lib/api/resource_api.dart index 63e6733..4596407 100644 --- a/manager_api/lib/api/resource_api.dart +++ b/manager_api/lib/api/resource_api.dart @@ -112,7 +112,10 @@ class ResourceApi { } /// Performs an HTTP 'GET /api/Resource' operation and returns the [Response]. - Future resourceGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future resourceGetWithHttpInfo({ String? instanceId, }) async { // ignore: prefer_const_declarations final path = r'/api/Resource'; @@ -123,6 +126,10 @@ class ResourceApi { final headerParams = {}; final formParams = {}; + if (instanceId != null) { + queryParams.addAll(_queryParams('', 'instanceId', instanceId)); + } + const contentTypes = []; @@ -137,8 +144,11 @@ class ResourceApi { ); } - Future?> resourceGet() async { - final response = await resourceGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future?> resourceGet({ String? instanceId, }) async { + final response = await resourceGetWithHttpInfo( instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } @@ -304,7 +314,9 @@ class ResourceApi { /// * [String] label: /// /// * [String] type: - Future resourceUploadWithHttpInfo({ String? label, String? type, }) async { + /// + /// * [String] instanceId: + Future resourceUploadWithHttpInfo({ String? label, String? type, String? instanceId, }) async { // ignore: prefer_const_declarations final path = r'/api/Resource/upload'; @@ -327,6 +339,10 @@ class ResourceApi { hasFields = true; mp.fields[r'type'] = parameterToString(type); } + if (instanceId != null) { + hasFields = true; + mp.fields[r'instanceId'] = parameterToString(instanceId); + } if (hasFields) { postBody = mp; } @@ -347,8 +363,10 @@ class ResourceApi { /// * [String] label: /// /// * [String] type: - Future resourceUpload({ String? label, String? type, }) async { - final response = await resourceUploadWithHttpInfo( label: label, type: type, ); + /// + /// * [String] instanceId: + Future resourceUpload({ String? label, String? type, String? instanceId, }) async { + final response = await resourceUploadWithHttpInfo( label: label, type: type, instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/manager_api/lib/api/section_api.dart b/manager_api/lib/api/section_api.dart index 8df21d9..cb2897c 100644 --- a/manager_api/lib/api/section_api.dart +++ b/manager_api/lib/api/section_api.dart @@ -160,7 +160,10 @@ class SectionApi { } /// Performs an HTTP 'GET /api/Section' operation and returns the [Response]. - Future sectionGetWithHttpInfo() async { + /// Parameters: + /// + /// * [String] instanceId: + Future sectionGetWithHttpInfo({ String? instanceId, }) async { // ignore: prefer_const_declarations final path = r'/api/Section'; @@ -171,6 +174,10 @@ class SectionApi { final headerParams = {}; final formParams = {}; + if (instanceId != null) { + queryParams.addAll(_queryParams('', 'instanceId', instanceId)); + } + const contentTypes = []; @@ -185,8 +192,11 @@ class SectionApi { ); } - Future?> sectionGet() async { - final response = await sectionGetWithHttpInfo(); + /// Parameters: + /// + /// * [String] instanceId: + Future?> sectionGet({ String? instanceId, }) async { + final response = await sectionGetWithHttpInfo( instanceId: instanceId, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/manager_api/lib/api_client.dart b/manager_api/lib/api_client.dart index d842fa0..70d5cce 100644 --- a/manager_api/lib/api_client.dart +++ b/manager_api/lib/api_client.dart @@ -11,7 +11,7 @@ part of openapi.api; class ApiClient { - ApiClient({this.basePath = 'http://localhost:5000', this.authentication}); + ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication}); final String basePath; @@ -210,6 +210,10 @@ class ApiClient { return ImageDTO.fromJson(value); case 'ImageGeoPoint': return ImageGeoPoint.fromJson(value); + case 'Instance': + return Instance.fromJson(value); + case 'InstanceDTO': + return InstanceDTO.fromJson(value); case 'LevelDTO': return LevelDTO.fromJson(value); case 'LoginDTO': diff --git a/manager_api/lib/model/configuration_dto.dart b/manager_api/lib/model/configuration_dto.dart index 4624851..5b29c23 100644 --- a/manager_api/lib/model/configuration_dto.dart +++ b/manager_api/lib/model/configuration_dto.dart @@ -25,6 +25,7 @@ class ConfigurationDTO { this.isMobile, this.isTablet, this.isOffline, + this.instanceId, }); String? id; @@ -75,6 +76,8 @@ class ConfigurationDTO { /// bool? isOffline; + String? instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && other.id == id && @@ -88,7 +91,8 @@ class ConfigurationDTO { other.dateCreation == dateCreation && other.isMobile == isMobile && other.isTablet == isTablet && - other.isOffline == isOffline; + other.isOffline == isOffline && + other.instanceId == instanceId; @override int get hashCode => @@ -104,10 +108,11 @@ class ConfigurationDTO { (dateCreation == null ? 0 : dateCreation!.hashCode) + (isMobile == null ? 0 : isMobile!.hashCode) + (isTablet == null ? 0 : isTablet!.hashCode) + - (isOffline == null ? 0 : isOffline!.hashCode); + (isOffline == null ? 0 : isOffline!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline]'; + String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId]'; Map toJson() { final _json = {}; @@ -147,6 +152,9 @@ class ConfigurationDTO { if (isOffline != null) { _json[r'isOffline'] = isOffline; } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } return _json; } @@ -183,6 +191,7 @@ class ConfigurationDTO { isMobile: mapValueOfType(json, r'isMobile'), isTablet: mapValueOfType(json, r'isTablet'), isOffline: mapValueOfType(json, r'isOffline'), + instanceId: mapValueOfType(json, r'instanceId'), ); } return null; diff --git a/manager_api/lib/model/device_detail_dto.dart b/manager_api/lib/model/device_detail_dto.dart index ed99b68..88ec18f 100644 --- a/manager_api/lib/model/device_detail_dto.dart +++ b/manager_api/lib/model/device_detail_dto.dart @@ -23,6 +23,7 @@ class DeviceDetailDTO { this.connected, this.dateCreation, this.dateUpdate, + this.instanceId, this.connectionLevel, this.lastConnectionLevel, this.batteryLevel, @@ -67,6 +68,8 @@ class DeviceDetailDTO { /// DateTime? dateUpdate; + String? instanceId; + String? connectionLevel; /// @@ -99,6 +102,7 @@ class DeviceDetailDTO { other.connected == connected && other.dateCreation == dateCreation && other.dateUpdate == dateUpdate && + other.instanceId == instanceId && other.connectionLevel == connectionLevel && other.lastConnectionLevel == lastConnectionLevel && other.batteryLevel == batteryLevel && @@ -117,13 +121,14 @@ class DeviceDetailDTO { (connected == null ? 0 : connected!.hashCode) + (dateCreation == null ? 0 : dateCreation!.hashCode) + (dateUpdate == null ? 0 : dateUpdate!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + (connectionLevel == null ? 0 : connectionLevel!.hashCode) + (lastConnectionLevel == null ? 0 : lastConnectionLevel!.hashCode) + (batteryLevel == null ? 0 : batteryLevel!.hashCode) + (lastBatteryLevel == null ? 0 : lastBatteryLevel!.hashCode); @override - String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; + String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; Map toJson() { final _json = {}; @@ -157,6 +162,9 @@ class DeviceDetailDTO { if (dateUpdate != null) { _json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String(); } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } if (connectionLevel != null) { _json[r'connectionLevel'] = connectionLevel; } @@ -201,6 +209,7 @@ class DeviceDetailDTO { connected: mapValueOfType(json, r'connected'), dateCreation: mapDateTime(json, r'dateCreation', ''), dateUpdate: mapDateTime(json, r'dateUpdate', ''), + instanceId: mapValueOfType(json, r'instanceId'), connectionLevel: mapValueOfType(json, r'connectionLevel'), lastConnectionLevel: mapDateTime(json, r'lastConnectionLevel', ''), batteryLevel: mapValueOfType(json, r'batteryLevel'), diff --git a/manager_api/lib/model/device_dto.dart b/manager_api/lib/model/device_dto.dart index 9ce4f70..7915fb8 100644 --- a/manager_api/lib/model/device_dto.dart +++ b/manager_api/lib/model/device_dto.dart @@ -23,6 +23,7 @@ class DeviceDTO { this.connected, this.dateCreation, this.dateUpdate, + this.instanceId, }); String? id; @@ -63,6 +64,8 @@ class DeviceDTO { /// DateTime? dateUpdate; + String? instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is DeviceDTO && other.id == id && @@ -74,7 +77,8 @@ class DeviceDTO { other.configuration == configuration && other.connected == connected && other.dateCreation == dateCreation && - other.dateUpdate == dateUpdate; + other.dateUpdate == dateUpdate && + other.instanceId == instanceId; @override int get hashCode => @@ -88,10 +92,11 @@ class DeviceDTO { (configuration == null ? 0 : configuration!.hashCode) + (connected == null ? 0 : connected!.hashCode) + (dateCreation == null ? 0 : dateCreation!.hashCode) + - (dateUpdate == null ? 0 : dateUpdate!.hashCode); + (dateUpdate == null ? 0 : dateUpdate!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate]'; + String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId]'; Map toJson() { final _json = {}; @@ -125,6 +130,9 @@ class DeviceDTO { if (dateUpdate != null) { _json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String(); } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } return _json; } @@ -157,6 +165,7 @@ class DeviceDTO { connected: mapValueOfType(json, r'connected'), dateCreation: mapDateTime(json, r'dateCreation', ''), dateUpdate: mapDateTime(json, r'dateUpdate', ''), + instanceId: mapValueOfType(json, r'instanceId'), ); } return null; diff --git a/manager_api/lib/model/export_configuration_dto.dart b/manager_api/lib/model/export_configuration_dto.dart index 49e4ab6..ac75edc 100644 --- a/manager_api/lib/model/export_configuration_dto.dart +++ b/manager_api/lib/model/export_configuration_dto.dart @@ -25,6 +25,7 @@ class ExportConfigurationDTO { this.isMobile, this.isTablet, this.isOffline, + this.instanceId, this.sections = const [], this.resources = const [], }); @@ -77,6 +78,8 @@ class ExportConfigurationDTO { /// bool? isOffline; + String? instanceId; + List? sections; List? resources; @@ -95,6 +98,7 @@ class ExportConfigurationDTO { other.isMobile == isMobile && other.isTablet == isTablet && other.isOffline == isOffline && + other.instanceId == instanceId && other.sections == sections && other.resources == resources; @@ -113,11 +117,12 @@ class ExportConfigurationDTO { (isMobile == null ? 0 : isMobile!.hashCode) + (isTablet == null ? 0 : isTablet!.hashCode) + (isOffline == null ? 0 : isOffline!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + (sections == null ? 0 : sections!.hashCode) + (resources == null ? 0 : resources!.hashCode); @override - String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, sections=$sections, resources=$resources]'; + String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sections=$sections, resources=$resources]'; Map toJson() { final _json = {}; @@ -157,6 +162,9 @@ class ExportConfigurationDTO { if (isOffline != null) { _json[r'isOffline'] = isOffline; } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } if (sections != null) { _json[r'sections'] = sections; } @@ -199,6 +207,7 @@ class ExportConfigurationDTO { isMobile: mapValueOfType(json, r'isMobile'), isTablet: mapValueOfType(json, r'isTablet'), isOffline: mapValueOfType(json, r'isOffline'), + instanceId: mapValueOfType(json, r'instanceId'), sections: SectionDTO.listFromJson(json[r'sections']) ?? const [], resources: ResourceDTO.listFromJson(json[r'resources']) ?? const [], ); diff --git a/manager_api/lib/model/instance.dart b/manager_api/lib/model/instance.dart new file mode 100644 index 0000000..74e7ca8 --- /dev/null +++ b/manager_api/lib/model/instance.dart @@ -0,0 +1,136 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Instance { + /// Returns a new [Instance] instance. + Instance({ + this.id, + this.name, + this.dateCreation, + }); + + String? id; + + String? name; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? dateCreation; + + @override + bool operator ==(Object other) => identical(this, other) || other is Instance && + other.id == id && + other.name == name && + other.dateCreation == dateCreation; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode); + + @override + String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation]'; + + Map toJson() { + final _json = {}; + if (id != null) { + _json[r'id'] = id; + } + if (name != null) { + _json[r'name'] = name; + } + if (dateCreation != null) { + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); + } + return _json; + } + + /// Returns a new [Instance] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Instance? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Instance[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Instance[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Instance( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Instance.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Instance.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Instance-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Instance.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/instance_dto.dart b/manager_api/lib/model/instance_dto.dart new file mode 100644 index 0000000..a1d77a7 --- /dev/null +++ b/manager_api/lib/model/instance_dto.dart @@ -0,0 +1,136 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class InstanceDTO { + /// Returns a new [InstanceDTO] instance. + InstanceDTO({ + this.id, + this.name, + this.dateCreation, + }); + + String? id; + + String? name; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? dateCreation; + + @override + bool operator ==(Object other) => identical(this, other) || other is InstanceDTO && + other.id == id && + other.name == name && + other.dateCreation == dateCreation; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode); + + @override + String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation]'; + + Map toJson() { + final _json = {}; + if (id != null) { + _json[r'id'] = id; + } + if (name != null) { + _json[r'name'] = name; + } + if (dateCreation != null) { + _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); + } + return _json; + } + + /// Returns a new [InstanceDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static InstanceDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "InstanceDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "InstanceDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return InstanceDTO( + id: mapValueOfType(json, r'id'), + name: mapValueOfType(json, r'name'), + dateCreation: mapDateTime(json, r'dateCreation', ''), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = InstanceDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = InstanceDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of InstanceDTO-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = InstanceDTO.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/resource_dto.dart b/manager_api/lib/model/resource_dto.dart index 4b79b8e..309c5a3 100644 --- a/manager_api/lib/model/resource_dto.dart +++ b/manager_api/lib/model/resource_dto.dart @@ -18,6 +18,7 @@ class ResourceDTO { this.label, this.dateCreation, this.data, + this.instanceId, }); String? id; @@ -42,13 +43,16 @@ class ResourceDTO { String? data; + String? instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is ResourceDTO && other.id == id && other.type == type && other.label == label && other.dateCreation == dateCreation && - other.data == data; + other.data == data && + other.instanceId == instanceId; @override int get hashCode => @@ -57,10 +61,11 @@ class ResourceDTO { (type == null ? 0 : type!.hashCode) + (label == null ? 0 : label!.hashCode) + (dateCreation == null ? 0 : dateCreation!.hashCode) + - (data == null ? 0 : data!.hashCode); + (data == null ? 0 : data!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, dateCreation=$dateCreation, data=$data]'; + String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, dateCreation=$dateCreation, data=$data, instanceId=$instanceId]'; Map toJson() { final _json = {}; @@ -79,6 +84,9 @@ class ResourceDTO { if (data != null) { _json[r'data'] = data; } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } return _json; } @@ -106,6 +114,7 @@ class ResourceDTO { label: mapValueOfType(json, r'label'), dateCreation: mapDateTime(json, r'dateCreation', ''), data: mapValueOfType(json, r'data'), + instanceId: mapValueOfType(json, r'instanceId'), ); } return null; diff --git a/manager_api/lib/model/section_dto.dart b/manager_api/lib/model/section_dto.dart index a3da2bf..4ba32aa 100644 --- a/manager_api/lib/model/section_dto.dart +++ b/manager_api/lib/model/section_dto.dart @@ -26,6 +26,7 @@ class SectionDTO { this.data, this.dateCreation, this.order, + this.instanceId, }); String? id; @@ -78,6 +79,8 @@ class SectionDTO { /// int? order; + String? instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is SectionDTO && other.id == id && @@ -92,7 +95,8 @@ class SectionDTO { other.type == type && other.data == data && other.dateCreation == dateCreation && - other.order == order; + other.order == order && + other.instanceId == instanceId; @override int get hashCode => @@ -109,10 +113,11 @@ class SectionDTO { (type == null ? 0 : type!.hashCode) + (data == null ? 0 : data!.hashCode) + (dateCreation == null ? 0 : dateCreation!.hashCode) + - (order == null ? 0 : order!.hashCode); + (order == null ? 0 : order!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order]'; + String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order, instanceId=$instanceId]'; Map toJson() { final _json = {}; @@ -155,6 +160,9 @@ class SectionDTO { if (order != null) { _json[r'order'] = order; } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } return _json; } @@ -190,6 +198,7 @@ class SectionDTO { data: mapValueOfType(json, r'data'), dateCreation: mapDateTime(json, r'dateCreation', ''), order: mapValueOfType(json, r'order'), + instanceId: mapValueOfType(json, r'instanceId'), ); } return null; diff --git a/manager_api/lib/model/token_dto.dart b/manager_api/lib/model/token_dto.dart index 395efdd..5f89ba2 100644 --- a/manager_api/lib/model/token_dto.dart +++ b/manager_api/lib/model/token_dto.dart @@ -19,6 +19,7 @@ class TokenDTO { this.tokenType, this.expiresIn, this.expiration, + this.instanceId, }); String? accessToken; @@ -45,6 +46,8 @@ class TokenDTO { /// DateTime? expiration; + String? instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is TokenDTO && other.accessToken == accessToken && @@ -52,7 +55,8 @@ class TokenDTO { other.scope == scope && other.tokenType == tokenType && other.expiresIn == expiresIn && - other.expiration == expiration; + other.expiration == expiration && + other.instanceId == instanceId; @override int get hashCode => @@ -62,10 +66,11 @@ class TokenDTO { (scope == null ? 0 : scope!.hashCode) + (tokenType == null ? 0 : tokenType!.hashCode) + (expiresIn == null ? 0 : expiresIn!.hashCode) + - (expiration == null ? 0 : expiration!.hashCode); + (expiration == null ? 0 : expiration!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration]'; + String toString() => 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId]'; Map toJson() { final _json = {}; @@ -87,6 +92,9 @@ class TokenDTO { if (expiration != null) { _json[r'expiration'] = expiration!.toUtc().toIso8601String(); } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } return _json; } @@ -115,6 +123,7 @@ class TokenDTO { tokenType: mapValueOfType(json, r'token_type'), expiresIn: mapValueOfType(json, r'expires_in'), expiration: mapDateTime(json, r'expiration', ''), + instanceId: mapValueOfType(json, r'instanceId'), ); } return null; diff --git a/manager_api/lib/model/user.dart b/manager_api/lib/model/user.dart index f6a903c..e50ca10 100644 --- a/manager_api/lib/model/user.dart +++ b/manager_api/lib/model/user.dart @@ -20,6 +20,7 @@ class User { this.lastName, this.token, this.dateCreation, + this.instanceId, }); String? id; @@ -42,6 +43,8 @@ class User { /// DateTime? dateCreation; + String? instanceId; + @override bool operator ==(Object other) => identical(this, other) || other is User && other.id == id && @@ -50,7 +53,8 @@ class User { other.firstName == firstName && other.lastName == lastName && other.token == token && - other.dateCreation == dateCreation; + other.dateCreation == dateCreation && + other.instanceId == instanceId; @override int get hashCode => @@ -61,10 +65,11 @@ class User { (firstName == null ? 0 : firstName!.hashCode) + (lastName == null ? 0 : lastName!.hashCode) + (token == null ? 0 : token!.hashCode) + - (dateCreation == null ? 0 : dateCreation!.hashCode); + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode); @override - String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation]'; + String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation, instanceId=$instanceId]'; Map toJson() { final _json = {}; @@ -89,6 +94,9 @@ class User { if (dateCreation != null) { _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String(); } + if (instanceId != null) { + _json[r'instanceId'] = instanceId; + } return _json; } @@ -118,6 +126,7 @@ class User { lastName: mapValueOfType(json, r'lastName'), token: mapValueOfType(json, r'token'), dateCreation: mapDateTime(json, r'dateCreation', ''), + instanceId: mapValueOfType(json, r'instanceId'), ); } return null; diff --git a/manager_api/test/instance_api_test.dart b/manager_api/test/instance_api_test.dart new file mode 100644 index 0000000..d603922 --- /dev/null +++ b/manager_api/test/instance_api_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + + +/// tests for InstanceApi +void main() { + // final instance = InstanceApi(); + + group('tests for InstanceApi', () { + //Future instanceCreateInstance(Instance instance) async + test('test instanceCreateInstance', () async { + // TODO + }); + + //Future instanceDeleteInstance(String id) async + test('test instanceDeleteInstance', () async { + // TODO + }); + + //Future> instanceGet() async + test('test instanceGet', () async { + // TODO + }); + + //Future instanceGetDetail(String id) async + test('test instanceGetDetail', () async { + // TODO + }); + + //Future instanceUpdateinstance(Instance instance) async + test('test instanceUpdateinstance', () async { + // TODO + }); + + }); +} diff --git a/manager_api/test/instance_dto_test.dart b/manager_api/test/instance_dto_test.dart new file mode 100644 index 0000000..e8c6878 --- /dev/null +++ b/manager_api/test/instance_dto_test.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for InstanceDTO +void main() { + // final instance = InstanceDTO(); + + group('test InstanceDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/instance_test.dart b/manager_api/test/instance_test.dart new file mode 100644 index 0000000..9133f85 --- /dev/null +++ b/manager_api/test/instance_test.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for Instance +void main() { + // final instance = Instance(); + + group('test Instance', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + + }); + +}