Skip to content

Commit

Permalink
Refactored response models from class to record
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Jun 18, 2024
1 parent 62717e3 commit ac7ee57
Show file tree
Hide file tree
Showing 43 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/MexcPaginated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Mexc.Net.Objects.Models
/// Paginated result
/// </summary>
/// <typeparam name="T"></typeparam>
public class MexcPaginated<T>
public record MexcPaginated<T>
{
/// <summary>
/// Total records
Expand Down
4 changes: 2 additions & 2 deletions Mexc.Net/Objects/Models/MexcResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Mexc.Net.Objects.Models
{
internal class MexcResult
internal record MexcResult
{
[JsonProperty("code")]
public int Code { get; set; }
[JsonProperty("msg")]
public string? Message { get; set; }
}

internal class MexcResult<T> : MexcResult
internal record MexcResult<T> : MexcResult
{
[JsonProperty("data")]
public T? Data { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/MexcRows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Mexc.Net.Objects.Models
/// Rows result
/// </summary>
/// <typeparam name="T"></typeparam>
public class MexcRows<T>
public record MexcRows<T>
{
/// <summary>
/// Total records
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MecxAggregatedTrade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Aggregated trade info
/// </summary>
public class MecxAggregatedTrade
public record MecxAggregatedTrade
{
/// <summary>
/// Trade price
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MecxKline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// Kline/candlestick info
/// </summary>
[JsonConverter(typeof(ArrayConverter))]
public class MecxKline
public record MecxKline
{
/// <summary>
/// The time this candlestick opened
Expand Down
4 changes: 2 additions & 2 deletions Mexc.Net/Objects/Models/Spot/MexcAccountInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Account info
/// </summary>
public class MexcAccountInfo
public record MexcAccountInfo
{
/// <summary>
/// Maker fee
Expand Down Expand Up @@ -70,7 +70,7 @@ public class MexcAccountInfo
/// <summary>
/// Balance info
/// </summary>
public class MexcAccountBalance
public record MexcAccountBalance
{
/// <summary>
/// The asset this balance is for
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcAccountUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Account update info
/// </summary>
public class MexcAccountUpdate
public record MexcAccountUpdate
{
/// <summary>
/// Asset
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcAveragePrice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Average price info
/// </summary>
public class MexcAveragePrice
public record MexcAveragePrice
{
/// <summary>
/// Minutes the average is over
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcBookPrice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Best book offers info
/// </summary>
public class MexcBookPrice
public record MexcBookPrice
{
/// <summary>
/// Symbol
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcDeductStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Mexc MX deduct status
/// </summary>
public class MexcDeductStatus
public record MexcDeductStatus
{
/// <summary>
/// Is deduction enabled
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcDeposit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Deposit info
/// </summary>
public class MexcDeposit
public record MexcDeposit
{
/// <summary>
/// Quantity
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcDepositAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Deposit address
/// </summary>
public class MexcDepositAddress
public record MexcDepositAddress
{
/// <summary>
/// Asset
Expand Down
4 changes: 2 additions & 2 deletions Mexc.Net/Objects/Models/Spot/MexcDustLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Dust log entry
/// </summary>
public class MexcDustLog
public record MexcDustLog
{
/// <summary>
/// Total converted
Expand All @@ -34,7 +34,7 @@ public class MexcDustLog
/// <summary>
/// Dust log details
/// </summary>
public class MexcDustLogDetails
public record MexcDustLogDetails
{
/// <summary>
/// Id
Expand Down
4 changes: 2 additions & 2 deletions Mexc.Net/Objects/Models/Spot/MexcDustResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Dust transfer result
/// </summary>
public class MexcDustResult
public record MexcDustResult
{
/// <summary>
/// Successfully converted
Expand All @@ -34,7 +34,7 @@ public class MexcDustResult
/// <summary>
/// Failed dust asset
/// </summary>
public class MexcFailedDust
public record MexcFailedDust
{
/// <summary>
/// Asset name
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcEligibleDust.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Eligible dust asset
/// </summary>
public class MexcEligibleDust
public record MexcEligibleDust
{
/// <summary>
/// Resulting Mx
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcEtf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Etf info
/// </summary>
public class MexcEtf
public record MexcEtf
{
/// <summary>
/// Symbol
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcExchangeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Exchange info
/// </summary>
public class MexcExchangeInfo
public record MexcExchangeInfo
{
/// <summary>
/// The timezone the server uses
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Id
/// </summary>
public class MexcId
public record MexcId
{
/// <summary>
/// Id
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcListenKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Mexc.Net.Objects.Models.Spot
{
internal class MexcListenKey
internal record MexcListenKey
{
[JsonProperty("listenKey")]
public string ListenKey { get; set; } = string.Empty;
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Order info
/// </summary>
public class MexcOrder
public record MexcOrder
{
/// <summary>
/// Symbol
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcOrderBook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Order book info
/// </summary>
public class MexcOrderBook
public record MexcOrderBook
{
/// <summary>
/// Last update id
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcOrderBookEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// An entry in the order book
/// </summary>
[JsonConverter(typeof(ArrayConverter))]
public class MexcOrderBookEntry : ISymbolOrderBookEntry
public record MexcOrderBookEntry : ISymbolOrderBookEntry
{
/// <summary>
/// The price of this order book entry
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcPrice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Price info
/// </summary>
public class MexcPrice
public record MexcPrice
{
/// <summary>
/// Symbol name
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcServerTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Server time
/// </summary>
public class MexcServerTime
public record MexcServerTime
{
/// <summary>
/// Current server time
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcStreamBookTick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Book ticker
/// </summary>
public class MexcStreamBookTick : MexcStreamEvent
public record MexcStreamBookTick : MexcStreamEvent
{
/// <summary>
/// Best ask price
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcStreamKline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Kline info
/// </summary>
public class MexcStreamKline
public record MexcStreamKline
{
/// <summary>
/// Start time
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcStreamMiniTick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Mini ticker
/// </summary>
public class MexcStreamMiniTick : MexcStreamEvent
public record MexcStreamMiniTick : MexcStreamEvent
{
/// <summary>
/// Symbol name
Expand Down
4 changes: 2 additions & 2 deletions Mexc.Net/Objects/Models/Spot/MexcStreamOrderBook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Order book
/// </summary>
public class MexcStreamOrderBook : MexcStreamEvent
public record MexcStreamOrderBook : MexcStreamEvent
{
/// <summary>
/// Asks
Expand All @@ -33,7 +33,7 @@ public class MexcStreamOrderBook : MexcStreamEvent
/// <summary>
/// Order book entry
/// </summary>
public class MexcStreamOrderBookEntry : ISymbolOrderBookEntry
public record MexcStreamOrderBookEntry : ISymbolOrderBookEntry
{
/// <summary>
/// Price
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcStreamTrade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Trade info
/// </summary>
public class MexcStreamTrade
public record MexcStreamTrade
{
/// <summary>
/// Order side
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Symbol info
/// </summary>
public class MexcSymbol
public record MexcSymbol
{
/// <summary>
/// The symbol
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcTicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Ticker info
/// </summary>
public class MexcTicker
public record MexcTicker
{
/// <summary>
/// Symbol name
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcTrade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Trade info
/// </summary>
public class MexcTrade
public record MexcTrade
{
/// <summary>
/// Trade price
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcTransfer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Transfer info
/// </summary>
public class MexcTransfer
public record MexcTransfer
{
/// <summary>
/// Transfer id
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcTransferId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Transfer id
/// </summary>
public class MexcTransferId
public record MexcTransferId
{
/// <summary>
/// Transfer id
Expand Down
4 changes: 2 additions & 2 deletions Mexc.Net/Objects/Models/Spot/MexcUserAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// User asset info
/// </summary>
public class MexcUserAsset
public record MexcUserAsset
{
/// <summary>
/// Asset
Expand All @@ -29,7 +29,7 @@ public class MexcUserAsset
/// <summary>
/// Network info
/// </summary>
public class MexcNetwork
public record MexcNetwork
{
/// <summary>
/// Asset
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcUserOrderUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// Order update
/// </summary>
public class MexcUserOrderUpdate
public record MexcUserOrderUpdate
{
/// <summary>
/// Quote quantity remaining
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcUserTrade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// User trade info
/// </summary>
public class MexcUserTrade
public record MexcUserTrade
{
/// <summary>
/// Symbol
Expand Down
2 changes: 1 addition & 1 deletion Mexc.Net/Objects/Models/Spot/MexcUserTradeUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mexc.Net.Objects.Models.Spot
/// <summary>
/// User trade update
/// </summary>
public class MexcUserTradeUpdate
public record MexcUserTradeUpdate
{
/// <summary>
/// Trade time
Expand Down
Loading

0 comments on commit ac7ee57

Please sign in to comment.