@@ -801,11 +801,23 @@ public override void Write(Utf8JsonWriter writer, HighlighterTagsSchema value, J
801
801
}
802
802
}
803
803
804
- public partial struct HighlighterType
804
+ [ JsonConverter ( typeof ( EnumStructConverter < HighlighterType > ) ) ]
805
+ public readonly partial struct HighlighterType
805
806
{
806
- public const string Unified = "unified" ;
807
- public const string Plain = "plain" ;
808
- public const string FastVector = "fvh" ;
807
+ public HighlighterType ( string value ) => Value = value ;
808
+ public readonly string Value { get ; }
809
+
810
+ public static HighlighterType Unified { get ; } = new HighlighterType ( "unified" ) ;
811
+ public static HighlighterType Plain { get ; } = new HighlighterType ( "plain" ) ;
812
+ public static HighlighterType FastVector { get ; } = new HighlighterType ( "fvh" ) ;
813
+ public override string ToString ( ) => Value ?? string . Empty ;
814
+ public static implicit operator string ( HighlighterType highlighterType ) => highlighterType . Value ;
815
+ public static implicit operator HighlighterType ( string value ) => new ( value ) ;
816
+ public override int GetHashCode ( ) => Value . GetHashCode ( ) ;
817
+ public override bool Equals ( object obj ) => obj is HighlighterType other && this . Equals ( other ) ;
818
+ public bool Equals ( HighlighterType other ) => Value == other . Value ;
819
+ public static bool operator == ( HighlighterType a , HighlighterType b ) => a . Equals ( b ) ;
820
+ public static bool operator != ( HighlighterType a , HighlighterType b ) => ! ( a == b ) ;
809
821
}
810
822
811
823
[ JsonConverter ( typeof ( IBDistributionConverter ) ) ]
@@ -1305,12 +1317,24 @@ public override void Write(Utf8JsonWriter writer, ScoreMode value, JsonSerialize
1305
1317
}
1306
1318
}
1307
1319
1308
- public partial struct ScriptLanguage
1320
+ [ JsonConverter ( typeof ( EnumStructConverter < ScriptLanguage > ) ) ]
1321
+ public readonly partial struct ScriptLanguage
1309
1322
{
1310
- public const string Painless = "painless" ;
1311
- public const string Mustache = "mustache" ;
1312
- public const string Java = "java" ;
1313
- public const string Expression = "expression" ;
1323
+ public ScriptLanguage ( string value ) => Value = value ;
1324
+ public readonly string Value { get ; }
1325
+
1326
+ public static ScriptLanguage Painless { get ; } = new ScriptLanguage ( "painless" ) ;
1327
+ public static ScriptLanguage Mustache { get ; } = new ScriptLanguage ( "mustache" ) ;
1328
+ public static ScriptLanguage Java { get ; } = new ScriptLanguage ( "java" ) ;
1329
+ public static ScriptLanguage Expression { get ; } = new ScriptLanguage ( "expression" ) ;
1330
+ public override string ToString ( ) => Value ?? string . Empty ;
1331
+ public static implicit operator string ( ScriptLanguage scriptLanguage ) => scriptLanguage . Value ;
1332
+ public static implicit operator ScriptLanguage ( string value ) => new ( value ) ;
1333
+ public override int GetHashCode ( ) => Value . GetHashCode ( ) ;
1334
+ public override bool Equals ( object obj ) => obj is ScriptLanguage other && this . Equals ( other ) ;
1335
+ public bool Equals ( ScriptLanguage other ) => Value == other . Value ;
1336
+ public static bool operator == ( ScriptLanguage a , ScriptLanguage b ) => a . Equals ( b ) ;
1337
+ public static bool operator != ( ScriptLanguage a , ScriptLanguage b ) => ! ( a == b ) ;
1314
1338
}
1315
1339
1316
1340
[ JsonConverter ( typeof ( ScriptSortTypeConverter ) ) ]
0 commit comments