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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +3 -16
- data/LICENSE +1 -21
- data/README.md +13 -332
- data/lib/ideal_postcodes/base_client.rb +88 -0
- data/lib/ideal_postcodes/client.rb +42 -0
- data/lib/ideal_postcodes/errors.rb +59 -0
- data/lib/ideal_postcodes/generated.rb +83 -0
- data/lib/ideal_postcodes/model.rb +73 -0
- data/lib/ideal_postcodes/operations.rb +866 -0
- data/lib/ideal_postcodes/responses/address_response.rb +19 -0
- data/lib/ideal_postcodes/responses/api_key_details_response.rb +21 -0
- data/lib/ideal_postcodes/responses/api_key_response.rb +21 -0
- data/lib/ideal_postcodes/responses/api_key_usage_response.rb +21 -0
- data/lib/ideal_postcodes/responses/autocomplete_response.rb +19 -0
- data/lib/ideal_postcodes/responses/cleanse_response.rb +31 -0
- data/lib/ideal_postcodes/responses/config_response.rb +21 -0
- data/lib/ideal_postcodes/responses/configs_response.rb +21 -0
- data/lib/ideal_postcodes/responses/delete_config_response.rb +19 -0
- data/lib/ideal_postcodes/responses/delete_licensee_response.rb +19 -0
- data/lib/ideal_postcodes/responses/email_response.rb +31 -0
- data/lib/ideal_postcodes/responses/gbr_resolve_address_response.rb +21 -0
- data/lib/ideal_postcodes/responses/licensee_response.rb +21 -0
- data/lib/ideal_postcodes/responses/licensees_response.rb +21 -0
- data/lib/ideal_postcodes/responses/phone_number_response.rb +31 -0
- data/lib/ideal_postcodes/responses/place_response.rb +19 -0
- data/lib/ideal_postcodes/responses/postcode_response.rb +30 -0
- data/lib/ideal_postcodes/responses/resolve_place_response.rb +24 -0
- data/lib/ideal_postcodes/transport.rb +61 -0
- data/lib/ideal_postcodes/types/ab_address.rb +283 -0
- data/lib/ideal_postcodes/types/abp_address.rb +674 -0
- data/lib/ideal_postcodes/types/address.rb +290 -0
- data/lib/ideal_postcodes/types/address_list_item.rb +592 -0
- data/lib/ideal_postcodes/types/address_result.rb +24 -0
- data/lib/ideal_postcodes/types/address_suggestion.rb +27 -0
- data/lib/ideal_postcodes/types/api_key.rb +27 -0
- data/lib/ideal_postcodes/types/api_key_automated_topup.rb +17 -0
- data/lib/ideal_postcodes/types/api_key_current_purchase.rb +27 -0
- data/lib/ideal_postcodes/types/api_key_daily_limit.rb +21 -0
- data/lib/ideal_postcodes/types/api_key_datasets.rb +202 -0
- data/lib/ideal_postcodes/types/api_key_details.rb +90 -0
- data/lib/ideal_postcodes/types/api_key_individual_limit.rb +16 -0
- data/lib/ideal_postcodes/types/api_key_monthly_limit.rb +21 -0
- data/lib/ideal_postcodes/types/api_key_notifications.rb +35 -0
- data/lib/ideal_postcodes/types/autocomplete_result.rb +25 -0
- data/lib/ideal_postcodes/types/available_context.rb +35 -0
- data/lib/ideal_postcodes/types/ban_address.rb +179 -0
- data/lib/ideal_postcodes/types/bev_address.rb +288 -0
- data/lib/ideal_postcodes/types/cannar_address.rb +297 -0
- data/lib/ideal_postcodes/types/carrier.rb +31 -0
- data/lib/ideal_postcodes/types/config.rb +34 -0
- data/lib/ideal_postcodes/types/configs_result.rb +15 -0
- data/lib/ideal_postcodes/types/deleted_config.rb +13 -0
- data/lib/ideal_postcodes/types/deleted_licensee.rb +13 -0
- data/lib/ideal_postcodes/types/ecad_address.rb +393 -0
- data/lib/ideal_postcodes/types/ecaf_address.rb +204 -0
- data/lib/ideal_postcodes/types/email.rb +45 -0
- data/lib/ideal_postcodes/types/fodbosa_address.rb +201 -0
- data/lib/ideal_postcodes/types/gbr_cleanse_match.rb +70 -0
- data/lib/ideal_postcodes/types/gbr_cleanse_no_match.rb +47 -0
- data/lib/ideal_postcodes/types/geonames_place.rb +153 -0
- data/lib/ideal_postcodes/types/gnaf_address.rb +463 -0
- data/lib/ideal_postcodes/types/here_address.rb +174 -0
- data/lib/ideal_postcodes/types/invalid_phone_number.rb +50 -0
- data/lib/ideal_postcodes/types/kadaster_address.rb +480 -0
- data/lib/ideal_postcodes/types/kartverket_address.rb +342 -0
- data/lib/ideal_postcodes/types/key_usage_day.rb +16 -0
- data/lib/ideal_postcodes/types/key_usage_result.rb +36 -0
- data/lib/ideal_postcodes/types/licensee.rb +50 -0
- data/lib/ideal_postcodes/types/licensee_daily_usage.rb +29 -0
- data/lib/ideal_postcodes/types/licensees_result.rb +23 -0
- data/lib/ideal_postcodes/types/mois_address.rb +440 -0
- data/lib/ideal_postcodes/types/mr_address.rb +99 -0
- data/lib/ideal_postcodes/types/native_record.rb +368 -0
- data/lib/ideal_postcodes/types/nyb_address.rb +99 -0
- data/lib/ideal_postcodes/types/paf_address.rb +96 -0
- data/lib/ideal_postcodes/types/pafa_address.rb +104 -0
- data/lib/ideal_postcodes/types/pafw_address.rb +99 -0
- data/lib/ideal_postcodes/types/phone_number.rb +50 -0
- data/lib/ideal_postcodes/types/place.rb +79 -0
- data/lib/ideal_postcodes/types/place_result.rb +21 -0
- data/lib/ideal_postcodes/types/place_suggestion.rb +32 -0
- data/lib/ideal_postcodes/types/sdfi_address.rb +520 -0
- data/lib/ideal_postcodes/types/swt_address.rb +247 -0
- data/lib/ideal_postcodes/types/uk_address_suggestion.rb +45 -0
- data/lib/ideal_postcodes/types/uk_address_suggestion_urls.rb +21 -0
- data/lib/ideal_postcodes/types/unknown_email.rb +43 -0
- data/lib/ideal_postcodes/types/upujp_address.rb +763 -0
- data/lib/ideal_postcodes/types/usps_address.rb +294 -0
- data/lib/ideal_postcodes/version.rb +5 -0
- data/lib/ideal_postcodes.rb +14 -2
- data/sig/ideal_postcodes/base_client.rbs +40 -0
- data/sig/ideal_postcodes/client.rbs +35 -0
- data/sig/ideal_postcodes/errors.rbs +27 -0
- data/sig/ideal_postcodes/model.rbs +37 -0
- data/sig/ideal_postcodes/operations.rbs +207 -0
- data/sig/ideal_postcodes/responses/address_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/api_key_details_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/api_key_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/api_key_usage_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/autocomplete_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/cleanse_response.rbs +19 -0
- data/sig/ideal_postcodes/responses/config_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/configs_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/delete_config_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/delete_licensee_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/email_response.rbs +19 -0
- data/sig/ideal_postcodes/responses/gbr_resolve_address_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/licensee_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/licensees_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/phone_number_response.rbs +19 -0
- data/sig/ideal_postcodes/responses/place_response.rbs +13 -0
- data/sig/ideal_postcodes/responses/postcode_response.rbs +16 -0
- data/sig/ideal_postcodes/responses/resolve_place_response.rbs +13 -0
- data/sig/ideal_postcodes/transport.rbs +39 -0
- data/sig/ideal_postcodes/types/ab_address.rbs +57 -0
- data/sig/ideal_postcodes/types/abp_address.rbs +126 -0
- data/sig/ideal_postcodes/types/address.rbs +136 -0
- data/sig/ideal_postcodes/types/address_list_item.rbs +160 -0
- data/sig/ideal_postcodes/types/address_result.rbs +12 -0
- data/sig/ideal_postcodes/types/address_suggestion.rbs +11 -0
- data/sig/ideal_postcodes/types/api_key.rbs +11 -0
- data/sig/ideal_postcodes/types/api_key_automated_topup.rbs +9 -0
- data/sig/ideal_postcodes/types/api_key_current_purchase.rbs +11 -0
- data/sig/ideal_postcodes/types/api_key_daily_limit.rbs +10 -0
- data/sig/ideal_postcodes/types/api_key_datasets.rbs +46 -0
- data/sig/ideal_postcodes/types/api_key_details.rbs +22 -0
- data/sig/ideal_postcodes/types/api_key_individual_limit.rbs +9 -0
- data/sig/ideal_postcodes/types/api_key_monthly_limit.rbs +10 -0
- data/sig/ideal_postcodes/types/api_key_notifications.rbs +13 -0
- data/sig/ideal_postcodes/types/autocomplete_result.rbs +15 -0
- data/sig/ideal_postcodes/types/available_context.rbs +13 -0
- data/sig/ideal_postcodes/types/ban_address.rbs +46 -0
- data/sig/ideal_postcodes/types/bev_address.rbs +67 -0
- data/sig/ideal_postcodes/types/cannar_address.rbs +62 -0
- data/sig/ideal_postcodes/types/carrier.rbs +14 -0
- data/sig/ideal_postcodes/types/config.rbs +14 -0
- data/sig/ideal_postcodes/types/configs_result.rbs +9 -0
- data/sig/ideal_postcodes/types/deleted_config.rbs +9 -0
- data/sig/ideal_postcodes/types/deleted_licensee.rbs +9 -0
- data/sig/ideal_postcodes/types/ecad_address.rbs +84 -0
- data/sig/ideal_postcodes/types/ecaf_address.rbs +45 -0
- data/sig/ideal_postcodes/types/email.rbs +16 -0
- data/sig/ideal_postcodes/types/fodbosa_address.rbs +43 -0
- data/sig/ideal_postcodes/types/gbr_cleanse_match.rbs +25 -0
- data/sig/ideal_postcodes/types/gbr_cleanse_no_match.rbs +28 -0
- data/sig/ideal_postcodes/types/geonames_place.rbs +42 -0
- data/sig/ideal_postcodes/types/gnaf_address.rbs +104 -0
- data/sig/ideal_postcodes/types/here_address.rbs +37 -0
- data/sig/ideal_postcodes/types/invalid_phone_number.rbs +17 -0
- data/sig/ideal_postcodes/types/kadaster_address.rbs +98 -0
- data/sig/ideal_postcodes/types/kartverket_address.rbs +78 -0
- data/sig/ideal_postcodes/types/key_usage_day.rbs +10 -0
- data/sig/ideal_postcodes/types/key_usage_result.rbs +13 -0
- data/sig/ideal_postcodes/types/licensee.rbs +17 -0
- data/sig/ideal_postcodes/types/licensee_daily_usage.rbs +12 -0
- data/sig/ideal_postcodes/types/licensees_result.rbs +11 -0
- data/sig/ideal_postcodes/types/mois_address.rbs +97 -0
- data/sig/ideal_postcodes/types/mr_address.rbs +27 -0
- data/sig/ideal_postcodes/types/native_record.rbs +34 -0
- data/sig/ideal_postcodes/types/nyb_address.rbs +27 -0
- data/sig/ideal_postcodes/types/paf_address.rbs +27 -0
- data/sig/ideal_postcodes/types/pafa_address.rbs +27 -0
- data/sig/ideal_postcodes/types/pafw_address.rbs +27 -0
- data/sig/ideal_postcodes/types/phone_number.rbs +17 -0
- data/sig/ideal_postcodes/types/place.rbs +29 -0
- data/sig/ideal_postcodes/types/place_result.rbs +15 -0
- data/sig/ideal_postcodes/types/place_suggestion.rbs +12 -0
- data/sig/ideal_postcodes/types/sdfi_address.rbs +108 -0
- data/sig/ideal_postcodes/types/swt_address.rbs +57 -0
- data/sig/ideal_postcodes/types/uk_address_suggestion.rbs +13 -0
- data/sig/ideal_postcodes/types/uk_address_suggestion_urls.rbs +10 -0
- data/sig/ideal_postcodes/types/unknown_email.rbs +16 -0
- data/sig/ideal_postcodes/types/upujp_address.rbs +156 -0
- data/sig/ideal_postcodes/types/usps_address.rbs +63 -0
- metadata +186 -175
- data/.travis.yml +0 -9
- data/Gemfile +0 -2
- data/Rakefile +0 -15
- data/ideal-postcodes-ruby.gemspec +0 -25
- data/lib/idealpostcodes/address.rb +0 -31
- data/lib/idealpostcodes/errors.rb +0 -33
- data/lib/idealpostcodes/key.rb +0 -13
- data/lib/idealpostcodes/postcode.rb +0 -22
- data/lib/idealpostcodes/util.rb +0 -29
- data/lib/idealpostcodes/version.rb +0 -3
- data/lib/idealpostcodes.rb +0 -112
- data/spec/addresses_spec.rb +0 -68
- data/spec/idealpostcodes_spec.rb +0 -56
- data/spec/keys_spec.rb +0 -25
- data/spec/postcodes_spec.rb +0 -66
- data/spec/spec_helper.rb +0 -68
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_invalid_key.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_limit_breached.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_raises_an_exception_if_no_lookups_remaining.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_returns_an_address_for_a_valid_UDPRN.yml +0 -74
- data/spec/vcr_cassettes/IdealPostcodes_Address_lookup_returns_nil_for_an_invalid_UDPRN.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_is_sensitive_to_limit.yml +0 -81
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_is_sensitive_to_page.yml +0 -369
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_invalid_key.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_limit_breached.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_raises_an_exception_if_no_lookups_remaining.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Address_search_returns_results_in_a_SearchResult_object.yml +0 -273
- data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_details_returns_key_details.yml +0 -62
- data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_returns_the_availability_status_of_a_key_false_key_.yml +0 -45
- data/spec/vcr_cassettes/IdealPostcodes_Key_lookup_returns_the_availability_status_of_a_key_true_key_.yml +0 -45
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_is_sensitive_to_limit_parameter.yml +0 -52
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_is_sensitive_to_radius_parament.yml +0 -133
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_returns_an_array_of_postcodes_and_locations.yml +0 -84
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_find_by_location_returns_an_empty_array_if_no_results_are_found.yml +0 -43
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_invalid_key.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_key_has_run_out_of_balance.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_raises_an_exception_if_limit_has_been_reached.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_returns_a_list_of_addresses_for_a_postcode.yml +0 -268
- data/spec/vcr_cassettes/IdealPostcodes_Postcode_lookup_returns_an_empty_array_if_postcode_does_not_exist.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_key_available_returns_false_if_key_is_unavailable.yml +0 -45
- data/spec/vcr_cassettes/IdealPostcodes_key_available_returns_true_if_key_is_available.yml +0 -45
- data/spec/vcr_cassettes/IdealPostcodes_key_details_raises_an_exception_if_no_secret_is_provided.yml +0 -45
- data/spec/vcr_cassettes/IdealPostcodes_key_details_returns_key_information.yml +0 -62
- data/spec/vcr_cassettes/IdealPostcodes_request_generates_a_HTTP_request.yml +0 -268
- data/spec/vcr_cassettes/IdealPostcodes_request_raises_authentication_error_if_invalid_key_is_provided.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_request_raises_limit_reached_error_if_a_limit_has_been_breached.yml +0 -42
- data/spec/vcr_cassettes/IdealPostcodes_request_raises_token_exhausted_error_if_key_balance_is_depleted.yml +0 -42
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated from the OpenAPI spec. Do not edit.
|
|
4
|
+
|
|
5
|
+
module IdealPostcodes
|
|
6
|
+
module Types
|
|
7
|
+
# Welsh PAF Address
|
|
8
|
+
#
|
|
9
|
+
# Raw Royal Mail Welsh language record backing a `pafw` address.
|
|
10
|
+
#
|
|
11
|
+
# Welsh alternatives for addresses in the sectors Royal Mail defines as part of the Welsh
|
|
12
|
+
# principality. Same shape as a PAF record, keyed on the same UDPRN.
|
|
13
|
+
class PafwAddress < Model
|
|
14
|
+
# @return [String]
|
|
15
|
+
def dataset = @hash["dataset"]
|
|
16
|
+
|
|
17
|
+
# Postcode, space separated
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
def postcode = @hash["postcode"]
|
|
21
|
+
|
|
22
|
+
# Royal Mail post town, title cased
|
|
23
|
+
#
|
|
24
|
+
# @return [String]
|
|
25
|
+
def post_town = @hash["post_town"]
|
|
26
|
+
|
|
27
|
+
# Dependant locality. Empty string when not present
|
|
28
|
+
#
|
|
29
|
+
# @return [String]
|
|
30
|
+
def dependant_locality = @hash["dependant_locality"]
|
|
31
|
+
|
|
32
|
+
# Double dependant locality. Empty string when not present
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
def double_dependant_locality = @hash["double_dependant_locality"]
|
|
36
|
+
|
|
37
|
+
# Street name
|
|
38
|
+
#
|
|
39
|
+
# @return [String]
|
|
40
|
+
def thoroughfare = @hash["thoroughfare"]
|
|
41
|
+
|
|
42
|
+
# Dependant street name. Empty string when not present
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
def dependant_thoroughfare = @hash["dependant_thoroughfare"]
|
|
46
|
+
|
|
47
|
+
# Building number. Empty string when not present, or when PAF merges it into the building name
|
|
48
|
+
#
|
|
49
|
+
# @return [String]
|
|
50
|
+
def building_number = @hash["building_number"]
|
|
51
|
+
|
|
52
|
+
# Building name. Empty string when not present
|
|
53
|
+
#
|
|
54
|
+
# @return [String]
|
|
55
|
+
def building_name = @hash["building_name"]
|
|
56
|
+
|
|
57
|
+
# Sub building name. Empty string when not present
|
|
58
|
+
#
|
|
59
|
+
# @return [String]
|
|
60
|
+
def sub_building_name = @hash["sub_building_name"]
|
|
61
|
+
|
|
62
|
+
# Department name within an organisation. Empty string when not present
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
def department_name = @hash["department_name"]
|
|
66
|
+
|
|
67
|
+
# Organisation name. Empty string when not present
|
|
68
|
+
#
|
|
69
|
+
# @return [String]
|
|
70
|
+
def organisation_name = @hash["organisation_name"]
|
|
71
|
+
|
|
72
|
+
# Unique Delivery Point Reference Number
|
|
73
|
+
#
|
|
74
|
+
# @return [Integer]
|
|
75
|
+
def udprn = @hash["udprn"]
|
|
76
|
+
|
|
77
|
+
# Postcode type.
|
|
78
|
+
#
|
|
79
|
+
# @return [String]
|
|
80
|
+
def postcode_type = @hash["postcode_type"]
|
|
81
|
+
|
|
82
|
+
# Small user organisation indicator. `Y` where the small user postcode is held by an
|
|
83
|
+
# organisation
|
|
84
|
+
#
|
|
85
|
+
# @return [String]
|
|
86
|
+
def su_organisation_indicator = @hash["su_organisation_indicator"]
|
|
87
|
+
|
|
88
|
+
# Royal Mail delivery point suffix
|
|
89
|
+
#
|
|
90
|
+
# @return [String]
|
|
91
|
+
def delivery_point_suffix = @hash["delivery_point_suffix"]
|
|
92
|
+
|
|
93
|
+
# PO Box number. Empty string when not present
|
|
94
|
+
#
|
|
95
|
+
# @return [String]
|
|
96
|
+
def po_box = @hash["po_box"]
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated from the OpenAPI spec. Do not edit.
|
|
4
|
+
|
|
5
|
+
module IdealPostcodes
|
|
6
|
+
module Types
|
|
7
|
+
# Phone Number Object
|
|
8
|
+
class PhoneNumber < Model
|
|
9
|
+
# @return [Boolean]
|
|
10
|
+
def valid = @hash["valid"]
|
|
11
|
+
|
|
12
|
+
# Phone number formatted to local standard
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
def national_format = @hash["national_format"]
|
|
16
|
+
|
|
17
|
+
# Phone number formatted to international standard
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
def international_format = @hash["international_format"]
|
|
21
|
+
|
|
22
|
+
# Country code in 3 letter ISO format
|
|
23
|
+
#
|
|
24
|
+
# @return [String]
|
|
25
|
+
def iso_country = @hash["iso_country"]
|
|
26
|
+
|
|
27
|
+
# Country code in 2 letter ISO format
|
|
28
|
+
#
|
|
29
|
+
# @return [String]
|
|
30
|
+
def iso_country_2 = @hash["iso_country_2"]
|
|
31
|
+
|
|
32
|
+
# Full country name
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
def country = @hash["country"]
|
|
36
|
+
|
|
37
|
+
# Representation of current phone carrier information like network code, name, country,
|
|
38
|
+
# network type
|
|
39
|
+
#
|
|
40
|
+
# @return [Types::Carrier, nil]
|
|
41
|
+
def current_carrier = read("current_carrier") { |v| Types::Carrier.from_hash(v) }
|
|
42
|
+
|
|
43
|
+
# Representation of original phone carrier information like network code, name, country,
|
|
44
|
+
# network type
|
|
45
|
+
#
|
|
46
|
+
# @return [Types::Carrier, nil]
|
|
47
|
+
def original_carrier = read("original_carrier") { |v| Types::Carrier.from_hash(v) }
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated from the OpenAPI spec. Do not edit.
|
|
4
|
+
|
|
5
|
+
module IdealPostcodes
|
|
6
|
+
module Types
|
|
7
|
+
# Place
|
|
8
|
+
#
|
|
9
|
+
# A geographical place: an administrative division, capital or seat of administration city drawn
|
|
10
|
+
# from GeoNames. `GET /places` returns a suggestion for each match and `GET /places/{place}`
|
|
11
|
+
# resolves a suggestion id to the full place. `native` holds the underlying GeoNames record.
|
|
12
|
+
class Place < Model
|
|
13
|
+
# Globally unique internally generated identifier for a place
|
|
14
|
+
#
|
|
15
|
+
# @return [String]
|
|
16
|
+
def id = @hash["id"]
|
|
17
|
+
|
|
18
|
+
# Indicates the provenance of a place.
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
def dataset = @hash["dataset"]
|
|
22
|
+
|
|
23
|
+
# Place name
|
|
24
|
+
#
|
|
25
|
+
# @return [String]
|
|
26
|
+
def name = @hash["name"]
|
|
27
|
+
|
|
28
|
+
# Longer form description of the place.
|
|
29
|
+
#
|
|
30
|
+
# @return [String]
|
|
31
|
+
def descriptive_name = @hash["descriptive_name"]
|
|
32
|
+
|
|
33
|
+
# 3 letter country code (ISO 3166-1)
|
|
34
|
+
#
|
|
35
|
+
# @return [String]
|
|
36
|
+
def country_iso = @hash["country_iso"]
|
|
37
|
+
|
|
38
|
+
# Language represented by 2 letter ISO Code (639-1)
|
|
39
|
+
#
|
|
40
|
+
# @return [String]
|
|
41
|
+
def language = @hash["language"]
|
|
42
|
+
|
|
43
|
+
# The longitude of the address or postcode (WGS84).
|
|
44
|
+
#
|
|
45
|
+
# @return [String, Float]
|
|
46
|
+
def longitude = @hash["longitude"]
|
|
47
|
+
|
|
48
|
+
# The latitude of the address or postcode (WGS84).
|
|
49
|
+
#
|
|
50
|
+
# @return [String, Float]
|
|
51
|
+
def latitude = @hash["latitude"]
|
|
52
|
+
|
|
53
|
+
# Native representation of a place
|
|
54
|
+
#
|
|
55
|
+
# @return [Types::GeonamesPlace, Hash{String => Object}, nil]
|
|
56
|
+
def native = read("native") { |v| hydrate_native(v) }
|
|
57
|
+
|
|
58
|
+
private
|
|
59
|
+
|
|
60
|
+
def hydrate_native(value)
|
|
61
|
+
Union.hydrate(
|
|
62
|
+
value,
|
|
63
|
+
[
|
|
64
|
+
[
|
|
65
|
+
Types::GeonamesPlace,
|
|
66
|
+
{ "dataset" => ["geonames"] },
|
|
67
|
+
%w[
|
|
68
|
+
id dataset geonameid name asciiname alternatenames language latitude longitude
|
|
69
|
+
feature_class feature_code country_code country_iso cc2 admin1_name admin1_geonameid
|
|
70
|
+
admin1_code admin2_name admin2_geonameid admin2_code admin3_code admin4_code
|
|
71
|
+
population elevation dem timezone modification_date
|
|
72
|
+
]
|
|
73
|
+
]
|
|
74
|
+
]
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
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
|
+
# PlaceResponseResult
|
|
8
|
+
class PlaceResult < Model
|
|
9
|
+
# List of up to 10 matching places
|
|
10
|
+
#
|
|
11
|
+
# @return [Array<Types::PlaceSuggestion>]
|
|
12
|
+
def hits = read("hits") { |v| v.map { |item| hydrate_hit(item) } }
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def hydrate_hit(value)
|
|
17
|
+
Types::PlaceSuggestion.from_hash(value)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated from the OpenAPI spec. Do not edit.
|
|
4
|
+
|
|
5
|
+
module IdealPostcodes
|
|
6
|
+
module Types
|
|
7
|
+
# Place Suggestion
|
|
8
|
+
#
|
|
9
|
+
# Represents a possible place given an autocomplete query.
|
|
10
|
+
class PlaceSuggestion < Model
|
|
11
|
+
# Unique identifier for place
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
def id = @hash["id"]
|
|
15
|
+
|
|
16
|
+
# Place name
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
def name = @hash["name"]
|
|
20
|
+
|
|
21
|
+
# Longer form description of the place.
|
|
22
|
+
#
|
|
23
|
+
# @return [String]
|
|
24
|
+
def descriptive_name = @hash["descriptive_name"]
|
|
25
|
+
|
|
26
|
+
# 3 letter country code (ISO 3166-1)
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
def country_iso = @hash["country_iso"]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|