Skip to content

Commit

Permalink
adding a previously unmapped activity type (#765)
Browse files Browse the repository at this point in the history
* adding a previously unmapped activity type

* Fixed compilation issues before merging changes to the origin repository.

---------

Co-authored-by: Oleg Rakhmatulin <oleg.rakhmatulin@gmail.com>
(cherry picked from commit 30af5fd)
  • Loading branch information
Chacoon3 authored and OlegRa committed Nov 10, 2024
1 parent aca75d8 commit f6bde3f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 164 deletions.
2 changes: 1 addition & 1 deletion Alpaca.Markets/Alpaca.Markets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<PropertyGroup>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
<!--<GenerateCompatibilitySuppressionFile>true</GenerateCompatibilitySuppressionFile>-->
<PackageValidationBaselineVersion>7.0.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>7.1.0</PackageValidationBaselineVersion>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
<EnablePackageValidation>true</EnablePackageValidation>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
Expand Down
189 changes: 28 additions & 161 deletions Alpaca.Markets/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,204 +2,71 @@
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionByIdAsync(System.Guid,System.Threading.CancellationToken)</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionBySymbolAsync(System.String,System.Threading.CancellationToken)</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractByIdAsync(System.Guid,System.Threading.CancellationToken)</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractBySymbolAsync(System.String,System.Threading.CancellationToken)</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:Alpaca.Markets.RequestValidationException</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/net462/Alpaca.Markets.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ListOptionContractsAsync(Alpaca.Markets.OptionContractsRequest,System.Threading.CancellationToken)</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:Alpaca.Markets.RestClientErrorException</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/net462/Alpaca.Markets.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsApprovedLevel</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Alpaca.Markets.AccountActivityType.CryptoFee</Target>
<Left>lib/net462/Alpaca.Markets.dll</Left>
<Right>lib/net462/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsBuyingPower</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Alpaca.Markets.AccountActivityType.FeeInUsd</Target>
<Left>lib/net462/Alpaca.Markets.dll</Left>
<Right>lib/net462/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsTradingLevel</Target>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Alpaca.Markets.AccountActivityType.CryptoFee</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccountConfiguration.MaxOptionsTradingLevel</Target>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Alpaca.Markets.AccountActivityType.FeeInUsd</Target>
<Left>lib/net6.0/Alpaca.Markets.dll</Left>
<Right>lib/net6.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionByIdAsync(System.Guid,System.Threading.CancellationToken)</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionBySymbolAsync(System.String,System.Threading.CancellationToken)</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractByIdAsync(System.Guid,System.Threading.CancellationToken)</Target>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Alpaca.Markets.AccountActivityType.CryptoFee</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractBySymbolAsync(System.String,System.Threading.CancellationToken)</Target>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Alpaca.Markets.AccountActivityType.FeeInUsd</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ListOptionContractsAsync(Alpaca.Markets.OptionContractsRequest,System.Threading.CancellationToken)</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsApprovedLevel</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsBuyingPower</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsTradingLevel</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccountConfiguration.MaxOptionsTradingLevel</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.0/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionByIdAsync(System.Guid,System.Threading.CancellationToken)</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ExerciseOptionsPositionBySymbolAsync(System.String,System.Threading.CancellationToken)</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractByIdAsync(System.Guid,System.Threading.CancellationToken)</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.GetOptionContractBySymbolAsync(System.String,System.Threading.CancellationToken)</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Alpaca.Markets.IAlpacaTradingClient.ListOptionContractsAsync(Alpaca.Markets.OptionContractsRequest,System.Threading.CancellationToken)</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsApprovedLevel</Target>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Alpaca.Markets.AccountActivityType.CryptoFee</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsBuyingPower</Target>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Alpaca.Markets.AccountActivityType.FeeInUsd</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccount.OptionsTradingLevel</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Alpaca.Markets.IAccountConfiguration.MaxOptionsTradingLevel</Target>
<Left>lib/netstandard2.1/Alpaca.Markets.dll</Left>
<Right>lib/netstandard2.1/Alpaca.Markets.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:Alpaca.Markets.RequestValidationException</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/net462/Alpaca.Markets.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:Alpaca.Markets.RestClientErrorException</Target>
<Left>lib/netstandard2.0/Alpaca.Markets.dll</Left>
<Right>lib/net462/Alpaca.Markets.dll</Right>
</Suppression>
</Suppressions>
9 changes: 9 additions & 0 deletions Alpaca.Markets/Enums/AccountActivityType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,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
{
/// <summary>
Expand Down Expand Up @@ -250,6 +252,13 @@ public enum AccountActivityType
[EnumMember(Value = "OPXRC")]
OptionExercise,

/// <summary>
/// Option trade
/// </summary>
[UsedImplicitly]
[EnumMember(Value = "OPTRD")]
OptionTrade,

/// <summary>
/// Fee denominated in USD
/// </summary>
Expand Down
5 changes: 3 additions & 2 deletions Alpaca.Markets/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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
Expand All @@ -31,7 +31,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
Expand All @@ -45,6 +45,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.RefTafFee = 30 -> Alpaca.Markets.AccountActivityType
Expand Down

0 comments on commit f6bde3f

Please sign in to comment.