From b622217a39acd8042d7e50e2976350844c72e438 Mon Sep 17 00:00:00 2001 From: aestene Date: Tue, 7 Mar 2023 12:08:03 +0100 Subject: [PATCH] Revert change to metadata type --- src/isar/config/settings.py | 3 ++- .../models/inspection/inspection.py | 22 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/isar/config/settings.py b/src/isar/config/settings.py index 1b492117..bf21df99 100644 --- a/src/isar/config/settings.py +++ b/src/isar/config/settings.py @@ -1,6 +1,7 @@ import importlib.resources as pkg_resources import os from typing import List + from dotenv import load_dotenv from pydantic import BaseSettings, Field, validator @@ -101,7 +102,7 @@ class Settings(BaseSettings): AZURE_TENANT_ID: str = Field(default="3aa4a235-b6e2-48d5-9195-7fcf05b459b0") # Client ID for the API client - APP_CLIENT_ID: str = Field(default="68cca82d-84e7-495c-96b4-4c32509f2a46") + APP_CLIENT_ID: str = Field(default="fd384acd-5c1b-4c44-a1ac-d41d720ed0fe") # Client ID for the OpenAPI client OPENAPI_CLIENT_ID: str = Field(default="5f412c20-8c36-4c69-898f-d2b5051f5fb6") diff --git a/src/robot_interface/models/inspection/inspection.py b/src/robot_interface/models/inspection/inspection.py index d184675b..7c39cab5 100644 --- a/src/robot_interface/models/inspection/inspection.py +++ b/src/robot_interface/models/inspection/inspection.py @@ -1,7 +1,7 @@ from abc import ABC from dataclasses import dataclass, field from datetime import datetime -from typing import List, Optional +from typing import List, Optional, Type from uuid import UUID, uuid4 from alitra import Pose @@ -43,22 +43,42 @@ class Inspection: metadata: InspectionMetadata data: Optional[bytes] = field(default=None, init=False) + @staticmethod + def get_metadata_type() -> Type[InspectionMetadata]: + return InspectionMetadata + @dataclass class Image(Inspection): metadata: ImageMetadata + @staticmethod + def get_metadata_type() -> Type[InspectionMetadata]: + return ImageMetadata + @dataclass class ThermalImage(Inspection): metadata: ThermalImageMetadata + @staticmethod + def get_metadata_type() -> Type[InspectionMetadata]: + return ThermalImageMetadata + @dataclass class Video(Inspection): metadata: VideoMetadata + @staticmethod + def get_metadata_type() -> Type[InspectionMetadata]: + return VideoMetadata + @dataclass class ThermalVideo(Inspection): metadata: ThermalVideoMetadata + + @staticmethod + def get_metadata_type() -> Type[InspectionMetadata]: + return ThermalVideoMetadata