repull 0.2.60 → 0.2.62

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +8 -8
  3. data/lib/repull/api/connect_api.rb +205 -5
  4. data/lib/repull/api/connections_api.rb +4 -4
  5. data/lib/repull/api/listings_api.rb +70 -0
  6. data/lib/repull/api/properties_api.rb +3 -3
  7. data/lib/repull/api/tiket_api.rb +885 -0
  8. data/lib/repull/models/account_import.rb +1 -1
  9. data/lib/repull/models/airbnb_reservation.rb +346 -6
  10. data/lib/repull/models/airbnb_reservation_detail.rb +679 -0
  11. data/lib/repull/models/airbnb_reservation_detail_response.rb +173 -0
  12. data/lib/repull/models/connect_provider_session.rb +266 -0
  13. data/lib/repull/models/create_connect_session_request.rb +2 -2
  14. data/lib/repull/models/create_connection_request.rb +3 -2
  15. data/lib/repull/models/guest.rb +4 -2
  16. data/lib/repull/models/listing_publish_tiket_response.rb +165 -0
  17. data/lib/repull/models/listing_publish_tiket_response_result.rb +182 -0
  18. data/lib/repull/models/map_tiket_connect_rooms_request.rb +201 -0
  19. data/lib/repull/models/map_tiket_connect_rooms_request_mappings_inner.rb +184 -0
  20. data/lib/repull/models/publish_listing_tiket_request.rb +148 -0
  21. data/lib/repull/models/reservation.rb +1 -1
  22. data/lib/repull/models/start_connection_import202_response_data.rb +32 -6
  23. data/lib/repull/models/start_connection_import_request.rb +3 -5
  24. data/lib/repull/models/sync_tiket_request.rb +160 -0
  25. data/lib/repull/models/tiket_ari_day.rb +347 -0
  26. data/lib/repull/models/tiket_ari_mismatch.rb +198 -0
  27. data/lib/repull/models/tiket_ari_update.rb +468 -0
  28. data/lib/repull/models/tiket_ari_write_response.rb +357 -0
  29. data/lib/repull/models/tiket_availability_response.rb +269 -0
  30. data/lib/repull/models/tiket_availability_update_request.rb +241 -0
  31. data/lib/repull/models/tiket_child_price.rb +217 -0
  32. data/lib/repull/models/tiket_connect_claim_response.rb +216 -0
  33. data/lib/repull/models/tiket_connect_map_rooms_response.rb +204 -0
  34. data/lib/repull/models/tiket_connect_rooms_response.rb +295 -0
  35. data/lib/repull/models/tiket_connect_rooms_response_rooms_inner.rb +199 -0
  36. data/lib/repull/models/tiket_content_response.rb +202 -0
  37. data/lib/repull/models/tiket_content_response_objects_inner.rb +237 -0
  38. data/lib/repull/models/tiket_listing_pricing_response.rb +321 -0
  39. data/lib/repull/models/tiket_listing_pricing_update_request.rb +209 -0
  40. data/lib/repull/models/tiket_map_listings_request.rb +202 -0
  41. data/lib/repull/models/tiket_map_listings_request_mappings_inner.rb +186 -0
  42. data/lib/repull/models/tiket_map_listings_response.rb +169 -0
  43. data/lib/repull/models/tiket_map_listings_response_results_inner.rb +176 -0
  44. data/lib/repull/models/tiket_occupancy_price.rb +201 -0
  45. data/lib/repull/models/tiket_property.rb +278 -0
  46. data/lib/repull/models/tiket_property_list_response.rb +166 -0
  47. data/lib/repull/models/tiket_property_listings_inner.rb +175 -0
  48. data/lib/repull/models/tiket_property_rooms_response.rb +192 -0
  49. data/lib/repull/models/tiket_rate_plan.rb +178 -0
  50. data/lib/repull/models/tiket_reservation.rb +421 -0
  51. data/lib/repull/models/tiket_reservation_list_response.rb +192 -0
  52. data/lib/repull/models/tiket_reservation_list_response_pagination.rb +165 -0
  53. data/lib/repull/models/tiket_room.rb +232 -0
  54. data/lib/repull/models/tiket_setup_request.rb +469 -0
  55. data/lib/repull/models/tiket_setup_request_contacts_inner.rb +192 -0
  56. data/lib/repull/models/tiket_setup_request_properties_inner.rb +174 -0
  57. data/lib/repull/models/tiket_setup_response.rb +159 -0
  58. data/lib/repull/models/tiket_sync_response.rb +167 -0
  59. data/lib/repull/models/tiket_sync_response_results_inner.rb +239 -0
  60. data/lib/repull/models/verify_tiket_claim_request.rb +212 -0
  61. data/lib/repull/version.rb +1 -1
  62. data/lib/repull.rb +46 -0
  63. data/openapi/v1.json +10004 -6945
  64. data/spec/api/tiket_api_spec.rb +56 -0
  65. metadata +50 -2
