-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add /v2/account/progression and deprecate /v2/account/luck
- Loading branch information
Showing
13 changed files
with
132 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"id": "fractal_agony_impedance", | ||
"value": 2 | ||
}, | ||
{ | ||
"id": "fractal_empowerment", | ||
"value": 1 | ||
}, | ||
{ | ||
"id": "fractal_karmic_retribution", | ||
"value": 3 | ||
}, | ||
{ | ||
"id": "luck", | ||
"value": 1234000 | ||
} | ||
] |
2 changes: 2 additions & 0 deletions
2
Gw2Sharp.Tests/WebApi/V2/Clients/Account/AccountLuckClientTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Gw2Sharp.Tests/WebApi/V2/Clients/Account/AccountProgressionClientTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Threading.Tasks; | ||
using Gw2Sharp.WebApi.V2.Clients; | ||
using Xunit; | ||
|
||
namespace Gw2Sharp.Tests.WebApi.V2.Clients | ||
{ | ||
public class AccountProgressionClientTests : BaseEndpointClientTests<IAccountProgressionClient> | ||
{ | ||
protected override bool IsAuthenticated => true; | ||
|
||
protected override IAccountProgressionClient CreateClient(IGw2Client gw2Client) => | ||
gw2Client.WebApi.V2.Account.Progression; | ||
|
||
[Theory] | ||
[InlineData("TestFiles.Account.AccountProgression.json")] | ||
public Task BlobTest(string file) => this.AssertBlobDataAsync(this.Client, file); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Gw2Sharp/WebApi/V2/Clients/Account/AccountProgressionClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using Gw2Sharp.WebApi.V2.Models; | ||
|
||
namespace Gw2Sharp.WebApi.V2.Clients | ||
{ | ||
/// <summary> | ||
/// A client of the Guild Wars 2 API v2 account progression endpoint. | ||
/// </summary> | ||
[EndpointPath("account/progression")] | ||
[EndpointSchemaVersion("2021-09-28T00:00:00.000Z")] | ||
public class AccountProgressionClient : BaseEndpointBlobClient<IApiV2ObjectList<AccountProgression>>, IAccountProgressionClient | ||
{ | ||
/// <summary> | ||
/// Creates a new <see cref="AccountProgressionClient"/> that is used for the API v2 account progression endpoint. | ||
/// </summary> | ||
/// <param name="connection">The connection used to make requests, see <see cref="IConnection"/>.</param> | ||
/// <param name="gw2Client">The Guild Wars 2 client.</param> | ||
/// <exception cref="ArgumentNullException"><paramref name="connection"/> or <paramref name="gw2Client"/> is <c>null</c>.</exception> | ||
protected internal AccountProgressionClient(IConnection connection, IGw2Client gw2Client) : | ||
base(connection, gw2Client) | ||
{ } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Gw2Sharp/WebApi/V2/Clients/Account/IAccountProgressionClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Gw2Sharp.WebApi.V2.Models; | ||
|
||
namespace Gw2Sharp.WebApi.V2.Clients | ||
{ | ||
/// <summary> | ||
/// A client of the Guild Wars 2 API v2 account progression endpoint. | ||
/// </summary> | ||
public interface IAccountProgressionClient : | ||
IAuthenticatedClient, | ||
IBlobClient<IApiV2ObjectList<AccountProgression>> | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Gw2Sharp.WebApi.V2.Models | ||
{ | ||
/// <summary> | ||
/// Represents an account progression. | ||
/// </summary> | ||
public class AccountProgression | ||
{ | ||
/// <summary> | ||
/// The progression id. | ||
/// </summary> | ||
public string Id { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// The progression value. | ||
/// </summary> | ||
public int Value { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters