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,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # API Key Automated Topup
8
+ #
9
+ # Automated topup status
10
+ class ApiKeyAutomatedTopup < Model
11
+ # Indicates whether automated top-ups are enabled
12
+ #
13
+ # @return [Boolean]
14
+ def enabled = @hash["enabled"]
15
+ end
16
+ end
17
+ 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
+ # API Key Batch Purchase
8
+ class ApiKeyCurrentPurchase < Model
9
+ # `string` or `null` The date when this purchase will expire in simplified extended ISO format
10
+ # (ISO 8601). This is typically 365 days from the time of first use. This field will be `null`
11
+ # if the purchase has not yet been used.
12
+ #
13
+ # @return [String, nil]
14
+ def expires = @hash["expires"]
15
+
16
+ # Number of procured lookups from this purchase.
17
+ #
18
+ # @return [Integer]
19
+ def purchased = @hash["purchased"]
20
+
21
+ # Number of consumed lookups off this purchase.
22
+ #
23
+ # @return [Integer]
24
+ def consumed = @hash["consumed"]
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # API Key Daily Limit
8
+ class ApiKeyDailyLimit < Model
9
+ # `number` or `null`. The daily lookup limit currently set on your key. `null` means the limit
10
+ # is currently disabled.
11
+ #
12
+ # @return [Integer, nil]
13
+ def limit = @hash["limit"]
14
+
15
+ # Number of lookups performed today which count towards your daily limit.
16
+ #
17
+ # @return [Integer]
18
+ def consumed = @hash["consumed"]
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,202 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # API Key Dataset Availability
8
+ #
9
+ # Indicates which datasets are available and added by default to the address responses
10
+ class ApiKeyDatasets < Model
11
+ # UK Main Address File (Postcode Address File)
12
+ #
13
+ # @return [Boolean]
14
+ def paf = @hash["paf"]
15
+
16
+ # UK Property Alias dataset
17
+ #
18
+ # @return [Boolean]
19
+ def pafa = @hash["pafa"]
20
+
21
+ # UK Welsh Language Dataset
22
+ #
23
+ # @return [Boolean]
24
+ def pafw = @hash["pafw"]
25
+
26
+ # UK Multiple Residence Dataset
27
+ #
28
+ # @return [Boolean]
29
+ def mr = @hash["mr"]
30
+
31
+ # UK Not Yet Built Dataset
32
+ #
33
+ # @return [Boolean]
34
+ def nyb = @hash["nyb"]
35
+
36
+ # UK AddressBase dataset
37
+ #
38
+ # @return [Boolean]
39
+ def ab = @hash["ab"]
40
+
41
+ # UK AddressBase Premium dataset
42
+ #
43
+ # @return [Boolean, nil]
44
+ def abp = @hash["abp"]
45
+
46
+ # Northern Ireland Pointer Dataset
47
+ #
48
+ # @return [Boolean]
49
+ def nip = @hash["nip"]
50
+
51
+ # US Address Dataset
52
+ #
53
+ # @return [Boolean]
54
+ def usps = @hash["usps"]
55
+
56
+ # Republic of Ireland: Eircode Address Database
57
+ #
58
+ # @return [Boolean]
59
+ def ecad = @hash["ecad"]
60
+
61
+ # Republic of Ireland: Eircode Address File
62
+ #
63
+ # @return [Boolean]
64
+ def ecaf = @hash["ecaf"]
65
+
66
+ # Australia: Geocoded National Address File
67
+ #
68
+ # @return [Boolean]
69
+ def gnaf = @hash["gnaf"]
70
+
71
+ # Asia Pacific Address File
72
+ #
73
+ # @return [Boolean]
74
+ def hereap = @hash["hereap"]
75
+
76
+ # Hong Kong Address File
77
+ #
78
+ # @return [Boolean]
79
+ def herehk = @hash["herehk"]
80
+
81
+ # India Address File
82
+ #
83
+ # @return [Boolean]
84
+ def herei = @hash["herei"]
85
+
86
+ # Macau Address File
87
+ #
88
+ # @return [Boolean]
89
+ def herem = @hash["herem"]
90
+
91
+ # Middle East and Africa Address File
92
+ #
93
+ # @return [Boolean]
94
+ def heremea = @hash["heremea"]
95
+
96
+ # Middle East and Africa Standalone Intermediate Maps Address File
97
+ #
98
+ # @return [Boolean]
99
+ def heremeas = @hash["heremeas"]
100
+
101
+ # North America Address File
102
+ #
103
+ # @return [Boolean]
104
+ def herena = @hash["herena"]
105
+
106
+ # Oceania Address File
107
+ #
108
+ # @return [Boolean]
109
+ def hereo = @hash["hereo"]
110
+
111
+ # South America Address File
112
+ #
113
+ # @return [Boolean]
114
+ def heresa = @hash["heresa"]
115
+
116
+ # Taiwan Address File
117
+ #
118
+ # @return [Boolean]
119
+ def heret = @hash["heret"]
120
+
121
+ # Eastern Europe Address File
122
+ #
123
+ # @return [Boolean]
124
+ def hereee = @hash["hereee"]
125
+
126
+ # Western Europe Address File
127
+ #
128
+ # @return [Boolean]
129
+ def herewe = @hash["herewe"]
130
+
131
+ # Phone validation is enabled
132
+ #
133
+ # @return [Boolean]
134
+ def phone = @hash["phone"]
135
+
136
+ # Email validation is enabled
137
+ #
138
+ # @return [Boolean]
139
+ def email = @hash["email"]
140
+
141
+ # Netherlands: Kadaster BAG 2.0 Address File
142
+ #
143
+ # @return [Boolean]
144
+ def kadaster = @hash["kadaster"]
145
+
146
+ # Norway: Kartverket Address File
147
+ #
148
+ # @return [Boolean]
149
+ def kartverket = @hash["kartverket"]
150
+
151
+ # South Korea: MOIS Address File
152
+ #
153
+ # @return [Boolean]
154
+ def mois = @hash["mois"]
155
+
156
+ # Denmark: Danmarks Adresseregister (DAR)
157
+ #
158
+ # @return [Boolean]
159
+ def sdfi = @hash["sdfi"]
160
+
161
+ # Canada: Statistics Canada National Address Register
162
+ #
163
+ # @return [Boolean]
164
+ def cannar = @hash["cannar"]
165
+
166
+ # Belgium: FOD BOSA Address File
167
+ #
168
+ # @return [Boolean]
169
+ def fodbosa = @hash["fodbosa"]
170
+
171
+ # Japan: UPU Address File
172
+ #
173
+ # @return [Boolean]
174
+ def upujp = @hash["upujp"]
175
+
176
+ # Austria: BEV Address File
177
+ #
178
+ # @return [Boolean]
179
+ def bev = @hash["bev"]
180
+
181
+ # France: BAN (Base Adresse Nationale)
182
+ #
183
+ # @return [Boolean]
184
+ def ban = @hash["ban"]
185
+
186
+ # Switzerland and Liechtenstein: Swisstopo Address File
187
+ #
188
+ # @return [Boolean]
189
+ def swt = @hash["swt"]
190
+
191
+ # UK GBR Cleanse
192
+ #
193
+ # @return [Boolean]
194
+ def gbrcleanse = @hash["gbrcleanse"]
195
+
196
+ # US CASS Cleanse
197
+ #
198
+ # @return [Boolean]
199
+ def uspscleanse = @hash["uspscleanse"]
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # API Key Details
8
+ class ApiKeyDetails < Model
9
+ # A name for the key
10
+ #
11
+ # @return [String]
12
+ def name = @hash["name"]
13
+
14
+ # A list of available contexts for a key
15
+ #
16
+ # @return [Array<Types::AvailableContext>]
17
+ def contexts
18
+ read("contexts") { |v| v.map { |item| Types::AvailableContext.from_hash(item) } }
19
+ end
20
+
21
+ # @return [Integer]
22
+ def lookups_remaining = @hash["lookups_remaining"]
23
+
24
+ # API Key Daily Limit
25
+ #
26
+ # @return [Types::ApiKeyDailyLimit]
27
+ def daily_limit = read("daily_limit") { |v| Types::ApiKeyDailyLimit.from_hash(v) }
28
+
29
+ # API Key Monthly Limit
30
+ #
31
+ # @return [Types::ApiKeyMonthlyLimit]
32
+ def monthly_limit = read("monthly_limit") { |v| Types::ApiKeyMonthlyLimit.from_hash(v) }
33
+
34
+ # API Key Individual Limit
35
+ #
36
+ # @return [Types::ApiKeyIndividualLimit]
37
+ def individual_limit
38
+ read("individual_limit") { |v| Types::ApiKeyIndividualLimit.from_hash(v) }
39
+ end
40
+
41
+ # A list of allowed URLs. An empty list disables the check.
42
+ #
43
+ # @return [Array<String>]
44
+ def allowed_urls = @hash["allowed_urls"]
45
+
46
+ # Number of days to preserve personal data stored in your key usage history. Set to 0 to
47
+ # prevent personal data storage
48
+ #
49
+ # @return [Integer]
50
+ def redact_days = @hash["redact_days"]
51
+
52
+ # API Key Notifications
53
+ #
54
+ # @return [Types::ApiKeyNotifications]
55
+ def notifications = read("notifications") { |v| Types::ApiKeyNotifications.from_hash(v) }
56
+
57
+ # Indicates which datasets are available and added by default to the address responses
58
+ #
59
+ # @return [Types::ApiKeyDatasets]
60
+ def datasets = read("datasets") { |v| Types::ApiKeyDatasets.from_hash(v) }
61
+
62
+ # Automated topup status
63
+ #
64
+ # @return [Types::ApiKeyAutomatedTopup]
65
+ def automated_topups
66
+ read("automated_topups") { |v| Types::ApiKeyAutomatedTopup.from_hash(v) }
67
+ end
68
+
69
+ # Current balance purchases attached to key.
70
+ #
71
+ # @return [Array<Types::ApiKeyCurrentPurchase>]
72
+ def current_purchases
73
+ read("current_purchases") do |v|
74
+ v.map { |item| Types::ApiKeyCurrentPurchase.from_hash(item) }
75
+ end
76
+ end
77
+
78
+ # Accept IP addresses forwarded in the `IDPC-Source-IP` header
79
+ #
80
+ # @return [Boolean]
81
+ def ip_forwarding = @hash["ip_forwarding"]
82
+
83
+ # Whether the key is enrolled in the premier support programme and monitored closely by our
84
+ # devops team. Read-only; managed by our team.
85
+ #
86
+ # @return [Boolean]
87
+ def premier_support = @hash["premier_support"]
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # API Key Individual Limit
8
+ class ApiKeyIndividualLimit < Model
9
+ # `number` or `null` Limit set on the number of lookups that can be performed from a single IP
10
+ # address. `null` means the limit is currently disabled.
11
+ #
12
+ # @return [Integer, nil]
13
+ def limit = @hash["limit"]
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # API Key Monthly Limit
8
+ class ApiKeyMonthlyLimit < Model
9
+ # `number` or `null`. The monthly lookup limit currently set on your key. `null` means the
10
+ # limit is currently disabled.
11
+ #
12
+ # @return [Integer, nil]
13
+ def limit = @hash["limit"]
14
+
15
+ # Number of lookups performed this month which count towards your monthly limit.
16
+ #
17
+ # @return [Integer]
18
+ def consumed = @hash["consumed"]
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # API Key Notifications
8
+ class ApiKeyNotifications < Model
9
+ # A list of email addresses designated by you to receive notifications about this key.
10
+ #
11
+ # @return [Array<String>]
12
+ def emails = @hash["emails"]
13
+
14
+ # Indicates whether email notifications are enabled.
15
+ #
16
+ # @return [Boolean]
17
+ def enabled = @hash["enabled"]
18
+
19
+ # Balance threshold that triggers a reminder email. null means disabled.
20
+ #
21
+ # @return [Integer, nil]
22
+ def balance_threshold = @hash["balance_threshold"]
23
+
24
+ # Send notice when balance hits zero.
25
+ #
26
+ # @return [Boolean]
27
+ def no_balance = @hash["no_balance"]
28
+
29
+ # Send notice when rate limit is reached.
30
+ #
31
+ # @return [Boolean]
32
+ def limit_reached = @hash["limit_reached"]
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # AutocompleteResponseResult
8
+ class AutocompleteResult < Model
9
+ # @return [Array<Types::AddressSuggestion, Types::UkAddressSuggestion>]
10
+ def hits = read("hits") { |v| v.map { |item| hydrate_hit(item) } }
11
+
12
+ private
13
+
14
+ def hydrate_hit(value)
15
+ Union.hydrate(
16
+ value,
17
+ [
18
+ [Types::UkAddressSuggestion, {}, %w[id suggestion udprn urls]]
19
+ ],
20
+ Types::AddressSuggestion
21
+ )
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # AvailableContext
8
+ class AvailableContext < Model
9
+ # 3 letter ISO code
10
+ #
11
+ # @return [String]
12
+ def iso_3 = @hash["iso_3"]
13
+
14
+ # 2 letter ISO code
15
+ #
16
+ # @return [String]
17
+ def iso_2 = @hash["iso_2"]
18
+
19
+ # Country descriptor to show in Address Finder
20
+ #
21
+ # @return [String]
22
+ def description = @hash["description"]
23
+
24
+ # Emoji text icon
25
+ #
26
+ # @return [String]
27
+ def emoji = @hash["emoji"]
28
+
29
+ # Indicates availability of reverse geolocation search
30
+ #
31
+ # @return [Boolean]
32
+ def rgeo = @hash["rgeo"]
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,179 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # France BAN Address
8
+ #
9
+ # Address from France's Base Adresse Nationale (BAN), the official open national
10
+ # address database published via Etalab.
11
+ #
12
+ # BAN reaches house-number level only (`numero` + street + commune) - it carries
13
+ # no sub-premise (unit, floor, building) data.
14
+ class BanAddress < Model
15
+ # Globally unique internally generated identifier for an address
16
+ #
17
+ # @return [String]
18
+ def id = @hash["id"]
19
+
20
+ # @return [String]
21
+ def dataset = @hash["dataset"]
22
+
23
+ # Full country names (ISO 3166)
24
+ #
25
+ # @return [String]
26
+ def country = @hash["country"]
27
+
28
+ # 3 letter country code (ISO 3166-1)
29
+ #
30
+ # @return [String]
31
+ def country_iso = @hash["country_iso"]
32
+
33
+ # 2 letter country code (ISO 3166-1)
34
+ #
35
+ # @return [String]
36
+ def country_iso_2 = @hash["country_iso_2"]
37
+
38
+ # Language represented by 2 letter ISO Code (639-1)
39
+ #
40
+ # @return [String]
41
+ def language = @hash["language"]
42
+
43
+ # The house number of the address (`numero`), without any suffix.
44
+ #
45
+ # @return [String]
46
+ def address = @hash["address"]
47
+
48
+ # First address line (house number, suffix, and street name).
49
+ #
50
+ # @return [String, nil]
51
+ def line_1 = @hash["line_1"]
52
+
53
+ # Second address line (postcode and municipality name).
54
+ #
55
+ # @return [String, nil]
56
+ def line_2 = @hash["line_2"]
57
+
58
+ # The latitude of the address or postcode (WGS84).
59
+ #
60
+ # @return [String, Float]
61
+ def latitude = @hash["latitude"]
62
+
63
+ # The longitude of the address or postcode (WGS84).
64
+ #
65
+ # @return [String, Float]
66
+ def longitude = @hash["longitude"]
67
+
68
+ # FANTOIR street identifier
69
+ #
70
+ # @return [String, nil]
71
+ def id_fantoir = @hash["id_fantoir"]
72
+
73
+ # House number
74
+ #
75
+ # @return [Integer, nil]
76
+ def numero = @hash["numero"]
77
+
78
+ # House number suffix / répétition (`bis`, `ter`, `quater`, etc.)
79
+ #
80
+ # @return [String, nil]
81
+ def rep = @hash["rep"]
82
+
83
+ # Street name
84
+ #
85
+ # @return [String]
86
+ def nom_voie = @hash["nom_voie"]
87
+
88
+ # 5-digit postal code
89
+ #
90
+ # @return [String, nil]
91
+ def code_postal = @hash["code_postal"]
92
+
93
+ # INSEE commune code (2-digit département + 3-digit commune)
94
+ #
95
+ # @return [String]
96
+ def code_insee = @hash["code_insee"]
97
+
98
+ # Municipality name
99
+ #
100
+ # @return [String]
101
+ def nom_commune = @hash["nom_commune"]
102
+
103
+ # INSEE code of the pre-fusion commune (for merged municipalities)
104
+ #
105
+ # @return [String, nil]
106
+ def code_insee_ancienne_commune = @hash["code_insee_ancienne_commune"]
107
+
108
+ # Name of the pre-fusion commune (for merged municipalities)
109
+ #
110
+ # @return [String, nil]
111
+ def nom_ancienne_commune = @hash["nom_ancienne_commune"]
112
+
113
+ # Lambert 93 easting coordinate
114
+ #
115
+ # @return [String, nil]
116
+ def x = @hash["x"]
117
+
118
+ # Lambert 93 northing coordinate
119
+ #
120
+ # @return [String, nil]
121
+ def y = @hash["y"]
122
+
123
+ # Longitude (WGS84) as returned from source data
124
+ #
125
+ # @return [String, nil]
126
+ def lon = @hash["lon"]
127
+
128
+ # Latitude (WGS84) as returned from source data
129
+ #
130
+ # @return [String, nil]
131
+ def lat = @hash["lat"]
132
+
133
+ # Positional accuracy type (`entrée`, `bâtiment`, `parcelle`, `délivrance postale`, etc.)
134
+ #
135
+ # @return [String, nil]
136
+ def type_position = @hash["type_position"]
137
+
138
+ # Address alias
139
+ #
140
+ # @return [String, nil]
141
+ def alias = @hash["alias"]
142
+
143
+ # Lieu-dit (named place) label
144
+ #
145
+ # @return [String, nil]
146
+ def nom_ld = @hash["nom_ld"]
147
+
148
+ # Postal routing label
149
+ #
150
+ # @return [String, nil]
151
+ def libelle_acheminement = @hash["libelle_acheminement"]
152
+
153
+ # AFNOR-normalised street name
154
+ #
155
+ # @return [String, nil]
156
+ def nom_afnor = @hash["nom_afnor"]
157
+
158
+ # Source of position data (`commune`, `IGN`, etc.)
159
+ #
160
+ # @return [String, nil]
161
+ def source_position = @hash["source_position"]
162
+
163
+ # Source of street name data
164
+ #
165
+ # @return [String, nil]
166
+ def source_nom_voie = @hash["source_nom_voie"]
167
+
168
+ # Whether the municipality has certified this address
169
+ #
170
+ # @return [Boolean, nil]
171
+ def certification_commune = @hash["certification_commune"]
172
+
173
+ # Cadastral parcel reference(s)
174
+ #
175
+ # @return [String, nil]
176
+ def cad_parcelles = @hash["cad_parcelles"]
177
+ end
178
+ end
179
+ end