using System; using System.Collections.Generic; using System.Text; namespace CryptoExchange.Net.Objects { /// /// Settings for parameter serialization /// public class ParameterSerializationSettings { /// /// Default serialization settings /// public static ParameterSerializationSettings Default { get; } = new ParameterSerializationSettings(); /// /// Whether to sort the parameters /// public bool Sort { get; set; } = true; /// /// The parameter comparer when sorting /// public IComparer? SortComparer { get; set; } /// /// Decimal serialization type /// public DecimalSerialization Decimal { get; set; } = DecimalSerialization.Number; /// /// DateTime serialization type /// public DateTimeSerialization DateTimes { get; set; } = DateTimeSerialization.MillisecondsNumber; /// /// Boolean serialization type /// public BoolSerialization Bool { get; set; } = BoolSerialization.Bool; /// /// Integer serialization type /// public IntegerSerialization Integer { get; set; } = IntegerSerialization.Number; /// /// Enum serialization type /// public EnumSerialization Enum { get; set; } = EnumSerialization.String; /// /// Array serialization type /// public ArrayParametersSerialization Array { get; set; } = ArrayParametersSerialization.Array; } /// /// Type of decimal value serialization /// public enum DecimalSerialization { /// /// Decimals should be serialized as numbers /// Number, /// /// Decimals should be strings /// String } /// /// Type of DateTime value serialization /// public enum DateTimeSerialization { /// /// DateTimes should be serialized as milliseconds number /// MillisecondsNumber, /// /// DateTimes should be serialized as milliseconds string /// MillisecondsString, /// /// DateTimes should be serialized as seconds number /// SecondsNumber, /// /// DateTimes should be serialized as seconds string /// SecondsString, /// /// DateTimes should be serialized as microseconds number /// MicrosecondsNumber, /// /// DateTimes should be serialized as microseconds string /// MicrosecondsString, /// /// DateTimes should be serialized as ISO 8601 string /// Rfc3339String } /// /// Type of boolean value serialization /// public enum BoolSerialization { /// /// Booleans should be serialized as bool values /// Bool, /// /// Booleans should be serialized as strings /// String } /// /// Type of integer value serialization /// public enum IntegerSerialization { /// /// Integers should be serialized as integer values /// Number, /// /// Integers should be serialized as strings /// String } /// /// Type of enum value serialization /// public enum EnumSerialization { /// /// Enums should be serialized as integer values /// Number, /// /// Enums should be serialized as strings /// String } }