repull 0.2.24 → 0.2.26

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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +619 -2
  3. data/lib/repull/api/connections_api.rb +312 -0
  4. data/lib/repull/api/conversations_api.rb +154 -18
  5. data/lib/repull/api/health_api.rb +5 -5
  6. data/lib/repull/api/listings_api.rb +67 -4
  7. data/lib/repull/api/properties_api.rb +3 -0
  8. data/lib/repull/api/reservations_api.rb +3 -0
  9. data/lib/repull/api/reviews_api.rb +5 -2
  10. data/lib/repull/api/vrbo_api.rb +4 -4
  11. data/lib/repull/models/apply_connection_mappings200_response.rb +167 -0
  12. data/lib/repull/models/apply_connection_mappings200_response_results_inner.rb +184 -0
  13. data/lib/repull/models/apply_connection_mappings_request.rb +175 -0
  14. data/lib/repull/models/apply_connection_mappings_request_mappings_inner.rb +193 -0
  15. data/lib/repull/models/auto_map_connection_units200_response.rb +176 -0
  16. data/lib/repull/models/auto_map_connection_units_request.rb +156 -0
  17. data/lib/repull/models/channel_market_state_item.rb +15 -4
  18. data/lib/repull/models/connect_session_completed_event.rb +281 -0
  19. data/lib/repull/models/connect_session_completed_payload.rb +210 -0
  20. data/lib/repull/models/connect_status.rb +25 -5
  21. data/lib/repull/models/connect_status_accounts_inner.rb +71 -4
  22. data/lib/repull/models/conversation.rb +12 -1
  23. data/lib/repull/models/conversation_capabilities.rb +260 -0
  24. data/lib/repull/models/conversation_detail.rb +25 -5
  25. data/lib/repull/models/create_connect_session_request.rb +24 -2
  26. data/lib/repull/models/create_connection_request.rb +8 -8
  27. data/lib/repull/models/create_conversation_special_offer201_response.rb +127 -4
  28. data/lib/repull/models/create_conversation_special_offer201_response_fees_inner.rb +166 -0
  29. data/lib/repull/models/create_conversation_special_offer201_response_lines_inner.rb +157 -0
  30. data/lib/repull/models/create_conversation_special_offer_request.rb +91 -52
  31. data/lib/repull/models/create_conversation_special_offer_request_fees_inner.rb +199 -0
  32. data/lib/repull/models/get_booking_extranet_login_config200_response.rb +147 -0
  33. data/lib/repull/models/get_booking_extranet_login_status200_response.rb +192 -0
  34. data/lib/repull/models/get_channel_health200_response.rb +190 -0
  35. data/lib/repull/models/get_channel_health200_response_vrbo.rb +197 -0
  36. data/lib/repull/models/get_connect_write_policy200_response.rb +166 -0
  37. data/lib/repull/models/get_listing_calendar_sync200_response.rb +192 -0
  38. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner.rb +331 -0
  39. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_problems_inner.rb +157 -0
  40. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue.rb +212 -0
  41. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue_last_push.rb +268 -0
  42. data/lib/repull/models/invite_booking_extranet_user200_response.rb +174 -0
  43. data/lib/repull/models/invite_booking_extranet_user_request.rb +173 -0
  44. data/lib/repull/models/list_connection_units200_response.rb +242 -0
  45. data/lib/repull/models/list_connection_units200_response_listing_options_inner.rb +165 -0
  46. data/lib/repull/models/list_connection_units200_response_units_inner.rb +194 -0
  47. data/lib/repull/models/listing_publish_status_connection.rb +34 -1
  48. data/lib/repull/models/pms_write_policy.rb +191 -0
  49. data/lib/repull/models/pms_write_policy_calendar.rb +219 -0
  50. data/lib/repull/models/pms_write_policy_reservations.rb +219 -0
  51. data/lib/repull/models/preapprove_conversation201_response.rb +47 -6
  52. data/lib/repull/models/preapprove_conversation_request.rb +34 -5
  53. data/lib/repull/models/preview_conversation_special_offer_request.rb +231 -0
  54. data/lib/repull/models/preview_conversation_special_offer_request_fees_inner.rb +199 -0
  55. data/lib/repull/models/preview_conversation_special_offer_request_guests.rb +250 -0
  56. data/lib/repull/models/property.rb +14 -2
  57. data/lib/repull/models/record_account.rb +170 -0
  58. data/lib/repull/models/reply_to_review_request.rb +33 -4
  59. data/lib/repull/models/reservation.rb +12 -1
  60. data/lib/repull/models/review.rb +12 -1
  61. data/lib/repull/models/search_connect_session_listing_options200_response.rb +158 -0
  62. data/lib/repull/models/search_connect_session_listing_options200_response_data_inner.rb +166 -0
  63. data/lib/repull/models/search_connection_listing_options200_response.rb +159 -0
  64. data/lib/repull/models/send_message_request.rb +1 -1
  65. data/lib/repull/models/start_booking_extranet_login200_response.rb +174 -0
  66. data/lib/repull/models/start_booking_extranet_login_request.rb +225 -0
  67. data/lib/repull/models/submit_cloudbeds_credentials200_response.rb +10 -1
  68. data/lib/repull/models/submit_cloudbeds_credentials_request.rb +11 -1
  69. data/lib/repull/models/submit_mews_credentials200_response.rb +10 -1
  70. data/lib/repull/models/submit_mews_credentials_request.rb +11 -1
  71. data/lib/repull/models/update_connect_write_policy_request.rb +157 -0
  72. data/lib/repull/models/update_connect_write_policy_request_calendar.rb +165 -0
  73. data/lib/repull/models/update_connect_write_policy_request_reservations.rb +165 -0
  74. data/lib/repull/models/vrbo_import_status.rb +249 -0
  75. data/lib/repull/models/vrbo_login200_response.rb +235 -0
  76. data/lib/repull/models/vrbo_login_request.rb +271 -0
  77. data/lib/repull/models/webhook_event.rb +2 -0
  78. data/lib/repull/models/webhook_event_type.rb +2 -1
  79. data/lib/repull/models/withdraw_conversation_preapproval200_response.rb +226 -0
  80. data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +29 -1
  81. data/lib/repull/version.rb +1 -1
  82. data/lib/repull.rb +47 -0
  83. data/openapi/v1.json +2810 -74
  84. data/scripts/regen.sh +1 -1
  85. metadata +49 -2
