@@ -864,88 +864,6 @@ def to_json_string(self, **kw: Any) -> str:
864
864
return json .dumps (self .to_json (), ** kw )
865
865
866
866
867
- @dataclass
868
- class OsemgrepFormatOutput :
869
- """Original type: osemgrep_format_output = { ... }"""
870
-
871
- succeeded : Optional [bool ] = None
872
- format : Optional [str ] = None
873
- osemgrep_rpc_response_time_seconds : Optional [float ] = None
874
- osemgrep_format_time_seconds : Optional [float ] = None
875
- pysemgrep_format_time_seconds : Optional [float ] = None
876
- validation_time_seconds : Optional [float ] = None
877
- is_match : Optional [bool ] = None
878
-
879
- @classmethod
880
- def from_json (cls , x : Any ) -> 'OsemgrepFormatOutput' :
881
- if isinstance (x , dict ):
882
- return cls (
883
- succeeded = _atd_read_bool (x ['succeeded' ]) if 'succeeded' in x else None ,
884
- format = _atd_read_string (x ['format' ]) if 'format' in x else None ,
885
- osemgrep_rpc_response_time_seconds = _atd_read_float (x ['osemgrep_rpc_response_time_seconds' ]) if 'osemgrep_rpc_response_time_seconds' in x else None ,
886
- osemgrep_format_time_seconds = _atd_read_float (x ['osemgrep_format_time_seconds' ]) if 'osemgrep_format_time_seconds' in x else None ,
887
- pysemgrep_format_time_seconds = _atd_read_float (x ['pysemgrep_format_time_seconds' ]) if 'pysemgrep_format_time_seconds' in x else None ,
888
- validation_time_seconds = _atd_read_float (x ['validation_time_seconds' ]) if 'validation_time_seconds' in x else None ,
889
- is_match = _atd_read_bool (x ['is_match' ]) if 'is_match' in x else None ,
890
- )
891
- else :
892
- _atd_bad_json ('OsemgrepFormatOutput' , x )
893
-
894
- def to_json (self ) -> Any :
895
- res : Dict [str , Any ] = {}
896
- if self .succeeded is not None :
897
- res ['succeeded' ] = _atd_write_bool (self .succeeded )
898
- if self .format is not None :
899
- res ['format' ] = _atd_write_string (self .format )
900
- if self .osemgrep_rpc_response_time_seconds is not None :
901
- res ['osemgrep_rpc_response_time_seconds' ] = _atd_write_float (self .osemgrep_rpc_response_time_seconds )
902
- if self .osemgrep_format_time_seconds is not None :
903
- res ['osemgrep_format_time_seconds' ] = _atd_write_float (self .osemgrep_format_time_seconds )
904
- if self .pysemgrep_format_time_seconds is not None :
905
- res ['pysemgrep_format_time_seconds' ] = _atd_write_float (self .pysemgrep_format_time_seconds )
906
- if self .validation_time_seconds is not None :
907
- res ['validation_time_seconds' ] = _atd_write_float (self .validation_time_seconds )
908
- if self .is_match is not None :
909
- res ['is_match' ] = _atd_write_bool (self .is_match )
910
- return res
911
-
912
- @classmethod
913
- def from_json_string (cls , x : str ) -> 'OsemgrepFormatOutput' :
914
- return cls .from_json (json .loads (x ))
915
-
916
- def to_json_string (self , ** kw : Any ) -> str :
917
- return json .dumps (self .to_json (), ** kw )
918
-
919
-
920
- @dataclass
921
- class OsemgrepMetrics :
922
- """Original type: osemgrep_metrics = { ... }"""
923
-
924
- format_output : Optional [OsemgrepFormatOutput ] = None
925
-
926
- @classmethod
927
- def from_json (cls , x : Any ) -> 'OsemgrepMetrics' :
928
- if isinstance (x , dict ):
929
- return cls (
930
- format_output = OsemgrepFormatOutput .from_json (x ['format_output' ]) if 'format_output' in x else None ,
931
- )
932
- else :
933
- _atd_bad_json ('OsemgrepMetrics' , x )
934
-
935
- def to_json (self ) -> Any :
936
- res : Dict [str , Any ] = {}
937
- if self .format_output is not None :
938
- res ['format_output' ] = (lambda x : x .to_json ())(self .format_output )
939
- return res
940
-
941
- @classmethod
942
- def from_json_string (cls , x : str ) -> 'OsemgrepMetrics' :
943
- return cls .from_json (json .loads (x ))
944
-
945
- def to_json_string (self , ** kw : Any ) -> str :
946
- return json .dumps (self .to_json (), ** kw )
947
-
948
-
949
867
@dataclass
950
868
class Extension :
951
869
"""Original type: extension = { ... }"""
@@ -1149,7 +1067,6 @@ class Payload:
1149
1067
value : Value
1150
1068
extension : Extension
1151
1069
parse_rate : List [Tuple [str , ParseStat ]] = field (default_factory = lambda : [])
1152
- osemgrep : Optional [OsemgrepMetrics ] = None
1153
1070
1154
1071
@classmethod
1155
1072
def from_json (cls , x : Any ) -> 'Payload' :
@@ -1165,7 +1082,6 @@ def from_json(cls, x: Any) -> 'Payload':
1165
1082
value = Value .from_json (x ['value' ]) if 'value' in x else _atd_missing_json_field ('Payload' , 'value' ),
1166
1083
extension = Extension .from_json (x ['extension' ]) if 'extension' in x else _atd_missing_json_field ('Payload' , 'extension' ),
1167
1084
parse_rate = _atd_read_assoc_object_into_list (ParseStat .from_json )(x ['parse_rate' ]) if 'parse_rate' in x else [],
1168
- osemgrep = OsemgrepMetrics .from_json (x ['osemgrep' ]) if 'osemgrep' in x else None ,
1169
1085
)
1170
1086
else :
1171
1087
_atd_bad_json ('Payload' , x )
@@ -1182,8 +1098,6 @@ def to_json(self) -> Any:
1182
1098
res ['value' ] = (lambda x : x .to_json ())(self .value )
1183
1099
res ['extension' ] = (lambda x : x .to_json ())(self .extension )
1184
1100
res ['parse_rate' ] = _atd_write_assoc_list_to_object ((lambda x : x .to_json ()))(self .parse_rate )
1185
- if self .osemgrep is not None :
1186
- res ['osemgrep' ] = (lambda x : x .to_json ())(self .osemgrep )
1187
1101
return res
1188
1102
1189
1103
@classmethod
0 commit comments