@@ -359,7 +359,7 @@ public static string Base64Encode(IMessage message)
359359 failureDetails . StackTrace ,
360360 GetFailureDetails ( failureDetails . InnerFailure ) ,
361361 failureDetails . IsNonRetriable ,
362- ConvertProperties ( failureDetails . Properties ) ) ;
362+ ConvertMapToDictionary ( failureDetails . Properties ) ) ;
363363 }
364364
365365 internal static Proto . TaskFailureDetails ? GetFailureDetails ( FailureDetails ? failureDetails )
@@ -368,7 +368,7 @@ public static string Base64Encode(IMessage message)
368368 {
369369 return null ;
370370 }
371-
371+
372372 var taskFailureDetails = new Proto . TaskFailureDetails
373373 {
374374 ErrorType = failureDetails . ErrorType ,
@@ -454,7 +454,7 @@ internal static Proto.PurgeInstancesResponse CreatePurgeInstancesResponse(PurgeR
454454 }
455455
456456 /// <summary>
457- /// Converts a Dictionary <string, object?> into a MapField<string, Value>.
457+ /// Converts a IDictionary <string, object?> into a MapField<string, Value>.
458458 /// Supports nested dictionaries and lists.
459459 /// </summary>
460460 public static MapField < string , Value > ConvertDictionaryToMapField ( IDictionary < string , object ? > dict )
@@ -470,15 +470,15 @@ public static MapField<string, Value> ConvertDictionaryToMapField(IDictionary<st
470470 }
471471
472472 /// <summary>
473- ///
473+ /// Converts a MapField<string, Value> into a IDictionary<string, object?>.
474474 /// </summary>
475475 /// <param name="properties"></param>
476476 /// <returns></returns>
477- public static IDictionary < string , object > ConvertProperties ( MapField < string , Value > properties )
477+ public static IDictionary < string , object ? > ConvertMapToDictionary ( MapField < string , Value > properties )
478478 {
479479 return properties . ToDictionary (
480480 kvp => kvp . Key ,
481- kvp => ConvertValue ( kvp . Value )
481+ kvp => ConvertValueToObject ( kvp . Value )
482482 ) ;
483483 }
484484
@@ -487,7 +487,7 @@ public static IDictionary<string, object> ConvertProperties(MapField<string, Val
487487 /// </summary>
488488 /// <param name="obj">The object to convert.</param>
489489 /// <returns>The converted protobuf Value.</returns>
490- private static Value ConvertObjectToValue ( object ? obj )
490+ static Value ConvertObjectToValue ( object ? obj )
491491 {
492492 return obj switch
493493 {
@@ -510,7 +510,7 @@ private static Value ConvertObjectToValue(object? obj)
510510 } ;
511511 }
512512
513- private static object ConvertValue ( Value value )
513+ static object ConvertValueToObject ( Value value )
514514 {
515515 switch ( value . KindCase )
516516 {
@@ -521,9 +521,9 @@ private static object ConvertValue(Value value)
521521 case Value . KindOneofCase . BoolValue :
522522 return value . BoolValue ;
523523 case Value . KindOneofCase . StructValue :
524- return value . StructValue . Fields . ToDictionary ( f => f . Key , f => ConvertValue ( f . Value ) ) ;
524+ return value . StructValue . Fields . ToDictionary ( f => f . Key , f => ConvertValueToObject ( f . Value ) ) ;
525525 case Value . KindOneofCase . ListValue :
526- return value . ListValue . Values . Select ( ConvertValue ) . ToList ( ) ;
526+ return value . ListValue . Values . Select ( ConvertValueToObject ) . ToList ( ) ;
527527 case Value . KindOneofCase . NullValue :
528528 return null ! ;
529529 default :
0 commit comments