repull 0.2.61 → 0.2.63

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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +26 -2
  3. data/lib/repull/api/connect_api.rb +200 -0
  4. data/lib/repull/api/listings_api.rb +74 -4
  5. data/lib/repull/api/properties_api.rb +3 -3
  6. data/lib/repull/api/tiket_api.rb +885 -0
  7. data/lib/repull/models/get_listing_markups200_response_airbnb_inner.rb +1 -1
  8. data/lib/repull/models/get_listing_markups200_response_vrbo_inner.rb +3 -3
  9. data/lib/repull/models/listing_publish_tiket_response.rb +165 -0
  10. data/lib/repull/models/listing_publish_tiket_response_result.rb +182 -0
  11. data/lib/repull/models/map_tiket_connect_rooms_request.rb +201 -0
  12. data/lib/repull/models/map_tiket_connect_rooms_request_mappings_inner.rb +184 -0
  13. data/lib/repull/models/publish_listing_tiket_request.rb +148 -0
  14. data/lib/repull/models/reservation.rb +1 -1
  15. data/lib/repull/models/set_listing_markup_request.rb +7 -7
  16. data/lib/repull/models/submit_guest_review200_response.rb +14 -1
  17. data/lib/repull/models/sync_tiket_request.rb +160 -0
  18. data/lib/repull/models/tiket_ari_day.rb +347 -0
  19. data/lib/repull/models/tiket_ari_mismatch.rb +198 -0
  20. data/lib/repull/models/tiket_ari_update.rb +468 -0
  21. data/lib/repull/models/tiket_ari_write_response.rb +357 -0
  22. data/lib/repull/models/tiket_availability_response.rb +269 -0
  23. data/lib/repull/models/tiket_availability_update_request.rb +241 -0
  24. data/lib/repull/models/tiket_child_price.rb +217 -0
  25. data/lib/repull/models/tiket_connect_claim_response.rb +216 -0
  26. data/lib/repull/models/tiket_connect_map_rooms_response.rb +204 -0
  27. data/lib/repull/models/tiket_connect_rooms_response.rb +295 -0
  28. data/lib/repull/models/tiket_connect_rooms_response_rooms_inner.rb +199 -0
  29. data/lib/repull/models/tiket_content_response.rb +202 -0
  30. data/lib/repull/models/tiket_content_response_objects_inner.rb +237 -0
  31. data/lib/repull/models/tiket_listing_pricing_response.rb +321 -0
  32. data/lib/repull/models/tiket_listing_pricing_update_request.rb +209 -0
  33. data/lib/repull/models/tiket_map_listings_request.rb +202 -0
  34. data/lib/repull/models/tiket_map_listings_request_mappings_inner.rb +186 -0
  35. data/lib/repull/models/tiket_map_listings_response.rb +169 -0
  36. data/lib/repull/models/tiket_map_listings_response_results_inner.rb +176 -0
  37. data/lib/repull/models/tiket_occupancy_price.rb +201 -0
  38. data/lib/repull/models/tiket_property.rb +278 -0
  39. data/lib/repull/models/tiket_property_list_response.rb +166 -0
  40. data/lib/repull/models/tiket_property_listings_inner.rb +175 -0
  41. data/lib/repull/models/tiket_property_rooms_response.rb +192 -0
  42. data/lib/repull/models/tiket_rate_plan.rb +178 -0
  43. data/lib/repull/models/tiket_reservation.rb +421 -0
  44. data/lib/repull/models/tiket_reservation_list_response.rb +192 -0
  45. data/lib/repull/models/tiket_reservation_list_response_pagination.rb +165 -0
  46. data/lib/repull/models/tiket_room.rb +232 -0
  47. data/lib/repull/models/tiket_setup_request.rb +469 -0
  48. data/lib/repull/models/tiket_setup_request_contacts_inner.rb +192 -0
  49. data/lib/repull/models/tiket_setup_request_properties_inner.rb +174 -0
  50. data/lib/repull/models/tiket_setup_response.rb +159 -0
  51. data/lib/repull/models/tiket_sync_response.rb +167 -0
  52. data/lib/repull/models/tiket_sync_response_results_inner.rb +239 -0
  53. data/lib/repull/models/verify_tiket_claim_request.rb +212 -0
  54. data/lib/repull/version.rb +1 -1
  55. data/lib/repull.rb +43 -0
  56. data/openapi/v1.json +8101 -5462
  57. data/spec/api/tiket_api_spec.rb +56 -0
  58. metadata +47 -2
