Skip to content

Commit

Permalink
Deprecate metro code
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Jan 13, 2025
1 parent fa53639 commit a27dcc4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

4.3.0
------------------

* `getMetroCode` in the `Location` model has been deprecated. The code
values are no longer being maintained.

4.2.1 (2024-09-20)
------------------

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/maxmind/geoip2/record/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ public Integer getAccuracyRadius() {
}

/**
* @return The metro code of the location if the location is in the US.
* MaxMind returns the same metro codes as the <a href=
* "https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions"
* >Google AdWords API</a>.
* @return The metro code is a no-longer-maintained code for targeting
* advertisements in Google.
* @deprecated Code values are no longer maintained.
*/
@JsonProperty("metro_code")
@Deprecated
public Integer getMetroCode() {
return this.metroCode;
}
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/maxmind/geoip2/WebServiceClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public void test200WithInvalidJson() throws Exception {
assertEquals("Received a 200 response but could not decode it as JSON", ex.getMessage());
}

@SuppressWarnings("deprecation")
@Test
public void test200WithDefaultValues() throws Exception {
WebServiceClient client = createSuccessClient("insights", "1.2.3.13",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public void leastSpecificSubdivision() {
);
}

@SuppressWarnings("deprecation")
@Test
public void testTraits() {
Traits traits = this.insights.getTraits();
Expand Down Expand Up @@ -172,6 +173,7 @@ public void testTraits() {
);
}

@SuppressWarnings("deprecation")
@Test
public void testLocation() {

Expand Down

0 comments on commit a27dcc4

Please sign in to comment.