1212RESULT_ENTITY_TYPE = "genomicVariant"
1313
1414
15- class HandoverSettings (BaseSettings ):
16- """Settings for 'HandoverType' class"""
17-
18- id : str
19- label : str
20-
21- model_config = SettingsConfigDict (
22- env_prefix = "HANDOVER_TYPE_" ,
23- extra = "ignore" ,
24- )
25-
26-
27- handover_type_settings = HandoverSettings () # type: ignore
28-
29-
3015class HandoverType (BaseModel ):
3116 """The type of handover the parent `BeaconHandover` represents."""
3217
33- id : str = Field (
34- "" ,
35- description = "Node-specific identifier" ,
36- frozen = True ,
37- )
18+ id : str = Field (default = "gregor" , description = "Node-specific identifier" )
3819 label : str = Field (
39- "" ,
40- description = "Node-specific label" ,
41- frozen = True ,
42- )
43-
44- model_config = ConfigDict (
45- extra = "forbid" ,
46- )
47-
48- # custom __init__ to prevent overriding attributes that are static/set via environment variables
49- def __init__ (self ) -> None :
50- super ().__init__ (
51- id = handover_type_settings .id ,
52- label = handover_type_settings .label ,
53- )
54-
55-
56- class BeaconHandoverSettings (BaseSettings ):
57- """Settings for 'BeaconHandover' class"""
58-
59- url : str
60-
61- model_config = SettingsConfigDict (
62- env_prefix = "BEACON_HANDOVER_" ,
63- extra = "ignore" ,
20+ description = "Node-specific identifier" ,
6421 )
6522
6623
67- beacon_handover_settings = BeaconHandoverSettings () # type: ignore
68-
69-
7024class BeaconHandover (BaseModel ):
7125 """Describes how users can get more information about the results provided in the parent `VlmResponse`"""
7226
73- handoverType : HandoverType = Field (default = HandoverType ())
27+ handoverType : HandoverType = Field (
28+ ..., description = "The type of handover this represents"
29+ )
7430 url : str = Field (
7531 "" ,
7632 description = """
@@ -79,10 +35,6 @@ class BeaconHandover(BaseModel):
7935 """ ,
8036 )
8137
82- # custom __init__ to prevent overriding attributes that are static/set via environment variables
83- def __init__ (self ) -> None :
84- super ().__init__ (url = beacon_handover_settings .url )
85-
8638
8739class ReturnedSchema (BaseModel ):
8840 """Fixed [Beacon Schema](https://github.com/ga4gh-beacon/beacon-v2/blob/c6558bf2e6494df3905f7b2df66e903dfe509500/framework/json/common/beaconCommonComponents.json#L241)"""
@@ -190,7 +142,7 @@ class ResponseField(BaseModel):
190142class VlmResponse (BaseModel ):
191143 """Define response structure for the variant_counts endpoint."""
192144
193- beaconHandovers : list [BeaconHandover ] = [ BeaconHandover ()]
145+ beaconHandovers : list [BeaconHandover ]
194146 meta : Meta = Meta ()
195147 responseSummary : ResponseSummary
196148 response : ResponseField
0 commit comments