From ebb5474191b74d09d6ecdb3201bd0328ce2b0f22 Mon Sep 17 00:00:00 2001 From: sandeshit Date: Thu, 21 Aug 2025 16:06:56 +0545 Subject: [PATCH 1/2] chore(project): separate yaml declaration files --- functions/definition/models.yaml | 583 ------------------ functions/definition/project/common.yaml | 189 ++++++ .../definition/project/customOptions.yaml | 35 ++ .../project/project_types/compare.yaml | 37 ++ .../project/project_types/completeness.yaml | 41 ++ .../project/project_types/find.yaml | 12 + .../project/project_types/tileMapService.yaml | 18 + .../project/project_types/validate.yaml | 61 ++ .../project/project_types/validateImage.yaml | 67 ++ functions/definition/project/rasterTiles.yaml | 54 ++ functions/definition/project/vectorTiles.yaml | 64 ++ .../tutorial/{ => project_types}/compare.yaml | 0 .../{ => project_types}/completeness.yaml | 0 .../tutorial/{ => project_types}/find.yaml | 0 .../{ => project_types}/tileMapService.yaml | 0 .../{ => project_types}/validate.yaml | 0 .../{ => project_types}/validateImage.yaml | 0 functions/definition/userGroup.yaml | 10 + 18 files changed, 588 insertions(+), 583 deletions(-) delete mode 100644 functions/definition/models.yaml create mode 100644 functions/definition/project/common.yaml create mode 100644 functions/definition/project/customOptions.yaml create mode 100644 functions/definition/project/project_types/compare.yaml create mode 100644 functions/definition/project/project_types/completeness.yaml create mode 100644 functions/definition/project/project_types/find.yaml create mode 100644 functions/definition/project/project_types/tileMapService.yaml create mode 100644 functions/definition/project/project_types/validate.yaml create mode 100644 functions/definition/project/project_types/validateImage.yaml create mode 100644 functions/definition/project/rasterTiles.yaml create mode 100644 functions/definition/project/vectorTiles.yaml rename functions/definition/tutorial/{ => project_types}/compare.yaml (100%) rename functions/definition/tutorial/{ => project_types}/completeness.yaml (100%) rename functions/definition/tutorial/{ => project_types}/find.yaml (100%) rename functions/definition/tutorial/{ => project_types}/tileMapService.yaml (100%) rename functions/definition/tutorial/{ => project_types}/validate.yaml (100%) rename functions/definition/tutorial/{ => project_types}/validateImage.yaml (100%) diff --git a/functions/definition/models.yaml b/functions/definition/models.yaml deleted file mode 100644 index 8c151e5..0000000 --- a/functions/definition/models.yaml +++ /dev/null @@ -1,583 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json - -# ENUM - -FbEnumOverlayTileServerType: - model: alias - type: - type: enum - members: - - label: 'RASTER' - value: 'raster' - - label: 'VECTOR' - value: 'vector' - -FbEnumValidateImageInputType: - model: alias - type: - type: enum - members: - - label: 'DIRECT_IMAGES' - value: 'direct_images' - - label: 'DATASET_FILE' - value: 'dataset_file' - -FbEnumValidateInputType: - model: alias - type: - type: enum - members: - - label: 'AOI_FILE' - value: 'aoi_file' - - label: 'LINK' - value: 'link' - - label: 'TMID' - value: 'TMId' - -FbEnumUserGroupMembershipAction: - model: alias - type: - type: enum - members: - - label: 'JOIN' - value: 'join' - - label: 'LEAVE' - value: 'leave' - -FbEnumRasterTileServerName: - model: alias - docs: Represents supported raster tile server - type: - type: enum - members: - - label: CUSTOM - value: custom - - label: BING - value: bing - - label: MAPBOX - value: mapbox - - label: MAXAR_STANDARD - value: maxarStandard - - label: MAXAR_PREMIUM - value: maxarPremium - - label: ESRI - value: esri - - label: ESRI_BETA - value: esriBeta - -FbEnumVectorTileServerName: - model: alias - docs: Represents supported vector tile server - type: - type: enum - members: - - label: CUSTOM - value: custom - - label: OPEN_STREET_MAP - value: openStreetMap - - label: OPEN_FREE_MAP - value: openFreeMap - - label: VERSATILES - value: versatiles - -FbEnumProjectStatus: - model: alias - docs: Represents project status - type: - type: enum - members: - # FIXME: tutorial always has status "tutorial" - - label: "ACTIVE" - value: active - - label: "INACTIVE" - value: inactive - - label: "PRIVATE_INACTIVE" - value: private_inactive - - label: "PRIVATE_ACTIVE" - value: private_active - - label: "FINISHED" - value: finished - -FbEnumProjectType: - model: alias - docs: Represents project type - type: - type: enum - members: - - label: 'FIND' - value: 1 - - label: 'VALIDATE' - value: 2 - - label: 'VALIDATE_IMAGE' - value: 10 - - label: 'COMPARE' - value: 3 - - label: 'COMPLETENESS' - value: 4 - -# PROJECT - -FbBaseObjCustomSubOption: - model: alias - docs: Represents a custom sub-option - type: - type: object - fields: - value: - type: int - description: - type: string - -FbObjCustomOption: - model: alias - docs: Represents a custom option - type: - type: object - fields: - value: - type: int - title: - type: string - description: - type: string - # FIXME: Do we add enum here? - icon: - type: string - iconColor: - type: string - subOptions: - optional: true - type: - type: list - elementType: FbBaseObjCustomSubOption - -FbObjRasterTileServer: - model: alias - docs: Represents a raster tile server configuration - type: - type: object - fields: - apiKey: - optional: true - type: string - wmtsLayerName: - deprecated: true - optional: true - type: string - credits: - type: string - name: - type: FbEnumRasterTileServerName - url: - type: string - -FbObjVectorTileServer: - model: alias - docs: Represents a vector tile server configuration - type: - type: object - fields: - credits: - type: string - name: - type: FbEnumVectorTileServerName - sourceLayer: - type: string - url: - type: string - minZoom: - type: int - maxZoom: - type: int - -FbObjRasterTileServerOverlay: - model: alias - docs: Represents an overlay layer for raster layer - type: - type: object - fields: - tileServer: - type: FbObjRasterTileServer - opacity: - type: double - -FbObjVectorTileServerOverlay: - model: alias - docs: Represents an overlay layer for vector layer - type: - type: object - fields: - tileServer: - type: FbObjVectorTileServer - fillColor: - type: string - fillOpacity: - type: double - lineColor: - type: string - lineOpacity: - type: double - lineWidth: - type: double - lineDasharray: - type: - type: list - elementType: int - circleColor: - type: string - circleOpacity: - type: double - circleRadius: - type: double - -FbObjUnifiedOverlayTileServer: - model: alias - docs: Represents an overlay layer - type: - type: object - fields: - type: - type: FbEnumOverlayTileServerType - raster: - optional: true - type: FbObjRasterTileServerOverlay - vector: - optional: true - type: FbObjVectorTileServerOverlay - -FbProjectReadonlyType: - model: alias - docs: Represents project fields that cannot be updated from backend - type: - type: object - fields: - contributorCount: - type: int - progress: - type: int - resultCount: - type: int - -FbProjectUpdateInput: - model: alias - docs: Represents project fields that are valid while updating a project - type: - type: object - fields: - image: - type: string - optional: true - isFeatured: - type: boolean - lookFor: - optional: true - type: string - projectInstruction: - optional: true - type: string - name: - type: string - projectDetails: - type: string - projectNumber: - type: int - projectRegion: - type: string - projectTopic: - type: string - projectTopicKey: - type: string - deprecated: true - # NOTE: Name of the organisation - requestingOrganisation: - type: string - tutorialId: - type: string - language: - type: string - manualUrl: - optional: true - type: string - teamId: - optional: true - type: string - status: - type: FbEnumProjectStatus - -FbProjectCreateOnlyInput: - model: alias - docs: Represents project fields that are valid while creating a project - type: - type: object - fields: - created: - type: timestamp - createdBy: - type: string - groupMaxSize: - type: int - groupSize: - type: int - maxTasksPerUser: - optional: true - type: int - projectId: - type: string - projectType: - type: FbEnumProjectType - # project_type: - # type: FbEnumProjectType - requiredResults: - type: int - verificationNumber: - type: int - -FbProjectFindCreateOnlyInput: - model: alias - docs: Represents FIND project fields that are valid while creating a project - type: - type: object - fields: - zoomLevel: - type: int - tileServer: - type: FbObjRasterTileServer - -FbProjectCompareCreateOnlyInput: - model: alias - docs: Represents COMPARE project fields that are valid while creating a project - type: - type: object - fields: - zoomLevel: - type: int - tileServer: - type: FbObjRasterTileServer - tileServerB: - type: FbObjRasterTileServer - -FbProjectCompletenessCreateOnlyInput: - model: alias - docs: Represents COMPLETNESS project fields that are valid while creating a project - type: - type: object - fields: - zoomLevel: - type: int - tileServer: - type: FbObjRasterTileServer - tileServerB: - type: FbObjRasterTileServer - overlayTileServer: - type: FbObjUnifiedOverlayTileServer - -FbProjectValidateCreateOnlyInput: - model: alias - docs: Represents VALIDATE project fields that are valid while creating a project - type: - type: object - fields: - customOptions: - optional: true - type: - type: list - elementType: FbObjCustomOption - tileServer: - type: FbObjRasterTileServer - inputType: - type: FbEnumValidateInputType - - # NOTE: available for aoi_file and TMId - filter: - type: string - optional: true - # NOTE: available for TMId - TMId: - type: string - optional: true - - -FbProjectValidateImageCreateOnlyInput: - model: alias - docs: Represents VALIDATE_IMAGE project fields that are valid while creating a project - type: - type: object - fields: - customOptions: - optional: true - type: - type: list - elementType: FbObjCustomOption - -# MAPPING - -FbMappingGroupReadonlyType: - model: alias - docs: Represents mapping group fields that cannot be updated from backend - type: - type: object - fields: - finishedCount: - type: int - progress: - type: int - -FbMappingGroupCreateOnlyInput: - model: alias - docs: Represents mapping group fields that are valid while creating a mapping group - type: - type: object - fields: - projectId: - type: string - numberOfTasks: - type: int - requiredCount: - type: int - -FbMappingGroupTileMapServiceCreateOnlyInput: - model: alias - docs: Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group - type: - type: object - fields: - groupId: - type: string - xMax: - type: int - xMin: - type: int - yMax: - type: int - yMin: - type: int - -FbMappingGroupValidateCreateOnlyInput: - model: alias - docs: Represents VALIDATE mapping group fields that are valid while creating a mapping group - type: - type: object - fields: - groupId: - type: string - -FbMappingGroupValidateImageCreateOnlyInput: - model: alias - docs: Represents VALIDATE_IMAGE mapping group fields that are valid while creating a mapping group - type: - type: object - fields: - groupId: - type: string - -FbMappingTaskCreateOnlyInput: - model: alias - # path: tasks/{projectId}/{groupId}/{index} - docs: Represents mapping task fields that are valid while creating a task - type: - type: object - fields: - projectId: - type: string - -FbMappingTaskValidateCreateOnlyInput: - model: alias - docs: Represents VALIDATE mapping task fields that are valid while creating a task - type: - type: object - fields: - taskId: - type: string - geojson: - # NOTE: This is not optional - type: - type: map - valueType: any - -FbMappingTaskValidateImageCreateOnlyInput: - model: alias - docs: Represents VALIDATE_IMAGE mapping task fields that are valid while creating a task - type: - type: object - fields: - taskId: - type: string - url: - type: string - fileName: - type: string - width: - type: int - optional: true - height: - type: int - optional: true - annotationId: - # NOTE: using string to handle large integers - type: string - optional: true - bbox: - type: - type: list - elementType: double - optional: true - segmentation: - type: - type: list - elementType: - type: list - elementType: double - optional: true - -FbMappingTaskCompareCreateOnlyInput: - model: alias - docs: Represents COMPARE mapping task fields that are valid while creating a task - type: - type: object - fields: - groupId: - type: string - taskId: - type: string - taskX: - type: int - optional: true - taskY: - type: int - optional: true - url: - type: string - optional: true - urlB: - type: string - optional: true - -FbMappingResult: - model: alias - # path: results/{projectId}/{groupId}/{userId} - docs: Represents a mapswipe project - type: - type: object - fields: - appVersion: - type: string - clientType: - # FIXME: this is an enum - type: string - optional: true - endTime: - type: timestamp - startTime: - type: timestamp - results: - optional: true - type: - # NOTE: The key is taskId - type: map - valueType: int - usergroups: - optional: true - type: - # NOTE: The key is usergroupId - type: map - valueType: boolean diff --git a/functions/definition/project/common.yaml b/functions/definition/project/common.yaml new file mode 100644 index 0000000..763026d --- /dev/null +++ b/functions/definition/project/common.yaml @@ -0,0 +1,189 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +# ENUM + +FbEnumProjectStatus: + model: alias + docs: Represents project status + type: + type: enum + members: + # FIXME: tutorial always has status "tutorial" + - label: "ACTIVE" + value: active + - label: "INACTIVE" + value: inactive + - label: "PRIVATE_INACTIVE" + value: private_inactive + - label: "PRIVATE_ACTIVE" + value: private_active + - label: "FINISHED" + value: finished + +FbEnumProjectType: + model: alias + docs: Represents project type + type: + type: enum + members: + - label: 'FIND' + value: 1 + - label: 'VALIDATE' + value: 2 + - label: 'VALIDATE_IMAGE' + value: 10 + - label: 'COMPARE' + value: 3 + - label: 'COMPLETENESS' + value: 4 + +FbProjectReadonlyType: + model: alias + docs: Represents project fields that cannot be updated from backend + type: + type: object + fields: + contributorCount: + type: int + progress: + type: int + resultCount: + type: int + +FbProjectUpdateInput: + model: alias + docs: Represents project fields that are valid while updating a project + type: + type: object + fields: + image: + type: string + optional: true + isFeatured: + type: boolean + lookFor: + optional: true + type: string + projectInstruction: + optional: true + type: string + name: + type: string + projectDetails: + type: string + projectNumber: + type: int + projectRegion: + type: string + projectTopic: + type: string + projectTopicKey: + type: string + deprecated: true + # NOTE: Name of the organisation + requestingOrganisation: + type: string + tutorialId: + type: string + language: + type: string + manualUrl: + optional: true + type: string + teamId: + optional: true + type: string + status: + type: FbEnumProjectStatus + +FbProjectCreateOnlyInput: + model: alias + docs: Represents project fields that are valid while creating a project + type: + type: object + fields: + created: + type: timestamp + createdBy: + type: string + groupMaxSize: + type: int + groupSize: + type: int + maxTasksPerUser: + optional: true + type: int + projectId: + type: string + projectType: + type: FbEnumProjectType + # project_type: + # type: FbEnumProjectType + requiredResults: + type: int + verificationNumber: + type: int + +FbMappingGroupReadonlyType: + model: alias + docs: Represents mapping group fields that cannot be updated from backend + type: + type: object + fields: + finishedCount: + type: int + progress: + type: int + +FbMappingGroupCreateOnlyInput: + model: alias + docs: Represents mapping group fields that are valid while creating a mapping group + type: + type: object + fields: + projectId: + type: string + numberOfTasks: + type: int + requiredCount: + type: int + +FbMappingTaskCreateOnlyInput: + model: alias + # path: tasks/{projectId}/{groupId}/{index} + docs: Represents mapping task fields that are valid while creating a task + type: + type: object + fields: + projectId: + type: string + +FbMappingResult: + model: alias + # path: results/{projectId}/{groupId}/{userId} + docs: Represents a mapswipe project + type: + type: object + fields: + appVersion: + type: string + clientType: + # FIXME: this is an enum + type: string + optional: true + endTime: + type: timestamp + startTime: + type: timestamp + results: + optional: true + type: + # NOTE: The key is taskId + type: map + valueType: int + usergroups: + optional: true + type: + # NOTE: The key is usergroupId + type: map + valueType: boolean diff --git a/functions/definition/project/customOptions.yaml b/functions/definition/project/customOptions.yaml new file mode 100644 index 0000000..05132ac --- /dev/null +++ b/functions/definition/project/customOptions.yaml @@ -0,0 +1,35 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbBaseObjCustomSubOption: + model: alias + docs: Represents a custom sub-option + type: + type: object + fields: + value: + type: int + description: + type: string + +FbObjCustomOption: + model: alias + docs: Represents a custom option + type: + type: object + fields: + value: + type: int + title: + type: string + description: + type: string + # FIXME: Do we add enum here? + icon: + type: string + iconColor: + type: string + subOptions: + optional: true + type: + type: list + elementType: FbBaseObjCustomSubOption diff --git a/functions/definition/project/project_types/compare.yaml b/functions/definition/project/project_types/compare.yaml new file mode 100644 index 0000000..f5f011e --- /dev/null +++ b/functions/definition/project/project_types/compare.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbProjectCompareCreateOnlyInput: + model: alias + docs: Represents COMPARE project fields that are valid while creating a project + type: + type: object + fields: + zoomLevel: + type: int + tileServer: + type: FbObjRasterTileServer + tileServerB: + type: FbObjRasterTileServer + +FbMappingTaskCompareCreateOnlyInput: + model: alias + docs: Represents COMPARE mapping task fields that are valid while creating a task + type: + type: object + fields: + groupId: + type: string + taskId: + type: string + taskX: + type: int + optional: true + taskY: + type: int + optional: true + url: + type: string + optional: true + urlB: + type: string + optional: true diff --git a/functions/definition/project/project_types/completeness.yaml b/functions/definition/project/project_types/completeness.yaml new file mode 100644 index 0000000..2e66c65 --- /dev/null +++ b/functions/definition/project/project_types/completeness.yaml @@ -0,0 +1,41 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbEnumOverlayTileServerType: + model: alias + type: + type: enum + members: + - label: 'RASTER' + value: 'raster' + - label: 'VECTOR' + value: 'vector' + +FbObjUnifiedOverlayTileServer: + model: alias + docs: Represents an overlay layer + type: + type: object + fields: + type: + type: FbEnumOverlayTileServerType + raster: + optional: true + type: FbObjRasterTileServerOverlay + vector: + optional: true + type: FbObjVectorTileServerOverlay + +FbProjectCompletenessCreateOnlyInput: + model: alias + docs: Represents COMPLETNESS project fields that are valid while creating a project + type: + type: object + fields: + zoomLevel: + type: int + tileServer: + type: FbObjRasterTileServer + tileServerB: + type: FbObjRasterTileServer + overlayTileServer: + type: FbObjUnifiedOverlayTileServer diff --git a/functions/definition/project/project_types/find.yaml b/functions/definition/project/project_types/find.yaml new file mode 100644 index 0000000..bc8a8e0 --- /dev/null +++ b/functions/definition/project/project_types/find.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbProjectFindCreateOnlyInput: + model: alias + docs: Represents FIND project fields that are valid while creating a project + type: + type: object + fields: + zoomLevel: + type: int + tileServer: + type: FbObjRasterTileServer diff --git a/functions/definition/project/project_types/tileMapService.yaml b/functions/definition/project/project_types/tileMapService.yaml new file mode 100644 index 0000000..b00f1df --- /dev/null +++ b/functions/definition/project/project_types/tileMapService.yaml @@ -0,0 +1,18 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbMappingGroupTileMapServiceCreateOnlyInput: + model: alias + docs: Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group + type: + type: object + fields: + groupId: + type: string + xMax: + type: int + xMin: + type: int + yMax: + type: int + yMin: + type: int diff --git a/functions/definition/project/project_types/validate.yaml b/functions/definition/project/project_types/validate.yaml new file mode 100644 index 0000000..4cf4a9f --- /dev/null +++ b/functions/definition/project/project_types/validate.yaml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbEnumValidateInputType: + model: alias + type: + type: enum + members: + - label: 'AOI_FILE' + value: 'aoi_file' + - label: 'LINK' + value: 'link' + - label: 'TMID' + value: 'TMId' + +FbProjectValidateCreateOnlyInput: + model: alias + docs: Represents VALIDATE project fields that are valid while creating a project + type: + type: object + fields: + customOptions: + optional: true + type: + type: list + elementType: FbObjCustomOption + tileServer: + type: FbObjRasterTileServer + inputType: + type: FbEnumValidateInputType + + # NOTE: available for aoi_file and TMId + filter: + type: string + optional: true + # NOTE: available for TMId + TMId: + type: string + optional: true + +FbMappingGroupValidateCreateOnlyInput: + model: alias + docs: Represents VALIDATE mapping group fields that are valid while creating a mapping group + type: + type: object + fields: + groupId: + type: string + +FbMappingTaskValidateCreateOnlyInput: + model: alias + docs: Represents VALIDATE mapping task fields that are valid while creating a task + type: + type: object + fields: + taskId: + type: string + geojson: + # NOTE: This is not optional + type: + type: map + valueType: any diff --git a/functions/definition/project/project_types/validateImage.yaml b/functions/definition/project/project_types/validateImage.yaml new file mode 100644 index 0000000..0186566 --- /dev/null +++ b/functions/definition/project/project_types/validateImage.yaml @@ -0,0 +1,67 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbEnumValidateImageInputType: + model: alias + type: + type: enum + members: + - label: 'DIRECT_IMAGES' + value: 'direct_images' + - label: 'DATASET_FILE' + value: 'dataset_file' + +FbProjectValidateImageCreateOnlyInput: + model: alias + docs: Represents VALIDATE_IMAGE project fields that are valid while creating a project + type: + type: object + fields: + customOptions: + optional: true + type: + type: list + elementType: FbObjCustomOption + +FbMappingGroupValidateImageCreateOnlyInput: + model: alias + docs: Represents VALIDATE_IMAGE mapping group fields that are valid while creating a mapping group + type: + type: object + fields: + groupId: + type: string + +FbMappingTaskValidateImageCreateOnlyInput: + model: alias + docs: Represents VALIDATE_IMAGE mapping task fields that are valid while creating a task + type: + type: object + fields: + taskId: + type: string + url: + type: string + fileName: + type: string + width: + type: int + optional: true + height: + type: int + optional: true + annotationId: + # NOTE: using string to handle large integers + type: string + optional: true + bbox: + type: + type: list + elementType: double + optional: true + segmentation: + type: + type: list + elementType: + type: list + elementType: double + optional: true diff --git a/functions/definition/project/rasterTiles.yaml b/functions/definition/project/rasterTiles.yaml new file mode 100644 index 0000000..0186d85 --- /dev/null +++ b/functions/definition/project/rasterTiles.yaml @@ -0,0 +1,54 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbEnumRasterTileServerName: + model: alias + docs: Represents supported raster tile server + type: + type: enum + members: + - label: CUSTOM + value: custom + - label: BING + value: bing + - label: MAPBOX + value: mapbox + - label: MAXAR_STANDARD + value: maxarStandard + - label: MAXAR_PREMIUM + value: maxarPremium + - label: ESRI + value: esri + - label: ESRI_BETA + value: esriBeta + +FbObjRasterTileServer: + model: alias + docs: Represents a raster tile server configuration + type: + type: object + fields: + apiKey: + optional: true + type: string + wmtsLayerName: + deprecated: true + optional: true + type: string + credits: + type: string + name: + type: FbEnumRasterTileServerName + url: + type: string + +FbObjRasterTileServerOverlay: + model: alias + docs: Represents an overlay layer for raster layer + type: + type: object + fields: + tileServer: + type: FbObjRasterTileServer + opacity: + type: double + diff --git a/functions/definition/project/vectorTiles.yaml b/functions/definition/project/vectorTiles.yaml new file mode 100644 index 0000000..465a628 --- /dev/null +++ b/functions/definition/project/vectorTiles.yaml @@ -0,0 +1,64 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbEnumVectorTileServerName: + model: alias + docs: Represents supported vector tile server + type: + type: enum + members: + - label: CUSTOM + value: custom + - label: OPEN_STREET_MAP + value: openStreetMap + - label: OPEN_FREE_MAP + value: openFreeMap + - label: VERSATILES + value: versatiles + +FbObjVectorTileServer: + model: alias + docs: Represents a vector tile server configuration + type: + type: object + fields: + credits: + type: string + name: + type: FbEnumVectorTileServerName + sourceLayer: + type: string + url: + type: string + minZoom: + type: int + maxZoom: + type: int + +FbObjVectorTileServerOverlay: + model: alias + docs: Represents an overlay layer for vector layer + type: + type: object + fields: + tileServer: + type: FbObjVectorTileServer + fillColor: + type: string + fillOpacity: + type: double + lineColor: + type: string + lineOpacity: + type: double + lineWidth: + type: double + lineDasharray: + type: + type: list + elementType: int + circleColor: + type: string + circleOpacity: + type: double + circleRadius: + type: double diff --git a/functions/definition/tutorial/compare.yaml b/functions/definition/tutorial/project_types/compare.yaml similarity index 100% rename from functions/definition/tutorial/compare.yaml rename to functions/definition/tutorial/project_types/compare.yaml diff --git a/functions/definition/tutorial/completeness.yaml b/functions/definition/tutorial/project_types/completeness.yaml similarity index 100% rename from functions/definition/tutorial/completeness.yaml rename to functions/definition/tutorial/project_types/completeness.yaml diff --git a/functions/definition/tutorial/find.yaml b/functions/definition/tutorial/project_types/find.yaml similarity index 100% rename from functions/definition/tutorial/find.yaml rename to functions/definition/tutorial/project_types/find.yaml diff --git a/functions/definition/tutorial/tileMapService.yaml b/functions/definition/tutorial/project_types/tileMapService.yaml similarity index 100% rename from functions/definition/tutorial/tileMapService.yaml rename to functions/definition/tutorial/project_types/tileMapService.yaml diff --git a/functions/definition/tutorial/validate.yaml b/functions/definition/tutorial/project_types/validate.yaml similarity index 100% rename from functions/definition/tutorial/validate.yaml rename to functions/definition/tutorial/project_types/validate.yaml diff --git a/functions/definition/tutorial/validateImage.yaml b/functions/definition/tutorial/project_types/validateImage.yaml similarity index 100% rename from functions/definition/tutorial/validateImage.yaml rename to functions/definition/tutorial/project_types/validateImage.yaml diff --git a/functions/definition/userGroup.yaml b/functions/definition/userGroup.yaml index 9179e6b..14fdf5f 100644 --- a/functions/definition/userGroup.yaml +++ b/functions/definition/userGroup.yaml @@ -1,5 +1,15 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json +FbEnumUserGroupMembershipAction: + model: alias + type: + type: enum + members: + - label: 'JOIN' + value: 'join' + - label: 'LEAVE' + value: 'leave' + FbUserGroupReadOnlyType: model: alias # path: userGroups/{userGroupId} From 28a33983f62b990b448c2650ac3e793a5c87c165 Mon Sep 17 00:00:00 2001 From: tnagorra Date: Fri, 29 Aug 2025 12:30:22 +0545 Subject: [PATCH 2/2] chore(pyfirebase): generate models.py --- .../pyfirebase/pyfirebase_mapswipe/models.py | 542 +++++++++--------- 1 file changed, 271 insertions(+), 271 deletions(-) diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index b089f94..b65b73c 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -80,46 +80,26 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbEnumOverlayTileServerType(enum.Enum): - RASTER = "raster" - VECTOR = "vector" - - -class FbEnumValidateImageInputType(enum.Enum): - DIRECT_IMAGES = "direct_images" - DATASET_FILE = "dataset_file" - - -class FbEnumValidateInputType(enum.Enum): - AOI_FILE = "aoi_file" - LINK = "link" - TMID = "TMId" - - -class FbEnumUserGroupMembershipAction(enum.Enum): - JOIN = "join" - LEAVE = "leave" - - -class FbEnumRasterTileServerName(enum.Enum): - """Represents supported raster tile server""" - - CUSTOM = "custom" - BING = "bing" - MAPBOX = "mapbox" - MAXAR_STANDARD = "maxarStandard" - MAXAR_PREMIUM = "maxarPremium" - ESRI = "esri" - ESRI_BETA = "esriBeta" +class FbOrganisation(TypesyncModel): + """Represents the requesting organisation.""" + name: str + description: str | TypesyncUndefined | None = UNDEFINED + nameKey: typing.Annotated[str, pydantic.Field(deprecated=True)] + abbreviation: str | TypesyncUndefined | None = UNDEFINED + isArchived: bool -class FbEnumVectorTileServerName(enum.Enum): - """Represents supported vector tile server""" + class Config: + use_enum_values = False + extra = "forbid" - CUSTOM = "custom" - OPEN_STREET_MAP = "openStreetMap" - OPEN_FREE_MAP = "openFreeMap" - VERSATILES = "versatiles" + @typing.override + def __setattr__(self, name: str, value: typing.Any) -> None: + if name == "description" and value is None: + raise ValueError("'description' field cannot be set to None") + if name == "abbreviation" and value is None: + raise ValueError("'abbreviation' field cannot be set to None") + super().__setattr__(name, value) class FbEnumProjectStatus(enum.Enum): @@ -142,11 +122,12 @@ class FbEnumProjectType(enum.Enum): COMPLETENESS = 4 -class FbBaseObjCustomSubOption(TypesyncModel): - """Represents a custom sub-option""" +class FbProjectReadonlyType(TypesyncModel): + """Represents project fields that cannot be updated from backend""" - value: int - description: str + contributorCount: int + progress: int + resultCount: int class Config: use_enum_values = False @@ -157,15 +138,25 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbObjCustomOption(TypesyncModel): - """Represents a custom option""" +class FbProjectUpdateInput(TypesyncModel): + """Represents project fields that are valid while updating a project""" - value: int - title: str - description: str - icon: str - iconColor: str - subOptions: list[FbBaseObjCustomSubOption] | TypesyncUndefined | None = UNDEFINED + image: str | TypesyncUndefined | None = UNDEFINED + isFeatured: bool + lookFor: str | TypesyncUndefined | None = UNDEFINED + projectInstruction: str | TypesyncUndefined | None = UNDEFINED + name: str + projectDetails: str + projectNumber: int + projectRegion: str + projectTopic: str + projectTopicKey: typing.Annotated[str, pydantic.Field(deprecated=True)] + requestingOrganisation: str + tutorialId: str + language: str + manualUrl: str | TypesyncUndefined | None = UNDEFINED + teamId: str | TypesyncUndefined | None = UNDEFINED + status: FbEnumProjectStatus class Config: use_enum_values = False @@ -173,22 +164,31 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "subOptions" and value is None: - raise ValueError("'subOptions' field cannot be set to None") + if name == "image" and value is None: + raise ValueError("'image' field cannot be set to None") + if name == "lookFor" and value is None: + raise ValueError("'lookFor' field cannot be set to None") + if name == "projectInstruction" and value is None: + raise ValueError("'projectInstruction' field cannot be set to None") + if name == "manualUrl" and value is None: + raise ValueError("'manualUrl' field cannot be set to None") + if name == "teamId" and value is None: + raise ValueError("'teamId' field cannot be set to None") super().__setattr__(name, value) -class FbObjRasterTileServer(TypesyncModel): - """Represents a raster tile server configuration""" +class FbProjectCreateOnlyInput(TypesyncModel): + """Represents project fields that are valid while creating a project""" - apiKey: str | TypesyncUndefined | None = UNDEFINED - wmtsLayerName: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), - ] = UNDEFINED - credits: str - name: FbEnumRasterTileServerName - url: str + created: datetime.datetime + createdBy: str + groupMaxSize: int + groupSize: int + maxTasksPerUser: int | TypesyncUndefined | None = UNDEFINED + projectId: str + projectType: FbEnumProjectType + requiredResults: int + verificationNumber: int class Config: use_enum_values = False @@ -196,22 +196,16 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "apiKey" and value is None: - raise ValueError("'apiKey' field cannot be set to None") - if name == "wmtsLayerName" and value is None: - raise ValueError("'wmtsLayerName' field cannot be set to None") + if name == "maxTasksPerUser" and value is None: + raise ValueError("'maxTasksPerUser' field cannot be set to None") super().__setattr__(name, value) -class FbObjVectorTileServer(TypesyncModel): - """Represents a vector tile server configuration""" +class FbMappingGroupReadonlyType(TypesyncModel): + """Represents mapping group fields that cannot be updated from backend""" - credits: str - name: FbEnumVectorTileServerName - sourceLayer: str - url: str - minZoom: int - maxZoom: int + finishedCount: int + progress: int class Config: use_enum_values = False @@ -222,11 +216,12 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbObjRasterTileServerOverlay(TypesyncModel): - """Represents an overlay layer for raster layer""" +class FbMappingGroupCreateOnlyInput(TypesyncModel): + """Represents mapping group fields that are valid while creating a mapping group""" - tileServer: FbObjRasterTileServer - opacity: float + projectId: str + numberOfTasks: int + requiredCount: int class Config: use_enum_values = False @@ -237,19 +232,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbObjVectorTileServerOverlay(TypesyncModel): - """Represents an overlay layer for vector layer""" +class FbMappingTaskCreateOnlyInput(TypesyncModel): + """Represents mapping task fields that are valid while creating a task""" - tileServer: FbObjVectorTileServer - fillColor: str - fillOpacity: float - lineColor: str - lineOpacity: float - lineWidth: float - lineDasharray: list[int] - circleColor: str - circleOpacity: float - circleRadius: float + projectId: str class Config: use_enum_values = False @@ -260,12 +246,15 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbObjUnifiedOverlayTileServer(TypesyncModel): - """Represents an overlay layer""" +class FbMappingResult(TypesyncModel): + """Represents a mapswipe project""" - type: FbEnumOverlayTileServerType - raster: FbObjRasterTileServerOverlay | TypesyncUndefined | None = UNDEFINED - vector: FbObjVectorTileServerOverlay | TypesyncUndefined | None = UNDEFINED + appVersion: str + clientType: str | TypesyncUndefined | None = UNDEFINED + endTime: datetime.datetime + startTime: datetime.datetime + results: dict[str, int] | TypesyncUndefined | None = UNDEFINED + usergroups: dict[str, bool] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -273,19 +262,20 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "raster" and value is None: - raise ValueError("'raster' field cannot be set to None") - if name == "vector" and value is None: - raise ValueError("'vector' field cannot be set to None") + if name == "clientType" and value is None: + raise ValueError("'clientType' field cannot be set to None") + if name == "results" and value is None: + raise ValueError("'results' field cannot be set to None") + if name == "usergroups" and value is None: + raise ValueError("'usergroups' field cannot be set to None") super().__setattr__(name, value) -class FbProjectReadonlyType(TypesyncModel): - """Represents project fields that cannot be updated from backend""" +class FbBaseObjCustomSubOption(TypesyncModel): + """Represents a custom sub-option""" - contributorCount: int - progress: int - resultCount: int + value: int + description: str class Config: use_enum_values = False @@ -296,25 +286,15 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbProjectUpdateInput(TypesyncModel): - """Represents project fields that are valid while updating a project""" +class FbObjCustomOption(TypesyncModel): + """Represents a custom option""" - image: str | TypesyncUndefined | None = UNDEFINED - isFeatured: bool - lookFor: str | TypesyncUndefined | None = UNDEFINED - projectInstruction: str | TypesyncUndefined | None = UNDEFINED - name: str - projectDetails: str - projectNumber: int - projectRegion: str - projectTopic: str - projectTopicKey: typing.Annotated[str, pydantic.Field(deprecated=True)] - requestingOrganisation: str - tutorialId: str - language: str - manualUrl: str | TypesyncUndefined | None = UNDEFINED - teamId: str | TypesyncUndefined | None = UNDEFINED - status: FbEnumProjectStatus + value: int + title: str + description: str + icon: str + iconColor: str + subOptions: list[FbBaseObjCustomSubOption] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -322,31 +302,20 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "image" and value is None: - raise ValueError("'image' field cannot be set to None") - if name == "lookFor" and value is None: - raise ValueError("'lookFor' field cannot be set to None") - if name == "projectInstruction" and value is None: - raise ValueError("'projectInstruction' field cannot be set to None") - if name == "manualUrl" and value is None: - raise ValueError("'manualUrl' field cannot be set to None") - if name == "teamId" and value is None: - raise ValueError("'teamId' field cannot be set to None") + if name == "subOptions" and value is None: + raise ValueError("'subOptions' field cannot be set to None") super().__setattr__(name, value) -class FbProjectCreateOnlyInput(TypesyncModel): - """Represents project fields that are valid while creating a project""" +class FbMappingTaskCompareCreateOnlyInput(TypesyncModel): + """Represents COMPARE mapping task fields that are valid while creating a task""" - created: datetime.datetime - createdBy: str - groupMaxSize: int - groupSize: int - maxTasksPerUser: int | TypesyncUndefined | None = UNDEFINED - projectId: str - projectType: FbEnumProjectType - requiredResults: int - verificationNumber: int + groupId: str + taskId: str + taskX: int | TypesyncUndefined | None = UNDEFINED + taskY: int | TypesyncUndefined | None = UNDEFINED + url: str | TypesyncUndefined | None = UNDEFINED + urlB: str | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -354,32 +323,30 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "maxTasksPerUser" and value is None: - raise ValueError("'maxTasksPerUser' field cannot be set to None") + if name == "taskX" and value is None: + raise ValueError("'taskX' field cannot be set to None") + if name == "taskY" and value is None: + raise ValueError("'taskY' field cannot be set to None") + if name == "url" and value is None: + raise ValueError("'url' field cannot be set to None") + if name == "urlB" and value is None: + raise ValueError("'urlB' field cannot be set to None") super().__setattr__(name, value) -class FbProjectFindCreateOnlyInput(TypesyncModel): - """Represents FIND project fields that are valid while creating a project""" - - zoomLevel: int - tileServer: FbObjRasterTileServer - - class Config: - use_enum_values = False - extra = "forbid" - - @typing.override - def __setattr__(self, name: str, value: typing.Any) -> None: - super().__setattr__(name, value) - +class FbEnumOverlayTileServerType(enum.Enum): + RASTER = "raster" + VECTOR = "vector" -class FbProjectCompareCreateOnlyInput(TypesyncModel): - """Represents COMPARE project fields that are valid while creating a project""" - zoomLevel: int - tileServer: FbObjRasterTileServer - tileServerB: FbObjRasterTileServer +class FbMappingGroupTileMapServiceCreateOnlyInput(TypesyncModel): + """Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group""" + + groupId: str + xMax: int + xMin: int + yMax: int + yMin: int class Config: use_enum_values = False @@ -390,13 +357,16 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbProjectCompletenessCreateOnlyInput(TypesyncModel): - """Represents COMPLETNESS project fields that are valid while creating a project""" +class FbEnumValidateInputType(enum.Enum): + AOI_FILE = "aoi_file" + LINK = "link" + TMID = "TMId" - zoomLevel: int - tileServer: FbObjRasterTileServer - tileServerB: FbObjRasterTileServer - overlayTileServer: FbObjUnifiedOverlayTileServer + +class FbMappingGroupValidateCreateOnlyInput(TypesyncModel): + """Represents VALIDATE mapping group fields that are valid while creating a mapping group""" + + groupId: str class Config: use_enum_values = False @@ -407,14 +377,11 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbProjectValidateCreateOnlyInput(TypesyncModel): - """Represents VALIDATE project fields that are valid while creating a project""" +class FbMappingTaskValidateCreateOnlyInput(TypesyncModel): + """Represents VALIDATE mapping task fields that are valid while creating a task""" - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED - tileServer: FbObjRasterTileServer - inputType: FbEnumValidateInputType - filter: str | TypesyncUndefined | None = UNDEFINED - TMId: str | TypesyncUndefined | None = UNDEFINED + taskId: str + geojson: dict[str, typing.Any] class Config: use_enum_values = False @@ -422,15 +389,14 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "customOptions" and value is None: - raise ValueError("'customOptions' field cannot be set to None") - if name == "filter" and value is None: - raise ValueError("'filter' field cannot be set to None") - if name == "TMId" and value is None: - raise ValueError("'TMId' field cannot be set to None") super().__setattr__(name, value) +class FbEnumValidateImageInputType(enum.Enum): + DIRECT_IMAGES = "direct_images" + DATASET_FILE = "dataset_file" + + class FbProjectValidateImageCreateOnlyInput(TypesyncModel): """Represents VALIDATE_IMAGE project fields that are valid while creating a project""" @@ -447,11 +413,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbMappingGroupReadonlyType(TypesyncModel): - """Represents mapping group fields that cannot be updated from backend""" +class FbMappingGroupValidateImageCreateOnlyInput(TypesyncModel): + """Represents VALIDATE_IMAGE mapping group fields that are valid while creating a mapping group""" - finishedCount: int - progress: int + groupId: str class Config: use_enum_values = False @@ -462,12 +427,17 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbMappingGroupCreateOnlyInput(TypesyncModel): - """Represents mapping group fields that are valid while creating a mapping group""" +class FbMappingTaskValidateImageCreateOnlyInput(TypesyncModel): + """Represents VALIDATE_IMAGE mapping task fields that are valid while creating a task""" - projectId: str - numberOfTasks: int - requiredCount: int + taskId: str + url: str + fileName: str + width: int | TypesyncUndefined | None = UNDEFINED + height: int | TypesyncUndefined | None = UNDEFINED + annotationId: str | TypesyncUndefined | None = UNDEFINED + bbox: list[float] | TypesyncUndefined | None = UNDEFINED + segmentation: list[list[float]] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -475,17 +445,42 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: + if name == "width" and value is None: + raise ValueError("'width' field cannot be set to None") + if name == "height" and value is None: + raise ValueError("'height' field cannot be set to None") + if name == "annotationId" and value is None: + raise ValueError("'annotationId' field cannot be set to None") + if name == "bbox" and value is None: + raise ValueError("'bbox' field cannot be set to None") + if name == "segmentation" and value is None: + raise ValueError("'segmentation' field cannot be set to None") super().__setattr__(name, value) -class FbMappingGroupTileMapServiceCreateOnlyInput(TypesyncModel): - """Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group""" +class FbEnumRasterTileServerName(enum.Enum): + """Represents supported raster tile server""" - groupId: str - xMax: int - xMin: int - yMax: int - yMin: int + CUSTOM = "custom" + BING = "bing" + MAPBOX = "mapbox" + MAXAR_STANDARD = "maxarStandard" + MAXAR_PREMIUM = "maxarPremium" + ESRI = "esri" + ESRI_BETA = "esriBeta" + + +class FbObjRasterTileServer(TypesyncModel): + """Represents a raster tile server configuration""" + + apiKey: str | TypesyncUndefined | None = UNDEFINED + wmtsLayerName: typing.Annotated[ + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), + ] = UNDEFINED + credits: str + name: FbEnumRasterTileServerName + url: str class Config: use_enum_values = False @@ -493,13 +488,19 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: + if name == "apiKey" and value is None: + raise ValueError("'apiKey' field cannot be set to None") + if name == "wmtsLayerName" and value is None: + raise ValueError("'wmtsLayerName' field cannot be set to None") super().__setattr__(name, value) -class FbMappingGroupValidateCreateOnlyInput(TypesyncModel): - """Represents VALIDATE mapping group fields that are valid while creating a mapping group""" +class FbProjectCompareCreateOnlyInput(TypesyncModel): + """Represents COMPARE project fields that are valid while creating a project""" - groupId: str + zoomLevel: int + tileServer: FbObjRasterTileServer + tileServerB: FbObjRasterTileServer class Config: use_enum_values = False @@ -510,10 +511,11 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbMappingGroupValidateImageCreateOnlyInput(TypesyncModel): - """Represents VALIDATE_IMAGE mapping group fields that are valid while creating a mapping group""" +class FbProjectFindCreateOnlyInput(TypesyncModel): + """Represents FIND project fields that are valid while creating a project""" - groupId: str + zoomLevel: int + tileServer: FbObjRasterTileServer class Config: use_enum_values = False @@ -524,10 +526,14 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbMappingTaskCreateOnlyInput(TypesyncModel): - """Represents mapping task fields that are valid while creating a task""" +class FbProjectValidateCreateOnlyInput(TypesyncModel): + """Represents VALIDATE project fields that are valid while creating a project""" - projectId: str + customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + tileServer: FbObjRasterTileServer + inputType: FbEnumValidateInputType + filter: str | TypesyncUndefined | None = UNDEFINED + TMId: str | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -535,14 +541,20 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: + if name == "customOptions" and value is None: + raise ValueError("'customOptions' field cannot be set to None") + if name == "filter" and value is None: + raise ValueError("'filter' field cannot be set to None") + if name == "TMId" and value is None: + raise ValueError("'TMId' field cannot be set to None") super().__setattr__(name, value) -class FbMappingTaskValidateCreateOnlyInput(TypesyncModel): - """Represents VALIDATE mapping task fields that are valid while creating a task""" +class FbObjRasterTileServerOverlay(TypesyncModel): + """Represents an overlay layer for raster layer""" - taskId: str - geojson: dict[str, typing.Any] + tileServer: FbObjRasterTileServer + opacity: float class Config: use_enum_values = False @@ -553,17 +565,24 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbMappingTaskValidateImageCreateOnlyInput(TypesyncModel): - """Represents VALIDATE_IMAGE mapping task fields that are valid while creating a task""" +class FbEnumVectorTileServerName(enum.Enum): + """Represents supported vector tile server""" - taskId: str + CUSTOM = "custom" + OPEN_STREET_MAP = "openStreetMap" + OPEN_FREE_MAP = "openFreeMap" + VERSATILES = "versatiles" + + +class FbObjVectorTileServer(TypesyncModel): + """Represents a vector tile server configuration""" + + credits: str + name: FbEnumVectorTileServerName + sourceLayer: str url: str - fileName: str - width: int | TypesyncUndefined | None = UNDEFINED - height: int | TypesyncUndefined | None = UNDEFINED - annotationId: str | TypesyncUndefined | None = UNDEFINED - bbox: list[float] | TypesyncUndefined | None = UNDEFINED - segmentation: list[list[float]] | TypesyncUndefined | None = UNDEFINED + minZoom: int + maxZoom: int class Config: use_enum_values = False @@ -571,28 +590,22 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "width" and value is None: - raise ValueError("'width' field cannot be set to None") - if name == "height" and value is None: - raise ValueError("'height' field cannot be set to None") - if name == "annotationId" and value is None: - raise ValueError("'annotationId' field cannot be set to None") - if name == "bbox" and value is None: - raise ValueError("'bbox' field cannot be set to None") - if name == "segmentation" and value is None: - raise ValueError("'segmentation' field cannot be set to None") super().__setattr__(name, value) -class FbMappingTaskCompareCreateOnlyInput(TypesyncModel): - """Represents COMPARE mapping task fields that are valid while creating a task""" +class FbObjVectorTileServerOverlay(TypesyncModel): + """Represents an overlay layer for vector layer""" - groupId: str - taskId: str - taskX: int | TypesyncUndefined | None = UNDEFINED - taskY: int | TypesyncUndefined | None = UNDEFINED - url: str | TypesyncUndefined | None = UNDEFINED - urlB: str | TypesyncUndefined | None = UNDEFINED + tileServer: FbObjVectorTileServer + fillColor: str + fillOpacity: float + lineColor: str + lineOpacity: float + lineWidth: float + lineDasharray: list[int] + circleColor: str + circleOpacity: float + circleRadius: float class Config: use_enum_values = False @@ -600,26 +613,15 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "taskX" and value is None: - raise ValueError("'taskX' field cannot be set to None") - if name == "taskY" and value is None: - raise ValueError("'taskY' field cannot be set to None") - if name == "url" and value is None: - raise ValueError("'url' field cannot be set to None") - if name == "urlB" and value is None: - raise ValueError("'urlB' field cannot be set to None") super().__setattr__(name, value) -class FbMappingResult(TypesyncModel): - """Represents a mapswipe project""" +class FbObjUnifiedOverlayTileServer(TypesyncModel): + """Represents an overlay layer""" - appVersion: str - clientType: str | TypesyncUndefined | None = UNDEFINED - endTime: datetime.datetime - startTime: datetime.datetime - results: dict[str, int] | TypesyncUndefined | None = UNDEFINED - usergroups: dict[str, bool] | TypesyncUndefined | None = UNDEFINED + type: FbEnumOverlayTileServerType + raster: FbObjRasterTileServerOverlay | TypesyncUndefined | None = UNDEFINED + vector: FbObjVectorTileServerOverlay | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -627,23 +629,20 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "clientType" and value is None: - raise ValueError("'clientType' field cannot be set to None") - if name == "results" and value is None: - raise ValueError("'results' field cannot be set to None") - if name == "usergroups" and value is None: - raise ValueError("'usergroups' field cannot be set to None") + if name == "raster" and value is None: + raise ValueError("'raster' field cannot be set to None") + if name == "vector" and value is None: + raise ValueError("'vector' field cannot be set to None") super().__setattr__(name, value) -class FbOrganisation(TypesyncModel): - """Represents the requesting organisation.""" +class FbProjectCompletenessCreateOnlyInput(TypesyncModel): + """Represents COMPLETNESS project fields that are valid while creating a project""" - name: str - description: str | TypesyncUndefined | None = UNDEFINED - nameKey: typing.Annotated[str, pydantic.Field(deprecated=True)] - abbreviation: str | TypesyncUndefined | None = UNDEFINED - isArchived: bool + zoomLevel: int + tileServer: FbObjRasterTileServer + tileServerB: FbObjRasterTileServer + overlayTileServer: FbObjUnifiedOverlayTileServer class Config: use_enum_values = False @@ -651,10 +650,6 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: - if name == "description" and value is None: - raise ValueError("'description' field cannot be set to None") - if name == "abbreviation" and value is None: - raise ValueError("'abbreviation' field cannot be set to None") super().__setattr__(name, value) @@ -1069,6 +1064,11 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) +class FbEnumUserGroupMembershipAction(enum.Enum): + JOIN = "join" + LEAVE = "leave" + + class FbUserGroupReadOnlyType(TypesyncModel): """Represents a usergroup"""