From 75f6ecf22edf35301a89a6091f09899977023ed0 Mon Sep 17 00:00:00 2001 From: Bryan Amundson Date: Fri, 8 Nov 2024 14:56:28 -0700 Subject: [PATCH] Add administrative_area_iso2 field to international street. --- international-street-api/candidate.go | 1 + international-street-api/client_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/international-street-api/candidate.go b/international-street-api/candidate.go index 2b180ba..eeebb34 100644 --- a/international-street-api/candidate.go +++ b/international-street-api/candidate.go @@ -32,6 +32,7 @@ type ( Components struct { SuperAdministrativeArea string `json:"super_administrative_area,omitempty"` AdministrativeArea string `json:"administrative_area,omitempty"` + AdministrativeAreaISO2 string `json:"administrative_area_iso2,omitempty"` AdministrativeAreaShort string `json:"administrative_area_short,omitempty"` AdministrativeAreaLong string `json:"administrative_area_long,omitempty"` SubAdministrativeArea string `json:"sub_administrative_area,omitempty"` diff --git a/international-street-api/client_test.go b/international-street-api/client_test.go index 711c51c..c6a71c3 100644 --- a/international-street-api/client_test.go +++ b/international-street-api/client_test.go @@ -115,6 +115,7 @@ func (f *ClientFixture) TestFullJSONResponseDeserialization() { "components": { "super_administrative_area": "super_blah", "administrative_area": "SP", + "administrative_area_iso2": "BR-SP", "administrative_area_short": "SP", "administrative_area_long": "São Paulo", "sub_administrative_area": "sub_blah", @@ -185,6 +186,7 @@ func (f *ClientFixture) TestFullJSONResponseDeserialization() { "components": { "super_administrative_area": "blank", "administrative_area": "Verified-NoChange", + "administrative_area_iso2": "Added", "administrative_area_short": "blank", "administrative_area_long": "blank", "sub_administrative_area": "blank", @@ -262,6 +264,7 @@ func (f *ClientFixture) TestFullJSONResponseDeserialization() { f.So(candidate.Address12, should.Equal, "here") f.So(component.SuperAdministrativeArea, should.Equal, "super_blah") f.So(component.AdministrativeArea, should.Equal, "SP") + f.So(component.AdministrativeAreaISO2, should.Equal, "BR-SP") f.So(component.AdministrativeAreaShort, should.Equal, "SP") f.So(component.AdministrativeAreaLong, should.Equal, "São Paulo") f.So(component.SubAdministrativeArea, should.Equal, "sub_blah")