Skip to content

Commit

Permalink
Apply data model changes (#186)
Browse files Browse the repository at this point in the history
* Apply data model changes

* Set new version

---------

Co-authored-by: Michael Lieshoff <[email protected]>
  • Loading branch information
mlieshoff and Michael Lieshoff authored Feb 16, 2024
1 parent f8a7b22 commit f98925a
Show file tree
Hide file tree
Showing 19 changed files with 254 additions and 7 deletions.
25 changes: 23 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@

## [Unreleased]

## [4.0.1] - 2024-05-15
## [4.0.2] - 2024-02-16

- Apply data model changes on different endpoints (#185)
* (new field) players.info.Player.supportCards
* (new field) players.info.Player.currentDeckSupportCards
* (new field) players.info.Card.rarity
* (new field) players.info.Card.elixirCost
* (new field) players.info.CurrentDeck.rarity
* (new field) players.info.CurrentDeck.elixirCost
* (new field) players.info.CurrentFavouriteCard.rarity
* (new field) players.info.CurrentFavouriteCard.elixirCost
* (new field) players.battlelog.Team.supportCards
* (new field) players.battlelog.Card.rarity
* (new field) players.battlelog.Card.elixirCost
* (new field) players.battlelog.Opponent.supportCards
* (new field) cards.Cards.supportItems
* (new field) cards.Card.rarity
* (new field) cards.Card.elixirCost
* (new field) globaltournaments.Card.rarity

## [4.0.1] - 2024-02-15

### Fixed

Expand Down Expand Up @@ -157,7 +177,8 @@

- Create a Release job (#152)

[unreleased]: https://github.com/mlieshoff/jcrapi2/compare/v4.0.1...HEAD
[unreleased]: https://github.com/mlieshoff/jcrapi2/compare/v4.0.2...HEAD
[4.0.2]: https://github.com/mlieshoff/jcrapi2/compare/v4.0.1...4.0.2
[4.0.1]: https://github.com/mlieshoff/jcrapi2/compare/v4.0.0...4.0.1
[4.0.0]: https://github.com/mlieshoff/jcrapi2/compare/v3.0.5...4.0.0
[3.0.5]: https://github.com/mlieshoff/jcrapi2/compare/v3.0.4...3.0.5
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![](https://img.shields.io/badge/java-packagecloud.io-844fec.svg)](https://packagecloud.io/)
[![Nightlies](https://github.com/mlieshoff/jcrapi2/actions/workflows/nightlies.yml/badge.svg)](https://github.com/mlieshoff/jcrapi2/actions/workflows/nightlies.yml)

# jcrapi2 4.0.1
# jcrapi2 4.0.2
A Java Wrapper For Official Supercell Clash Royal Api

## Why we don't use the Swagger scheme?
Expand Down Expand Up @@ -454,15 +454,15 @@ All requests are returning *java.concurrent.Future*. The execution will be async

to Gradle:
```groovy
implementation group: 'jcrapi2', name: 'jcrapi2', version: '4.0.1'
implementation group: 'jcrapi2', name: 'jcrapi2', version: '4.0.2'
```

to Maven:
```xml
<dependency>
<groupId>jcrapi2</groupId>
<artifactId>jcrapi2</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.0.1
v4.0.2
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>jcrapi2</artifactId>
<packaging>jar</packaging>
<version>4.0.1</version>
<version>4.0.2</version>
<groupId>jcrapi2</groupId>
<url>https://maven.apache.org</url>
<inceptionYear>2018</inceptionYear>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/jcrapi2/api/intern/cards/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ public class Card {

@SerializedName("maxEvolutionLevel")
private Integer maxEvolutionLevel;

@SerializedName("rarity")
private String rarity;

@SerializedName("elixirCost")
private Integer elixirCost;
}
3 changes: 3 additions & 0 deletions src/main/java/jcrapi2/api/intern/cards/Cards.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ public class Cards {

@SerializedName("items")
private List<Card> items;

@SerializedName("supportItems")
private List<SupportItem> supportItems;
}
40 changes: 40 additions & 0 deletions src/main/java/jcrapi2/api/intern/cards/SupportItem.java
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.cards;

import com.google.gson.annotations.SerializedName;

import lombok.Data;

@Data
public class SupportItem {

@SerializedName("name")
private String name;

@SerializedName("id")
private long id;

@SerializedName("maxLevel")
private int maxLevel;

@SerializedName("iconUrls")
private IconUrls iconUrls;

@SerializedName("rarity")
private String rarity;
}
3 changes: 3 additions & 0 deletions src/main/java/jcrapi2/api/intern/globaltournaments/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ public class Card {

@SerializedName("maxLevel")
private int maxLevel;

@SerializedName("rarity")
private String rarity;
}
6 changes: 6 additions & 0 deletions src/main/java/jcrapi2/api/intern/players/battlelog/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,10 @@ public class Card {

@SerializedName("evolutionLevel")
private Integer evolutionLevel;

@SerializedName("rarity")
private String rarity;

@SerializedName("elixirCost")
private Integer elixirCost;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ public class Opponent {

@SerializedName("globalRank")
private Integer globalRank;

@SerializedName("supportCards")
private List<SupportCard> supportCards;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.players.battlelog;

import com.google.gson.annotations.SerializedName;

import lombok.Data;

@Data
public class SupportCard {

@SerializedName("name")
private String name;

@SerializedName("id")
private long id;

@SerializedName("level")
private int level;

@SerializedName("maxLevel")
private int maxLevel;

@SerializedName("rarity")
private String rarity;

@SerializedName("iconUrls")
private IconUrls iconUrls;
}
3 changes: 3 additions & 0 deletions src/main/java/jcrapi2/api/intern/players/battlelog/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ public class Team {

@SerializedName("globalRank")
private Integer globalRank;

@SerializedName("supportCards")
private List<SupportCard> supportCards;
}
6 changes: 6 additions & 0 deletions src/main/java/jcrapi2/api/intern/players/info/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,10 @@ public class Card {

@SerializedName("evolutionLevel")
private int evolutionLevel;

@SerializedName("rarity")
private String rarity;

@SerializedName("elixirCost")
private Integer elixirCost;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,10 @@ public class CurrentDeck {

@SerializedName("evolutionLevel")
private int evolutionLevel;

@SerializedName("rarity")
private String rarity;

@SerializedName("elixirCost")
private Integer elixirCost;
}
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.players.info;

import com.google.gson.annotations.SerializedName;

import lombok.Data;

@Data
public class CurrentDeckSupportCard {

@SerializedName("name")
private String name;

@SerializedName("id")
private long id;

@SerializedName("level")
private int level;

@SerializedName("maxLevel")
private int maxLevel;

@SerializedName("iconUrls")
private IconUrls iconUrls;

@SerializedName("rarity")
private String rarity;

@SerializedName("count")
private int count;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ public class CurrentFavouriteCard {

@SerializedName("iconUrls")
private IconUrls iconUrls;

@SerializedName("rarity")
private String rarity;

@SerializedName("elixirCost")
private Integer elixirCost;
}
6 changes: 6 additions & 0 deletions src/main/java/jcrapi2/api/intern/players/info/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,10 @@ public class Player {

@SerializedName("bestPathOfLegendSeasonResult")
private PathOfLegendSeasonResult bestPathOfLegendSeasonResult;

@SerializedName("supportCards")
private List<SupportCard> supportCards;

@SerializedName("currentDeckSupportCards")
private List<CurrentDeckSupportCard> currentDeckSupportCards;
}
46 changes: 46 additions & 0 deletions src/main/java/jcrapi2/api/intern/players/info/SupportCard.java
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.players.info;

import com.google.gson.annotations.SerializedName;

import lombok.Data;

@Data
public class SupportCard {

@SerializedName("name")
private String name;

@SerializedName("id")
private long id;

@SerializedName("level")
private int level;

@SerializedName("maxLevel")
private int maxLevel;

@SerializedName("iconUrls")
private IconUrls iconUrls;

@SerializedName("rarity")
private String rarity;

@SerializedName("count")
private int count;
}
3 changes: 3 additions & 0 deletions src/test/java/jcrapi2/EndToEnd.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void players_getBattleLog() throws Exception {
.replace(",\"remainingTowers\":0", "")
.replace(",\"starLevel\":0", "")
.replace(",\"elixirLeaked\":0.0,", ",")
.replace(",\"elixirLeaked\":0.0}", "}")
.replace(",\"challengeId\":0", "")
.replace(",\"challengeWinCountBefore\":0", "")
.replace(",\"globalRank\":null", "");
Expand All @@ -296,6 +297,7 @@ void players_getBattleLog() throws Exception {
.replace(",\"kingTowerHitPoints\":0", "")
.replace(",\"princessTowersHitPoints\":null", "")
.replace(",\"elixirLeaked\":0.0,", ",")
.replace(",\"elixirLeaked\":0.0}", "}")
.replace("\"name\":null,", "")
.replace(",\"challengeWinCountBefore\":0", "")
.replace(",\"maxEvolutionLevel\":null", "")
Expand Down Expand Up @@ -490,6 +492,7 @@ void globalTournaments_findAll() throws Exception {
response.getRawResponse()
.getRaw()
.replace(",\"type\":null", "")
.replace(",\"rarity\":null", "")
.replace("\"name\":null,", "");

assertDiff(expected, actual);
Expand Down

0 comments on commit f98925a

Please sign in to comment.