ideal_postcodes 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +3 -16
  3. data/LICENSE +1 -21
  4. data/README.md +13 -332
  5. data/lib/ideal_postcodes/base_client.rb +88 -0
  6. data/lib/ideal_postcodes/client.rb +42 -0
  7. data/lib/ideal_postcodes/errors.rb +59 -0
  8. data/lib/ideal_postcodes/generated.rb +83 -0
  9. data/lib/ideal_postcodes/model.rb +73 -0
  10. data/lib/ideal_postcodes/operations.rb +866 -0
  11. data/lib/ideal_postcodes/responses/address_response.rb +19 -0
  12. data/lib/ideal_postcodes/responses/api_key_details_response.rb +21 -0
  13. data/lib/ideal_postcodes/responses/api_key_response.rb +21 -0
  14. data/lib/ideal_postcodes/responses/api_key_usage_response.rb +21 -0
  15. data/lib/ideal_postcodes/responses/autocomplete_response.rb +19 -0
  16. data/lib/ideal_postcodes/responses/cleanse_response.rb +31 -0
  17. data/lib/ideal_postcodes/responses/config_response.rb +21 -0
  18. data/lib/ideal_postcodes/responses/configs_response.rb +21 -0
  19. data/lib/ideal_postcodes/responses/delete_config_response.rb +19 -0
  20. data/lib/ideal_postcodes/responses/delete_licensee_response.rb +19 -0
  21. data/lib/ideal_postcodes/responses/email_response.rb +31 -0
  22. data/lib/ideal_postcodes/responses/gbr_resolve_address_response.rb +21 -0
  23. data/lib/ideal_postcodes/responses/licensee_response.rb +21 -0
  24. data/lib/ideal_postcodes/responses/licensees_response.rb +21 -0
  25. data/lib/ideal_postcodes/responses/phone_number_response.rb +31 -0
  26. data/lib/ideal_postcodes/responses/place_response.rb +19 -0
  27. data/lib/ideal_postcodes/responses/postcode_response.rb +30 -0
  28. data/lib/ideal_postcodes/responses/resolve_place_response.rb +24 -0
  29. data/lib/ideal_postcodes/transport.rb +61 -0
  30. data/lib/ideal_postcodes/types/ab_address.rb +283 -0
  31. data/lib/ideal_postcodes/types/abp_address.rb +674 -0
  32. data/lib/ideal_postcodes/types/address.rb +290 -0
  33. data/lib/ideal_postcodes/types/address_list_item.rb +592 -0
  34. data/lib/ideal_postcodes/types/address_result.rb +24 -0
  35. data/lib/ideal_postcodes/types/address_suggestion.rb +27 -0
  36. data/lib/ideal_postcodes/types/api_key.rb +27 -0
  37. data/lib/ideal_postcodes/types/api_key_automated_topup.rb +17 -0
  38. data/lib/ideal_postcodes/types/api_key_current_purchase.rb +27 -0
  39. data/lib/ideal_postcodes/types/api_key_daily_limit.rb +21 -0
  40. data/lib/ideal_postcodes/types/api_key_datasets.rb +202 -0
  41. data/lib/ideal_postcodes/types/api_key_details.rb +90 -0
  42. data/lib/ideal_postcodes/types/api_key_individual_limit.rb +16 -0
  43. data/lib/ideal_postcodes/types/api_key_monthly_limit.rb +21 -0
  44. data/lib/ideal_postcodes/types/api_key_notifications.rb +35 -0
  45. data/lib/ideal_postcodes/types/autocomplete_result.rb +25 -0
  46. data/lib/ideal_postcodes/types/available_context.rb +35 -0
  47. data/lib/ideal_postcodes/types/ban_address.rb +179 -0
  48. data/lib/ideal_postcodes/types/bev_address.rb +288 -0
  49. data/lib/ideal_postcodes/types/cannar_address.rb +297 -0
  50. data/lib/ideal_postcodes/types/carrier.rb +31 -0
  51. data/lib/ideal_postcodes/types/config.rb +34 -0
  52. data/lib/ideal_postcodes/types/configs_result.rb +15 -0
  53. data/lib/ideal_postcodes/types/deleted_config.rb +13 -0
  54. data/lib/ideal_postcodes/types/deleted_licensee.rb +13 -0
  55. data/lib/ideal_postcodes/types/ecad_address.rb +393 -0
  56. data/lib/ideal_postcodes/types/ecaf_address.rb +204 -0
  57. data/lib/ideal_postcodes/types/email.rb +45 -0
  58. data/lib/ideal_postcodes/types/fodbosa_address.rb +201 -0
  59. data/lib/ideal_postcodes/types/gbr_cleanse_match.rb +70 -0
  60. data/lib/ideal_postcodes/types/gbr_cleanse_no_match.rb +47 -0
  61. data/lib/ideal_postcodes/types/geonames_place.rb +153 -0
  62. data/lib/ideal_postcodes/types/gnaf_address.rb +463 -0
  63. data/lib/ideal_postcodes/types/here_address.rb +174 -0
  64. data/lib/ideal_postcodes/types/invalid_phone_number.rb +50 -0
  65. data/lib/ideal_postcodes/types/kadaster_address.rb +480 -0
  66. data/lib/ideal_postcodes/types/kartverket_address.rb +342 -0
  67. data/lib/ideal_postcodes/types/key_usage_day.rb +16 -0
  68. data/lib/ideal_postcodes/types/key_usage_result.rb +36 -0
  69. data/lib/ideal_postcodes/types/licensee.rb +50 -0
  70. data/lib/ideal_postcodes/types/licensee_daily_usage.rb +29 -0
  71. data/lib/ideal_postcodes/types/licensees_result.rb +23 -0
  72. data/lib/ideal_postcodes/types/mois_address.rb +440 -0
  73. data/lib/ideal_postcodes/types/mr_address.rb +99 -0
  74. data/lib/ideal_postcodes/types/native_record.rb +368 -0
  75. data/lib/ideal_postcodes/types/nyb_address.rb +99 -0
  76. data/lib/ideal_postcodes/types/paf_address.rb +96 -0
  77. data/lib/ideal_postcodes/types/pafa_address.rb +104 -0
  78. data/lib/ideal_postcodes/types/pafw_address.rb +99 -0
  79. data/lib/ideal_postcodes/types/phone_number.rb +50 -0
  80. data/lib/ideal_postcodes/types/place.rb +79 -0
  81. data/lib/ideal_postcodes/types/place_result.rb +21 -0
  82. data/lib/ideal_postcodes/types/place_suggestion.rb +32 -0
  83. data/lib/ideal_postcodes/types/sdfi_address.rb +520 -0
  84. data/lib/ideal_postcodes/types/swt_address.rb +247 -0
  85. data/lib/ideal_postcodes/types/uk_address_suggestion.rb +45 -0
  86. data/lib/ideal_postcodes/types/uk_address_suggestion_urls.rb +21 -0
  87. data/lib/ideal_postcodes/types/unknown_email.rb +43 -0
  88. data/lib/ideal_postcodes/types/upujp_address.rb +763 -0
  89. data/lib/ideal_postcodes/types/usps_address.rb +294 -0
  90. data/lib/ideal_postcodes/version.rb +5 -0
  91. data/lib/ideal_postcodes.rb +14 -2
  92. data/sig/ideal_postcodes/base_client.rbs +40 -0
  93. data/sig/ideal_postcodes/client.rbs +35 -0
  94. data/sig/ideal_postcodes/errors.rbs +27 -0
  95. data/sig/ideal_postcodes/model.rbs +37 -0
  96. data/sig/ideal_postcodes/operations.rbs +207 -0
  97. data/sig/ideal_postcodes/responses/address_response.rbs +13 -0
  98. data/sig/ideal_postcodes/responses/api_key_details_response.rbs +13 -0
  99. data/sig/ideal_postcodes/responses/api_key_response.rbs +13 -0
  100. data/sig/ideal_postcodes/responses/api_key_usage_response.rbs +13 -0
  101. data/sig/ideal_postcodes/responses/autocomplete_response.rbs +13 -0
  102. data/sig/ideal_postcodes/responses/cleanse_response.rbs +19 -0
  103. data/sig/ideal_postcodes/responses/config_response.rbs +13 -0
  104. data/sig/ideal_postcodes/responses/configs_response.rbs +13 -0
  105. data/sig/ideal_postcodes/responses/delete_config_response.rbs +13 -0
  106. data/sig/ideal_postcodes/responses/delete_licensee_response.rbs +13 -0
  107. data/sig/ideal_postcodes/responses/email_response.rbs +19 -0
  108. data/sig/ideal_postcodes/responses/gbr_resolve_address_response.rbs +13 -0
  109. data/sig/ideal_postcodes/responses/licensee_response.rbs +13 -0
  110. data/sig/ideal_postcodes/responses/licensees_response.rbs +13 -0
  111. data/sig/ideal_postcodes/responses/phone_number_response.rbs +19 -0
  112. data/sig/ideal_postcodes/responses/place_response.rbs +13 -0
  113. data/sig/ideal_postcodes/responses/postcode_response.rbs +16 -0
  114. data/sig/ideal_postcodes/responses/resolve_place_response.rbs +13 -0
  115. data/sig/ideal_postcodes/transport.rbs +39 -0
  116. data/sig/ideal_postcodes/types/ab_address.rbs +57 -0
  117. data/sig/ideal_postcodes/types/abp_address.rbs +126 -0
  118. data/sig/ideal_postcodes/types/address.rbs +136 -0
  119. data/sig/ideal_postcodes/types/address_list_item.rbs +160 -0
  120. data/sig/ideal_postcodes/types/address_result.rbs +12 -0
  121. data/sig/ideal_postcodes/types/address_suggestion.rbs +11 -0
  122. data/sig/ideal_postcodes/types/api_key.rbs +11 -0
  123. data/sig/ideal_postcodes/types/api_key_automated_topup.rbs +9 -0
  124. data/sig/ideal_postcodes/types/api_key_current_purchase.rbs +11 -0
  125. data/sig/ideal_postcodes/types/api_key_daily_limit.rbs +10 -0
  126. data/sig/ideal_postcodes/types/api_key_datasets.rbs +46 -0
  127. data/sig/ideal_postcodes/types/api_key_details.rbs +22 -0
  128. data/sig/ideal_postcodes/types/api_key_individual_limit.rbs +9 -0
  129. data/sig/ideal_postcodes/types/api_key_monthly_limit.rbs +10 -0
  130. data/sig/ideal_postcodes/types/api_key_notifications.rbs +13 -0
  131. data/sig/ideal_postcodes/types/autocomplete_result.rbs +15 -0
  132. data/sig/ideal_postcodes/types/available_context.rbs +13 -0
  133. data/sig/ideal_postcodes/types/ban_address.rbs +46 -0
  134. data/sig/ideal_postcodes/types/bev_address.rbs +67 -0
  135. data/sig/ideal_postcodes/types/cannar_address.rbs +62 -0
  136. data/sig/ideal_postcodes/types/carrier.rbs +14 -0
  137. data/sig/ideal_postcodes/types/config.rbs +14 -0
  138. data/sig/ideal_postcodes/types/configs_result.rbs +9 -0
  139. data/sig/ideal_postcodes/types/deleted_config.rbs +9 -0
  140. data/sig/ideal_postcodes/types/deleted_licensee.rbs +9 -0
  141. data/sig/ideal_postcodes/types/ecad_address.rbs +84 -0
  142. data/sig/ideal_postcodes/types/ecaf_address.rbs +45 -0
  143. data/sig/ideal_postcodes/types/email.rbs +16 -0
  144. data/sig/ideal_postcodes/types/fodbosa_address.rbs +43 -0
  145. data/sig/ideal_postcodes/types/gbr_cleanse_match.rbs +25 -0
  146. data/sig/ideal_postcodes/types/gbr_cleanse_no_match.rbs +28 -0
  147. data/sig/ideal_postcodes/types/geonames_place.rbs +42 -0
  148. data/sig/ideal_postcodes/types/gnaf_address.rbs +104 -0
  149. data/sig/ideal_postcodes/types/here_address.rbs +37 -0
  150. data/sig/ideal_postcodes/types/invalid_phone_number.rbs +17 -0
  151. data/sig/ideal_postcodes/types/kadaster_address.rbs +98 -0
  152. data/sig/ideal_postcodes/types/kartverket_address.rbs +78 -0
  153. data/sig/ideal_postcodes/types/key_usage_day.rbs +10 -0
  154. data/sig/ideal_postcodes/types/key_usage_result.rbs +13 -0
  155. data/sig/ideal_postcodes/types/licensee.rbs +17 -0
  156. data/sig/ideal_postcodes/types/licensee_daily_usage.rbs +12 -0
  157. data/sig/ideal_postcodes/types/licensees_result.rbs +11 -0
  158. data/sig/ideal_postcodes/types/mois_address.rbs +97 -0
  159. data/sig/ideal_postcodes/types/mr_address.rbs +27 -0
  160. data/sig/ideal_postcodes/types/native_record.rbs +34 -0
  161. data/sig/ideal_postcodes/types/nyb_address.rbs +27 -0
  162. data/sig/ideal_postcodes/types/paf_address.rbs +27 -0
  163. data/sig/ideal_postcodes/types/pafa_address.rbs +27 -0
  164. data/sig/ideal_postcodes/types/pafw_address.rbs +27 -0
  165. data/sig/ideal_postcodes/types/phone_number.rbs +17 -0
  166. data/sig/ideal_postcodes/types/place.rbs +29 -0
  167. data/sig/ideal_postcodes/types/place_result.rbs +15 -0
  168. data/sig/ideal_postcodes/types/place_suggestion.rbs +12 -0
  169. data/sig/ideal_postcodes/types/sdfi_address.rbs +108 -0
  170. data/sig/ideal_postcodes/types/swt_address.rbs +57 -0
  171. data/sig/ideal_postcodes/types/uk_address_suggestion.rbs +13 -0
  172. data/sig/ideal_postcodes/types/uk_address_suggestion_urls.rbs +10 -0
  173. data/sig/ideal_postcodes/types/unknown_email.rbs +16 -0
  174. data/sig/ideal_postcodes/types/upujp_address.rbs +156 -0
  175. data/sig/ideal_postcodes/types/usps_address.rbs +63 -0
  176. metadata +186 -175
  177. data/.travis.yml +0 -9
  178. data/Gemfile +0 -2
  179. data/Rakefile +0 -15
  180. data/ideal-postcodes-ruby.gemspec +0 -25
  181. data/lib/idealpostcodes/address.rb +0 -31
  182. data/lib/idealpostcodes/errors.rb +0 -33
  183. data/lib/idealpostcodes/key.rb +0 -13
  184. data/lib/idealpostcodes/postcode.rb +0 -22
  185. data/lib/idealpostcodes/util.rb +0 -29
  186. data/lib/idealpostcodes/version.rb +0 -3
  187. data/lib/idealpostcodes.rb +0 -112
  188. data/spec/addresses_spec.rb +0 -68
  189. data/spec/idealpostcodes_spec.rb +0 -56
  190. data/spec/keys_spec.rb +0 -25
  191. data/spec/postcodes_spec.rb +0 -66
  192. data/spec/spec_helper.rb +0 -68
  193. data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_invalid_key.yml +0 -42
  194. data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_limit_breached.yml +0 -42
  195. data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_no_lookups_remaining.yml +0 -42
  196. data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_returns_an_address_for_a_valid_UDPRN.yml +0 -74
  197. data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_returns_nil_for_an_invalid_UDPRN.yml +0 -42
  198. data/spec/vcr_cassettes/IdealPostcodes_Address_search_is_sensitive_to_limit.yml +0 -81
  199. data/spec/vcr_cassettes/IdealPostcodes_Address_search_is_sensitive_to_page.yml +0 -369
  200. data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_invalid_key.yml +0 -42
  201. data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_limit_breached.yml +0 -42
  202. data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_no_lookups_remaining.yml +0 -42
  203. data/spec/vcr_cassettes/IdealPostcodes_Address_search_returns_results_in_a_SearchResult_object.yml +0 -273
  204. data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_details_returns_key_details.yml +0 -62
  205. data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_returns_the_availability_status_of_a_key_false_key_.yml +0 -45
  206. data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_returns_the_availability_status_of_a_key_true_key_.yml +0 -45
  207. data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_is_sensitive_to_limit_parameter.yml +0 -52
  208. data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_is_sensitive_to_radius_parament.yml +0 -133
  209. data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_returns_an_array_of_postcodes_and_locations.yml +0 -84
  210. data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_returns_an_empty_array_if_no_results_are_found.yml +0 -43
  211. data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_invalid_key.yml +0 -42
  212. data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_key_has_run_out_of_balance.yml +0 -42
  213. data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_limit_has_been_reached.yml +0 -42
  214. data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_returns_a_list_of_addresses_for_a_postcode.yml +0 -268
  215. data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_returns_an_empty_array_if_postcode_does_not_exist.yml +0 -42
  216. data/spec/vcr_cassettes/IdealPostcodes_key_available_returns_false_if_key_is_unavailable.yml +0 -45
  217. data/spec/vcr_cassettes/IdealPostcodes_key_available_returns_true_if_key_is_available.yml +0 -45
  218. data/spec/vcr_cassettes/IdealPostcodes_key_details_raises_an_exception_if_no_secret_is_provided.yml +0 -45
  219. data/spec/vcr_cassettes/IdealPostcodes_key_details_returns_key_information.yml +0 -62
  220. data/spec/vcr_cassettes/IdealPostcodes_request_generates_a_HTTP_request.yml +0 -268
  221. data/spec/vcr_cassettes/IdealPostcodes_request_raises_authentication_error_if_invalid_key_is_provided.yml +0 -42
  222. data/spec/vcr_cassettes/IdealPostcodes_request_raises_limit_reached_error_if_a_limit_has_been_breached.yml +0 -42
  223. data/spec/vcr_cassettes/IdealPostcodes_request_raises_token_exhausted_error_if_key_balance_is_depleted.yml +0 -42
