From 30af5fd30735ffeebcbbb2c88a82a9cc268e5f24 Mon Sep 17 00:00:00 2001 From: Zizheng Zhang <92221220+Chacoon3@users.noreply.github.com> Date: Sun, 10 Nov 2024 12:27:54 -0500 Subject: [PATCH] adding a previously unmapped activity type (#765) * adding a previously unmapped activity type * Fixed compilation issues before merging changes to the origin repository. --------- Co-authored-by: Oleg Rakhmatulin --- Alpaca.Markets/Alpaca.Markets.csproj | 2 +- Alpaca.Markets/CompatibilitySuppressions.xml | 189 +++---------------- Alpaca.Markets/Enums/AccountActivityType.cs | 13 +- Alpaca.Markets/PublicAPI.Shipped.txt | 5 +- 4 files changed, 41 insertions(+), 168 deletions(-) diff --git a/Alpaca.Markets/Alpaca.Markets.csproj b/Alpaca.Markets/Alpaca.Markets.csproj index 16ad0244..ff643462 100644 --- a/Alpaca.Markets/Alpaca.Markets.csproj +++ b/Alpaca.Markets/Alpaca.Markets.csproj @@ -49,7 +49,7 @@ true - 7.0.0 + 7.1.0 true true AllEnabledByDefault diff --git a/Alpaca.Markets/CompatibilitySuppressions.xml b/Alpaca.Markets/CompatibilitySuppressions.xml index c05ec260..2d535f74 100644 --- a/Alpaca.Markets/CompatibilitySuppressions.xml +++ b/Alpaca.Markets/CompatibilitySuppressions.xml @@ -1458,204 +1458,71 @@ true - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionByIdAsync(System.Guid,System.Threading.CancellationToken) - lib/net6.0/Alpaca.Markets.dll - lib/net6.0/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionBySymbolAsync(System.String,System.Threading.CancellationToken) - lib/net6.0/Alpaca.Markets.dll - lib/net6.0/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractByIdAsync(System.Guid,System.Threading.CancellationToken) - lib/net6.0/Alpaca.Markets.dll - lib/net6.0/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractBySymbolAsync(System.String,System.Threading.CancellationToken) - lib/net6.0/Alpaca.Markets.dll - lib/net6.0/Alpaca.Markets.dll - true + CP0008 + T:Alpaca.Markets.RequestValidationException + lib/netstandard2.0/Alpaca.Markets.dll + lib/net462/Alpaca.Markets.dll - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ListOptionContractsAsync(Alpaca.Markets.OptionContractsRequest,System.Threading.CancellationToken) - lib/net6.0/Alpaca.Markets.dll - lib/net6.0/Alpaca.Markets.dll - true + CP0008 + T:Alpaca.Markets.RestClientErrorException + lib/netstandard2.0/Alpaca.Markets.dll + lib/net462/Alpaca.Markets.dll - CP0006 - P:Alpaca.Markets.IAccount.OptionsApprovedLevel - lib/net6.0/Alpaca.Markets.dll - lib/net6.0/Alpaca.Markets.dll + CP0011 + F:Alpaca.Markets.AccountActivityType.CryptoFee + lib/net462/Alpaca.Markets.dll + lib/net462/Alpaca.Markets.dll true - CP0006 - P:Alpaca.Markets.IAccount.OptionsBuyingPower - lib/net6.0/Alpaca.Markets.dll - lib/net6.0/Alpaca.Markets.dll + CP0011 + F:Alpaca.Markets.AccountActivityType.FeeInUsd + lib/net462/Alpaca.Markets.dll + lib/net462/Alpaca.Markets.dll true - CP0006 - P:Alpaca.Markets.IAccount.OptionsTradingLevel + CP0011 + F:Alpaca.Markets.AccountActivityType.CryptoFee lib/net6.0/Alpaca.Markets.dll lib/net6.0/Alpaca.Markets.dll true - CP0006 - P:Alpaca.Markets.IAccountConfiguration.MaxOptionsTradingLevel + CP0011 + F:Alpaca.Markets.AccountActivityType.FeeInUsd lib/net6.0/Alpaca.Markets.dll lib/net6.0/Alpaca.Markets.dll true - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionByIdAsync(System.Guid,System.Threading.CancellationToken) - lib/netstandard2.0/Alpaca.Markets.dll - lib/netstandard2.0/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionBySymbolAsync(System.String,System.Threading.CancellationToken) - lib/netstandard2.0/Alpaca.Markets.dll - lib/netstandard2.0/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractByIdAsync(System.Guid,System.Threading.CancellationToken) - lib/netstandard2.0/Alpaca.Markets.dll - lib/netstandard2.0/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractBySymbolAsync(System.String,System.Threading.CancellationToken) + CP0011 + F:Alpaca.Markets.AccountActivityType.CryptoFee lib/netstandard2.0/Alpaca.Markets.dll lib/netstandard2.0/Alpaca.Markets.dll true - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ListOptionContractsAsync(Alpaca.Markets.OptionContractsRequest,System.Threading.CancellationToken) + CP0011 + F:Alpaca.Markets.AccountActivityType.FeeInUsd lib/netstandard2.0/Alpaca.Markets.dll lib/netstandard2.0/Alpaca.Markets.dll true - CP0006 - P:Alpaca.Markets.IAccount.OptionsApprovedLevel - lib/netstandard2.0/Alpaca.Markets.dll - lib/netstandard2.0/Alpaca.Markets.dll - true - - - CP0006 - P:Alpaca.Markets.IAccount.OptionsBuyingPower - lib/netstandard2.0/Alpaca.Markets.dll - lib/netstandard2.0/Alpaca.Markets.dll - true - - - CP0006 - P:Alpaca.Markets.IAccount.OptionsTradingLevel - lib/netstandard2.0/Alpaca.Markets.dll - lib/netstandard2.0/Alpaca.Markets.dll - true - - - CP0006 - P:Alpaca.Markets.IAccountConfiguration.MaxOptionsTradingLevel - lib/netstandard2.0/Alpaca.Markets.dll - lib/netstandard2.0/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionByIdAsync(System.Guid,System.Threading.CancellationToken) - lib/netstandard2.1/Alpaca.Markets.dll - lib/netstandard2.1/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionBySymbolAsync(System.String,System.Threading.CancellationToken) - lib/netstandard2.1/Alpaca.Markets.dll - lib/netstandard2.1/Alpaca.Markets.dll - true - - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractByIdAsync(System.Guid,System.Threading.CancellationToken) + CP0011 + F:Alpaca.Markets.AccountActivityType.CryptoFee lib/netstandard2.1/Alpaca.Markets.dll lib/netstandard2.1/Alpaca.Markets.dll true - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractBySymbolAsync(System.String,System.Threading.CancellationToken) + CP0011 + F:Alpaca.Markets.AccountActivityType.FeeInUsd lib/netstandard2.1/Alpaca.Markets.dll lib/netstandard2.1/Alpaca.Markets.dll true - - CP0006 - M:Alpaca.Markets.IAlpacaTradingClient.ListOptionContractsAsync(Alpaca.Markets.OptionContractsRequest,System.Threading.CancellationToken) - lib/netstandard2.1/Alpaca.Markets.dll - lib/netstandard2.1/Alpaca.Markets.dll - true - - - CP0006 - P:Alpaca.Markets.IAccount.OptionsApprovedLevel - lib/netstandard2.1/Alpaca.Markets.dll - lib/netstandard2.1/Alpaca.Markets.dll - true - - - CP0006 - P:Alpaca.Markets.IAccount.OptionsBuyingPower - lib/netstandard2.1/Alpaca.Markets.dll - lib/netstandard2.1/Alpaca.Markets.dll - true - - - CP0006 - P:Alpaca.Markets.IAccount.OptionsTradingLevel - lib/netstandard2.1/Alpaca.Markets.dll - lib/netstandard2.1/Alpaca.Markets.dll - true - - - CP0006 - P:Alpaca.Markets.IAccountConfiguration.MaxOptionsTradingLevel - lib/netstandard2.1/Alpaca.Markets.dll - lib/netstandard2.1/Alpaca.Markets.dll - true - - - CP0008 - T:Alpaca.Markets.RequestValidationException - lib/netstandard2.0/Alpaca.Markets.dll - lib/net462/Alpaca.Markets.dll - - - CP0008 - T:Alpaca.Markets.RestClientErrorException - lib/netstandard2.0/Alpaca.Markets.dll - lib/net462/Alpaca.Markets.dll - \ No newline at end of file diff --git a/Alpaca.Markets/Enums/AccountActivityType.cs b/Alpaca.Markets/Enums/AccountActivityType.cs index 94bf08bb..706a4eb1 100644 --- a/Alpaca.Markets/Enums/AccountActivityType.cs +++ b/Alpaca.Markets/Enums/AccountActivityType.cs @@ -1,7 +1,5 @@ namespace Alpaca.Markets; -#pragma warning disable CA1027 - /// /// Types of account activities /// @@ -10,6 +8,8 @@ [SuppressMessage("ReSharper", "IdentifierTypo")] [SuppressMessage("ReSharper", "StringLiteralTypo")] [SuppressMessage("ReSharper", "InconsistentNaming")] +[SuppressMessage("Design", "CA1027:Mark enums with FlagsAttribute", + Justification = "This enum is not flags-based so we shouldn't mark it with this attribute.")] public enum AccountActivityType { /// @@ -244,6 +244,13 @@ public enum AccountActivityType [EnumMember(Value = "OPXRC")] OptionExercise, + /// + /// Option trade + /// + [UsedImplicitly] + [EnumMember(Value = "OPTRD")] + OptionTrade, + /// /// Fee denominated in USD /// @@ -258,5 +265,3 @@ public enum AccountActivityType [EnumMember(Value = "CFEE")] CryptoFee } - -#pragma warning restore CA1027 diff --git a/Alpaca.Markets/PublicAPI.Shipped.txt b/Alpaca.Markets/PublicAPI.Shipped.txt index c75525a6..1df2dbed 100644 --- a/Alpaca.Markets/PublicAPI.Shipped.txt +++ b/Alpaca.Markets/PublicAPI.Shipped.txt @@ -20,7 +20,7 @@ Alpaca.Markets.AccountActivityType.ACATCash = 3 -> Alpaca.Markets.AccountActivit Alpaca.Markets.AccountActivityType.ACATSecurities = 4 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.CashDeposit = 5 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.CashWithdrawal = 6 -> Alpaca.Markets.AccountActivityType -Alpaca.Markets.AccountActivityType.CryptoFee = 35 -> Alpaca.Markets.AccountActivityType +Alpaca.Markets.AccountActivityType.CryptoFee = 36 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.Dividend = 7 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.DividendCapitalGainsLongTerm = 8 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.DividendCapitalGainsShortTerm = 9 -> Alpaca.Markets.AccountActivityType @@ -30,7 +30,7 @@ Alpaca.Markets.AccountActivityType.DividendNRAWithheld = 12 -> Alpaca.Markets.Ac Alpaca.Markets.AccountActivityType.DividendReturnOfCapital = 13 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.DividendTaxExempt = 15 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.DividendTefraWithheld = 14 -> Alpaca.Markets.AccountActivityType -Alpaca.Markets.AccountActivityType.FeeInUsd = 34 -> Alpaca.Markets.AccountActivityType +Alpaca.Markets.AccountActivityType.FeeInUsd = 35 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.Fill = 0 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.Interest = 16 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.InterestNRAWithheld = 17 -> Alpaca.Markets.AccountActivityType @@ -44,6 +44,7 @@ Alpaca.Markets.AccountActivityType.NameChange = 23 -> Alpaca.Markets.AccountActi Alpaca.Markets.AccountActivityType.OptionAssignment = 31 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.OptionExercise = 33 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.OptionExpiration = 32 -> Alpaca.Markets.AccountActivityType +Alpaca.Markets.AccountActivityType.OptionTrade = 34 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.PassThruCharge = 24 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.PassThruRebate = 25 -> Alpaca.Markets.AccountActivityType Alpaca.Markets.AccountActivityType.Reorg = 26 -> Alpaca.Markets.AccountActivityType