checkify 0.1.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 (87) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +319 -0
  5. data/docs/AbnAddress.md +24 -0
  6. data/docs/AbnResponse.md +34 -0
  7. data/docs/AbnResponseAbnDetails.md +22 -0
  8. data/docs/Account.md +36 -0
  9. data/docs/AccountApi.md +74 -0
  10. data/docs/AcnAddress.md +24 -0
  11. data/docs/AcnResponse.md +38 -0
  12. data/docs/AcnResponseAbnDetails.md +18 -0
  13. data/docs/AcnResponseAcnDetails.md +22 -0
  14. data/docs/AddressApi.md +457 -0
  15. data/docs/AddressDetails.md +52 -0
  16. data/docs/AsicDocument.md +28 -0
  17. data/docs/AsicDocumentContentsInner.md +20 -0
  18. data/docs/BatchApi.md +217 -0
  19. data/docs/BulkCreateRequest.md +20 -0
  20. data/docs/BulkCreateRequestItems.md +49 -0
  21. data/docs/BulkJob.md +26 -0
  22. data/docs/BusinessActivity.md +22 -0
  23. data/docs/BusinessActivityResponse.md +22 -0
  24. data/docs/BusinessApi.md +361 -0
  25. data/docs/CommunicationApi.md +151 -0
  26. data/docs/DirectorIdResponse.md +24 -0
  27. data/docs/EmailResponse.md +42 -0
  28. data/docs/EmailResponseDns.md +18 -0
  29. data/docs/EmailResponseFormat.md +22 -0
  30. data/docs/Error.md +22 -0
  31. data/docs/FormerName.md +22 -0
  32. data/docs/IdentityApi.md +225 -0
  33. data/docs/NameAvailability.md +26 -0
  34. data/docs/PhoneResponse.md +32 -0
  35. data/docs/PostcodeResult.md +30 -0
  36. data/docs/ReverseResult.md +38 -0
  37. data/docs/SanctionsResponse.md +20 -0
  38. data/docs/SanctionsResult.md +42 -0
  39. data/docs/SanctionsResultSanctions.md +24 -0
  40. data/docs/SuburbDetails.md +30 -0
  41. data/docs/TfnResponse.md +24 -0
  42. data/lib/checkify/api/account_api.rb +79 -0
  43. data/lib/checkify/api/address_api.rb +490 -0
  44. data/lib/checkify/api/batch_api.rb +216 -0
  45. data/lib/checkify/api/business_api.rb +365 -0
  46. data/lib/checkify/api/communication_api.rb +157 -0
  47. data/lib/checkify/api/identity_api.rb +248 -0
  48. data/lib/checkify/api_client.rb +397 -0
  49. data/lib/checkify/api_error.rb +58 -0
  50. data/lib/checkify/api_model_base.rb +88 -0
  51. data/lib/checkify/client.rb +25 -0
  52. data/lib/checkify/configuration.rb +305 -0
  53. data/lib/checkify/models/abn_address.rb +173 -0
  54. data/lib/checkify/models/abn_response.rb +223 -0
  55. data/lib/checkify/models/abn_response_abn_details.rb +165 -0
  56. data/lib/checkify/models/account.rb +277 -0
  57. data/lib/checkify/models/acn_address.rb +173 -0
  58. data/lib/checkify/models/acn_response.rb +244 -0
  59. data/lib/checkify/models/acn_response_abn_details.rb +145 -0
  60. data/lib/checkify/models/acn_response_acn_details.rb +164 -0
  61. data/lib/checkify/models/address_details.rb +324 -0
  62. data/lib/checkify/models/asic_document.rb +192 -0
  63. data/lib/checkify/models/asic_document_contents_inner.rb +154 -0
  64. data/lib/checkify/models/bulk_create_request.rb +213 -0
  65. data/lib/checkify/models/bulk_create_request_items.rb +103 -0
  66. data/lib/checkify/models/bulk_job.rb +215 -0
  67. data/lib/checkify/models/business_activity.rb +166 -0
  68. data/lib/checkify/models/business_activity_response.rb +165 -0
  69. data/lib/checkify/models/director_id_response.rb +174 -0
  70. data/lib/checkify/models/email_response.rb +292 -0
  71. data/lib/checkify/models/email_response_dns.rb +146 -0
  72. data/lib/checkify/models/email_response_format.rb +167 -0
  73. data/lib/checkify/models/error.rb +166 -0
  74. data/lib/checkify/models/former_name.rb +163 -0
  75. data/lib/checkify/models/name_availability.rb +186 -0
  76. data/lib/checkify/models/phone_response.rb +216 -0
  77. data/lib/checkify/models/postcode_result.rb +201 -0
  78. data/lib/checkify/models/reverse_result.rb +237 -0
  79. data/lib/checkify/models/sanctions_response.rb +157 -0
  80. data/lib/checkify/models/sanctions_result.rb +339 -0
  81. data/lib/checkify/models/sanctions_result_sanctions.rb +172 -0
  82. data/lib/checkify/models/suburb_details.rb +207 -0
  83. data/lib/checkify/models/tfn_response.rb +174 -0
  84. data/lib/checkify/version.rb +15 -0
  85. data/lib/checkify.rb +78 -0
  86. data/openapi.yaml +1373 -0
  87. metadata +182 -0