@@ -0,0 +1,885 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## 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`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
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 TiketApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Read tiket.com rates, availability and restrictions
23
+ # What tiket.com holds for a property over a date window, read live from tiket.com: rooms to sell and booked per room type, prices (Room Based, or per number of guests on an Occupancy Based property, and children prices) and restrictions per rate plan. One row per night, room type and rate plan. `property_id` must be a tiket.com property connected to this workspace (`GET /v1/channels/tiket/properties`).
24
+ # @param property_id [String] tiket.com Hotel ID (shown next to the property name in the tiket.com extranet; `propertyId` on `GET /v1/channels/tiket/properties`).
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Date] :start_date First night, YYYY-MM-DD. Default today.
27
+ # @option opts [Date] :end_date Last night, YYYY-MM-DD, inclusive. Default `start_date` + `number_of_days` - 1.
28
+ # @option opts [Integer] :number_of_days Window length when `end_date` is omitted. (default to 31)
29
+ # @option opts [String] :room_type_code Only this tiket.com room type.
30
+ # @option opts [String] :rate_plan_code Only this tiket.com rate plan.
31
+ # @return [TiketAvailabilityResponse]
32
+ def get_tiket_availability(property_id, opts = {})
33
+ data, _status_code, _headers = get_tiket_availability_with_http_info(property_id, opts)
34
+ data
35
+ end
36
+
37
+ # Read tiket.com rates, availability and restrictions
38
+ # What tiket.com holds for a property over a date window, read live from tiket.com: rooms to sell and booked per room type, prices (Room Based, or per number of guests on an Occupancy Based property, and children prices) and restrictions per rate plan. One row per night, room type and rate plan. `property_id` must be a tiket.com property connected to this workspace (`GET /v1/channels/tiket/properties`).
39
+ # @param property_id [String] tiket.com Hotel ID (shown next to the property name in the tiket.com extranet; `propertyId` on `GET /v1/channels/tiket/properties`).
40
+ # @param [Hash] opts the optional parameters
41
+ # @option opts [Date] :start_date First night, YYYY-MM-DD. Default today.
42
+ # @option opts [Date] :end_date Last night, YYYY-MM-DD, inclusive. Default `start_date` + `number_of_days` - 1.
43
+ # @option opts [Integer] :number_of_days Window length when `end_date` is omitted. (default to 31)
44
+ # @option opts [String] :room_type_code Only this tiket.com room type.
45
+ # @option opts [String] :rate_plan_code Only this tiket.com rate plan.
46
+ # @return [Array<(TiketAvailabilityResponse, Integer, Hash)>] TiketAvailabilityResponse data, response status code and response headers
47
+ def get_tiket_availability_with_http_info(property_id, opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: TiketApi.get_tiket_availability ...'
50
+ end
51
+ # verify the required parameter 'property_id' is set
52
+ if @api_client.config.client_side_validation && property_id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'property_id' when calling TiketApi.get_tiket_availability"
54
+ end
55
+ if @api_client.config.client_side_validation && !opts[:'number_of_days'].nil? && opts[:'number_of_days'] > 366
56
+ fail ArgumentError, 'invalid value for "opts[:"number_of_days"]" when calling TiketApi.get_tiket_availability, must be smaller than or equal to 366.'
57
+ end
58
+
59
+ if @api_client.config.client_side_validation && !opts[:'number_of_days'].nil? && opts[:'number_of_days'] < 1
60
+ fail ArgumentError, 'invalid value for "opts[:"number_of_days"]" when calling TiketApi.get_tiket_availability, must be greater than or equal to 1.'
61
+ end
62
+
63
+ # resource path
64
+ local_var_path = '/v1/channels/tiket/availability'
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+ query_params[:'property_id'] = property_id
69
+ query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
70
+ query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
71
+ query_params[:'number_of_days'] = opts[:'number_of_days'] if !opts[:'number_of_days'].nil?
72
+ query_params[:'room_type_code'] = opts[:'room_type_code'] if !opts[:'room_type_code'].nil?
73
+ query_params[:'rate_plan_code'] = opts[:'rate_plan_code'] if !opts[:'rate_plan_code'].nil?
74
+
75
+ # header parameters
76
+ header_params = opts[:header_params] || {}
77
+ # HTTP header 'Accept' (if needed)
78
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
79
+
80
+ # form parameters
81
+ form_params = opts[:form_params] || {}
82
+
83
+ # http body (model)
84
+ post_body = opts[:debug_body]
85
+
86
+ # return_type
87
+ return_type = opts[:debug_return_type] || 'TiketAvailabilityResponse'
88
+
89
+ # auth_names
90
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
91
+
92
+ new_options = opts.merge(
93
+ :operation => :"TiketApi.get_tiket_availability",
94
+ :header_params => header_params,
95
+ :query_params => query_params,
96
+ :form_params => form_params,
97
+ :body => post_body,
98
+ :auth_names => auth_names,
99
+ :return_type => return_type
100
+ )
101
+
102
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug "API called: TiketApi#get_tiket_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
105
+ end
106
+ return data, status_code, headers
107
+ end
108
+
109
+ # Read the content Repull sent tiket.com
110
+ # tiket.com has no API to read content back, so this is the record of what Repull sent for a property — the property, its room types and rate plans — with when each was sent and tiket.com's reference for it. Send changes with `POST /v1/listings/{id}/publish/tiket`. Name the property with `property_id`, or with `partner_hotel_code` for a property Repull created that tiket.com has not assigned an id to yet.
111
+ # @param [Hash] opts the optional parameters
112
+ # @option opts [String] :property_id tiket.com Hotel ID (shown next to the property name in the tiket.com extranet; &#x60;propertyId&#x60; on &#x60;GET /v1/channels/tiket/properties&#x60;). Required unless &#x60;partner_hotel_code&#x60; is sent.
113
+ # @option opts [String] :partner_hotel_code Repull&#39;s code for a property Repull created (&#x60;partnerHotelCode&#x60;).
114
+ # @return [TiketContentResponse]
115
+ def get_tiket_content(opts = {})
116
+ data, _status_code, _headers = get_tiket_content_with_http_info(opts)
117
+ data
118
+ end
119
+
120
+ # Read the content Repull sent tiket.com
121
+ # tiket.com has no API to read content back, so this is the record of what Repull sent for a property — the property, its room types and rate plans — with when each was sent and tiket.com&#39;s reference for it. Send changes with &#x60;POST /v1/listings/{id}/publish/tiket&#x60;. Name the property with &#x60;property_id&#x60;, or with &#x60;partner_hotel_code&#x60; for a property Repull created that tiket.com has not assigned an id to yet.
122
+ # @param [Hash] opts the optional parameters
123
+ # @option opts [String] :property_id tiket.com Hotel ID (shown next to the property name in the tiket.com extranet; &#x60;propertyId&#x60; on &#x60;GET /v1/channels/tiket/properties&#x60;). Required unless &#x60;partner_hotel_code&#x60; is sent.
124
+ # @option opts [String] :partner_hotel_code Repull&#39;s code for a property Repull created (&#x60;partnerHotelCode&#x60;).
125
+ # @return [Array<(TiketContentResponse, Integer, Hash)>] TiketContentResponse data, response status code and response headers
126
+ def get_tiket_content_with_http_info(opts = {})
127
+ if @api_client.config.debugging
128
+ @api_client.config.logger.debug 'Calling API: TiketApi.get_tiket_content ...'
129
+ end
130
+ # resource path
131
+ local_var_path = '/v1/channels/tiket/content'
132
+
133
+ # query parameters
134
+ query_params = opts[:query_params] || {}
135
+ query_params[:'property_id'] = opts[:'property_id'] if !opts[:'property_id'].nil?
136
+ query_params[:'partner_hotel_code'] = opts[:'partner_hotel_code'] if !opts[:'partner_hotel_code'].nil?
137
+
138
+ # header parameters
139
+ header_params = opts[:header_params] || {}
140
+ # HTTP header 'Accept' (if needed)
141
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
142
+
143
+ # form parameters
144
+ form_params = opts[:form_params] || {}
145
+
146
+ # http body (model)
147
+ post_body = opts[:debug_body]
148
+
149
+ # return_type
150
+ return_type = opts[:debug_return_type] || 'TiketContentResponse'
151
+
152
+ # auth_names
153
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
154
+
155
+ new_options = opts.merge(
156
+ :operation => :"TiketApi.get_tiket_content",
157
+ :header_params => header_params,
158
+ :query_params => query_params,
159
+ :form_params => form_params,
160
+ :body => post_body,
161
+ :auth_names => auth_names,
162
+ :return_type => return_type
163
+ )
164
+
165
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug "API called: TiketApi#get_tiket_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
168
+ end
169
+ return data, status_code, headers
170
+ end
171
+
172
+ # Read tiket.com rates, availability and restrictions for a listing
173
+ # Same as `GET /v1/channels/tiket/availability`, addressed by listing: the listing's tiket.com room type and every active rate plan of that room, read live from tiket.com. A listing mapped on more than one tiket.com property needs `hotel_id`; without it the call returns `409 ambiguous_tiket_mapping` listing the ids.
174
+ # @param id [Integer] Repull listing id.
175
+ # @param [Hash] opts the optional parameters
176
+ # @option opts [String] :hotel_id tiket.com Hotel ID — only needed when the listing is mapped on more than one tiket.com property.
177
+ # @option opts [Date] :start_date First night, YYYY-MM-DD. Default today.
178
+ # @option opts [Date] :end_date Last night, YYYY-MM-DD, inclusive.
179
+ # @option opts [Integer] :number_of_days Window length when &#x60;end_date&#x60; is omitted. (default to 31)
180
+ # @return [TiketListingPricingResponse]
181
+ def get_tiket_listing_pricing(id, opts = {})
182
+ data, _status_code, _headers = get_tiket_listing_pricing_with_http_info(id, opts)
183
+ data
184
+ end
185
+
186
+ # Read tiket.com rates, availability and restrictions for a listing
187
+ # Same as &#x60;GET /v1/channels/tiket/availability&#x60;, addressed by listing: the listing&#39;s tiket.com room type and every active rate plan of that room, read live from tiket.com. A listing mapped on more than one tiket.com property needs &#x60;hotel_id&#x60;; without it the call returns &#x60;409 ambiguous_tiket_mapping&#x60; listing the ids.
188
+ # @param id [Integer] Repull listing id.
189
+ # @param [Hash] opts the optional parameters
190
+ # @option opts [String] :hotel_id tiket.com Hotel ID — only needed when the listing is mapped on more than one tiket.com property.
191
+ # @option opts [Date] :start_date First night, YYYY-MM-DD. Default today.
192
+ # @option opts [Date] :end_date Last night, YYYY-MM-DD, inclusive.
193
+ # @option opts [Integer] :number_of_days Window length when &#x60;end_date&#x60; is omitted. (default to 31)
194
+ # @return [Array<(TiketListingPricingResponse, Integer, Hash)>] TiketListingPricingResponse data, response status code and response headers
195
+ def get_tiket_listing_pricing_with_http_info(id, opts = {})
196
+ if @api_client.config.debugging
197
+ @api_client.config.logger.debug 'Calling API: TiketApi.get_tiket_listing_pricing ...'
198
+ end
199
+ # verify the required parameter 'id' is set
200
+ if @api_client.config.client_side_validation && id.nil?
201
+ fail ArgumentError, "Missing the required parameter 'id' when calling TiketApi.get_tiket_listing_pricing"
202
+ end
203
+ if @api_client.config.client_side_validation && !opts[:'number_of_days'].nil? && opts[:'number_of_days'] > 366
204
+ fail ArgumentError, 'invalid value for "opts[:"number_of_days"]" when calling TiketApi.get_tiket_listing_pricing, must be smaller than or equal to 366.'
205
+ end
206
+
207
+ if @api_client.config.client_side_validation && !opts[:'number_of_days'].nil? && opts[:'number_of_days'] < 1
208
+ fail ArgumentError, 'invalid value for "opts[:"number_of_days"]" when calling TiketApi.get_tiket_listing_pricing, must be greater than or equal to 1.'
209
+ end
210
+
211
+ # resource path
212
+ local_var_path = '/v1/channels/tiket/listings/{id}/pricing'.sub('{id}', CGI.escape(id.to_s))
213
+
214
+ # query parameters
215
+ query_params = opts[:query_params] || {}
216
+ query_params[:'hotel_id'] = opts[:'hotel_id'] if !opts[:'hotel_id'].nil?
217
+ query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
218
+ query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
219
+ query_params[:'number_of_days'] = opts[:'number_of_days'] if !opts[:'number_of_days'].nil?
220
+
221
+ # header parameters
222
+ header_params = opts[:header_params] || {}
223
+ # HTTP header 'Accept' (if needed)
224
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
225
+
226
+ # form parameters
227
+ form_params = opts[:form_params] || {}
228
+
229
+ # http body (model)
230
+ post_body = opts[:debug_body]
231
+
232
+ # return_type
233
+ return_type = opts[:debug_return_type] || 'TiketListingPricingResponse'
234
+
235
+ # auth_names
236
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
237
+
238
+ new_options = opts.merge(
239
+ :operation => :"TiketApi.get_tiket_listing_pricing",
240
+ :header_params => header_params,
241
+ :query_params => query_params,
242
+ :form_params => form_params,
243
+ :body => post_body,
244
+ :auth_names => auth_names,
245
+ :return_type => return_type
246
+ )
247
+
248
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
249
+ if @api_client.config.debugging
250
+ @api_client.config.logger.debug "API called: TiketApi#get_tiket_listing_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
251
+ end
252
+ return data, status_code, headers
253
+ end
254
+
255
+ # Get a tiket.com property
256
+ # One tiket.com property connected to this workspace, by Hotel ID — same shape as an entry of `GET /v1/channels/tiket/properties`. A property connected to another workspace returns the same `404` as one that does not exist.
257
+ # @param id [String] tiket.com Hotel ID.
258
+ # @param [Hash] opts the optional parameters
259
+ # @option opts [String] :status &#x60;active&#x60; (default) hides inactive listings: they are left out of &#x60;listings&#x60;, and a room mapped to one comes back with &#x60;listingId: null&#x60; and &#x60;listingHidden: true&#x60;. &#x60;inactive&#x60; shows only inactive listings and &#x60;all&#x60; shows both. &#x60;mappingStatus&#x60; always counts every mapped room. (default to 'active')
260
+ # @return [TiketProperty]
261
+ def get_tiket_property(id, opts = {})
262
+ data, _status_code, _headers = get_tiket_property_with_http_info(id, opts)
263
+ data
264
+ end
265
+
266
+ # Get a tiket.com property
267
+ # One tiket.com property connected to this workspace, by Hotel ID — same shape as an entry of &#x60;GET /v1/channels/tiket/properties&#x60;. A property connected to another workspace returns the same &#x60;404&#x60; as one that does not exist.
268
+ # @param id [String] tiket.com Hotel ID.
269
+ # @param [Hash] opts the optional parameters
270
+ # @option opts [String] :status &#x60;active&#x60; (default) hides inactive listings: they are left out of &#x60;listings&#x60;, and a room mapped to one comes back with &#x60;listingId: null&#x60; and &#x60;listingHidden: true&#x60;. &#x60;inactive&#x60; shows only inactive listings and &#x60;all&#x60; shows both. &#x60;mappingStatus&#x60; always counts every mapped room. (default to 'active')
271
+ # @return [Array<(TiketProperty, Integer, Hash)>] TiketProperty data, response status code and response headers
272
+ def get_tiket_property_with_http_info(id, opts = {})
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug 'Calling API: TiketApi.get_tiket_property ...'
275
+ end
276
+ # verify the required parameter 'id' is set
277
+ if @api_client.config.client_side_validation && id.nil?
278
+ fail ArgumentError, "Missing the required parameter 'id' when calling TiketApi.get_tiket_property"
279
+ end
280
+ allowable_values = ["active", "inactive", "all"]
281
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
282
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
283
+ end
284
+ # resource path
285
+ local_var_path = '/v1/channels/tiket/properties/{id}'.sub('{id}', CGI.escape(id.to_s))
286
+
287
+ # query parameters
288
+ query_params = opts[:query_params] || {}
289
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
290
+
291
+ # header parameters
292
+ header_params = opts[:header_params] || {}
293
+ # HTTP header 'Accept' (if needed)
294
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
295
+
296
+ # form parameters
297
+ form_params = opts[:form_params] || {}
298
+
299
+ # http body (model)
300
+ post_body = opts[:debug_body]
301
+
302
+ # return_type
303
+ return_type = opts[:debug_return_type] || 'TiketProperty'
304
+
305
+ # auth_names
306
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
307
+
308
+ new_options = opts.merge(
309
+ :operation => :"TiketApi.get_tiket_property",
310
+ :header_params => header_params,
311
+ :query_params => query_params,
312
+ :form_params => form_params,
313
+ :body => post_body,
314
+ :auth_names => auth_names,
315
+ :return_type => return_type
316
+ )
317
+
318
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
319
+ if @api_client.config.debugging
320
+ @api_client.config.logger.debug "API called: TiketApi#get_tiket_property\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
321
+ end
322
+ return data, status_code, headers
323
+ end
324
+
325
+ # List tiket.com properties
326
+ # Every tiket.com property connected to this workspace, each returned once with its room types, rate plans and the listing each room type is mapped to. A tiket.com property is a hotel or building; its room types are what guests book, and each room type maps to one Repull listing. A property whose rooms are not mapped yet is still listed, with `mappingStatus: \"unmapped\"`. Properties waiting for tiket.com to activate Repull are listed with their `activationStatus`.
327
+ # @param [Hash] opts the optional parameters
328
+ # @option opts [String] :status &#x60;active&#x60; (default) hides inactive listings: they are left out of &#x60;listings&#x60;, and a room mapped to one comes back with &#x60;listingId: null&#x60; and &#x60;listingHidden: true&#x60;. &#x60;inactive&#x60; shows only inactive listings and &#x60;all&#x60; shows both. &#x60;mappingStatus&#x60; always counts every mapped room. (default to 'active')
329
+ # @return [TiketPropertyListResponse]
330
+ def list_tiket_properties(opts = {})
331
+ data, _status_code, _headers = list_tiket_properties_with_http_info(opts)
332
+ data
333
+ end
334
+
335
+ # List tiket.com properties
336
+ # Every tiket.com property connected to this workspace, each returned once with its room types, rate plans and the listing each room type is mapped to. A tiket.com property is a hotel or building; its room types are what guests book, and each room type maps to one Repull listing. A property whose rooms are not mapped yet is still listed, with &#x60;mappingStatus: \&quot;unmapped\&quot;&#x60;. Properties waiting for tiket.com to activate Repull are listed with their &#x60;activationStatus&#x60;.
337
+ # @param [Hash] opts the optional parameters
338
+ # @option opts [String] :status &#x60;active&#x60; (default) hides inactive listings: they are left out of &#x60;listings&#x60;, and a room mapped to one comes back with &#x60;listingId: null&#x60; and &#x60;listingHidden: true&#x60;. &#x60;inactive&#x60; shows only inactive listings and &#x60;all&#x60; shows both. &#x60;mappingStatus&#x60; always counts every mapped room. (default to 'active')
339
+ # @return [Array<(TiketPropertyListResponse, Integer, Hash)>] TiketPropertyListResponse data, response status code and response headers
340
+ def list_tiket_properties_with_http_info(opts = {})
341
+ if @api_client.config.debugging
342
+ @api_client.config.logger.debug 'Calling API: TiketApi.list_tiket_properties ...'
343
+ end
344
+ allowable_values = ["active", "inactive", "all"]
345
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
346
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
347
+ end
348
+ # resource path
349
+ local_var_path = '/v1/channels/tiket/properties'
350
+
351
+ # query parameters
352
+ query_params = opts[:query_params] || {}
353
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
354
+
355
+ # header parameters
356
+ header_params = opts[:header_params] || {}
357
+ # HTTP header 'Accept' (if needed)
358
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
359
+
360
+ # form parameters
361
+ form_params = opts[:form_params] || {}
362
+
363
+ # http body (model)
364
+ post_body = opts[:debug_body]
365
+
366
+ # return_type
367
+ return_type = opts[:debug_return_type] || 'TiketPropertyListResponse'
368
+
369
+ # auth_names
370
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
371
+
372
+ new_options = opts.merge(
373
+ :operation => :"TiketApi.list_tiket_properties",
374
+ :header_params => header_params,
375
+ :query_params => query_params,
376
+ :form_params => form_params,
377
+ :body => post_body,
378
+ :auth_names => auth_names,
379
+ :return_type => return_type
380
+ )
381
+
382
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
383
+ if @api_client.config.debugging
384
+ @api_client.config.logger.debug "API called: TiketApi#list_tiket_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
385
+ end
386
+ return data, status_code, headers
387
+ end
388
+
389
+ # List a tiket.com property's room types
390
+ # The room types of a tiket.com property, each with its rate plans and the listing it is mapped to. `roomTypeCode` is what `POST /v1/channels/tiket/listings/map` and the rates writes take.
391
+ # @param id [String] tiket.com Hotel ID.
392
+ # @param [Hash] opts the optional parameters
393
+ # @return [TiketPropertyRoomsResponse]
394
+ def list_tiket_property_rooms(id, opts = {})
395
+ data, _status_code, _headers = list_tiket_property_rooms_with_http_info(id, opts)
396
+ data
397
+ end
398
+
399
+ # List a tiket.com property&#39;s room types
400
+ # The room types of a tiket.com property, each with its rate plans and the listing it is mapped to. &#x60;roomTypeCode&#x60; is what &#x60;POST /v1/channels/tiket/listings/map&#x60; and the rates writes take.
401
+ # @param id [String] tiket.com Hotel ID.
402
+ # @param [Hash] opts the optional parameters
403
+ # @return [Array<(TiketPropertyRoomsResponse, Integer, Hash)>] TiketPropertyRoomsResponse data, response status code and response headers
404
+ def list_tiket_property_rooms_with_http_info(id, opts = {})
405
+ if @api_client.config.debugging
406
+ @api_client.config.logger.debug 'Calling API: TiketApi.list_tiket_property_rooms ...'
407
+ end
408
+ # verify the required parameter 'id' is set
409
+ if @api_client.config.client_side_validation && id.nil?
410
+ fail ArgumentError, "Missing the required parameter 'id' when calling TiketApi.list_tiket_property_rooms"
411
+ end
412
+ # resource path
413
+ local_var_path = '/v1/channels/tiket/properties/{id}/rooms'.sub('{id}', CGI.escape(id.to_s))
414
+
415
+ # query parameters
416
+ query_params = opts[:query_params] || {}
417
+
418
+ # header parameters
419
+ header_params = opts[:header_params] || {}
420
+ # HTTP header 'Accept' (if needed)
421
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
422
+
423
+ # form parameters
424
+ form_params = opts[:form_params] || {}
425
+
426
+ # http body (model)
427
+ post_body = opts[:debug_body]
428
+
429
+ # return_type
430
+ return_type = opts[:debug_return_type] || 'TiketPropertyRoomsResponse'
431
+
432
+ # auth_names
433
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
434
+
435
+ new_options = opts.merge(
436
+ :operation => :"TiketApi.list_tiket_property_rooms",
437
+ :header_params => header_params,
438
+ :query_params => query_params,
439
+ :form_params => form_params,
440
+ :body => post_body,
441
+ :auth_names => auth_names,
442
+ :return_type => return_type
443
+ )
444
+
445
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
446
+ if @api_client.config.debugging
447
+ @api_client.config.logger.debug "API called: TiketApi#list_tiket_property_rooms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
448
+ end
449
+ return data, status_code, headers
450
+ end
451
+
452
+ # List tiket.com reservations as tiket.com sent them
453
+ # tiket.com's own record of the bookings it delivered, newest first: one row per booked room (`<id>`, `<id>-2`, …) with tiket.com's ids, rate plan, meal plan, cancellation policy, what the guest paid, the net amount tiket.com pays the property, how tiket.com pays (`paymentMethod`: `Virtual Credit Card` or `Bank Transfer`), and the Repull reservation the room became. **Cards.** Card details are never returned by the API, on this route or on `/v1/reservations`. **Date changes.** tiket.com sends a date change as a cancellation plus a new booking. Repull applies it as a change to the original reservation, so the Repull reservation keeps its id; the new tiket.com booking carries `previousTiketReservationId`. The same bookings, normalized like every other channel's (`source: tiket`), are on `GET /v1/reservations`.
454
+ # @param [Hash] opts the optional parameters
455
+ # @option opts [String] :property_id tiket.com Hotel ID (shown next to the property name in the tiket.com extranet; &#x60;propertyId&#x60; on &#x60;GET /v1/channels/tiket/properties&#x60;).
456
+ # @option opts [String] :status Only &#x60;confirmed&#x60; or only &#x60;cancelled&#x60; bookings.
457
+ # @option opts [Date] :check_in_from Check-in on or after, YYYY-MM-DD.
458
+ # @option opts [Date] :check_in_to Check-in on or before, YYYY-MM-DD.
459
+ # @option opts [Integer] :limit Page size. (default to 50)
460
+ # @option opts [Integer] :offset Rows to skip. (default to 0)
461
+ # @return [TiketReservationListResponse]
462
+ def list_tiket_reservations(opts = {})
463
+ data, _status_code, _headers = list_tiket_reservations_with_http_info(opts)
464
+ data
465
+ end
466
+
467
+ # List tiket.com reservations as tiket.com sent them
468
+ # tiket.com&#39;s own record of the bookings it delivered, newest first: one row per booked room (&#x60;&lt;id&gt;&#x60;, &#x60;&lt;id&gt;-2&#x60;, …) with tiket.com&#39;s ids, rate plan, meal plan, cancellation policy, what the guest paid, the net amount tiket.com pays the property, how tiket.com pays (&#x60;paymentMethod&#x60;: &#x60;Virtual Credit Card&#x60; or &#x60;Bank Transfer&#x60;), and the Repull reservation the room became. **Cards.** Card details are never returned by the API, on this route or on &#x60;/v1/reservations&#x60;. **Date changes.** tiket.com sends a date change as a cancellation plus a new booking. Repull applies it as a change to the original reservation, so the Repull reservation keeps its id; the new tiket.com booking carries &#x60;previousTiketReservationId&#x60;. The same bookings, normalized like every other channel&#39;s (&#x60;source: tiket&#x60;), are on &#x60;GET /v1/reservations&#x60;.
469
+ # @param [Hash] opts the optional parameters
470
+ # @option opts [String] :property_id tiket.com Hotel ID (shown next to the property name in the tiket.com extranet; &#x60;propertyId&#x60; on &#x60;GET /v1/channels/tiket/properties&#x60;).
471
+ # @option opts [String] :status Only &#x60;confirmed&#x60; or only &#x60;cancelled&#x60; bookings.
472
+ # @option opts [Date] :check_in_from Check-in on or after, YYYY-MM-DD.
473
+ # @option opts [Date] :check_in_to Check-in on or before, YYYY-MM-DD.
474
+ # @option opts [Integer] :limit Page size. (default to 50)
475
+ # @option opts [Integer] :offset Rows to skip. (default to 0)
476
+ # @return [Array<(TiketReservationListResponse, Integer, Hash)>] TiketReservationListResponse data, response status code and response headers
477
+ def list_tiket_reservations_with_http_info(opts = {})
478
+ if @api_client.config.debugging
479
+ @api_client.config.logger.debug 'Calling API: TiketApi.list_tiket_reservations ...'
480
+ end
481
+ allowable_values = ["confirmed", "cancelled"]
482
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
483
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
484
+ end
485
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
486
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TiketApi.list_tiket_reservations, must be smaller than or equal to 200.'
487
+ end
488
+
489
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
490
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TiketApi.list_tiket_reservations, must be greater than or equal to 1.'
491
+ end
492
+
493
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
494
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling TiketApi.list_tiket_reservations, must be greater than or equal to 0.'
495
+ end
496
+
497
+ # resource path
498
+ local_var_path = '/v1/channels/tiket/reservations'
499
+
500
+ # query parameters
501
+ query_params = opts[:query_params] || {}
502
+ query_params[:'property_id'] = opts[:'property_id'] if !opts[:'property_id'].nil?
503
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
504
+ query_params[:'check_in_from'] = opts[:'check_in_from'] if !opts[:'check_in_from'].nil?
505
+ query_params[:'check_in_to'] = opts[:'check_in_to'] if !opts[:'check_in_to'].nil?
506
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
507
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
508
+
509
+ # header parameters
510
+ header_params = opts[:header_params] || {}
511
+ # HTTP header 'Accept' (if needed)
512
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
513
+
514
+ # form parameters
515
+ form_params = opts[:form_params] || {}
516
+
517
+ # http body (model)
518
+ post_body = opts[:debug_body]
519
+
520
+ # return_type
521
+ return_type = opts[:debug_return_type] || 'TiketReservationListResponse'
522
+
523
+ # auth_names
524
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
525
+
526
+ new_options = opts.merge(
527
+ :operation => :"TiketApi.list_tiket_reservations",
528
+ :header_params => header_params,
529
+ :query_params => query_params,
530
+ :form_params => form_params,
531
+ :body => post_body,
532
+ :auth_names => auth_names,
533
+ :return_type => return_type
534
+ )
535
+
536
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
537
+ if @api_client.config.debugging
538
+ @api_client.config.logger.debug "API called: TiketApi#list_tiket_reservations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
539
+ end
540
+ return data, status_code, headers
541
+ end
542
+
543
+ # Map tiket.com room types to listings
544
+ # Map each room type of a tiket.com property to a Repull listing — the API-key equivalent of the mapping step of the hosted Connect flow, and the counterpart of `POST /v1/channels/booking/listings/map`. Each mapping is `{ roomTypeCode, listingId }` (`listingId: null` unmaps the room) or `{ roomTypeCode, create: true }`, which creates a new listing from the room with tiket.com's calendar. Mapping a room to an existing listing sends that listing's calendar to tiket.com, and records any bookings tiket.com delivered while the room was unmapped (`replayedReservations`). Returns `403 listing_inactive` when a target listing is inactive; nothing is changed.
545
+ # @param tiket_map_listings_request [TiketMapListingsRequest]
546
+ # @param [Hash] opts the optional parameters
547
+ # @return [TiketMapListingsResponse]
548
+ def map_tiket_listings(tiket_map_listings_request, opts = {})
549
+ data, _status_code, _headers = map_tiket_listings_with_http_info(tiket_map_listings_request, opts)
550
+ data
551
+ end
552
+
553
+ # Map tiket.com room types to listings
554
+ # Map each room type of a tiket.com property to a Repull listing — the API-key equivalent of the mapping step of the hosted Connect flow, and the counterpart of &#x60;POST /v1/channels/booking/listings/map&#x60;. Each mapping is &#x60;{ roomTypeCode, listingId }&#x60; (&#x60;listingId: null&#x60; unmaps the room) or &#x60;{ roomTypeCode, create: true }&#x60;, which creates a new listing from the room with tiket.com&#39;s calendar. Mapping a room to an existing listing sends that listing&#39;s calendar to tiket.com, and records any bookings tiket.com delivered while the room was unmapped (&#x60;replayedReservations&#x60;). Returns &#x60;403 listing_inactive&#x60; when a target listing is inactive; nothing is changed.
555
+ # @param tiket_map_listings_request [TiketMapListingsRequest]
556
+ # @param [Hash] opts the optional parameters
557
+ # @return [Array<(TiketMapListingsResponse, Integer, Hash)>] TiketMapListingsResponse data, response status code and response headers
558
+ def map_tiket_listings_with_http_info(tiket_map_listings_request, opts = {})
559
+ if @api_client.config.debugging
560
+ @api_client.config.logger.debug 'Calling API: TiketApi.map_tiket_listings ...'
561
+ end
562
+ # verify the required parameter 'tiket_map_listings_request' is set
563
+ if @api_client.config.client_side_validation && tiket_map_listings_request.nil?
564
+ fail ArgumentError, "Missing the required parameter 'tiket_map_listings_request' when calling TiketApi.map_tiket_listings"
565
+ end
566
+ # resource path
567
+ local_var_path = '/v1/channels/tiket/listings/map'
568
+
569
+ # query parameters
570
+ query_params = opts[:query_params] || {}
571
+
572
+ # header parameters
573
+ header_params = opts[:header_params] || {}
574
+ # HTTP header 'Accept' (if needed)
575
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
576
+ # HTTP header 'Content-Type'
577
+ content_type = @api_client.select_header_content_type(['application/json'])
578
+ if !content_type.nil?
579
+ header_params['Content-Type'] = content_type
580
+ end
581
+
582
+ # form parameters
583
+ form_params = opts[:form_params] || {}
584
+
585
+ # http body (model)
586
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(tiket_map_listings_request)
587
+
588
+ # return_type
589
+ return_type = opts[:debug_return_type] || 'TiketMapListingsResponse'
590
+
591
+ # auth_names
592
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
593
+
594
+ new_options = opts.merge(
595
+ :operation => :"TiketApi.map_tiket_listings",
596
+ :header_params => header_params,
597
+ :query_params => query_params,
598
+ :form_params => form_params,
599
+ :body => post_body,
600
+ :auth_names => auth_names,
601
+ :return_type => return_type
602
+ )
603
+
604
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
605
+ if @api_client.config.debugging
606
+ @api_client.config.logger.debug "API called: TiketApi#map_tiket_listings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
607
+ end
608
+ return data, status_code, headers
609
+ end
610
+
611
+ # Send every mapped listing's calendar to tiket.com
612
+ # Send the full calendar (today to 500 days ahead: rooms to sell, prices, restrictions) of every mapped listing of one tiket.com property, or of every active property when `property_id` is omitted. `refresh_products: true` re-reads room types and rate plans from tiket.com first. Use it after a bulk edit or to re-baseline a property; day-to-day changes are sent automatically. Inactive listings are not sold, so they are skipped (`skipped: listing_inactive`).
613
+ # @param [Hash] opts the optional parameters
614
+ # @option opts [SyncTiketRequest] :sync_tiket_request
615
+ # @return [TiketSyncResponse]
616
+ def sync_tiket(opts = {})
617
+ data, _status_code, _headers = sync_tiket_with_http_info(opts)
618
+ data
619
+ end
620
+
621
+ # Send every mapped listing&#39;s calendar to tiket.com
622
+ # Send the full calendar (today to 500 days ahead: rooms to sell, prices, restrictions) of every mapped listing of one tiket.com property, or of every active property when &#x60;property_id&#x60; is omitted. &#x60;refresh_products: true&#x60; re-reads room types and rate plans from tiket.com first. Use it after a bulk edit or to re-baseline a property; day-to-day changes are sent automatically. Inactive listings are not sold, so they are skipped (&#x60;skipped: listing_inactive&#x60;).
623
+ # @param [Hash] opts the optional parameters
624
+ # @option opts [SyncTiketRequest] :sync_tiket_request
625
+ # @return [Array<(TiketSyncResponse, Integer, Hash)>] TiketSyncResponse data, response status code and response headers
626
+ def sync_tiket_with_http_info(opts = {})
627
+ if @api_client.config.debugging
628
+ @api_client.config.logger.debug 'Calling API: TiketApi.sync_tiket ...'
629
+ end
630
+ # resource path
631
+ local_var_path = '/v1/channels/tiket/sync'
632
+
633
+ # query parameters
634
+ query_params = opts[:query_params] || {}
635
+
636
+ # header parameters
637
+ header_params = opts[:header_params] || {}
638
+ # HTTP header 'Accept' (if needed)
639
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
640
+ # HTTP header 'Content-Type'
641
+ content_type = @api_client.select_header_content_type(['application/json'])
642
+ if !content_type.nil?
643
+ header_params['Content-Type'] = content_type
644
+ end
645
+
646
+ # form parameters
647
+ form_params = opts[:form_params] || {}
648
+
649
+ # http body (model)
650
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'sync_tiket_request'])
651
+
652
+ # return_type
653
+ return_type = opts[:debug_return_type] || 'TiketSyncResponse'
654
+
655
+ # auth_names
656
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
657
+
658
+ new_options = opts.merge(
659
+ :operation => :"TiketApi.sync_tiket",
660
+ :header_params => header_params,
661
+ :query_params => query_params,
662
+ :form_params => form_params,
663
+ :body => post_body,
664
+ :auth_names => auth_names,
665
+ :return_type => return_type
666
+ )
667
+
668
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
669
+ if @api_client.config.debugging
670
+ @api_client.config.logger.debug "API called: TiketApi#sync_tiket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
671
+ end
672
+ return data, status_code, headers
673
+ end
674
+
675
+ # Set up a tiket.com property
676
+ # Onboarding and maintenance actions for tiket.com properties (counterpart of `POST /v1/channels/booking/setup`). `action`: - `request-activation` — ask tiket.com to activate Repull as channel manager for one or more existing properties (`properties[]`). The usual path for a group; a single host activates Repull in the tiket.com extranet and connects through Connect instead. - `check-activation` — whether tiket.com has activated Repull for `hotel_id` yet. - `create-property` — create a new property on tiket.com from a listing (`listing_id` plus the property and company details). Then `request-registration` asks tiket.com for its ids and `set-tiket-hotel-id` records the Hotel ID tiket.com replies with. - `add-room`, `add-rate-plan` — add a room type or rate plan to a property Repull created. - `request-content-mapping` / `confirm-content-mapping` — for an existing property, ask tiket.com to link Repull's codes to it so `POST /v1/listings/{id}/publish/tiket` can send content. - `refresh` — re-read room types and rate plans from tiket.com. - `set-push-rate-plans` — choose the rate plans (`rate_plan_ids`) that receive prices and restrictions. - `set-sync` — turn automatic calendar sending on or off (`enabled`). - `disconnect` — stop syncing the property. Always available, even when its listings are inactive. tiket.com accepts incomplete content and rejects it later, so content is checked against tiket.com's requirements before it is sent; problems come back as `422 invalid_params` with each field in `value_received`.
677
+ # @param tiket_setup_request [TiketSetupRequest]
678
+ # @param [Hash] opts the optional parameters
679
+ # @return [TiketSetupResponse]
680
+ def tiket_setup(tiket_setup_request, opts = {})
681
+ data, _status_code, _headers = tiket_setup_with_http_info(tiket_setup_request, opts)
682
+ data
683
+ end
684
+
685
+ # Set up a tiket.com property
686
+ # Onboarding and maintenance actions for tiket.com properties (counterpart of &#x60;POST /v1/channels/booking/setup&#x60;). &#x60;action&#x60;: - &#x60;request-activation&#x60; — ask tiket.com to activate Repull as channel manager for one or more existing properties (&#x60;properties[]&#x60;). The usual path for a group; a single host activates Repull in the tiket.com extranet and connects through Connect instead. - &#x60;check-activation&#x60; — whether tiket.com has activated Repull for &#x60;hotel_id&#x60; yet. - &#x60;create-property&#x60; — create a new property on tiket.com from a listing (&#x60;listing_id&#x60; plus the property and company details). Then &#x60;request-registration&#x60; asks tiket.com for its ids and &#x60;set-tiket-hotel-id&#x60; records the Hotel ID tiket.com replies with. - &#x60;add-room&#x60;, &#x60;add-rate-plan&#x60; — add a room type or rate plan to a property Repull created. - &#x60;request-content-mapping&#x60; / &#x60;confirm-content-mapping&#x60; — for an existing property, ask tiket.com to link Repull&#39;s codes to it so &#x60;POST /v1/listings/{id}/publish/tiket&#x60; can send content. - &#x60;refresh&#x60; — re-read room types and rate plans from tiket.com. - &#x60;set-push-rate-plans&#x60; — choose the rate plans (&#x60;rate_plan_ids&#x60;) that receive prices and restrictions. - &#x60;set-sync&#x60; — turn automatic calendar sending on or off (&#x60;enabled&#x60;). - &#x60;disconnect&#x60; — stop syncing the property. Always available, even when its listings are inactive. tiket.com accepts incomplete content and rejects it later, so content is checked against tiket.com&#39;s requirements before it is sent; problems come back as &#x60;422 invalid_params&#x60; with each field in &#x60;value_received&#x60;.
687
+ # @param tiket_setup_request [TiketSetupRequest]
688
+ # @param [Hash] opts the optional parameters
689
+ # @return [Array<(TiketSetupResponse, Integer, Hash)>] TiketSetupResponse data, response status code and response headers
690
+ def tiket_setup_with_http_info(tiket_setup_request, opts = {})
691
+ if @api_client.config.debugging
692
+ @api_client.config.logger.debug 'Calling API: TiketApi.tiket_setup ...'
693
+ end
694
+ # verify the required parameter 'tiket_setup_request' is set
695
+ if @api_client.config.client_side_validation && tiket_setup_request.nil?
696
+ fail ArgumentError, "Missing the required parameter 'tiket_setup_request' when calling TiketApi.tiket_setup"
697
+ end
698
+ # resource path
699
+ local_var_path = '/v1/channels/tiket/setup'
700
+
701
+ # query parameters
702
+ query_params = opts[:query_params] || {}
703
+
704
+ # header parameters
705
+ header_params = opts[:header_params] || {}
706
+ # HTTP header 'Accept' (if needed)
707
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
708
+ # HTTP header 'Content-Type'
709
+ content_type = @api_client.select_header_content_type(['application/json'])
710
+ if !content_type.nil?
711
+ header_params['Content-Type'] = content_type
712
+ end
713
+
714
+ # form parameters
715
+ form_params = opts[:form_params] || {}
716
+
717
+ # http body (model)
718
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(tiket_setup_request)
719
+
720
+ # return_type
721
+ return_type = opts[:debug_return_type] || 'TiketSetupResponse'
722
+
723
+ # auth_names
724
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
725
+
726
+ new_options = opts.merge(
727
+ :operation => :"TiketApi.tiket_setup",
728
+ :header_params => header_params,
729
+ :query_params => query_params,
730
+ :form_params => form_params,
731
+ :body => post_body,
732
+ :auth_names => auth_names,
733
+ :return_type => return_type
734
+ )
735
+
736
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
737
+ if @api_client.config.debugging
738
+ @api_client.config.logger.debug "API called: TiketApi#tiket_setup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
739
+ end
740
+ return data, status_code, headers
741
+ end
742
+
743
+ # Write tiket.com rates, availability or restrictions
744
+ # `type` selects the write: - `availability` — rooms to sell per room type (`availableRooms`). `stopSell` with a `ratePlanCode` also closes that rate plan. - `rates` — `price` on a Room Based property or `occupancyPrices` on an Occupancy Based one, per room type and rate plan. `currency` defaults to the property currency. - `restrictions` — `minStay`, `maxStay`, `stopSell`, `closedToArrival`, `closedToDeparture`, `minAdvanceDays`, `maxAdvanceDays`. Dates are inclusive and must fall between today and 500 days ahead. Every update is checked before anything is sent; a problem returns `422 invalid_params` naming each field, and nothing is written. **Children rates are paused.** tiket.com has asked every channel manager not to send children rates until it fixes an issue on its side, so a write that includes `childPrices` is refused with `422 invalid_params` and nothing is sent. Children rates set in the tiket.com extranet still apply. Send `price` or `occupancyPrices` without `childPrices`. **Every write is read back.** `applied` is `verified` when tiket.com holds what was sent, `mismatch` when it holds something else (see `mismatches`), or `unverified` with `verify: false`. tiket.com's own warnings come back verbatim in `warnings`. A write tiket.com refuses returns `tiket_rejected` with tiket.com's reason and its reference (`echoToken`) in `value_received`. To write by listing instead of by room type, use `PUT /v1/channels/tiket/listings/{id}/pricing`.
745
+ # @param tiket_availability_update_request [TiketAvailabilityUpdateRequest]
746
+ # @param [Hash] opts the optional parameters
747
+ # @return [TiketAriWriteResponse]
748
+ def update_tiket_availability(tiket_availability_update_request, opts = {})
749
+ data, _status_code, _headers = update_tiket_availability_with_http_info(tiket_availability_update_request, opts)
750
+ data
751
+ end
752
+
753
+ # Write tiket.com rates, availability or restrictions
754
+ # &#x60;type&#x60; selects the write: - &#x60;availability&#x60; — rooms to sell per room type (&#x60;availableRooms&#x60;). &#x60;stopSell&#x60; with a &#x60;ratePlanCode&#x60; also closes that rate plan. - &#x60;rates&#x60; — &#x60;price&#x60; on a Room Based property or &#x60;occupancyPrices&#x60; on an Occupancy Based one, per room type and rate plan. &#x60;currency&#x60; defaults to the property currency. - &#x60;restrictions&#x60; — &#x60;minStay&#x60;, &#x60;maxStay&#x60;, &#x60;stopSell&#x60;, &#x60;closedToArrival&#x60;, &#x60;closedToDeparture&#x60;, &#x60;minAdvanceDays&#x60;, &#x60;maxAdvanceDays&#x60;. Dates are inclusive and must fall between today and 500 days ahead. Every update is checked before anything is sent; a problem returns &#x60;422 invalid_params&#x60; naming each field, and nothing is written. **Children rates are paused.** tiket.com has asked every channel manager not to send children rates until it fixes an issue on its side, so a write that includes &#x60;childPrices&#x60; is refused with &#x60;422 invalid_params&#x60; and nothing is sent. Children rates set in the tiket.com extranet still apply. Send &#x60;price&#x60; or &#x60;occupancyPrices&#x60; without &#x60;childPrices&#x60;. **Every write is read back.** &#x60;applied&#x60; is &#x60;verified&#x60; when tiket.com holds what was sent, &#x60;mismatch&#x60; when it holds something else (see &#x60;mismatches&#x60;), or &#x60;unverified&#x60; with &#x60;verify: false&#x60;. tiket.com&#39;s own warnings come back verbatim in &#x60;warnings&#x60;. A write tiket.com refuses returns &#x60;tiket_rejected&#x60; with tiket.com&#39;s reason and its reference (&#x60;echoToken&#x60;) in &#x60;value_received&#x60;. To write by listing instead of by room type, use &#x60;PUT /v1/channels/tiket/listings/{id}/pricing&#x60;.
755
+ # @param tiket_availability_update_request [TiketAvailabilityUpdateRequest]
756
+ # @param [Hash] opts the optional parameters
757
+ # @return [Array<(TiketAriWriteResponse, Integer, Hash)>] TiketAriWriteResponse data, response status code and response headers
758
+ def update_tiket_availability_with_http_info(tiket_availability_update_request, opts = {})
759
+ if @api_client.config.debugging
760
+ @api_client.config.logger.debug 'Calling API: TiketApi.update_tiket_availability ...'
761
+ end
762
+ # verify the required parameter 'tiket_availability_update_request' is set
763
+ if @api_client.config.client_side_validation && tiket_availability_update_request.nil?
764
+ fail ArgumentError, "Missing the required parameter 'tiket_availability_update_request' when calling TiketApi.update_tiket_availability"
765
+ end
766
+ # resource path
767
+ local_var_path = '/v1/channels/tiket/availability'
768
+
769
+ # query parameters
770
+ query_params = opts[:query_params] || {}
771
+
772
+ # header parameters
773
+ header_params = opts[:header_params] || {}
774
+ # HTTP header 'Accept' (if needed)
775
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
776
+ # HTTP header 'Content-Type'
777
+ content_type = @api_client.select_header_content_type(['application/json'])
778
+ if !content_type.nil?
779
+ header_params['Content-Type'] = content_type
780
+ end
781
+
782
+ # form parameters
783
+ form_params = opts[:form_params] || {}
784
+
785
+ # http body (model)
786
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(tiket_availability_update_request)
787
+
788
+ # return_type
789
+ return_type = opts[:debug_return_type] || 'TiketAriWriteResponse'
790
+
791
+ # auth_names
792
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
793
+
794
+ new_options = opts.merge(
795
+ :operation => :"TiketApi.update_tiket_availability",
796
+ :header_params => header_params,
797
+ :query_params => query_params,
798
+ :form_params => form_params,
799
+ :body => post_body,
800
+ :auth_names => auth_names,
801
+ :return_type => return_type
802
+ )
803
+
804
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
805
+ if @api_client.config.debugging
806
+ @api_client.config.logger.debug "API called: TiketApi#update_tiket_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
807
+ end
808
+ return data, status_code, headers
809
+ end
810
+
811
+ # Write tiket.com rates, availability or restrictions for a listing
812
+ # Same contract as `PUT /v1/channels/tiket/availability`, addressed by listing. `roomTypeCode` is always the listing's room; `ratePlanCode` defaults to every rate plan of the room selected for pushes (`pushTarget`), so one update row is sent to each. `type` defaults to `rates`. **Children rates are paused.** tiket.com has asked every channel manager not to send children rates until it fixes an issue on its side, so a write that includes `childPrices` is refused with `422 invalid_params` and nothing is sent. Children rates set in the tiket.com extranet still apply. Send `price` or `occupancyPrices` without `childPrices`.
813
+ # @param id [Integer] Repull listing id.
814
+ # @param tiket_listing_pricing_update_request [TiketListingPricingUpdateRequest]
815
+ # @param [Hash] opts the optional parameters
816
+ # @return [TiketAriWriteResponse]
817
+ def update_tiket_listing_pricing(id, tiket_listing_pricing_update_request, opts = {})
818
+ data, _status_code, _headers = update_tiket_listing_pricing_with_http_info(id, tiket_listing_pricing_update_request, opts)
819
+ data
820
+ end
821
+
822
+ # Write tiket.com rates, availability or restrictions for a listing
823
+ # Same contract as &#x60;PUT /v1/channels/tiket/availability&#x60;, addressed by listing. &#x60;roomTypeCode&#x60; is always the listing&#39;s room; &#x60;ratePlanCode&#x60; defaults to every rate plan of the room selected for pushes (&#x60;pushTarget&#x60;), so one update row is sent to each. &#x60;type&#x60; defaults to &#x60;rates&#x60;. **Children rates are paused.** tiket.com has asked every channel manager not to send children rates until it fixes an issue on its side, so a write that includes &#x60;childPrices&#x60; is refused with &#x60;422 invalid_params&#x60; and nothing is sent. Children rates set in the tiket.com extranet still apply. Send &#x60;price&#x60; or &#x60;occupancyPrices&#x60; without &#x60;childPrices&#x60;.
824
+ # @param id [Integer] Repull listing id.
825
+ # @param tiket_listing_pricing_update_request [TiketListingPricingUpdateRequest]
826
+ # @param [Hash] opts the optional parameters
827
+ # @return [Array<(TiketAriWriteResponse, Integer, Hash)>] TiketAriWriteResponse data, response status code and response headers
828
+ def update_tiket_listing_pricing_with_http_info(id, tiket_listing_pricing_update_request, opts = {})
829
+ if @api_client.config.debugging
830
+ @api_client.config.logger.debug 'Calling API: TiketApi.update_tiket_listing_pricing ...'
831
+ end
832
+ # verify the required parameter 'id' is set
833
+ if @api_client.config.client_side_validation && id.nil?
834
+ fail ArgumentError, "Missing the required parameter 'id' when calling TiketApi.update_tiket_listing_pricing"
835
+ end
836
+ # verify the required parameter 'tiket_listing_pricing_update_request' is set
837
+ if @api_client.config.client_side_validation && tiket_listing_pricing_update_request.nil?
838
+ fail ArgumentError, "Missing the required parameter 'tiket_listing_pricing_update_request' when calling TiketApi.update_tiket_listing_pricing"
839
+ end
840
+ # resource path
841
+ local_var_path = '/v1/channels/tiket/listings/{id}/pricing'.sub('{id}', CGI.escape(id.to_s))
842
+
843
+ # query parameters
844
+ query_params = opts[:query_params] || {}
845
+
846
+ # header parameters
847
+ header_params = opts[:header_params] || {}
848
+ # HTTP header 'Accept' (if needed)
849
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
850
+ # HTTP header 'Content-Type'
851
+ content_type = @api_client.select_header_content_type(['application/json'])
852
+ if !content_type.nil?
853
+ header_params['Content-Type'] = content_type
854
+ end
855
+
856
+ # form parameters
857
+ form_params = opts[:form_params] || {}
858
+
859
+ # http body (model)
860
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(tiket_listing_pricing_update_request)
861
+
862
+ # return_type
863
+ return_type = opts[:debug_return_type] || 'TiketAriWriteResponse'
864
+
865
+ # auth_names
866
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
867
+
868
+ new_options = opts.merge(
869
+ :operation => :"TiketApi.update_tiket_listing_pricing",
870
+ :header_params => header_params,
871
+ :query_params => query_params,
872
+ :form_params => form_params,
873
+ :body => post_body,
874
+ :auth_names => auth_names,
875
+ :return_type => return_type
876
+ )
877
+
878
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
879
+ if @api_client.config.debugging
880
+ @api_client.config.logger.debug "API called: TiketApi#update_tiket_listing_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
881
+ end
882
+ return data, status_code, headers
883
+ end
884
+ end
885
+ end