Class: ScrapeBadger::RedfinApi

Inherits:
Object
  • Object
show all
Defined in:
lib/scrapebadger/api/redfin_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RedfinApi

Returns a new instance of RedfinApi.



19
20
21
# File 'lib/scrapebadger/api/redfin_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/scrapebadger/api/redfin_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#redfin_get_agent_profile_listings(opts = {}) ⇒ Object

Get agent profile + listings Get a Redfin real-estate agent's profile and their active listings.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :url (String)

    Full Redfin /realestateagents/ URL

  • :agent_id (String)

    Redfin agent id

Returns:

  • (Object)


28
29
30
31
# File 'lib/scrapebadger/api/redfin_api.rb', line 28

def redfin_get_agent_profile_listings(opts = {})
  data, _status_code, _headers = redfin_get_agent_profile_listings_with_http_info(opts)
  data
end

#redfin_get_agent_profile_listings_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get agent profile + listings Get a Redfin real-estate agent's profile and their active listings.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :url (String)

    Full Redfin /realestateagents/ URL

  • :agent_id (String)

    Redfin agent id

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/scrapebadger/api/redfin_api.rb', line 39

def redfin_get_agent_profile_listings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RedfinApi.redfin_get_agent_profile_listings ...'
  end
  # resource path
  local_var_path = '/v1/redfin/agent'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'url'] = opts[:'url'] if !opts[:'url'].nil?
  query_params[:'agent_id'] = opts[:'agent_id'] if !opts[:'agent_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"RedfinApi.redfin_get_agent_profile_listings",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RedfinApi#redfin_get_agent_profile_listings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#redfin_get_property_detail(property_id, opts = {}) ⇒ Object

Get property detail Get a single Redfin property's full detail by its numeric propertyId.

Parameters:

  • property_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


90
91
92
93
# File 'lib/scrapebadger/api/redfin_api.rb', line 90

def redfin_get_property_detail(property_id, opts = {})
  data, _status_code, _headers = redfin_get_property_detail_with_http_info(property_id, opts)
  data
end

#redfin_get_property_detail_by_url(url, opts = {}) ⇒ Object

Get property detail by URL Get a single Redfin property's full detail by its home URL.

Parameters:

  • url (String)

    Full Redfin property URL (/CA/City/.../home/12345678)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


153
154
155
156
# File 'lib/scrapebadger/api/redfin_api.rb', line 153

def redfin_get_property_detail_by_url(url, opts = {})
  data, _status_code, _headers = redfin_get_property_detail_by_url_with_http_info(url, opts)
  data
end

#redfin_get_property_detail_by_url_with_http_info(url, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get property detail by URL Get a single Redfin property's full detail by its home URL.

Parameters:

  • url (String)

    Full Redfin property URL (/CA/City/.../home/12345678)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/scrapebadger/api/redfin_api.rb', line 163

def redfin_get_property_detail_by_url_with_http_info(url, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RedfinApi.redfin_get_property_detail_by_url ...'
  end
  # verify the required parameter 'url' is set
  if @api_client.config.client_side_validation && url.nil?
    fail ArgumentError, "Missing the required parameter 'url' when calling RedfinApi.redfin_get_property_detail_by_url"
  end
  # resource path
  local_var_path = '/v1/redfin/property'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'url'] = url

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"RedfinApi.redfin_get_property_detail_by_url",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RedfinApi#redfin_get_property_detail_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#redfin_get_property_detail_with_http_info(property_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get property detail Get a single Redfin property's full detail by its numeric propertyId.

Parameters:

  • property_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/scrapebadger/api/redfin_api.rb', line 100

def redfin_get_property_detail_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RedfinApi.redfin_get_property_detail ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling RedfinApi.redfin_get_property_detail"
  end
  # resource path
  local_var_path = '/v1/redfin/property/{property_id}'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"RedfinApi.redfin_get_property_detail",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RedfinApi#redfin_get_property_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#redfin_list_coverage_markets(opts = {}) ⇒ Object

List coverage markets List Redfin coverage regions (US).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


216
217
218
219
# File 'lib/scrapebadger/api/redfin_api.rb', line 216

def redfin_list_coverage_markets(opts = {})
  data, _status_code, _headers = redfin_list_coverage_markets_with_http_info(opts)
  data
end

#redfin_list_coverage_markets_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

List coverage markets List Redfin coverage regions (US).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/scrapebadger/api/redfin_api.rb', line 225

def redfin_list_coverage_markets_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RedfinApi.redfin_list_coverage_markets ...'
  end
  # resource path
  local_var_path = '/v1/redfin/markets'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"RedfinApi.redfin_list_coverage_markets",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RedfinApi#redfin_list_coverage_markets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#redfin_redfin_scraper_health_check(opts = {}) ⇒ Object

Redfin scraper health check Check health of the Redfin scraper service (accepts HEAD for UptimeRobot).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


273
274
275
276
# File 'lib/scrapebadger/api/redfin_api.rb', line 273

def redfin_redfin_scraper_health_check(opts = {})
  data, _status_code, _headers = redfin_redfin_scraper_health_check_with_http_info(opts)
  data
end

#redfin_redfin_scraper_health_check_head(opts = {}) ⇒ Object

Redfin scraper health check Check health of the Redfin scraper service (accepts HEAD for UptimeRobot).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


330
331
332
333
# File 'lib/scrapebadger/api/redfin_api.rb', line 330

def redfin_redfin_scraper_health_check_head(opts = {})
  data, _status_code, _headers = redfin_redfin_scraper_health_check_head_with_http_info(opts)
  data
end

#redfin_redfin_scraper_health_check_head_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Redfin scraper health check Check health of the Redfin scraper service (accepts HEAD for UptimeRobot).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/scrapebadger/api/redfin_api.rb', line 339

def redfin_redfin_scraper_health_check_head_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RedfinApi.redfin_redfin_scraper_health_check_head ...'
  end
  # resource path
  local_var_path = '/v1/redfin/health'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"RedfinApi.redfin_redfin_scraper_health_check_head",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:HEAD, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RedfinApi#redfin_redfin_scraper_health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#redfin_redfin_scraper_health_check_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Redfin scraper health check Check health of the Redfin scraper service (accepts HEAD for UptimeRobot).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/scrapebadger/api/redfin_api.rb', line 282

def redfin_redfin_scraper_health_check_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RedfinApi.redfin_redfin_scraper_health_check ...'
  end
  # resource path
  local_var_path = '/v1/redfin/health'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"RedfinApi.redfin_redfin_scraper_health_check",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RedfinApi#redfin_redfin_scraper_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#redfin_region_address_suggestions(query, opts = {}) ⇒ Object

Region/address suggestions Resolve a search term to Redfin regions/addresses.

Parameters:

  • query (String)

    Partial location — city, ZIP, address, neighborhood

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


388
389
390
391
# File 'lib/scrapebadger/api/redfin_api.rb', line 388

def redfin_region_address_suggestions(query, opts = {})
  data, _status_code, _headers = redfin_region_address_suggestions_with_http_info(query, opts)
  data
end

#redfin_region_address_suggestions_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Region/address suggestions Resolve a search term to Redfin regions/addresses.

Parameters:

  • query (String)

    Partial location — city, ZIP, address, neighborhood

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/scrapebadger/api/redfin_api.rb', line 398

def redfin_region_address_suggestions_with_http_info(query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RedfinApi.redfin_region_address_suggestions ...'
  end
  # verify the required parameter 'query' is set
  if @api_client.config.client_side_validation && query.nil?
    fail ArgumentError, "Missing the required parameter 'query' when calling RedfinApi.redfin_region_address_suggestions"
  end
  # resource path
  local_var_path = '/v1/redfin/autocomplete'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'query'] = query

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"RedfinApi.redfin_region_address_suggestions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RedfinApi#redfin_region_address_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#redfin_search_properties(location, opts = {}) ⇒ Object

Search properties Search Redfin for for-sale / for-rent / recently-sold properties.

Parameters:

  • location (String)

    City/state, ZIP, address or neighborhood

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :sort (String)

    relevant|newest|price_high_to_low|price_low_to_high|square_feet|lot_size|price_per_sqft|beds|baths

  • :price_min (Integer)
  • :price_max (Integer)
  • :beds_min (Integer)
  • :baths_min (Float)
  • :home_type (String)

    house|condo|townhouse|multi_family|land|mobile|coop|other

  • :sqft_min (Integer)
  • :sqft_max (Integer)
  • :lot_min (Integer)
  • :lot_max (Integer)
  • :year_built_min (Integer)
  • :year_built_max (Integer)
  • :max_days_on_market (Integer)
  • :north (Float)

    Map bounds for tiling past the cap

  • :south (Float)
  • :east (Float)
  • :west (Float)

Returns:

  • (Object)


470
471
472
473
# File 'lib/scrapebadger/api/redfin_api.rb', line 470

def redfin_search_properties(location, opts = {})
  data, _status_code, _headers = redfin_search_properties_with_http_info(location, opts)
  data
end

#redfin_search_properties_with_http_info(location, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Search properties Search Redfin for for-sale / for-rent / recently-sold properties.

Parameters:

  • location (String)

    City/state, ZIP, address or neighborhood

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :sort (String)

    relevant|newest|price_high_to_low|price_low_to_high|square_feet|lot_size|price_per_sqft|beds|baths

  • :price_min (Integer)
  • :price_max (Integer)
  • :beds_min (Integer)
  • :baths_min (Float)
  • :home_type (String)

    house|condo|townhouse|multi_family|land|mobile|coop|other

  • :sqft_min (Integer)
  • :sqft_max (Integer)
  • :lot_min (Integer)
  • :lot_max (Integer)
  • :year_built_min (Integer)
  • :year_built_max (Integer)
  • :max_days_on_market (Integer)
  • :north (Float)

    Map bounds for tiling past the cap

  • :south (Float)
  • :east (Float)
  • :west (Float)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
# File 'lib/scrapebadger/api/redfin_api.rb', line 498

def redfin_search_properties_with_http_info(location, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RedfinApi.redfin_search_properties ...'
  end
  # verify the required parameter 'location' is set
  if @api_client.config.client_side_validation && location.nil?
    fail ArgumentError, "Missing the required parameter 'location' when calling RedfinApi.redfin_search_properties"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 20
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling RedfinApi.redfin_search_properties, must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'price_min'].nil? && opts[:'price_min'] < 0
    fail ArgumentError, 'invalid value for "opts[:"price_min"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'price_max'].nil? && opts[:'price_max'] < 0
    fail ArgumentError, 'invalid value for "opts[:"price_max"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'beds_min'].nil? && opts[:'beds_min'] > 10
    fail ArgumentError, 'invalid value for "opts[:"beds_min"]" when calling RedfinApi.redfin_search_properties, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'beds_min'].nil? && opts[:'beds_min'] < 0
    fail ArgumentError, 'invalid value for "opts[:"beds_min"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'baths_min'].nil? && opts[:'baths_min'] > 10
    fail ArgumentError, 'invalid value for "opts[:"baths_min"]" when calling RedfinApi.redfin_search_properties, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'baths_min'].nil? && opts[:'baths_min'] < 0
    fail ArgumentError, 'invalid value for "opts[:"baths_min"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'sqft_min'].nil? && opts[:'sqft_min'] < 0
    fail ArgumentError, 'invalid value for "opts[:"sqft_min"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'sqft_max'].nil? && opts[:'sqft_max'] < 0
    fail ArgumentError, 'invalid value for "opts[:"sqft_max"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'lot_min'].nil? && opts[:'lot_min'] < 0
    fail ArgumentError, 'invalid value for "opts[:"lot_min"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'lot_max'].nil? && opts[:'lot_max'] < 0
    fail ArgumentError, 'invalid value for "opts[:"lot_max"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'year_built_min'].nil? && opts[:'year_built_min'] < 1800
    fail ArgumentError, 'invalid value for "opts[:"year_built_min"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 1800.'
  end

  if @api_client.config.client_side_validation && !opts[:'year_built_max'].nil? && opts[:'year_built_max'] < 1800
    fail ArgumentError, 'invalid value for "opts[:"year_built_max"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 1800.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_days_on_market'].nil? && opts[:'max_days_on_market'] < 0
    fail ArgumentError, 'invalid value for "opts[:"max_days_on_market"]" when calling RedfinApi.redfin_search_properties, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/v1/redfin/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'location'] = location
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'price_min'] = opts[:'price_min'] if !opts[:'price_min'].nil?
  query_params[:'price_max'] = opts[:'price_max'] if !opts[:'price_max'].nil?
  query_params[:'beds_min'] = opts[:'beds_min'] if !opts[:'beds_min'].nil?
  query_params[:'baths_min'] = opts[:'baths_min'] if !opts[:'baths_min'].nil?
  query_params[:'home_type'] = opts[:'home_type'] if !opts[:'home_type'].nil?
  query_params[:'sqft_min'] = opts[:'sqft_min'] if !opts[:'sqft_min'].nil?
  query_params[:'sqft_max'] = opts[:'sqft_max'] if !opts[:'sqft_max'].nil?
  query_params[:'lot_min'] = opts[:'lot_min'] if !opts[:'lot_min'].nil?
  query_params[:'lot_max'] = opts[:'lot_max'] if !opts[:'lot_max'].nil?
  query_params[:'year_built_min'] = opts[:'year_built_min'] if !opts[:'year_built_min'].nil?
  query_params[:'year_built_max'] = opts[:'year_built_max'] if !opts[:'year_built_max'].nil?
  query_params[:'max_days_on_market'] = opts[:'max_days_on_market'] if !opts[:'max_days_on_market'].nil?
  query_params[:'north'] = opts[:'north'] if !opts[:'north'].nil?
  query_params[:'south'] = opts[:'south'] if !opts[:'south'].nil?
  query_params[:'east'] = opts[:'east'] if !opts[:'east'].nil?
  query_params[:'west'] = opts[:'west'] if !opts[:'west'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"RedfinApi.redfin_search_properties",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RedfinApi#redfin_search_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end