@@ -0,0 +1,592 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # Address (list endpoints)
8
+ #
9
+ # A single address, as returned by the postcode and address list endpoints. Every other endpoint
10
+ # returns `Address`, the same set of fields with `native` on every record.
11
+ #
12
+ # The standard Ideal Postcodes address. Its fields follow the layout UK address databases
13
+ # typically use, and much of it reflects Royal Mail's Postcode Address File, the UK's primary
14
+ # address database.
15
+ #
16
+ # The API converts non-UK addresses into the same UK layout so they insert into a standard
17
+ # address database.
18
+ #
19
+ # Pay attention to the address lines (`line_1`, `line_2` and `line_3`), post town, postcode,
20
+ # county and country. Together they are all you need to identify an address uniquely, in the UK
21
+ # or as an international address.
22
+ #
23
+ # For international addresses, cities map to `post_town` and states map to `county`.
24
+ #
25
+ # Addresses from AddressBase (`ab`, `abp`) and non-UK datasets also carry a `native` object: the
26
+ # raw record from its source dataset, with local detail the standard fields cannot hold. It is
27
+ # never returned for the Royal Mail PAF family (`paf`, `mr`, `nyb`, `pafa`, `pafw`) on these two
28
+ # endpoints. E.g.
29
+ #
30
+ # - ECAD records say whether an address sits in a Gaeltacht (Irish-speaking) district and
31
+ # whether the building is residential or commercial
32
+ # - USPS records carry the carrier route and congressional district
33
+ # - Kadaster records carry the floor area, year of completion and use (residential, office,
34
+ # retail)
35
+ class AddressListItem < Model
36
+ # Globally unique internally generated identifier for an address
37
+ #
38
+ # @return [String]
39
+ def id = @hash["id"]
40
+
41
+ # Indicates the provenance of an address.
42
+ #
43
+ # @return [String]
44
+ def dataset = @hash["dataset"]
45
+
46
+ # 3 letter country code (ISO 3166-1)
47
+ #
48
+ # @return [String]
49
+ def country_iso = @hash["country_iso"]
50
+
51
+ # 2 letter country code (ISO 3166-1)
52
+ #
53
+ # @return [String]
54
+ def country_iso_2 = @hash["country_iso_2"]
55
+
56
+ # Full country names (ISO 3166)
57
+ #
58
+ # @return [String]
59
+ def country = @hash["country"]
60
+
61
+ # Language represented by 2 letter ISO Code (639-1)
62
+ #
63
+ # @return [String]
64
+ def language = @hash["language"]
65
+
66
+ # First address line. Often contains premise and thoroughfare information. For a commercial
67
+ # premise the first line is the full name of the registered organisation. Never empty.
68
+ #
69
+ # @return [String]
70
+ def line_1 = @hash["line_1"]
71
+
72
+ # Second address line. Often contains thoroughfare and locality information. May be empty.
73
+ #
74
+ # @return [String]
75
+ def line_2 = @hash["line_2"]
76
+
77
+ # Third address line. Takes the address elements left after `line_1` and `line_2` are filled;
78
+ # where the address needs more than three lines the remaining elements are joined into
79
+ # `line_3`, comma separated. May be empty.
80
+ #
81
+ # @return [String]
82
+ def line_3 = @hash["line_3"]
83
+
84
+ # The town or city used to route mail to the address. For UK addresses this is the Royal Mail
85
+ # post town, which is a routing instruction rather than the nearest town geographically.
86
+ # Present on every address.
87
+ #
88
+ # @return [String]
89
+ def post_town = @hash["post_town"]
90
+
91
+ # Correctly formatted postcode. Capitalised and spaced. Empty (`""`) where the address has no
92
+ # postcode.
93
+ #
94
+ # @return [String]
95
+ def postcode = @hash["postcode"]
96
+
97
+ # Whatever county data is available for the address. Normally the postal county. If that is
98
+ # not present it falls back to the administrative county, then to the traditional county. May
99
+ # be empty where none of the three is present.
100
+ #
101
+ # @return [String]
102
+ def county = @hash["county"]
103
+
104
+ # Short code representing the county or province. May be empty (`""`)
105
+ #
106
+ # @return [String]
107
+ def county_code = @hash["county_code"]
108
+
109
+ # UPRN stands for Unique Property Reference Number and is maintained by the Ordnance Survey
110
+ # (OS). Local governments in the UK have allocated a unique number for each land or property.
111
+ #
112
+ # @return [String]
113
+ def uprn = @hash["uprn"]
114
+
115
+ # UDPRN stands for 'Unique Delivery Point Reference Number'. Royal Mail assigns a unique UDPRN
116
+ # code for each premise on PAF. Simple, unique reference number for each Delivery Point.
117
+ # Unlikely to be reused when an address expires.
118
+ #
119
+ # @return [Integer, String]
120
+ def udprn = @hash["udprn"]
121
+
122
+ # A small minority of individual premises (as identified by a UDPRN) may have multiple
123
+ # occupants behind the same letterbox. These are known as Multiple Residence occupants and can
124
+ # be queried via the Multiple Residence dataset. Simple, unique reference number for each
125
+ # Multiple Residence occupant.
126
+ #
127
+ # @return [String, Float]
128
+ def umprn = @hash["umprn"]
129
+
130
+ # The first part of a postcode is known as the outward code. e.g. The outward code of BR8 7RE
131
+ # is BR8. Enables mail to be sorted to the correct local area for delivery. This part of the
132
+ # code contains the area and the district to which the mail is to be delivered, e.g. 'PO1',
133
+ # 'SW1A' or 'B23'.
134
+ #
135
+ # @return [String]
136
+ def postcode_outward = @hash["postcode_outward"]
137
+
138
+ # The second part of a postcode is known as the inward code. e.g. The inward code of BR8 7RE
139
+ # is 7RE.
140
+ #
141
+ # @return [String]
142
+ def postcode_inward = @hash["postcode_inward"]
143
+
144
+ # A locality that qualifies the thoroughfare. Used where the same thoroughfare name occurs
145
+ # more than once in a post town and no dependant thoroughfare distinguishes them. May be
146
+ # empty.
147
+ #
148
+ # @return [String]
149
+ def dependant_locality = @hash["dependant_locality"]
150
+
151
+ # Supplements dependant locality. Supplied where the dependant locality itself occurs twice in
152
+ # the same locality. May be empty.
153
+ #
154
+ # @return [String]
155
+ def double_dependant_locality = @hash["double_dependant_locality"]
156
+
157
+ # Also known as the street or road name. May be empty.
158
+ #
159
+ # @return [String]
160
+ def thoroughfare = @hash["thoroughfare"]
161
+
162
+ # Supplements thoroughfare. Used where a thoroughfare name occurs twice in the same post town,
163
+ # to identify the address uniquely. May be empty.
164
+ #
165
+ # @return [String]
166
+ def dependant_thoroughfare = @hash["dependant_thoroughfare"]
167
+
168
+ # Number identifying the premise on a thoroughfare or dependant thoroughfare. May be empty.
169
+ #
170
+ # @return [String]
171
+ def building_number = @hash["building_number"]
172
+
173
+ # Name of a residential or commercial premise. May be empty.
174
+ #
175
+ # @return [String]
176
+ def building_name = @hash["building_name"]
177
+
178
+ # Identifies a unit where a premise is split into flats, apartments or business units. Cannot
179
+ # be present without either building_name or building_number. E.g. Flat 1, A, 10B. May be
180
+ # empty.
181
+ #
182
+ # @return [String]
183
+ def sub_building_name = @hash["sub_building_name"]
184
+
185
+ # PO Box number for the address, occasionally a combination of numbers and letters. Allocated
186
+ # to Large User postcodes only. May be empty.
187
+ #
188
+ # @return [String]
189
+ def po_box = @hash["po_box"]
190
+
191
+ # Supplements organisation name to identify a department within the organisation. May be
192
+ # empty.
193
+ #
194
+ # @return [String]
195
+ def department_name = @hash["department_name"]
196
+
197
+ # Name of the business or organisation at this address. May be empty.
198
+ #
199
+ # @return [String]
200
+ def organisation_name = @hash["organisation_name"]
201
+
202
+ # Royal Mail postcode user type. UK addresses only.
203
+ #
204
+ # @return [String]
205
+ def postcode_type = @hash["postcode_type"]
206
+
207
+ # `Y` where an organisation is present at a small user postcode. Empty (`""`) otherwise. UK
208
+ # addresses only.
209
+ #
210
+ # @return [String]
211
+ def su_organisation_indicator = @hash["su_organisation_indicator"]
212
+
213
+ # Two-character code (the first numeric, the second alphabetical) which, added to the
214
+ # postcode, uniquely identifies a delivery point. May be reused once a delivery point is
215
+ # deleted, though not until every remaining code in the range has been allocated. Always `1A`
216
+ # for a large user postcode, since each large user has its own postcode. Empty (`""`) where
217
+ # not available.
218
+ #
219
+ # @return [String]
220
+ def delivery_point_suffix = @hash["delivery_point_suffix"]
221
+
222
+ # A pre-computed string which sensibly combines building_number, building_name and
223
+ # sub_building_name. Those three fields hold raw dataset values and can be difficult to parse
224
+ # if you are unaware of how they work together, so we also provide this single, simple premise
225
+ # string. Ideal if you want to pull premise information and thoroughfare information
226
+ # separately instead of using our address lines data.
227
+ #
228
+ # @return [String]
229
+ def premise = @hash["premise"]
230
+
231
+ # The current administrative county to which the postcode has been assigned.
232
+ #
233
+ # @return [String]
234
+ def administrative_county = @hash["administrative_county"]
235
+
236
+ # Postal counties were used for the distribution of mail before the Postcode system was
237
+ # introduced in the 1970s. The Former Postal County was the Administrative County at the time.
238
+ # This data rarely changes. May be empty.
239
+ #
240
+ # @return [String]
241
+ def postal_county = @hash["postal_county"]
242
+
243
+ # Traditional counties are provided by the Association of British Counties. It is historical
244
+ # data, and can date from the 1800s. May be empty.
245
+ #
246
+ # @return [String]
247
+ def traditional_county = @hash["traditional_county"]
248
+
249
+ # The current district/unitary authority to which the postcode has been assigned. May be
250
+ # empty.
251
+ #
252
+ # @return [String]
253
+ def district = @hash["district"]
254
+
255
+ # The current administrative/electoral area to which the postcode has been assigned. May be
256
+ # empty for a small number of addresses.
257
+ #
258
+ # @return [String]
259
+ def ward = @hash["ward"]
260
+
261
+ # The longitude of the address or postcode (WGS84).
262
+ #
263
+ # @return [String, Float]
264
+ def longitude = @hash["longitude"]
265
+
266
+ # The latitude of the address or postcode (WGS84).
267
+ #
268
+ # @return [String, Float]
269
+ def latitude = @hash["latitude"]
270
+
271
+ # Eastings reference using the [Ordnance Survey National Grid reference
272
+ # system](https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid).
273
+ #
274
+ # @return [String, Float]
275
+ def eastings = @hash["eastings"]
276
+
277
+ # Northings reference using the [Ordnance Survey National Grid reference
278
+ # system](https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid).
279
+ #
280
+ # @return [String, Float]
281
+ def northings = @hash["northings"]
282
+
283
+ # The raw dataset record backing this address. On these two endpoints it is returned for
284
+ # AddressBase (`ab`, `abp`) and non-UK datasets only, never for the PAF family. Use any other
285
+ # endpoint for a PAF native record.
286
+ #
287
+ # @return [Types::AbAddress, Types::AbpAddress, Types::UspsAddress, Types::EcadAddress,
288
+ # Types::EcafAddress, Types::HereAddress, Types::GnafAddress, Types::KadasterAddress,
289
+ # Types::KartverketAddress, Types::SdfiAddress, Types::CannarAddress, Types::FodbosaAddress,
290
+ # Types::MoisAddress, Types::UpujpAddress, Types::BevAddress, Types::BanAddress,
291
+ # Types::SwtAddress, Hash{String => Object}, nil]
292
+ def native = read("native") { |v| hydrate_native(v) }
293
+
294
+ private
295
+
296
+ def hydrate_native(value)
297
+ Union.hydrate(
298
+ value,
299
+ [
300
+ [
301
+ Types::AbAddress,
302
+ { "dataset" => ["ab"] },
303
+ %w[
304
+ id country_iso dataset language line_1 line_2 line_3 premise uprn udprn parent_uprn
305
+ usrn toid classification_code eastings northings latitude longitude
306
+ single_address_line street_name locality town_name delivery_point_suffix post_town
307
+ gss_code rpc last_update_date island change_code building_name building_number
308
+ sub_building postcode po_box organisation country county district ward
309
+ traditional_county administrative_county postal_county
310
+ ]
311
+ ],
312
+ [
313
+ Types::AbpAddress,
314
+ { "dataset" => ["abp"] },
315
+ %w[
316
+ uprn logical_status country latitude longitude x_coordinate y_coordinate
317
+ local_custodian_code addressbase_postal postcode_locator multi_occ_count postcode id
318
+ dataset country_iso suggestion_line
319
+ ]
320
+ ],
321
+ [
322
+ Types::UspsAddress,
323
+ { "dataset" => ["usps"] },
324
+ %w[
325
+ id dataset country country_iso country_iso_2 language primary_number
326
+ secondary_number plus_4_code line_1 line_2 last_line zip_code zip_plus_4_code
327
+ update_key_number record_type_code carrier_route_id
328
+ street_pre_directional_abbreviation street_name street_suffix_abbreviation
329
+ street_post_directional_abbreviation building_or_firm_name
330
+ address_secondary_abbreviation base_alternate_code lacs_status_indicator
331
+ government_building_indicator state_abbreviation state municipality_city_state_key
332
+ urbanization_city_state_key preferred_last_line_city_state_key county city
333
+ city_abbreviation preferred_city city_state_name_facility_code
334
+ zip_classification_code city_state_mailing_name_indicator
335
+ carrier_route_rate_sortation finance_number congressional_district_number
336
+ county_number
337
+ ]
338
+ ],
339
+ [
340
+ Types::EcadAddress,
341
+ { "dataset" => ["ecad"] },
342
+ %w[
343
+ id dataset country_iso country_iso_2 country language line_1 line_2 line_3 line_4
344
+ line_5 line_6 line_7 line_8 line_9 department organisation sub_building_name
345
+ building_name building_number building_group primary_thoroughfare
346
+ secondary_thoroughfare primary_locality secondary_locality tertiary_locality
347
+ post_county eircode address_reference longitude latitude
348
+ ]
349
+ ],
350
+ [
351
+ Types::EcafAddress,
352
+ { "dataset" => ["ecaf"] },
353
+ %w[
354
+ id dataset country_iso country_iso_2 country language line_1 line_2 line_3 line_4
355
+ line_5 line_6 line_7 line_8 line_9 department organisation sub_building_name
356
+ building_name building_number building_group primary_thoroughfare
357
+ secondary_thoroughfare primary_locality secondary_locality tertiary_locality
358
+ post_county eircode address_reference longitude latitude
359
+ ]
360
+ ],
361
+ [
362
+ Types::HereAddress,
363
+ {
364
+ "dataset" => %w[
365
+ herewe heret heresa hereo herena heremeas heremea herem herei herehk hereee hereap
366
+ ]
367
+ },
368
+ %w[
369
+ id country_iso dataset language line_1 line_2 line_3 line_4 line_5 address
370
+ delivery_latitude delivery_longitude building_name latitude longitude street_name
371
+ postal_code order1_name order2_name order8_name builtup_name poi_name
372
+ building_unit_name level_name unit_name suppl_address_info building_grp_name
373
+ ]
374
+ ],
375
+ [
376
+ Types::GnafAddress,
377
+ { "dataset" => ["gnaf"] },
378
+ %w[
379
+ id dataset country country_iso country_iso_2 line_1 line_2 language address latitude
380
+ longitude address_detail_pid date_created date_last_modified date_retired
381
+ building_name lot_number_prefix lot_number lot_number_suffix flat_type_code
382
+ flat_number_prefix flat_number flat_number_suffix level_type_code
383
+ level_number_prefix level_number level_number_suffix number_first_prefix
384
+ number_first number_first_suffix number_last_prefix number_last number_last_suffix
385
+ street_locality_pid alias_principal postcode private_street legal_parcel_id
386
+ confidence level_geocoded_code primary_secondary alias_type_code geocode_type_code
387
+ default_latitude default_longitude address_change_type_code mb_2016_match_code
388
+ mb_2021_match_code address_type address_site_name geocode_site_name
389
+ site_geocode_type_code reliability_code site_boundary_extent
390
+ site_planimetric_accuracy elevation site_longitude site_latitude
391
+ geocode_type_priority_order site_geocode_priority_order locality_name
392
+ primary_postcode locality_class_code locality_gnaf_reliability_code
393
+ locality_alias_name locality_alias_postcode locality_alias_type_code
394
+ locality_planimetric_accuracy locality_latitude locality_longitude mb_2016_code
395
+ mb_2021_code ps_join_type_code state_name state_abbreviation street_class_code
396
+ street_name street_type_code street_suffix_code gnaf_street_confidence
397
+ street_locality_gnaf_reliability_code street_locality_alias_street_name
398
+ street_locality_alias_street_type_code street_locality_alias_street_suffix_code
399
+ street_locality_alias_type_code street_locality_boundary_extent
400
+ street_locality_planimetric_accuracy street_locality_latitude
401
+ street_locality_longitude street_type_name street_locality_alias_street_type_name
402
+ ]
403
+ ],
404
+ [
405
+ Types::KadasterAddress,
406
+ { "dataset" => ["kadaster"] },
407
+ %w[
408
+ id dataset country country_iso country_iso_2 line_1 language address identificatie
409
+ latitude longitude gebruiksdoel oppervlakte status geconstateerd documentdatum
410
+ documentnummer voorkomenidentificatie begin_geldigheid eind_geldigheid
411
+ tijdstip_registratie eind_registratie tijdstip_registratie_lv
412
+ tijdstip_eind_registratie_lv nummeraanduidingen_identificatie
413
+ nummeraanduidingen_huisnummer nummeraanduidingen_huisnummertoevoeging
414
+ nummeraanduidingen_huisletter nummeraanduidingen_postcode
415
+ nummeraanduidingen_type_adresseerbaar_object nummeraanduidingen_status
416
+ nummeraanduidingen_geconstateerd nummeraanduidingen_documentdatum
417
+ nummeraanduidingen_documentnummer nummeraanduidingen_voorkomenidentificatie
418
+ nummeraanduidingen_begin_geldigheid nummeraanduidingen_eind_geldigheid
419
+ nummeraanduidingen_tijdstip_registratie nummeraanduidingen_eind_registratie
420
+ nummeraanduidingen_tijdstip_registratie_lv
421
+ nummeraanduidingen_tijdstip_eind_registratie_lv pand_identificatie
422
+ pand_oorspronkelijk_bouwjaar pand_status pand_geconstateerd pand_documentdatum
423
+ pand_documentnummer pand_voorkomenidentificatie pand_begin_geldigheid
424
+ pand_eind_geldigheid pand_tijdstip_registratie pand_eind_registratie
425
+ pand_tijdstip_registratie_lv pand_tijdstip_eind_registratie_lv
426
+ openbare_ruimte_identificatie openbare_ruimte_naam openbare_ruimte_type
427
+ openbare_ruimte_status openbare_ruimte_geconstateerd openbare_ruimte_documentdatum
428
+ openbare_ruimte_documentnummer openbare_ruimte_voorkomenidentificatie
429
+ openbare_ruimte_begin_geldigheid openbare_ruimte_eind_geldigheid
430
+ openbare_ruimte_tijdstip_registratie openbare_ruimte_eind_registratie
431
+ openbare_ruimte_tijdstip_registratie_lv openbare_ruimte_tijdstip_eind_registratie_lv
432
+ openbare_ruimte_verkorte_naam woonplaats_identificatie woonplaats_naam
433
+ woonplaats_status woonplaats_geconstateerd woonplaats_documentdatum
434
+ woonplaats_documentnummer woonplaats_voorkomenidentificatie
435
+ woonplaats_begin_geldigheid woonplaats_eind_geldigheid
436
+ woonplaats_tijdstip_registratie woonplaats_eind_registratie
437
+ woonplaats_tijdstip_registratie_lv woonplaats_tijdstip_eind_registratie_lv provincie
438
+ ]
439
+ ],
440
+ [
441
+ Types::KartverketAddress,
442
+ { "dataset" => ["kartverket"] },
443
+ %w[
444
+ id dataset country country_iso country_iso_2 line_1 line_2 language address latitude
445
+ longitude lokal_id kommunenummer kommunenavn adressetype adressetilleggsnavn
446
+ adressetilleggsnavn_kilde adressekode adressenavn nummer bokstav gardsnummer
447
+ bruksnummer festenummer seksjonsnummer undernummer adresse_tekst
448
+ adresse_tekst_uten_adressetilleggsnavn bruksenhet_id bruksenhetsnummer_tekst
449
+ offisiell_adresse_tekst offisiell_adresse_tekst_uten_adressetilleggsnavn epsg_kode
450
+ nord oest postnummer poststed grunnkretsnummer grunnkretsnavn soknenummer soknenavn
451
+ organisasjonsnummer tettstednummer tettstednavn valgkretsnummer valgkretsnavn
452
+ oppdateringsdato datauttaksdato adresse_id uuid_adresse uuid_bruksenhet atkomst_id
453
+ uuid_atkomst atkomst_nord atkomst_oest sommeratkomst_id uuid_sommeratkomst
454
+ sommeratkomst_nord sommeratkomst_oest vinteratkomst_id uuid_vinteratkomst
455
+ vinteratkomst_nord vinteratkomst_oest fylke landsdel
456
+ ]
457
+ ],
458
+ [
459
+ Types::SdfiAddress,
460
+ { "dataset" => ["sdfi"] },
461
+ %w[
462
+ id dataset country country_iso country_iso_2 address line_1 line_2 language latitude
463
+ longitude adresse_id kvhx kvh adgangsadresse status darstatus oprettet ændret
464
+ ikrafttrædelse nedlagt vejkode vejnavn adresseringsvejnavn husnr etage dør
465
+ supplerendebynavn_dagi_id supplerendebynavn postnr postnrnavn stormodtagerpostnr
466
+ stormodtagerpostnrnavn betegnelse adressepunktændringsdato etrs89koordinat_øst
467
+ etrs89koordinat_nord wgs84koordinat_bredde wgs84koordinat_længde højde nøjagtighed
468
+ kilde tekniskstandard tekstretning ddkn_m100 ddkn_km1 ddkn_km10 kommunekode
469
+ kommunenavn landsdelsnuts3 landsdelsnavn regionskode regionsnavn
470
+ afstemningsområdenummer afstemningsområdenavn menighedsrådsafstemningsområdenummer
471
+ menighedsrådsafstemningsområdenavn opstillingskredskode opstillingskredsnavn
472
+ storkredsnummer storkredsnavn valglandsdelsbogstav valglandsdelsnavn sognekode
473
+ sognenavn politikredskode politikredsnavn retskredskode retskredsnavn
474
+ jordstykke_ejerlavkode jordstykke_ejerlavnavn jordstykke_matrikelnr
475
+ jordstykke_esrejendomsnr ejerlavkode ejerlavnavn matrikelnr esrejendomsnr zone
476
+ brofast adgangsadresseid adgangspunktid navngivenvej_id adgangsadresse_status
477
+ adgangsadresse_darstatus adgangsadresse_oprettet adgangsadresse_ændret
478
+ adgangsadresse_ikrafttrædelse adgangsadresse_nedlagt vejpunkt_id vejpunkt_ændret
479
+ vejpunkt_kilde vejpunkt_nøjagtighed vejpunkt_tekniskstandard vejpunkt_x vejpunkt_y
480
+ ]
481
+ ],
482
+ [
483
+ Types::CannarAddress,
484
+ { "dataset" => ["cannar"] },
485
+ %w[
486
+ id dataset country country_iso country_iso_2 language address line_1 line_2 latitude
487
+ longitude loc_guid addr_guid apt_no_label civic_no civic_no_suffix
488
+ official_street_name official_street_type official_street_dir prov_code csd_eng_name
489
+ csd_fre_name csd_type_eng_code csd_type_fre_code mail_street_name mail_street_type
490
+ mail_street_dir mail_mun_name mail_prov_abvn mail_postal_code bg_dls_lsd bg_dls_qtr
491
+ bg_dls_sctn bg_dls_twnshp bg_dls_rng bg_dls_mrd bg_x bg_y bu_n_civic_add bu_use
492
+ csd_code fed_code fed_eng_name fed_fre_name er_code er_eng_name er_fre_name
493
+ reppoint_latitude reppoint_longitude
494
+ ]
495
+ ],
496
+ [
497
+ Types::FodbosaAddress,
498
+ { "dataset" => ["fodbosa"] },
499
+ %w[
500
+ id dataset country country_iso country_iso_2 language address line_1 latitude
501
+ longitude epsg_31370_x epsg_31370_y epsg_4326_lat epsg_4326_lon address_id
502
+ box_number house_number municipality_id municipality_name_de municipality_name_fr
503
+ municipality_name_nl postcode postname_fr postname_nl street_id streetname_de
504
+ streetname_fr streetname_nl region_code status
505
+ ]
506
+ ],
507
+ [
508
+ Types::MoisAddress,
509
+ { "dataset" => ["mois"] },
510
+ %w[
511
+ id dataset country country_iso country_iso_2 language address line_1 line_2 city
512
+ province 법정읍면동명 법정동코드 법정리명 비고1 비고2 변동전도로명주소 변경이력정보 변경이력사유 변경전_도로명주소 변경사유 변경사유코드
513
+ 층일련번호 층명칭 대표지번여부 대표여부 다량배달처명 동일련번호 동명칭 도로명 도로명_로마자 도로명번호 도로명코드 도로명코드_고시일자 도로명코드_말소일자
514
+ 읍면동구분 읍면동일련번호 읍면동코드 읍면동명 읍면동명_로마자 건축물대장_건물명 건물본번 건물부번 건물관리번호 기초구역번호 공동주택여부 고시일자 관리번호
515
+ 행정동코드 행정동명 호일련번호 호명칭 호접미사일련번호 호접미사명칭 이동사유코드 일련번호 지번일련번호 지번본번_번지 지번부번_호 지하구분 지하여부 산여부
516
+ 상위도로명 상위도로명번호 상세건물명 상세주소_부여여부 상세주소여부 사용여부 시도명 시도명_로마자 시군구_건물명 시군구코드 시군구명 시군구명_로마자
517
+ 시군구용_건물명 우편일련번호 우편번호 우편번호_일련번호 영문_법정리명 영문읍면동명 영문_법정읍면동명 영문도로명 영문시도명 영문시군구명
518
+ ]
519
+ ],
520
+ [
521
+ Types::UpujpAddress,
522
+ { "dataset" => ["upujp"] },
523
+ %w[
524
+ id dataset country country_iso country_iso_2 language script address line_1
525
+ building_name neighbourhood district city prefecture postcode latitude longitude
526
+ org_id org_type_ind org_sub_type_ind org_loc_id org_dis_id org_nei_id org_org_id
527
+ org_name org_name_trans org_loc_sfx org_loc_sfx_trans org_adr org_adr_trans
528
+ org_po_ind org_po_start org_po_end org_dsc org_dsc_trans org_pcode org_pcode_fin
529
+ org_script org_language str_id str_key str_loc_id str_dis_id str_nei_id str_org_id
530
+ str_pfx str_pfx_trans str_qlf_pre str_qlf_pre_trans str_qlf_suc str_qlf_suc_trans
531
+ str_name str_name_trans str_loc_sfx str_loc_sfx_trans str_type str_type_trans
532
+ str_type_abv str_type_abv_trans str_adr_num_key str_from_num str_from_unit
533
+ str_from_alph str_to_num str_to_unit str_to_alph str_evenodd str_dsc str_dsc_trans
534
+ str_blg_id str_blg_name str_blg_name_trans str_blg_type str_blg_type_trans
535
+ str_blg_dsc str_blg_dsc_trans str_ref_str_id str_pcode str_script str_language
536
+ sub_dis_id sub_dis_key sub_loc_id sub_loc_sfx sub_loc_sfx_trans sub_dis_name
537
+ sub_dis_name_trans sub_dis_sfx sub_dis_sfx_trans sub_dis_dsc sub_dis_dsc_trans
538
+ sub_dis_pcode sub_dis_pcode_fin sub_nei_id sub_nei_key sub_nei_name
539
+ sub_nei_name_trans sub_nei_sfx sub_nei_sfx_trans sub_nei_zone_from sub_nei_zone_to
540
+ sub_nei_dsc sub_nei_dsc_trans sub_nei_pcode sub_script sub_language loc_id loc_key
541
+ loc_adm1_id loc_adm1_key loc_adm1_name loc_adm1_name_trans loc_adm1_sfx
542
+ loc_adm1_sfx_trans loc_adm1_abv loc_adm1_abv_trans loc_adm2_id loc_adm2_key
543
+ loc_adm2_name loc_adm2_name_trans loc_adm2_sfx loc_adm2_sfx_trans loc_adm2_abv
544
+ loc_adm2_abv_trans loc_adm3_id loc_adm3_key loc_adm3_name loc_adm3_name_trans
545
+ loc_adm3_sfx loc_adm3_sfx_trans loc_adm3_abv loc_adm3_abv_trans loc_name
546
+ loc_name_trans loc_sfx loc_sfx_trans loc_pcode loc_pcode_fin loc_dsc loc_dsc_trans
547
+ loc_script loc_language
548
+ ]
549
+ ],
550
+ [
551
+ Types::BevAddress,
552
+ { "dataset" => ["bev"] },
553
+ %w[
554
+ id dataset country country_iso country_iso_2 language address line_1 line_2 latitude
555
+ longitude adrcd kgnr gkz okz plz skz zaehlsprengel hausnrtext hausnrzahl1
556
+ hausnrbuchstabe1 hausnrverbindung1 hausnrzahl2 hausnrbuchstabe2 hausnrbereich
557
+ hnr_adr_zusammen gnradresse hofname rw hw epsg quelladresse bestimmungsart subcd
558
+ objektnummer objfunktkennziffer hauptadresse hausnrverbindung2 hausnrzahl3
559
+ hausnrbuchstabe3 hausnrverbindung3 hausnrzahl4 hausnrbuchstabe4 hausnrgebaeudebez
560
+ hnr_geb_zusammen eigenschaft gemeindename ortsname strassenname strassennamenzusatz
561
+ szusadrbest zustellort zustellort_id zaehlsprengelname
562
+ ]
563
+ ],
564
+ [
565
+ Types::BanAddress,
566
+ { "dataset" => ["ban"] },
567
+ %w[
568
+ id dataset country country_iso country_iso_2 language address line_1 line_2 latitude
569
+ longitude id_fantoir numero rep nom_voie code_postal code_insee nom_commune
570
+ code_insee_ancienne_commune nom_ancienne_commune x y lon lat type_position alias
571
+ nom_ld libelle_acheminement nom_afnor source_position source_nom_voie
572
+ certification_commune cad_parcelles
573
+ ]
574
+ ],
575
+ [
576
+ Types::SwtAddress,
577
+ { "dataset" => ["swt"] },
578
+ %w[
579
+ id dataset country country_iso country_iso_2 language canton address line_1 line_2
580
+ latitude longitude adr_egaid str_esid bdg_egid adr_edid stn_label adr_number
581
+ bdg_category bdg_name zip_label com_fosnr com_name com_canton adr_status
582
+ adr_official adr_modified adr_easting adr_northing str_type str_status str_official
583
+ str_modified str_easting str_northing ortschaftsname plz4 zusatzziffer zip_id
584
+ gemeindename bfs_nr kantonskürzel sprache validity
585
+ ]
586
+ ]
587
+ ]
588
+ )
589
+ end
590
+ end
591
+ end
592
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # AddressResponseResult
8
+ class AddressResult < Model
9
+ # List of matching addresses
10
+ #
11
+ # @return [Array<Types::AddressListItem>]
12
+ def hits = read("hits") { |v| v.map { |item| Types::AddressListItem.from_hash(item) } }
13
+
14
+ # @return [Integer]
15
+ def total = @hash["total"]
16
+
17
+ # @return [Integer]
18
+ def limit = @hash["limit"]
19
+
20
+ # @return [Integer]
21
+ def page = @hash["page"]
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # Address Suggestion
8
+ #
9
+ # Represents an address suggestion for any address in the world
10
+ class AddressSuggestion < Model
11
+ # Globally unique internally generated identifier for an address
12
+ #
13
+ # @return [String]
14
+ def id = @hash["id"]
15
+
16
+ # Address Suggestion to be displayed to the user
17
+ #
18
+ # @return [String]
19
+ def suggestion = @hash["suggestion"]
20
+
21
+ # Always an empty object (`{}`). Retrieve the full address with `id`
22
+ #
23
+ # @return [Hash{String => Object}]
24
+ def urls = @hash["urls"]
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # Key
8
+ class ApiKey < Model
9
+ # A list of available contexts for a key
10
+ #
11
+ # @return [Array<Types::AvailableContext>]
12
+ def contexts
13
+ read("contexts") { |v| v.map { |item| Types::AvailableContext.from_hash(item) } }
14
+ end
15
+
16
+ # Returns current context if it is in the list of available contexts for this key.
17
+ #
18
+ # @return [String]
19
+ def context = @hash["context"]
20
+
21
+ # Determines whether the key can be used by the requesting agent.
22
+ #
23
+ # @return [Boolean]
24
+ def available = @hash["available"]
25
+ end
26
+ end
27
+ end