Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #178 Remove obsolete APIs #179

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions src/ClashOfClans.Models/ClanVersusRanking.cs

This file was deleted.

8 changes: 0 additions & 8 deletions src/ClashOfClans.Models/ClanVersusRankingList.cs

This file was deleted.

28 changes: 0 additions & 28 deletions src/ClashOfClans.Models/PlayerVersusRanking.cs

This file was deleted.

8 changes: 0 additions & 8 deletions src/ClashOfClans.Models/PlayerVersusRankingList.cs

This file was deleted.

36 changes: 0 additions & 36 deletions src/ClashOfClans.Tests.Integration/LocationsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,42 +119,6 @@ public async Task GetPlayerRankingsForASpecificLocation()
Assert.IsTrue(playerRankingList.Count <= ItemLimit, $"Id {location.Id}");
}

[TestMethod]
public async Task GetClanVersusRankingsForASpecificLocation()
{
// Arrange
var location = GetRandom(_locations, l => l.IsCountry);
var query = new Query
{
Limit = ItemLimit
};

// Act
var clanRankingList = (ClanVersusRankingList)await _coc.Locations.GetClanVersusRankingAsync(location.Id, query);

// Assert
Assert.IsNotNull(clanRankingList);
Assert.AreEqual(ItemLimit, clanRankingList.Count, $"Id {location.Id}");
}

[TestMethod]
public async Task GetPlayerVersusRankingsForASpecificLocation()
{
// Arrange
var location = GetRandom(_locations, l => l.IsCountry);
var query = new Query
{
Limit = ItemLimit
};

// Act
var playerVersusRankingList = (PlayerVersusRankingList)await _coc.Locations.GetPlayerVersusRankingAsync(location.Id, query);

// Assert
Assert.IsNotNull(playerVersusRankingList);
Assert.IsTrue(playerVersusRankingList.Count <= ItemLimit, $"Id {location.Id}");
}

[TestMethod]
public async Task GetCapitalRankingsForASpecificLocation()
{
Expand Down
24 changes: 0 additions & 24 deletions src/ClashOfClans/Api/Locations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,6 @@ public Task<QueryResult<PlayerRankingList>> GetPlayerRankingAsync(int? locationI
return _gameData.QueryAsync<PlayerRankingList>(request);
}

public Task<QueryResult<ClanVersusRankingList>> GetClanVersusRankingAsync(int? locationId, Query? query = default)
{
var request = new AutoValidatedRequest
{
Query = query,
LocationId = locationId,
Uri = $"/locations/{locationId}/rankings/clans-versus"
};

return _gameData.QueryAsync<ClanVersusRankingList>(request);
}

public Task<QueryResult<PlayerVersusRankingList>> GetPlayerVersusRankingAsync(int? locationId, Query? query = default)
{
var request = new AutoValidatedRequest
{
Query = query,
LocationId = locationId,
Uri = $"/locations/{locationId}/rankings/players-versus"
};

return _gameData.QueryAsync<PlayerVersusRankingList>(request);
}

public Task<QueryResult<ClanCapitalRankingList>> GetClanCapitalRankingAsync(int? locationId, Query? query = default)
{
var request = new AutoValidatedRequest
Expand Down
22 changes: 0 additions & 22 deletions src/ClashOfClans/ILocations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,6 @@ public interface ILocations
/// <returns>Player ranking list</returns>
Task<QueryResult<PlayerRankingList>> GetPlayerRankingAsync(int? locationId, Query? query = default);

/// <summary>
/// Get clan versus rankings for a specific location
/// </summary>
/// <param name="locationId">Identifier of the location to retrieve</param>
/// <param name="query">Optional query parameters</param>
/// <exception cref="Core.ClashOfClansException">Communication error with the backend API</exception>
/// <exception cref="System.ArgumentException">Argument is invalid</exception>
/// <returns>Clan ranking list</returns>
[Obsolete("This route is deprecated and will be removed in the future. Call GetClanBuilderBaseRankingAsync instead.")]
Task<QueryResult<ClanVersusRankingList>> GetClanVersusRankingAsync(int? locationId, Query? query = default);

/// <summary>
/// Get player versus rankings for a specific location
/// </summary>
/// <param name="locationId">Identifier of the location to retrieve</param>
/// <param name="query">Optional query parameters</param>
/// <exception cref="Core.ClashOfClansException">Communication error with the backend API</exception>
/// <exception cref="System.ArgumentException">Argument is invalid</exception>
/// <returns>Player versus ranking list</returns>
[Obsolete("This route is deprecated and will be removed in the future. Call GetPlayerBuilderBaseRankingAsync instead.")]
Task<QueryResult<PlayerVersusRankingList>> GetPlayerVersusRankingAsync(int? locationId, Query? query = default);

/// <summary>
/// Get capital rankings for a specific location
/// </summary>
Expand Down
Loading