@@ -0,0 +1,173 @@
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 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ class AirbnbReservationDetailResponse < ApiModelBase
18
+ attr_accessor :data
19
+
20
+ attr_accessor :data_freshness
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'data' => :'data',
26
+ :'data_freshness' => :'dataFreshness'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'AirbnbReservationDetail',
44
+ :'data_freshness' => :'AirbnbDataFreshness'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbReservationDetailResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbReservationDetailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'data')
71
+ self.data = attributes[:'data']
72
+ else
73
+ self.data = nil
74
+ end
75
+
76
+ if attributes.key?(:'data_freshness')
77
+ self.data_freshness = attributes[:'data_freshness']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ if @data.nil?
87
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @data.nil?
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] data Value to be assigned
103
+ def data=(data)
104
+ if data.nil?
105
+ fail ArgumentError, 'data cannot be nil'
106
+ end
107
+
108
+ @data = data
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ data == o.data &&
117
+ data_freshness == o.data_freshness
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [data, data_freshness].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ if value.nil?
162
+ is_nullable = self.class.openapi_nullable.include?(attr)
163
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
164
+ end
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ end
172
+
173
+ end
@@ -0,0 +1,266 @@
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 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ # A hosted Connect session for one provider (`POST /v1/connect/{provider}`). Send the user to `url`; every return to your `redirectUrl` carries `status`, `sessionId` and your `state`.
18
+ class ConnectProviderSession < ApiModelBase
19
+ # The hosted page to send the user to.
20
+ attr_accessor :url
21
+
22
+ attr_accessor :provider
23
+
24
+ # Also sent back on the redirect (`sessionId=`), in the popup message and in `connect.session.completed`.
25
+ attr_accessor :session_id
26
+
27
+ attr_accessor :expires_at
28
+
29
+ # Your `state` from the request, echoed; `null` when you sent none.
30
+ attr_accessor :state
31
+
32
+ # PriceLabs only, when the request opened a sub-workspace (`workspace.name`).
33
+ attr_accessor :workspace_id
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'url' => :'url',
39
+ :'provider' => :'provider',
40
+ :'session_id' => :'sessionId',
41
+ :'expires_at' => :'expiresAt',
42
+ :'state' => :'state',
43
+ :'workspace_id' => :'workspaceId'
44
+ }
45
+ end
46
+
47
+ # Returns attribute mapping this model knows about
48
+ def self.acceptable_attribute_map
49
+ attribute_map
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ acceptable_attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'url' => :'String',
61
+ :'provider' => :'String',
62
+ :'session_id' => :'String',
63
+ :'expires_at' => :'Time',
64
+ :'state' => :'String',
65
+ :'workspace_id' => :'String'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'state',
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConnectProviderSession` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConnectProviderSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'url')
93
+ self.url = attributes[:'url']
94
+ else
95
+ self.url = nil
96
+ end
97
+
98
+ if attributes.key?(:'provider')
99
+ self.provider = attributes[:'provider']
100
+ else
101
+ self.provider = nil
102
+ end
103
+
104
+ if attributes.key?(:'session_id')
105
+ self.session_id = attributes[:'session_id']
106
+ else
107
+ self.session_id = nil
108
+ end
109
+
110
+ if attributes.key?(:'expires_at')
111
+ self.expires_at = attributes[:'expires_at']
112
+ else
113
+ self.expires_at = nil
114
+ end
115
+
116
+ if attributes.key?(:'state')
117
+ self.state = attributes[:'state']
118
+ end
119
+
120
+ if attributes.key?(:'workspace_id')
121
+ self.workspace_id = attributes[:'workspace_id']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @url.nil?
131
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
132
+ end
133
+
134
+ if @provider.nil?
135
+ invalid_properties.push('invalid value for "provider", provider cannot be nil.')
136
+ end
137
+
138
+ if @session_id.nil?
139
+ invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
140
+ end
141
+
142
+ if @expires_at.nil?
143
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ warn '[DEPRECATED] the `valid?` method is obsolete'
153
+ return false if @url.nil?
154
+ return false if @provider.nil?
155
+ return false if @session_id.nil?
156
+ return false if @expires_at.nil?
157
+ true
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] url Value to be assigned
162
+ def url=(url)
163
+ if url.nil?
164
+ fail ArgumentError, 'url cannot be nil'
165
+ end
166
+
167
+ @url = url
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] provider Value to be assigned
172
+ def provider=(provider)
173
+ if provider.nil?
174
+ fail ArgumentError, 'provider cannot be nil'
175
+ end
176
+
177
+ @provider = provider
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] session_id Value to be assigned
182
+ def session_id=(session_id)
183
+ if session_id.nil?
184
+ fail ArgumentError, 'session_id cannot be nil'
185
+ end
186
+
187
+ @session_id = session_id
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] expires_at Value to be assigned
192
+ def expires_at=(expires_at)
193
+ if expires_at.nil?
194
+ fail ArgumentError, 'expires_at cannot be nil'
195
+ end
196
+
197
+ @expires_at = expires_at
198
+ end
199
+
200
+ # Checks equality by comparing each attribute.
201
+ # @param [Object] Object to be compared
202
+ def ==(o)
203
+ return true if self.equal?(o)
204
+ self.class == o.class &&
205
+ url == o.url &&
206
+ provider == o.provider &&
207
+ session_id == o.session_id &&
208
+ expires_at == o.expires_at &&
209
+ state == o.state &&
210
+ workspace_id == o.workspace_id
211
+ end
212
+
213
+ # @see the `==` method
214
+ # @param [Object] Object to be compared
215
+ def eql?(o)
216
+ self == o
217
+ end
218
+
219
+ # Calculates hash code according to all attributes.
220
+ # @return [Integer] Hash code
221
+ def hash
222
+ [url, provider, session_id, expires_at, state, workspace_id].hash
223
+ end
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def self.build_from_hash(attributes)
229
+ return nil unless attributes.is_a?(Hash)
230
+ attributes = attributes.transform_keys(&:to_sym)
231
+ transformed_hash = {}
232
+ openapi_types.each_pair do |key, type|
233
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
234
+ transformed_hash["#{key}"] = nil
235
+ elsif type =~ /\AArray<(.*)>/i
236
+ # check to ensure the input is an array given that the attribute
237
+ # is documented as an array but the input is not
238
+ if attributes[attribute_map[key]].is_a?(Array)
239
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
240
+ end
241
+ elsif !attributes[attribute_map[key]].nil?
242
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
243
+ end
244
+ end
245
+ new(transformed_hash)
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = self.send(attr)
254
+ if value.nil?
255
+ is_nullable = self.class.openapi_nullable.include?(attr)
256
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
257
+ end
258
+
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ end
265
+
266
+ end
@@ -15,10 +15,10 @@ require 'time'
15
15
 
16
16
  module Repull
17
17
  class CreateConnectSessionRequest < ApiModelBase
18
- # Where to send the user after they finish (or cancel). Status query params are appended.
18
+ # Where to send the user after they finish (or cancel). Every return to it carries `status` (`connected`, `cancelled`, `error` with a `code`, `expired`, `pending` when the host chose to finish later, or `requested` for a request-only PMS), `sessionId` (the id this call returns) and `state` when you sent one; a connected return adds `connectionId` and `externalAccountId` (and `hostId` for Airbnb). Your existing query string is kept.
19
19
  attr_accessor :redirect_url
20
20
 
21
- # Your own correlation token, e.g. your user id (at most 500 characters). Echoed in this response, on the redirect back (`&state=`), in the popup message, and in the `connect.session.completed` webhook.
21
+ # Your own correlation token, e.g. your user id (at most 500 characters). Echoed in this response, on every redirect back (`&state=`, whatever the outcome), in the popup message, and in the `connect.session.completed` webhook. Without it, match the return by `sessionId`.
22
22
  attr_accessor :state
23
23
 
24
24
  # Airbnb — how many months of past reservations the first import pulls (1–60). Omit it for the default window. Upcoming stays are always imported. A wider window takes longer to import, because every extra month is more stays to fetch.
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Repull
17
17
  # Provider-specific credentials (apiKey, clientId/clientSecret, etc.) or OAuth init params for Airbnb.
18
18
  class CreateConnectionRequest < ApiModelBase
19
- # Airbnb + Booking.com — where to redirect the user after they finish the hosted connect flow.
19
+ # Airbnb, Booking.com and PriceLabs — where to send the user after they finish (or cancel) the hosted connect flow. Every return to it carries `status` (`connected`, `cancelled`, `error` with a `code`, `expired`, `pending` when the host chose to finish later, or `requested` for a request-only PMS), `sessionId` (the id this call returns) and `state` when you sent one; a connected return adds `connectionId` and `externalAccountId` (and `hostId` for Airbnb). Your existing query string is kept.
20
20
  attr_accessor :redirect_url
21
21
 
22
22
  # Airbnb only — selects the OAuth scope set. 'read_only' grants read-only scopes; 'messaging' (shown to hosts as \"Messaging & reviews\") grants read scopes plus message read/send and review writes (reply to guest reviews, submit host reviews — Airbnb's reviews_write) but NOT property management, so it can coexist with another app (e.g. an existing PMS) that already holds property management on the same Airbnb account; 'full_access' (default) grants full host scopes including the exclusive property management (only one app per Airbnb account can hold it). The hosted consent screen normally lets the host pick a tier; passing `accessType` explicitly fixes the tier and hides that choice, so the host can only continue with the tier you requested. Omit it to let the host choose.
@@ -25,7 +25,7 @@ module Repull
25
25
  # Airbnb — how many months of past reservations the first import pulls (1–60). Omit it for the default window. Upcoming stays are always imported. A wider window takes longer to import, because every extra month is more stays to fetch.
26
26
  attr_accessor :reservation_history_months
27
27
 
28
- # Airbnb + Booking.com — your own correlation token, e.g. your user id (at most 500 characters). Echoed on the redirect back (`&state=`) and in the `connect.session.completed` webhook.
28
+ # Your own correlation token, e.g. your user id (at most 500 characters), for every hosted flow (Airbnb, Booking.com, PriceLabs). Echoed in this response, on every redirect back (`&state=`, whatever the outcome), in the popup message, and in the `connect.session.completed` webhook. Without it, match the return by `sessionId`.
29
29
  attr_accessor :state
30
30
 
31
31
  attr_accessor :workspace
@@ -92,6 +92,7 @@ module Repull
92
92
  # List of attributes with nullable: true
93
93
  def self.openapi_nullable
94
94
  Set.new([
95
+ :'state',
95
96
  :'locale'
96
97
  ])
97
98
  end
@@ -45,8 +45,10 @@ module Repull
45
45
  # Decimal-as-string to preserve precision across mixed-currency totals.
46
46
  attr_accessor :total_revenue
47
47
 
48
+ # Check-out date of the guest's most recent stay (YYYY-MM-DD).
48
49
  attr_accessor :last_stayed_at
49
50
 
51
+ # Check-in date of the guest's first stay (YYYY-MM-DD).
50
52
  attr_accessor :first_stayed_at
51
53
 
52
54
  attr_accessor :created_at
@@ -115,8 +117,8 @@ module Repull
115
117
  :'email' => :'String',
116
118
  :'total_reservations' => :'Integer',
117
119
  :'total_revenue' => :'String',
118
- :'last_stayed_at' => :'Time',
119
- :'first_stayed_at' => :'Time',
120
+ :'last_stayed_at' => :'Date',
121
+ :'first_stayed_at' => :'Date',
120
122
  :'created_at' => :'Time'
121
123
  }
122
124
  end