-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new endpoint /leaderboards/{leaderboardId} (#199)
* Add new endpoint /leaderboards/{leaderboardId} * Correct version * Upgrade wiremock
- Loading branch information
Showing
13 changed files
with
360 additions
and
8 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
v4.0.7 | ||
v4.0.8 |
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
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
34 changes: 34 additions & 0 deletions
34
src/main/java/jcrapi2/api/intern/leaderboards/info/Clan.java
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,34 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package jcrapi2.api.intern.leaderboards.info; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class Clan { | ||
|
||
@SerializedName("tag") | ||
private String tag; | ||
|
||
@SerializedName("name") | ||
private String name; | ||
|
||
@SerializedName("badgeId") | ||
private long badgeId; | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/jcrapi2/api/intern/leaderboards/info/Leaderboard.java
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,40 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package jcrapi2.api.intern.leaderboards.info; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class Leaderboard { | ||
|
||
@SerializedName("tag") | ||
private String tag; | ||
|
||
@SerializedName("name") | ||
private String name; | ||
|
||
@SerializedName("score") | ||
private int score; | ||
|
||
@SerializedName("rank") | ||
private int rank; | ||
|
||
@SerializedName("clan") | ||
private Clan clan; | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/jcrapi2/api/intern/leaderboards/info/LeaderboardRequest.java
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,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package jcrapi2.api.intern.leaderboards.info; | ||
|
||
import lombok.Builder; | ||
|
||
import supercell.api.wrapper.essentials.common.PaginationRequest; | ||
|
||
import java.util.Map; | ||
|
||
public class LeaderboardRequest extends PaginationRequest { | ||
|
||
private final long leaderboardId; | ||
|
||
@Builder | ||
private LeaderboardRequest( | ||
int limit, String after, String before, boolean storeRawResponse, long leaderboardId) { | ||
super(limit, after, before, storeRawResponse); | ||
this.leaderboardId = leaderboardId; | ||
} | ||
|
||
public static LeaderboardRequestBuilder builder(long leaderboardId) { | ||
return new LeaderboardRequestBuilder().leaderboardId(leaderboardId); | ||
} | ||
|
||
@Override | ||
public Map<String, Object> getRestParameters() { | ||
Map<String, Object> map = super.getRestParameters(); | ||
map.put("leaderboardId", leaderboardId); | ||
return map; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/jcrapi2/api/intern/leaderboards/info/LeaderboardResponse.java
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,21 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package jcrapi2.api.intern.leaderboards.info; | ||
|
||
import supercell.api.wrapper.essentials.common.PaginationResponse; | ||
|
||
public class LeaderboardResponse extends PaginationResponse<Leaderboard> {} |
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
Oops, something went wrong.