@@ -0,0 +1,312 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Repull
16
+ class ConnectionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Map, unmap or create listings for units
23
+ # One instruction per unit: `{unitId, listingId}` maps, `{unitId, listingId: null}` unmaps, `{unitId, create: true}` creates a listing. Answers per unit. Vrbo: nothing is imported when the account is signed in. Applying a mapping that maps at least one unit starts the import: upcoming bookings and the last 30 days of messages first, then the whole account history. Follow it on `GET /v1/connect/vrbo-login` (`accounts[].import`). Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
24
+ # @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
25
+ # @param apply_connection_mappings_request [ApplyConnectionMappingsRequest]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [ApplyConnectionMappings200Response]
28
+ def apply_connection_mappings(id, apply_connection_mappings_request, opts = {})
29
+ data, _status_code, _headers = apply_connection_mappings_with_http_info(id, apply_connection_mappings_request, opts)
30
+ data
31
+ end
32
+
33
+ # Map, unmap or create listings for units
34
+ # One instruction per unit: `{unitId, listingId}` maps, `{unitId, listingId: null}` unmaps, `{unitId, create: true}` creates a listing. Answers per unit. Vrbo: nothing is imported when the account is signed in. Applying a mapping that maps at least one unit starts the import: upcoming bookings and the last 30 days of messages first, then the whole account history. Follow it on `GET /v1/connect/vrbo-login` (`accounts[].import`). Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
35
+ # @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
36
+ # @param apply_connection_mappings_request [ApplyConnectionMappingsRequest]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(ApplyConnectionMappings200Response, Integer, Hash)>] ApplyConnectionMappings200Response data, response status code and response headers
39
+ def apply_connection_mappings_with_http_info(id, apply_connection_mappings_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.apply_connection_mappings ...'
42
+ end
43
+ # verify the required parameter 'id' is set
44
+ if @api_client.config.client_side_validation && id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.apply_connection_mappings"
46
+ end
47
+ # verify the required parameter 'apply_connection_mappings_request' is set
48
+ if @api_client.config.client_side_validation && apply_connection_mappings_request.nil?
49
+ fail ArgumentError, "Missing the required parameter 'apply_connection_mappings_request' when calling ConnectionsApi.apply_connection_mappings"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/connections/{id}/mappings'.sub('{id}', CGI.escape(id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(apply_connection_mappings_request)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'ApplyConnectionMappings200Response'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"ConnectionsApi.apply_connection_mappings",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: ConnectionsApi#apply_connection_mappings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Auto-map units by exact name
97
+ # Proposes (or with `apply: true` applies) mappings where a unit's name exactly matches one listing. Never guesses on ambiguity. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
98
+ # @param id [String] Connection handle &#x60;{channel}:{externalAccountId}&#x60;, e.g. &#x60;vrbo:12&#x60; or &#x60;booking_extranet:36&#x60;.
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [AutoMapConnectionUnitsRequest] :auto_map_connection_units_request
101
+ # @return [AutoMapConnectionUnits200Response]
102
+ def auto_map_connection_units(id, opts = {})
103
+ data, _status_code, _headers = auto_map_connection_units_with_http_info(id, opts)
104
+ data
105
+ end
106
+
107
+ # Auto-map units by exact name
108
+ # Proposes (or with &#x60;apply: true&#x60; applies) mappings where a unit&#39;s name exactly matches one listing. Never guesses on ambiguity. Auth: a Repull API key, or a Connect session token (&#x60;sessionId&#x60;) while the hosted flow is mapping.
109
+ # @param id [String] Connection handle &#x60;{channel}:{externalAccountId}&#x60;, e.g. &#x60;vrbo:12&#x60; or &#x60;booking_extranet:36&#x60;.
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [AutoMapConnectionUnitsRequest] :auto_map_connection_units_request
112
+ # @return [Array<(AutoMapConnectionUnits200Response, Integer, Hash)>] AutoMapConnectionUnits200Response data, response status code and response headers
113
+ def auto_map_connection_units_with_http_info(id, opts = {})
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.auto_map_connection_units ...'
116
+ end
117
+ # verify the required parameter 'id' is set
118
+ if @api_client.config.client_side_validation && id.nil?
119
+ fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.auto_map_connection_units"
120
+ end
121
+ # resource path
122
+ local_var_path = '/v1/connections/{id}/mappings/automap'.sub('{id}', CGI.escape(id.to_s))
123
+
124
+ # query parameters
125
+ query_params = opts[:query_params] || {}
126
+
127
+ # header parameters
128
+ header_params = opts[:header_params] || {}
129
+ # HTTP header 'Accept' (if needed)
130
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
131
+ # HTTP header 'Content-Type'
132
+ content_type = @api_client.select_header_content_type(['application/json'])
133
+ if !content_type.nil?
134
+ header_params['Content-Type'] = content_type
135
+ end
136
+
137
+ # form parameters
138
+ form_params = opts[:form_params] || {}
139
+
140
+ # http body (model)
141
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'auto_map_connection_units_request'])
142
+
143
+ # return_type
144
+ return_type = opts[:debug_return_type] || 'AutoMapConnectionUnits200Response'
145
+
146
+ # auth_names
147
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
148
+
149
+ new_options = opts.merge(
150
+ :operation => :"ConnectionsApi.auto_map_connection_units",
151
+ :header_params => header_params,
152
+ :query_params => query_params,
153
+ :form_params => form_params,
154
+ :body => post_body,
155
+ :auth_names => auth_names,
156
+ :return_type => return_type
157
+ )
158
+
159
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
160
+ if @api_client.config.debugging
161
+ @api_client.config.logger.debug "API called: ConnectionsApi#auto_map_connection_units\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
162
+ end
163
+ return data, status_code, headers
164
+ end
165
+
166
+ # List a connection's mappable units
167
+ # The units of a connected account with their current listing, a safe suggestion, and the workspace's listing options. `status: ready` with no units means the account has no properties. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping. `listing_options` carries only the listings the units already point at (mapped or suggested); `listing_options_total` says how many the workspace has. Search the rest with `GET /v1/connections/{id}/listing-options?q=`.
168
+ # @param id [String] Connection handle &#x60;{channel}:{externalAccountId}&#x60;, e.g. &#x60;vrbo:12&#x60; or &#x60;booking_extranet:36&#x60;.
169
+ # @param [Hash] opts the optional parameters
170
+ # @option opts [String] :session_id The Connect session ID (capability token).
171
+ # @return [ListConnectionUnits200Response]
172
+ def list_connection_units(id, opts = {})
173
+ data, _status_code, _headers = list_connection_units_with_http_info(id, opts)
174
+ data
175
+ end
176
+
177
+ # List a connection&#39;s mappable units
178
+ # The units of a connected account with their current listing, a safe suggestion, and the workspace&#39;s listing options. &#x60;status: ready&#x60; with no units means the account has no properties. Auth: a Repull API key, or a Connect session token (&#x60;sessionId&#x60;) while the hosted flow is mapping. &#x60;listing_options&#x60; carries only the listings the units already point at (mapped or suggested); &#x60;listing_options_total&#x60; says how many the workspace has. Search the rest with &#x60;GET /v1/connections/{id}/listing-options?q&#x3D;&#x60;.
179
+ # @param id [String] Connection handle &#x60;{channel}:{externalAccountId}&#x60;, e.g. &#x60;vrbo:12&#x60; or &#x60;booking_extranet:36&#x60;.
180
+ # @param [Hash] opts the optional parameters
181
+ # @option opts [String] :session_id The Connect session ID (capability token).
182
+ # @return [Array<(ListConnectionUnits200Response, Integer, Hash)>] ListConnectionUnits200Response data, response status code and response headers
183
+ def list_connection_units_with_http_info(id, opts = {})
184
+ if @api_client.config.debugging
185
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.list_connection_units ...'
186
+ end
187
+ # verify the required parameter 'id' is set
188
+ if @api_client.config.client_side_validation && id.nil?
189
+ fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.list_connection_units"
190
+ end
191
+ # resource path
192
+ local_var_path = '/v1/connections/{id}/units'.sub('{id}', CGI.escape(id.to_s))
193
+
194
+ # query parameters
195
+ query_params = opts[:query_params] || {}
196
+ query_params[:'sessionId'] = opts[:'session_id'] if !opts[:'session_id'].nil?
197
+
198
+ # header parameters
199
+ header_params = opts[:header_params] || {}
200
+ # HTTP header 'Accept' (if needed)
201
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
202
+
203
+ # form parameters
204
+ form_params = opts[:form_params] || {}
205
+
206
+ # http body (model)
207
+ post_body = opts[:debug_body]
208
+
209
+ # return_type
210
+ return_type = opts[:debug_return_type] || 'ListConnectionUnits200Response'
211
+
212
+ # auth_names
213
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
214
+
215
+ new_options = opts.merge(
216
+ :operation => :"ConnectionsApi.list_connection_units",
217
+ :header_params => header_params,
218
+ :query_params => query_params,
219
+ :form_params => form_params,
220
+ :body => post_body,
221
+ :auth_names => auth_names,
222
+ :return_type => return_type
223
+ )
224
+
225
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug "API called: ConnectionsApi#list_connection_units\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
228
+ end
229
+ return data, status_code, headers
230
+ end
231
+
232
+ # Search listings a unit can be mapped to
233
+ # Search the workspace's active listings by name, city or id, for a mapping picker. A workspace can hold tens of thousands of listings, so pickers search here as the user types rather than loading them all. Empty `q` returns the first `limit` listings by name. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
234
+ # @param id [String] Connection handle &#x60;{channel}:{externalAccountId}&#x60;.
235
+ # @param [Hash] opts the optional parameters
236
+ # @option opts [String] :q Text to match (name, city or listing id).
237
+ # @option opts [Integer] :limit (default to 20)
238
+ # @option opts [String] :session_id
239
+ # @return [SearchConnectionListingOptions200Response]
240
+ def search_connection_listing_options(id, opts = {})
241
+ data, _status_code, _headers = search_connection_listing_options_with_http_info(id, opts)
242
+ data
243
+ end
244
+
245
+ # Search listings a unit can be mapped to
246
+ # Search the workspace&#39;s active listings by name, city or id, for a mapping picker. A workspace can hold tens of thousands of listings, so pickers search here as the user types rather than loading them all. Empty &#x60;q&#x60; returns the first &#x60;limit&#x60; listings by name. Auth: a Repull API key, or a Connect session token (&#x60;sessionId&#x60;) while the hosted flow is mapping.
247
+ # @param id [String] Connection handle &#x60;{channel}:{externalAccountId}&#x60;.
248
+ # @param [Hash] opts the optional parameters
249
+ # @option opts [String] :q Text to match (name, city or listing id).
250
+ # @option opts [Integer] :limit (default to 20)
251
+ # @option opts [String] :session_id
252
+ # @return [Array<(SearchConnectionListingOptions200Response, Integer, Hash)>] SearchConnectionListingOptions200Response data, response status code and response headers
253
+ def search_connection_listing_options_with_http_info(id, opts = {})
254
+ if @api_client.config.debugging
255
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.search_connection_listing_options ...'
256
+ end
257
+ # verify the required parameter 'id' is set
258
+ if @api_client.config.client_side_validation && id.nil?
259
+ fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.search_connection_listing_options"
260
+ end
261
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50
262
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConnectionsApi.search_connection_listing_options, must be smaller than or equal to 50.'
263
+ end
264
+
265
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
266
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConnectionsApi.search_connection_listing_options, must be greater than or equal to 1.'
267
+ end
268
+
269
+ # resource path
270
+ local_var_path = '/v1/connections/{id}/listing-options'.sub('{id}', CGI.escape(id.to_s))
271
+
272
+ # query parameters
273
+ query_params = opts[:query_params] || {}
274
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
275
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
276
+ query_params[:'sessionId'] = opts[:'session_id'] if !opts[:'session_id'].nil?
277
+
278
+ # header parameters
279
+ header_params = opts[:header_params] || {}
280
+ # HTTP header 'Accept' (if needed)
281
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
282
+
283
+ # form parameters
284
+ form_params = opts[:form_params] || {}
285
+
286
+ # http body (model)
287
+ post_body = opts[:debug_body]
288
+
289
+ # return_type
290
+ return_type = opts[:debug_return_type] || 'SearchConnectionListingOptions200Response'
291
+
292
+ # auth_names
293
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
294
+
295
+ new_options = opts.merge(
296
+ :operation => :"ConnectionsApi.search_connection_listing_options",
297
+ :header_params => header_params,
298
+ :query_params => query_params,
299
+ :form_params => form_params,
300
+ :body => post_body,
301
+ :auth_names => auth_names,
302
+ :return_type => return_type
303
+ )
304
+
305
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
306
+ if @api_client.config.debugging
307
+ @api_client.config.logger.debug "API called: ConnectionsApi#search_connection_listing_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
308
+ end
309
+ return data, status_code, headers
310
+ end
311
+ end
312
+ end