@@ -0,0 +1,490 @@
1
+ =begin
2
+ #Checkify API
3
+
4
+ #Australian and New Zealand address validation, business lookups, identity checks, and communication validation through a single REST interface.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Checkify
16
+ class AddressApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Address autocomplete
23
+ # Type-ahead address search across 17.8 M+ Australian and New Zealand addresses. Returns a map of address IDs to highlighted HTML strings. Costs 0 units.
24
+ # @param query [String] Search term, min 3 characters
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
27
+ # @return [Hash<String, String>]
28
+ def autocomplete(query, opts = {})
29
+ data, _status_code, _headers = autocomplete_with_http_info(query, opts)
30
+ data
31
+ end
32
+
33
+ # Address autocomplete
34
+ # Type-ahead address search across 17.8 M+ Australian and New Zealand addresses. Returns a map of address IDs to highlighted HTML strings. Costs 0 units.
35
+ # @param query [String] Search term, min 3 characters
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
38
+ # @return [Array<(Hash<String, String>, Integer, Hash)>] Hash<String, String> data, response status code and response headers
39
+ def autocomplete_with_http_info(query, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: AddressApi.autocomplete ...'
42
+ end
43
+ # verify the required parameter 'query' is set
44
+ if @api_client.config.client_side_validation && query.nil?
45
+ fail ArgumentError, "Missing the required parameter 'query' when calling AddressApi.autocomplete"
46
+ end
47
+ if @api_client.config.client_side_validation && query.to_s.length < 3
48
+ fail ArgumentError, 'invalid value for "query" when calling AddressApi.autocomplete, the character length must be greater than or equal to 3.'
49
+ end
50
+
51
+ allowable_values = ["au", "nz"]
52
+ if @api_client.config.client_side_validation && opts[:'country'] && !allowable_values.include?(opts[:'country'])
53
+ fail ArgumentError, "invalid value for \"country\", must be one of #{allowable_values}"
54
+ end
55
+ # resource path
56
+ local_var_path = '/autocomplete'
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+ query_params[:'query'] = query
61
+ query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body]
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type] || 'Hash<String, String>'
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"AddressApi.autocomplete",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: AddressApi#autocomplete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # Address details
98
+ # Fetch the full structured record for an address ID returned by /autocomplete. Costs 1 unit.
99
+ # @param id [String] Address ID from /autocomplete
100
+ # @param [Hash] opts the optional parameters
101
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
102
+ # @return [AddressDetails]
103
+ def autocomplete_details(id, opts = {})
104
+ data, _status_code, _headers = autocomplete_details_with_http_info(id, opts)
105
+ data
106
+ end
107
+
108
+ # Address details
109
+ # Fetch the full structured record for an address ID returned by /autocomplete. Costs 1 unit.
110
+ # @param id [String] Address ID from /autocomplete
111
+ # @param [Hash] opts the optional parameters
112
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
113
+ # @return [Array<(AddressDetails, Integer, Hash)>] AddressDetails data, response status code and response headers
114
+ def autocomplete_details_with_http_info(id, opts = {})
115
+ if @api_client.config.debugging
116
+ @api_client.config.logger.debug 'Calling API: AddressApi.autocomplete_details ...'
117
+ end
118
+ # verify the required parameter 'id' is set
119
+ if @api_client.config.client_side_validation && id.nil?
120
+ fail ArgumentError, "Missing the required parameter 'id' when calling AddressApi.autocomplete_details"
121
+ end
122
+ allowable_values = ["au", "nz"]
123
+ if @api_client.config.client_side_validation && opts[:'country'] && !allowable_values.include?(opts[:'country'])
124
+ fail ArgumentError, "invalid value for \"country\", must be one of #{allowable_values}"
125
+ end
126
+ # resource path
127
+ local_var_path = '/autocomplete-details'
128
+
129
+ # query parameters
130
+ query_params = opts[:query_params] || {}
131
+ query_params[:'id'] = id
132
+ query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
133
+
134
+ # header parameters
135
+ header_params = opts[:header_params] || {}
136
+ # HTTP header 'Accept' (if needed)
137
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
138
+
139
+ # form parameters
140
+ form_params = opts[:form_params] || {}
141
+
142
+ # http body (model)
143
+ post_body = opts[:debug_body]
144
+
145
+ # return_type
146
+ return_type = opts[:debug_return_type] || 'AddressDetails'
147
+
148
+ # auth_names
149
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
150
+
151
+ new_options = opts.merge(
152
+ :operation => :"AddressApi.autocomplete_details",
153
+ :header_params => header_params,
154
+ :query_params => query_params,
155
+ :form_params => form_params,
156
+ :body => post_body,
157
+ :auth_names => auth_names,
158
+ :return_type => return_type
159
+ )
160
+
161
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug "API called: AddressApi#autocomplete_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
164
+ end
165
+ return data, status_code, headers
166
+ end
167
+
168
+ # Suburb autocomplete
169
+ # Search for suburbs and localities across Australia and New Zealand. Returns a map of locality IDs to highlighted strings. Costs 0 units.
170
+ # @param query [String] Search term, min 2 characters
171
+ # @param [Hash] opts the optional parameters
172
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
173
+ # @return [Hash<String, String>]
174
+ def autocomplete_suburb(query, opts = {})
175
+ data, _status_code, _headers = autocomplete_suburb_with_http_info(query, opts)
176
+ data
177
+ end
178
+
179
+ # Suburb autocomplete
180
+ # Search for suburbs and localities across Australia and New Zealand. Returns a map of locality IDs to highlighted strings. Costs 0 units.
181
+ # @param query [String] Search term, min 2 characters
182
+ # @param [Hash] opts the optional parameters
183
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
184
+ # @return [Array<(Hash<String, String>, Integer, Hash)>] Hash<String, String> data, response status code and response headers
185
+ def autocomplete_suburb_with_http_info(query, opts = {})
186
+ if @api_client.config.debugging
187
+ @api_client.config.logger.debug 'Calling API: AddressApi.autocomplete_suburb ...'
188
+ end
189
+ # verify the required parameter 'query' is set
190
+ if @api_client.config.client_side_validation && query.nil?
191
+ fail ArgumentError, "Missing the required parameter 'query' when calling AddressApi.autocomplete_suburb"
192
+ end
193
+ if @api_client.config.client_side_validation && query.to_s.length < 2
194
+ fail ArgumentError, 'invalid value for "query" when calling AddressApi.autocomplete_suburb, the character length must be greater than or equal to 2.'
195
+ end
196
+
197
+ allowable_values = ["au", "nz"]
198
+ if @api_client.config.client_side_validation && opts[:'country'] && !allowable_values.include?(opts[:'country'])
199
+ fail ArgumentError, "invalid value for \"country\", must be one of #{allowable_values}"
200
+ end
201
+ # resource path
202
+ local_var_path = '/autocomplete-suburb'
203
+
204
+ # query parameters
205
+ query_params = opts[:query_params] || {}
206
+ query_params[:'query'] = query
207
+ query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
208
+
209
+ # header parameters
210
+ header_params = opts[:header_params] || {}
211
+ # HTTP header 'Accept' (if needed)
212
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
213
+
214
+ # form parameters
215
+ form_params = opts[:form_params] || {}
216
+
217
+ # http body (model)
218
+ post_body = opts[:debug_body]
219
+
220
+ # return_type
221
+ return_type = opts[:debug_return_type] || 'Hash<String, String>'
222
+
223
+ # auth_names
224
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
225
+
226
+ new_options = opts.merge(
227
+ :operation => :"AddressApi.autocomplete_suburb",
228
+ :header_params => header_params,
229
+ :query_params => query_params,
230
+ :form_params => form_params,
231
+ :body => post_body,
232
+ :auth_names => auth_names,
233
+ :return_type => return_type
234
+ )
235
+
236
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug "API called: AddressApi#autocomplete_suburb\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
+ end
240
+ return data, status_code, headers
241
+ end
242
+
243
+ # Suburb details
244
+ # Get full details for a locality ID returned by /autocomplete-suburb. Costs 1 unit. For NZ results, state/stateFull are null; use region instead. NZ localities return postcode: null.
245
+ # @param id [String] Locality ID from /autocomplete-suburb
246
+ # @param [Hash] opts the optional parameters
247
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
248
+ # @return [SuburbDetails]
249
+ def autocomplete_suburb_details(id, opts = {})
250
+ data, _status_code, _headers = autocomplete_suburb_details_with_http_info(id, opts)
251
+ data
252
+ end
253
+
254
+ # Suburb details
255
+ # Get full details for a locality ID returned by /autocomplete-suburb. Costs 1 unit. For NZ results, state/stateFull are null; use region instead. NZ localities return postcode: null.
256
+ # @param id [String] Locality ID from /autocomplete-suburb
257
+ # @param [Hash] opts the optional parameters
258
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
259
+ # @return [Array<(SuburbDetails, Integer, Hash)>] SuburbDetails data, response status code and response headers
260
+ def autocomplete_suburb_details_with_http_info(id, opts = {})
261
+ if @api_client.config.debugging
262
+ @api_client.config.logger.debug 'Calling API: AddressApi.autocomplete_suburb_details ...'
263
+ end
264
+ # verify the required parameter 'id' is set
265
+ if @api_client.config.client_side_validation && id.nil?
266
+ fail ArgumentError, "Missing the required parameter 'id' when calling AddressApi.autocomplete_suburb_details"
267
+ end
268
+ allowable_values = ["au", "nz"]
269
+ if @api_client.config.client_side_validation && opts[:'country'] && !allowable_values.include?(opts[:'country'])
270
+ fail ArgumentError, "invalid value for \"country\", must be one of #{allowable_values}"
271
+ end
272
+ # resource path
273
+ local_var_path = '/autocomplete-suburb-details'
274
+
275
+ # query parameters
276
+ query_params = opts[:query_params] || {}
277
+ query_params[:'id'] = id
278
+ query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
279
+
280
+ # header parameters
281
+ header_params = opts[:header_params] || {}
282
+ # HTTP header 'Accept' (if needed)
283
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
284
+
285
+ # form parameters
286
+ form_params = opts[:form_params] || {}
287
+
288
+ # http body (model)
289
+ post_body = opts[:debug_body]
290
+
291
+ # return_type
292
+ return_type = opts[:debug_return_type] || 'SuburbDetails'
293
+
294
+ # auth_names
295
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
296
+
297
+ new_options = opts.merge(
298
+ :operation => :"AddressApi.autocomplete_suburb_details",
299
+ :header_params => header_params,
300
+ :query_params => query_params,
301
+ :form_params => form_params,
302
+ :body => post_body,
303
+ :auth_names => auth_names,
304
+ :return_type => return_type
305
+ )
306
+
307
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
308
+ if @api_client.config.debugging
309
+ @api_client.config.logger.debug "API called: AddressApi#autocomplete_suburb_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
310
+ end
311
+ return data, status_code, headers
312
+ end
313
+
314
+ # Postcode lookup
315
+ # Look up all suburbs and localities that belong to a postcode. Returns up to 50 results ordered alphabetically. Costs 1 unit.
316
+ # @param postcode [String] 4-digit postcode
317
+ # @param [Hash] opts the optional parameters
318
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
319
+ # @return [Array<PostcodeResult>]
320
+ def postcode_lookup(postcode, opts = {})
321
+ data, _status_code, _headers = postcode_lookup_with_http_info(postcode, opts)
322
+ data
323
+ end
324
+
325
+ # Postcode lookup
326
+ # Look up all suburbs and localities that belong to a postcode. Returns up to 50 results ordered alphabetically. Costs 1 unit.
327
+ # @param postcode [String] 4-digit postcode
328
+ # @param [Hash] opts the optional parameters
329
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
330
+ # @return [Array<(Array<PostcodeResult>, Integer, Hash)>] Array<PostcodeResult> data, response status code and response headers
331
+ def postcode_lookup_with_http_info(postcode, opts = {})
332
+ if @api_client.config.debugging
333
+ @api_client.config.logger.debug 'Calling API: AddressApi.postcode_lookup ...'
334
+ end
335
+ # verify the required parameter 'postcode' is set
336
+ if @api_client.config.client_side_validation && postcode.nil?
337
+ fail ArgumentError, "Missing the required parameter 'postcode' when calling AddressApi.postcode_lookup"
338
+ end
339
+ pattern = Regexp.new(/^\d{4}$/)
340
+ if @api_client.config.client_side_validation && postcode !~ pattern
341
+ fail ArgumentError, "invalid value for 'postcode' when calling AddressApi.postcode_lookup, must conform to the pattern #{pattern}."
342
+ end
343
+
344
+ allowable_values = ["au", "nz"]
345
+ if @api_client.config.client_side_validation && opts[:'country'] && !allowable_values.include?(opts[:'country'])
346
+ fail ArgumentError, "invalid value for \"country\", must be one of #{allowable_values}"
347
+ end
348
+ # resource path
349
+ local_var_path = '/postcode'
350
+
351
+ # query parameters
352
+ query_params = opts[:query_params] || {}
353
+ query_params[:'postcode'] = postcode
354
+ query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
355
+
356
+ # header parameters
357
+ header_params = opts[:header_params] || {}
358
+ # HTTP header 'Accept' (if needed)
359
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
360
+
361
+ # form parameters
362
+ form_params = opts[:form_params] || {}
363
+
364
+ # http body (model)
365
+ post_body = opts[:debug_body]
366
+
367
+ # return_type
368
+ return_type = opts[:debug_return_type] || 'Array<PostcodeResult>'
369
+
370
+ # auth_names
371
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
372
+
373
+ new_options = opts.merge(
374
+ :operation => :"AddressApi.postcode_lookup",
375
+ :header_params => header_params,
376
+ :query_params => query_params,
377
+ :form_params => form_params,
378
+ :body => post_body,
379
+ :auth_names => auth_names,
380
+ :return_type => return_type
381
+ )
382
+
383
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
384
+ if @api_client.config.debugging
385
+ @api_client.config.logger.debug "API called: AddressApi#postcode_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
386
+ end
387
+ return data, status_code, headers
388
+ end
389
+
390
+ # Reverse geocode
391
+ # Find the nearest address(es) to a coordinate pair. Results are ordered by distance. Costs 1 unit.
392
+ # @param lat [Float] Latitude (AU: −44 to −9, NZ: −47 to −34)
393
+ # @param lng [Float] Longitude (AU: 112–155, NZ: 166–178)
394
+ # @param [Hash] opts the optional parameters
395
+ # @option opts [Integer] :radius Search radius in metres (1–5000, default 100) (default to 100)
396
+ # @option opts [Integer] :limit Max results (1–10, default 1) (default to 1)
397
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
398
+ # @return [Array<ReverseResult>]
399
+ def reverse_geocode(lat, lng, opts = {})
400
+ data, _status_code, _headers = reverse_geocode_with_http_info(lat, lng, opts)
401
+ data
402
+ end
403
+
404
+ # Reverse geocode
405
+ # Find the nearest address(es) to a coordinate pair. Results are ordered by distance. Costs 1 unit.
406
+ # @param lat [Float] Latitude (AU: −44 to −9, NZ: −47 to −34)
407
+ # @param lng [Float] Longitude (AU: 112–155, NZ: 166–178)
408
+ # @param [Hash] opts the optional parameters
409
+ # @option opts [Integer] :radius Search radius in metres (1–5000, default 100) (default to 100)
410
+ # @option opts [Integer] :limit Max results (1–10, default 1) (default to 1)
411
+ # @option opts [String] :country Country dataset: au (default) or nz (default to 'au')
412
+ # @return [Array<(Array<ReverseResult>, Integer, Hash)>] Array<ReverseResult> data, response status code and response headers
413
+ def reverse_geocode_with_http_info(lat, lng, opts = {})
414
+ if @api_client.config.debugging
415
+ @api_client.config.logger.debug 'Calling API: AddressApi.reverse_geocode ...'
416
+ end
417
+ # verify the required parameter 'lat' is set
418
+ if @api_client.config.client_side_validation && lat.nil?
419
+ fail ArgumentError, "Missing the required parameter 'lat' when calling AddressApi.reverse_geocode"
420
+ end
421
+ # verify the required parameter 'lng' is set
422
+ if @api_client.config.client_side_validation && lng.nil?
423
+ fail ArgumentError, "Missing the required parameter 'lng' when calling AddressApi.reverse_geocode"
424
+ end
425
+ if @api_client.config.client_side_validation && !opts[:'radius'].nil? && opts[:'radius'] > 5000
426
+ fail ArgumentError, 'invalid value for "opts[:"radius"]" when calling AddressApi.reverse_geocode, must be smaller than or equal to 5000.'
427
+ end
428
+
429
+ if @api_client.config.client_side_validation && !opts[:'radius'].nil? && opts[:'radius'] < 1
430
+ fail ArgumentError, 'invalid value for "opts[:"radius"]" when calling AddressApi.reverse_geocode, must be greater than or equal to 1.'
431
+ end
432
+
433
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10
434
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AddressApi.reverse_geocode, must be smaller than or equal to 10.'
435
+ end
436
+
437
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
438
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AddressApi.reverse_geocode, must be greater than or equal to 1.'
439
+ end
440
+
441
+ allowable_values = ["au", "nz"]
442
+ if @api_client.config.client_side_validation && opts[:'country'] && !allowable_values.include?(opts[:'country'])
443
+ fail ArgumentError, "invalid value for \"country\", must be one of #{allowable_values}"
444
+ end
445
+ # resource path
446
+ local_var_path = '/reverse'
447
+
448
+ # query parameters
449
+ query_params = opts[:query_params] || {}
450
+ query_params[:'lat'] = lat
451
+ query_params[:'lng'] = lng
452
+ query_params[:'radius'] = opts[:'radius'] if !opts[:'radius'].nil?
453
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
454
+ query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
455
+
456
+ # header parameters
457
+ header_params = opts[:header_params] || {}
458
+ # HTTP header 'Accept' (if needed)
459
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
460
+
461
+ # form parameters
462
+ form_params = opts[:form_params] || {}
463
+
464
+ # http body (model)
465
+ post_body = opts[:debug_body]
466
+
467
+ # return_type
468
+ return_type = opts[:debug_return_type] || 'Array<ReverseResult>'
469
+
470
+ # auth_names
471
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
472
+
473
+ new_options = opts.merge(
474
+ :operation => :"AddressApi.reverse_geocode",
475
+ :header_params => header_params,
476
+ :query_params => query_params,
477
+ :form_params => form_params,
478
+ :body => post_body,
479
+ :auth_names => auth_names,
480
+ :return_type => return_type
481
+ )
482
+
483
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
484
+ if @api_client.config.debugging
485
+ @api_client.config.logger.debug "API called: AddressApi#reverse_geocode\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
486
+ end
487
+ return data, status_code, headers
488
+ end
489
+ end
490
+ end