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,294 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated from the OpenAPI spec. Do not edit.
4
+
5
+ module IdealPostcodes
6
+ module Types
7
+ # USPS Address
8
+ #
9
+ # The USPS ZIP + 4 record backing a `usps` address.
10
+ # Carries the complete USPS field set for the delivery point, including elements the standard
11
+ # address format does not expose.
12
+ class UspsAddress < Model
13
+ # Globally unique internally generated identifier for an address
14
+ #
15
+ # @return [String]
16
+ def id = @hash["id"]
17
+
18
+ # Identifies the address as sourced from USPS
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
+ # A house, rural route, contract box, or Post Office Box number. The numeric or alphanumeric
44
+ # component of an address preceding the street name. Often referred to as house number.
45
+ #
46
+ # @return [String]
47
+ def primary_number = @hash["primary_number"]
48
+
49
+ # Number of the sub unit, apartment, suite etc
50
+ #
51
+ # @return [String]
52
+ def secondary_number = @hash["secondary_number"]
53
+
54
+ # 4 digit ZIP add-on code.
55
+ #
56
+ # @return [String]
57
+ def plus_4_code = @hash["plus_4_code"]
58
+
59
+ # The primary delivery line (usually the street address) of the address.
60
+ #
61
+ # @return [String]
62
+ def line_1 = @hash["line_1"]
63
+
64
+ # Secondary delivery line of the address. Typically populated if the first line is the firm or
65
+ # building name.
66
+ #
67
+ # @return [String]
68
+ def line_2 = @hash["line_2"]
69
+
70
+ # Last line of the address comprising of city, state, zip code and zip+4
71
+ #
72
+ # @return [String]
73
+ def last_line = @hash["last_line"]
74
+
75
+ # A 5-digit code that identifies a specific geographic delivery area. ZIP Codes can represent
76
+ # an area within a state, or a single building or company that has a very high mail volume.
77
+ #
78
+ # @return [String]
79
+ def zip_code = @hash["zip_code"]
80
+
81
+ # Nine-digit code that identifies a small geographic delivery area that is serviceable by a
82
+ # single carrier; appears in the last line of the address on a mail piece.
83
+ #
84
+ # @return [String]
85
+ def zip_plus_4_code = @hash["zip_plus_4_code"]
86
+
87
+ # Field that contains a number that uniquely identifies a record; used to identify the base
88
+ # record to which an add or delete transaction is being directed. The Update Key Number field
89
+ # is used only when applying transactions to the base file; it is not used in address matching
90
+ # and remains fixed for the life of the record. The field is alphanumeric and consists of the
91
+ # database segment code (V1, V2, W1, W2, X1, X2, Y1, Y2, Z1, or Z2) and eight characters
92
+ # containing an alphanumeric value ranging from 00000001 to AAAAAAAA.
93
+ #
94
+ # @return [String]
95
+ def update_key_number = @hash["update_key_number"]
96
+
97
+ # An alphabetic value that identifies the type of data in the record. - G = General delivery
98
+ # (5-Digit ZIP, ZIP + 4, and Carrier Route products) - H = High-rise (ZIP + 4 only) - F = Firm
99
+ # (ZIP + 4 only) - S = Street (5-Digit ZIP, ZIP + 4, and Carrier Route products) - P = PO Box
100
+ # (5-Digit ZIP, ZIP + 4, and Carrier Route products) - R = Rural route/contract (5-Digit ZIP,
101
+ # ZIP + 4, and Carrier Route products) - M = Multi-carrier (Carrier Route product only)
102
+ #
103
+ # @return [String]
104
+ def record_type_code = @hash["record_type_code"]
105
+
106
+ # A 4 character ID identifying the postal route for the address. The first character indicates
107
+ # the route type. Specifically: - "B" indicates PO Box - "H" indicates highway - "C" indicates
108
+ # city - "G" indicates general - "R" indicates rural
109
+ #
110
+ # @return [String]
111
+ def carrier_route_id = @hash["carrier_route_id"]
112
+
113
+ # A geographic direction that precedes the street name.
114
+ #
115
+ # @return [String]
116
+ def street_pre_directional_abbreviation = @hash["street_pre_directional_abbreviation"]
117
+
118
+ # The official name of a street as assigned by a local governing authority. The Street Name
119
+ # field contains only the street name and does not include directionals (EAST, WEST, etc.) or
120
+ # suffixes (ST, DR, BLVD, etc.). This element may also contain literals, such as PO BOX,
121
+ # GENERAL DELIVERY, USS, PSC, or UNIT.
122
+ #
123
+ # @return [String]
124
+ def street_name = @hash["street_name"]
125
+
126
+ # Code that is the standard USPS abbreviation for the trailing designator in a street address.
127
+ #
128
+ # @return [String]
129
+ def street_suffix_abbreviation = @hash["street_suffix_abbreviation"]
130
+
131
+ # A geographic direction that follows the street name.
132
+ #
133
+ # @return [String]
134
+ def street_post_directional_abbreviation = @hash["street_post_directional_abbreviation"]
135
+
136
+ # The name of a company, building, apartment complex, shopping center, or other distinguishing
137
+ # secondary address information. This field is normally used with firm and highrise records
138
+ # but may also contain literals such as “Postmaster” or “United States Postal Service.”
139
+ #
140
+ # @return [String]
141
+ def building_or_firm_name = @hash["building_or_firm_name"]
142
+
143
+ # A descriptive code used to identify the type of address secondary range information in the
144
+ # Address Secondary Range field. This code may be useful in address matching, e.g., the
145
+ # secondary address numbers may indicate apartment, suite, or trailer numbers.
146
+ #
147
+ # @return [String]
148
+ def address_secondary_abbreviation = @hash["address_secondary_abbreviation"]
149
+
150
+ # Code that specifies whether a record is a base (preferred) or alternate record. Base records
151
+ # (represented as "B") can represent a range of addresses or an individual address, such as a
152
+ # firm record, while alternate records (represented as "A") are individual delivery points.
153
+ # Base records are generally preferred over alternate records. Government deliveries will only
154
+ # be listed on alternate records with the appropriate government building indicator (federal,
155
+ # state, or city) set.
156
+ #
157
+ # @return [String]
158
+ def base_alternate_code = @hash["base_alternate_code"]
159
+
160
+ # The Locatable Address Conversion Service (LACS) indicator describes records that have been
161
+ # converted to the LACS system (a product/system in a different USPS® product line that allows
162
+ # mailers to identify and convert a rural route address to a city-style address). Rural route
163
+ # and some city addresses are being modified to city-style addresses so that emergency
164
+ # services (e.g., ambulances, police) can find these addresses more efficiently. - L = LACS
165
+ # address: The old (usually rural-route) address that has been converted for the LACS system.
166
+ # - Blank = Not applicable
167
+ #
168
+ # @return [String]
169
+ def lacs_status_indicator = @hash["lacs_status_indicator"]
170
+
171
+ # An alphabetic value that identifies the type of government agency at the delivery point
172
+ # and/or whether a firm is the only delivery at an address. For this purpose, "address" is
173
+ # defined as the complete delivery line (e.g., complete street address and, if included as
174
+ # part of the firm record, the secondary abbreviation and/or address secondary number). - A =
175
+ # City government building - alternates only - B = Federal government building - alternates
176
+ # only - C = State government building - alternates only - D = Firm only - base and alternates
177
+ # - E = City government building and firm only - alternates only - F = Federal government
178
+ # building and firm only - alternates only - G = State government building and firm only -
179
+ # alternates only
180
+ #
181
+ # @return [String]
182
+ def government_building_indicator = @hash["government_building_indicator"]
183
+
184
+ # A 2-character abbreviation for the name of a state, U.S. territory, or armed forces ZIP Code
185
+ # designation. If APO/FPO/DPO, then the state abbreviation will be “AA,” “AE,” or “AP.”
186
+ #
187
+ # @return [String]
188
+ def state_abbreviation = @hash["state_abbreviation"]
189
+
190
+ # Full name of a state, U.S. territory, or armed forces ZIP Code designation.
191
+ #
192
+ # @return [String]
193
+ def state = @hash["state"]
194
+
195
+ # Municipality City State Key. Currently blank.
196
+ #
197
+ # @return [String]
198
+ def municipality_city_state_key = @hash["municipality_city_state_key"]
199
+
200
+ # An index to the City State file that provides the urbanization name for this delivery range.
201
+ #
202
+ # @return [String]
203
+ def urbanization_city_state_key = @hash["urbanization_city_state_key"]
204
+
205
+ # In the Carrier Route, Five-Digit ZIP Code, Delivery Statistics, and ZIP + 4 products, an
206
+ # index to the City State product record that provides the preferred last-line name for this
207
+ # address range. In the City State product, the preferred last line city/state key contains
208
+ # the key value of a City State product record that has the default preferred or alternate
209
+ # preferred last-line key for a given ZIP Code.
210
+ #
211
+ # @return [String]
212
+ def preferred_last_line_city_state_key = @hash["preferred_last_line_city_state_key"]
213
+
214
+ # The name of the county or parish in which the 5-digit ZIP Code resides. If APO/FPO/DPO, then
215
+ # the county name will be blank.
216
+ #
217
+ # @return [String]
218
+ def county = @hash["county"]
219
+
220
+ # A valid city name for mailing purposes; appears in the last line of an address on a mail
221
+ # piece.
222
+ #
223
+ # @return [String]
224
+ def city = @hash["city"]
225
+
226
+ # A standard 13-character abbreviation for a city/state name. This field is only used for
227
+ # names that are greater than 13 characters in length and have a city/state mailing name
228
+ # indicator of "Y." If the field is longer than 13 characters and the city/state mailing name
229
+ # indicator is "N," the field will be blank.
230
+ #
231
+ # @return [String]
232
+ def city_abbreviation = @hash["city_abbreviation"]
233
+
234
+ # Field that contains the default preferred or alternate preferred last-line name for a ZIP
235
+ # Code.
236
+ #
237
+ # @return [String]
238
+ def preferred_city = @hash["preferred_city"]
239
+
240
+ # The type of locale identified in the city/state name. The facility may be a USPS facility,
241
+ # such as a post office, station, or branch, or it may be a non-postal place name. City/state
242
+ # name facility codes include the following: - B = Branch - C = Community post office (CPO) -
243
+ # N = Non-postal community name, former USPS facility, or place name - P = Post Office - S =
244
+ # Station - U = Urbanization
245
+ #
246
+ # @return [String]
247
+ def city_state_name_facility_code = @hash["city_state_name_facility_code"]
248
+
249
+ # A field that describes the type of ZIP area that a 5-digit ZIP Code serves, e.g., a single
250
+ # educational institution, post office boxes only, or a single address that has unusually high
251
+ # mail volume or many different addresses. - M = Military ZIP Code - P = ZIP Code having only
252
+ # Post Office Boxes - U = Unique ZIP Code (ZIP assigned to a single organization) - Blank =
253
+ # Standard ZIP with many addresses assigned to it
254
+ #
255
+ # @return [String]
256
+ def zip_classification_code = @hash["zip_classification_code"]
257
+
258
+ # Specifies whether or not the city state name can be used as a last line of address on a mail
259
+ # piece. - "Y = City/state name is a USPS-approved mailing name." - "N = City/state name is
260
+ # not approved for mailing purposes."
261
+ #
262
+ # @return [String]
263
+ def city_state_mailing_name_indicator = @hash["city_state_mailing_name_indicator"]
264
+
265
+ # Identifies where automation Carrier Route rates are available and where the commingling of
266
+ # automation and non-automation mail, including Enhanced Carrier Routes and 5-digit presort,
267
+ # on the same pallet or in the same container is allowed.
268
+ #
269
+ # @return [String]
270
+ def carrier_route_rate_sortation = @hash["carrier_route_rate_sortation"]
271
+
272
+ # A code assigned to Postal Service facilities (primarily Post Offices) to collect cost and
273
+ # statistical data and compile revenue and expense data.
274
+ #
275
+ # @return [String, Float]
276
+ def finance_number = @hash["finance_number"]
277
+
278
+ # A standard value identifying a geographic area within the United States served by a member
279
+ # of the U.S. House of Representatives. If Army/Air Force (APO), Fleet Post Office (FPO), or
280
+ # Diplomatic/Defense Post Office (DPO), this field will be blank. If there is only one member
281
+ # of Congress within a state, the code will be "AL" (at large).
282
+ #
283
+ # @return [String, Float]
284
+ def congressional_district_number = @hash["congressional_district_number"]
285
+
286
+ # The Federal Information Processing Standard (FIPS) code assigned to a given county or parish
287
+ # within a state. In Alaska, it identifies a region within the state. If APO/FPO/DPO, and the
288
+ # record type is “S,” “H,” or “F,” the county number will be blank.
289
+ #
290
+ # @return [String, Float]
291
+ def county_number = @hash["county_number"]
292
+ end
293
+ end
294
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module IdealPostcodes
4
+ VERSION = "3.0.0" # x-release-please-version
5
+ end
@@ -1,2 +1,14 @@
1
- # Allows to reference by ideal_postcodes
2
- require 'idealpostcodes'
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require "net/http"
5
+ require "openssl"
6
+ require "uri"
7
+
8
+ require_relative "ideal_postcodes/version"
9
+ require_relative "ideal_postcodes/errors"
10
+ require_relative "ideal_postcodes/transport"
11
+ require_relative "ideal_postcodes/generated"
12
+ require_relative "ideal_postcodes/operations"
13
+ require_relative "ideal_postcodes/base_client"
14
+ require_relative "ideal_postcodes/client"
@@ -0,0 +1,40 @@
1
+ module IdealPostcodes
2
+ class BaseClient
3
+ DEFAULT_BASE_URL: String
4
+
5
+ def initialize: (
6
+ api_key: String,
7
+ ?management_key: String?,
8
+ ?base_url: String,
9
+ ?timeout: Numeric,
10
+ ?user_agent: String?,
11
+ ?transport: _Transport?
12
+ ) -> void
13
+
14
+ def inspect: () -> String
15
+
16
+ private
17
+
18
+ def request: (
19
+ String method,
20
+ String template,
21
+ Symbol auth,
22
+ ?path: Hash[String, untyped],
23
+ ?query: Hash[String, untyped],
24
+ ?body: Hash[String, untyped]?,
25
+ ?response: singleton(Model)?
26
+ ) -> untyped
27
+
28
+ def request_headers: (Symbol auth, singleton(Model)? response) -> Hash[String, String]
29
+
30
+ def credential: (Symbol auth) -> String?
31
+
32
+ def url: (String template, Hash[String, untyped] path, Hash[String, untyped] query) -> String
33
+
34
+ def query_value: (untyped value) -> String
35
+
36
+ def escape: (untyped value) -> String
37
+
38
+ def decode: (Response result) -> Hash[String, untyped]
39
+ end
40
+ end
@@ -0,0 +1,35 @@
1
+ module IdealPostcodes
2
+ class Client < BaseClient
3
+ include Operations
4
+
5
+ class PostcodeLookup
6
+ attr_reader found: bool
7
+ attr_reader addresses: Array[Types::AddressListItem]
8
+ attr_reader suggestions: Array[String]
9
+ attr_reader total: Integer
10
+
11
+ def initialize: (
12
+ found: bool,
13
+ addresses: Array[Types::AddressListItem],
14
+ suggestions: Array[String],
15
+ total: Integer
16
+ ) -> void
17
+
18
+ def found?: () -> bool
19
+ end
20
+
21
+ def lookup: (
22
+ String postcode,
23
+ ?filter: (String | Array[String])?,
24
+ ?page: Integer?,
25
+ ?tags: (String | Array[String])?,
26
+ ?remove_organisation: String?,
27
+ ?dataset: Array[String]?,
28
+ ?context: String?
29
+ ) -> PostcodeLookup
30
+
31
+ private
32
+
33
+ def suggestions: (untyped body) -> Array[String]
34
+ end
35
+ end
@@ -0,0 +1,27 @@
1
+ module IdealPostcodes
2
+ class Error < StandardError
3
+ end
4
+
5
+ class ApiError < Error
6
+ attr_reader status: Integer
7
+ attr_reader code: Integer?
8
+ attr_reader body: Hash[String, untyped] | String
9
+
10
+ def self.from_response: (Response response) -> ApiError
11
+
12
+ def initialize: (Integer status, Hash[String, untyped] | String body) -> void
13
+ end
14
+
15
+ class TransportError < Error
16
+ end
17
+
18
+ class UnserializableResponseError < Error
19
+ attr_reader response: Response
20
+
21
+ def initialize: (Response response) -> void
22
+ end
23
+
24
+ class MissingManagementKeyError < Error
25
+ def initialize: (?String message) -> void
26
+ end
27
+ end
@@ -0,0 +1,37 @@
1
+ module IdealPostcodes
2
+ class Model
3
+ def self.from_hash: (Hash[String, untyped]? hash) -> instance?
4
+
5
+ def initialize: (Hash[String, untyped] hash) -> void
6
+
7
+ def to_h: () -> Hash[String, untyped]
8
+
9
+ def []: (String key) -> untyped
10
+
11
+ def ==: (untyped other) -> bool
12
+
13
+ alias eql? ==
14
+
15
+ def hash: () -> Integer
16
+
17
+ def inspect: () -> String
18
+
19
+ private
20
+
21
+ def read: [T] (String key) { (untyped) -> T } -> T?
22
+ end
23
+
24
+ module Union
25
+ type rule = [untyped, Hash[String, Array[untyped]], Array[String]]
26
+
27
+ def self.hydrate: (Hash[String, untyped] value, Array[rule] rules, ?untyped fallback) -> untyped
28
+
29
+ private
30
+
31
+ def self.matches?: (
32
+ Hash[String, untyped] value,
33
+ Hash[String, Array[untyped]] match,
34
+ Array[String] required
35
+ ) -> bool
36
+ end
37
+ end
@@ -0,0 +1,207 @@
1
+ # Generated from the OpenAPI spec. Do not edit.
2
+
3
+ module IdealPostcodes
4
+ # The client method every operation calls.
5
+ interface _Requester
6
+ def request: (
7
+ String method,
8
+ String path,
9
+ Symbol auth,
10
+ ?path: Hash[String, untyped],
11
+ ?query: Hash[String, untyped],
12
+ ?body: Hash[String, untyped],
13
+ ?response: singleton(Model)
14
+ ) -> untyped
15
+ end
16
+
17
+ module Operations : _Requester
18
+ def postcodes: (
19
+ String postcode,
20
+ ?filter: (String | Array[String])?,
21
+ ?page: Integer?,
22
+ ?tags: (String | Array[String])?,
23
+ ?remove_organisation: String?,
24
+ ?dataset: Array[String]?,
25
+ ?context: String?
26
+ ) -> Responses::PostcodeResponse
27
+
28
+ def key_availability: (String key) -> Responses::ApiKeyResponse
29
+
30
+ def key_details: (String key) -> Responses::ApiKeyDetailsResponse
31
+
32
+ def update_key_details: (
33
+ String key,
34
+ ?name: String?,
35
+ ?daily_limit: Hash[String, untyped]?,
36
+ ?monthly_limit: Hash[String, untyped]?,
37
+ ?individual_limit: Hash[String, untyped]?,
38
+ ?allowed_urls: Array[String]?,
39
+ ?redact_days: Integer?,
40
+ ?notifications: Hash[String, untyped]?,
41
+ ?ip_forwarding: bool?,
42
+ ?datasets: Hash[String, untyped]?
43
+ ) -> Responses::ApiKeyDetailsResponse
44
+
45
+ def key_usage: (
46
+ String key,
47
+ ?start: Integer?,
48
+ ?end: Integer?,
49
+ ?tags: (String | Array[String])?,
50
+ ?licensee: String?
51
+ ) -> Responses::ApiKeyUsageResponse
52
+
53
+ def key_logs: (String key, ?start: Integer?, ?end: Integer?, ?licensee: String?) -> String
54
+
55
+ def address_cleanse: (
56
+ query: String,
57
+ ?tags: (String | Array[String])?,
58
+ ?remove_organisation: String?,
59
+ ?context: String?,
60
+ ?postcode: String?,
61
+ ?post_town: String?,
62
+ ?county: String?
63
+ ) -> Responses::CleanseResponse
64
+
65
+ def find_address: (
66
+ ?query: String?,
67
+ ?dataset: Array[String]?,
68
+ ?context: String?,
69
+ ?limit: Integer?,
70
+ ?bias_lonlat: String?,
71
+ ?bias_ip: String?,
72
+ ?box: (String | Array[String])?,
73
+ ?postcode_outward: String?,
74
+ ?postcode: String?,
75
+ ?postcode_area: String?,
76
+ ?postcode_sector: String?,
77
+ ?post_town: String?,
78
+ ?uprn: Integer?,
79
+ ?country: String?,
80
+ ?postcode_type: String?,
81
+ ?su_organisation_indicator: String?,
82
+ ?bias_postcode_outward: String?,
83
+ ?bias_postcode: String?,
84
+ ?bias_postcode_area: String?,
85
+ ?bias_postcode_sector: String?,
86
+ ?bias_post_town: String?,
87
+ ?bias_thoroughfare: String?,
88
+ ?bias_country: String?,
89
+ ?postal_code: String?,
90
+ ?postal_code_2: String?,
91
+ ?postal_code_3: String?,
92
+ ?city: String?,
93
+ ?state: String?,
94
+ ?state_code: String?,
95
+ ?bias_postal_code: String?,
96
+ ?bias_postal_code_2: String?,
97
+ ?bias_postal_code_3: String?,
98
+ ?bias_city: String?,
99
+ ?bias_state: String?,
100
+ ?bias_state_code: String?,
101
+ ?is_pobox: String?,
102
+ ?is_business: String?
103
+ ) -> Responses::AutocompleteResponse
104
+
105
+ def resolve_address: (
106
+ String address,
107
+ ?tags: (String | Array[String])?,
108
+ ?remove_organisation: String?
109
+ ) -> Responses::GbrResolveAddressResponse
110
+
111
+ def addresses: (
112
+ ?query: String?,
113
+ ?limit: Integer?,
114
+ ?page: Integer?,
115
+ ?filter: (String | Array[String])?,
116
+ ?lon: Float?,
117
+ ?lat: Float?,
118
+ ?postcode_outward: String?,
119
+ ?postcode: String?,
120
+ ?postcode_area: String?,
121
+ ?postcode_sector: String?,
122
+ ?post_town: String?,
123
+ ?uprn: Integer?,
124
+ ?country: String?,
125
+ ?postcode_type: String?,
126
+ ?su_organisation_indicator: String?,
127
+ ?box: (String | Array[String])?,
128
+ ?bias_postcode_outward: String?,
129
+ ?bias_postcode: String?,
130
+ ?bias_postcode_area: String?,
131
+ ?bias_postcode_sector: String?,
132
+ ?bias_post_town: String?,
133
+ ?bias_thoroughfare: String?,
134
+ ?bias_country: String?,
135
+ ?bias_lonlat: String?,
136
+ ?tags: (String | Array[String])?,
137
+ ?remove_organisation: String?,
138
+ ?dataset: Array[String]?
139
+ ) -> Responses::AddressResponse
140
+
141
+ def find_place: (
142
+ ?query: String?,
143
+ ?country_iso: (String | Array[String])?,
144
+ ?bias_country_iso: (String | Array[String])?,
145
+ ?bias_lonlat: String?,
146
+ ?bias_ip: String?
147
+ ) -> Responses::PlaceResponse
148
+
149
+ def resolve_place: (
150
+ String place,
151
+ ?tags: (String | Array[String])?
152
+ ) -> Responses::ResolvePlaceResponse
153
+
154
+ def list_licensees: (
155
+ String key,
156
+ ?starting_after: String?,
157
+ ?limit: Integer?,
158
+ ?query: String?
159
+ ) -> Responses::LicenseesResponse
160
+
161
+ def create_licensee: (
162
+ String key,
163
+ ?name: String?,
164
+ ?address: String?,
165
+ ?postcode: String?,
166
+ ?whitelist: Array[String]?,
167
+ ?daily: Hash[String, untyped]?
168
+ ) -> Responses::LicenseeResponse
169
+
170
+ def retrieve_licensee: (String key, String licensee) -> Responses::LicenseeResponse
171
+
172
+ def delete_licensee: (String key, String licensee) -> Responses::DeleteLicenseeResponse
173
+
174
+ def update_licensee: (
175
+ String key,
176
+ String licensee,
177
+ ?name: String?,
178
+ ?address: String?,
179
+ ?postcode: String?,
180
+ ?whitelist: Array[String]?,
181
+ ?daily: Hash[String, untyped]?
182
+ ) -> Responses::LicenseeResponse
183
+
184
+ def regenerate_licensee_key: (String key, String licensee) -> Responses::LicenseeResponse
185
+
186
+ def list_configs: (String key) -> Responses::ConfigsResponse
187
+
188
+ def create_config: (String key, name: String, payload: String) -> Responses::ConfigResponse
189
+
190
+ def retrieve_config: (String key, String config) -> Responses::ConfigResponse
191
+
192
+ def delete_config: (String key, String config) -> Responses::DeleteConfigResponse
193
+
194
+ def update_config: (String key, String config, ?payload: String?) -> Responses::ConfigResponse
195
+
196
+ def email_validation: (
197
+ query: String,
198
+ ?tags: (String | Array[String])?
199
+ ) -> Responses::EmailResponse
200
+
201
+ def phone_number_validation: (
202
+ query: String,
203
+ ?current_carrier: String?,
204
+ ?tags: (String | Array[String])?
205
+ ) -> Responses::PhoneNumberResponse
206
+ end
207
+ end
@@ -0,0 +1,13 @@
1
+ # Generated from the OpenAPI spec. Do not edit.
2
+
3
+ module IdealPostcodes
4
+ module Responses
5
+ class AddressResponse < Model
6
+ # Known values: 2000
7
+ def code: () -> Integer
8
+ # Known values: "Success"
9
+ def message: () -> String
10
+ def result: () -> Types::AddressResult
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # Generated from the OpenAPI spec. Do not edit.
2
+
3
+ module IdealPostcodes
4
+ module Responses
5
+ class ApiKeyDetailsResponse < Model
6
+ def result: () -> Types::ApiKeyDetails
7
+ # Known values: 2000
8
+ def code: () -> Integer
9
+ # Known values: "Success"
10
+ def message: () -> String
11
+ end
12
+ end
13
+ end