@@ -237,6 +237,72 @@ def write_nullable(x: Any) -> Any:
237
237
############################################################################
238
238
239
239
240
+ @dataclass (frozen = True )
241
+ class OSSMatch :
242
+ """Original type: engine_kind = [ ... | OSSMatch | ... ]"""
243
+
244
+ @property
245
+ def kind (self ) -> str :
246
+ """Name of the class representing this variant."""
247
+ return 'OSSMatch'
248
+
249
+ @staticmethod
250
+ def to_json () -> Any :
251
+ return 'OSSMatch'
252
+
253
+ def to_json_string (self , ** kw : Any ) -> str :
254
+ return json .dumps (self .to_json (), ** kw )
255
+
256
+
257
+ @dataclass (frozen = True )
258
+ class ProMatch :
259
+ """Original type: engine_kind = [ ... | ProMatch | ... ]"""
260
+
261
+ @property
262
+ def kind (self ) -> str :
263
+ """Name of the class representing this variant."""
264
+ return 'ProMatch'
265
+
266
+ @staticmethod
267
+ def to_json () -> Any :
268
+ return 'ProMatch'
269
+
270
+ def to_json_string (self , ** kw : Any ) -> str :
271
+ return json .dumps (self .to_json (), ** kw )
272
+
273
+
274
+ @dataclass (frozen = True )
275
+ class EngineKind :
276
+ """Original type: engine_kind = [ ... ]"""
277
+
278
+ value : Union [OSSMatch , ProMatch ]
279
+
280
+ @property
281
+ def kind (self ) -> str :
282
+ """Name of the class representing this variant."""
283
+ return self .value .kind
284
+
285
+ @classmethod
286
+ def from_json (cls , x : Any ) -> 'EngineKind' :
287
+ if isinstance (x , str ):
288
+ if x == 'OSSMatch' :
289
+ return cls (OSSMatch ())
290
+ if x == 'ProMatch' :
291
+ return cls (ProMatch ())
292
+ _atd_bad_json ('EngineKind' , x )
293
+ _atd_bad_json ('EngineKind' , x )
294
+
295
+ def to_json (self ) -> Any :
296
+ return self .value .to_json ()
297
+
298
+ @classmethod
299
+ def from_json_string (cls , x : str ) -> 'EngineKind' :
300
+ return cls .from_json (json .loads (x ))
301
+
302
+ def to_json_string (self , ** kw : Any ) -> str :
303
+ return json .dumps (self .to_json (), ** kw )
304
+
305
+
240
306
@dataclass (frozen = True )
241
307
class And :
242
308
"""Original type: matching_operation = [ ... | And | ... ]"""
@@ -852,6 +918,7 @@ class CoreMatchExtra:
852
918
"""Original type: core_match_extra = { ... }"""
853
919
854
920
metavars : Metavars
921
+ engine_kind : EngineKind
855
922
message : Optional [str ] = None
856
923
dataflow_trace : Optional [CoreMatchDataflowTrace ] = None
857
924
rendered_fix : Optional [str ] = None
@@ -861,6 +928,7 @@ def from_json(cls, x: Any) -> 'CoreMatchExtra':
861
928
if isinstance (x , dict ):
862
929
return cls (
863
930
metavars = Metavars .from_json (x ['metavars' ]) if 'metavars' in x else _atd_missing_json_field ('CoreMatchExtra' , 'metavars' ),
931
+ engine_kind = EngineKind .from_json (x ['engine_kind' ]) if 'engine_kind' in x else _atd_missing_json_field ('CoreMatchExtra' , 'engine_kind' ),
864
932
message = _atd_read_string (x ['message' ]) if 'message' in x else None ,
865
933
dataflow_trace = CoreMatchDataflowTrace .from_json (x ['dataflow_trace' ]) if 'dataflow_trace' in x else None ,
866
934
rendered_fix = _atd_read_string (x ['rendered_fix' ]) if 'rendered_fix' in x else None ,
@@ -871,6 +939,7 @@ def from_json(cls, x: Any) -> 'CoreMatchExtra':
871
939
def to_json (self ) -> Any :
872
940
res : Dict [str , Any ] = {}
873
941
res ['metavars' ] = (lambda x : x .to_json ())(self .metavars )
942
+ res ['engine_kind' ] = (lambda x : x .to_json ())(self .engine_kind )
874
943
if self .message is not None :
875
944
res ['message' ] = _atd_write_string (self .message )
876
945
if self .dataflow_trace is not None :
@@ -2837,6 +2906,7 @@ class CliMatchExtra:
2837
2906
message : str
2838
2907
metadata : RawJson
2839
2908
severity : str
2909
+ engine_kind : EngineKind
2840
2910
metavars : Optional [Metavars ] = None
2841
2911
fix : Optional [str ] = None
2842
2912
fix_regex : Optional [FixRegex ] = None
@@ -2854,6 +2924,7 @@ def from_json(cls, x: Any) -> 'CliMatchExtra':
2854
2924
message = _atd_read_string (x ['message' ]) if 'message' in x else _atd_missing_json_field ('CliMatchExtra' , 'message' ),
2855
2925
metadata = RawJson .from_json (x ['metadata' ]) if 'metadata' in x else _atd_missing_json_field ('CliMatchExtra' , 'metadata' ),
2856
2926
severity = _atd_read_string (x ['severity' ]) if 'severity' in x else _atd_missing_json_field ('CliMatchExtra' , 'severity' ),
2927
+ engine_kind = EngineKind .from_json (x ['engine_kind' ]) if 'engine_kind' in x else _atd_missing_json_field ('CliMatchExtra' , 'engine_kind' ),
2857
2928
metavars = Metavars .from_json (x ['metavars' ]) if 'metavars' in x else None ,
2858
2929
fix = _atd_read_string (x ['fix' ]) if 'fix' in x else None ,
2859
2930
fix_regex = FixRegex .from_json (x ['fix_regex' ]) if 'fix_regex' in x else None ,
@@ -2872,6 +2943,7 @@ def to_json(self) -> Any:
2872
2943
res ['message' ] = _atd_write_string (self .message )
2873
2944
res ['metadata' ] = (lambda x : x .to_json ())(self .metadata )
2874
2945
res ['severity' ] = _atd_write_string (self .severity )
2946
+ res ['engine_kind' ] = (lambda x : x .to_json ())(self .engine_kind )
2875
2947
if self .metavars is not None :
2876
2948
res ['metavars' ] = (lambda x : x .to_json ())(self .metavars )
2877
2949
if self .fix is not None :
0 commit comments