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,241 @@
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 TiketAvailabilityUpdateRequest < ApiModelBase
18
+ # tiket.com Hotel ID.
19
+ attr_accessor :property_id
20
+
21
+ # `availability` — rooms to sell per room type. `rates` — prices per room type and rate plan. `restrictions` — stay and arrival rules per room type and rate plan.
22
+ attr_accessor :type
23
+
24
+ attr_accessor :updates
25
+
26
+ # Read the nights back from tiket.com after the write and report `applied`. `false` skips the read-back (`applied: unverified`).
27
+ attr_accessor :verify
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'property_id' => :'property_id',
33
+ :'type' => :'type',
34
+ :'updates' => :'updates',
35
+ :'verify' => :'verify'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'property_id' => :'String',
53
+ :'type' => :'String',
54
+ :'updates' => :'Array<TiketAriUpdate>',
55
+ :'verify' => :'Boolean'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketAvailabilityUpdateRequest` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketAvailabilityUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'property_id')
82
+ self.property_id = attributes[:'property_id']
83
+ else
84
+ self.property_id = nil
85
+ end
86
+
87
+ if attributes.key?(:'type')
88
+ self.type = attributes[:'type']
89
+ else
90
+ self.type = nil
91
+ end
92
+
93
+ if attributes.key?(:'updates')
94
+ if (value = attributes[:'updates']).is_a?(Array)
95
+ self.updates = value
96
+ end
97
+ else
98
+ self.updates = nil
99
+ end
100
+
101
+ if attributes.key?(:'verify')
102
+ self.verify = attributes[:'verify']
103
+ else
104
+ self.verify = true
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @property_id.nil?
114
+ invalid_properties.push('invalid value for "property_id", property_id cannot be nil.')
115
+ end
116
+
117
+ if @type.nil?
118
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
119
+ end
120
+
121
+ if @updates.nil?
122
+ invalid_properties.push('invalid value for "updates", updates cannot be nil.')
123
+ end
124
+
125
+ if @updates.length < 1
126
+ invalid_properties.push('invalid value for "updates", number of items must be greater than or equal to 1.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ return false if @property_id.nil?
137
+ return false if @type.nil?
138
+ return false if @updates.nil?
139
+ return false if @updates.length < 1
140
+ true
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] property_id Value to be assigned
145
+ def property_id=(property_id)
146
+ if property_id.nil?
147
+ fail ArgumentError, 'property_id cannot be nil'
148
+ end
149
+
150
+ @property_id = property_id
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] type Value to be assigned
155
+ def type=(type)
156
+ if type.nil?
157
+ fail ArgumentError, 'type cannot be nil'
158
+ end
159
+
160
+ @type = type
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] updates Value to be assigned
165
+ def updates=(updates)
166
+ if updates.nil?
167
+ fail ArgumentError, 'updates cannot be nil'
168
+ end
169
+
170
+ if updates.length < 1
171
+ fail ArgumentError, 'invalid value for "updates", number of items must be greater than or equal to 1.'
172
+ end
173
+
174
+ @updates = updates
175
+ end
176
+
177
+ # Checks equality by comparing each attribute.
178
+ # @param [Object] Object to be compared
179
+ def ==(o)
180
+ return true if self.equal?(o)
181
+ self.class == o.class &&
182
+ property_id == o.property_id &&
183
+ type == o.type &&
184
+ updates == o.updates &&
185
+ verify == o.verify
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(o)
191
+ self == o
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Integer] Hash code
196
+ def hash
197
+ [property_id, type, updates, verify].hash
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def self.build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ attributes = attributes.transform_keys(&:to_sym)
206
+ transformed_hash = {}
207
+ openapi_types.each_pair do |key, type|
208
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
209
+ transformed_hash["#{key}"] = nil
210
+ elsif type =~ /\AArray<(.*)>/i
211
+ # check to ensure the input is an array given that the attribute
212
+ # is documented as an array but the input is not
213
+ if attributes[attribute_map[key]].is_a?(Array)
214
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
215
+ end
216
+ elsif !attributes[attribute_map[key]].nil?
217
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
218
+ end
219
+ end
220
+ new(transformed_hash)
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ end
240
+
241
+ end
@@ -0,0 +1,217 @@
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
+ # Price for a child in an age band. The age bands must match the ones set in the tiket.com extranet.
18
+ class TiketChildPrice < ApiModelBase
19
+ attr_accessor :min_age
20
+
21
+ attr_accessor :max_age
22
+
23
+ attr_accessor :amount
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'min_age' => :'minAge',
29
+ :'max_age' => :'maxAge',
30
+ :'amount' => :'amount'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'min_age' => :'Integer',
48
+ :'max_age' => :'Integer',
49
+ :'amount' => :'Float'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketChildPrice` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketChildPrice`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'min_age')
76
+ self.min_age = attributes[:'min_age']
77
+ else
78
+ self.min_age = nil
79
+ end
80
+
81
+ if attributes.key?(:'max_age')
82
+ self.max_age = attributes[:'max_age']
83
+ else
84
+ self.max_age = nil
85
+ end
86
+
87
+ if attributes.key?(:'amount')
88
+ self.amount = attributes[:'amount']
89
+ else
90
+ self.amount = nil
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
+ invalid_properties = Array.new
99
+ if @min_age.nil?
100
+ invalid_properties.push('invalid value for "min_age", min_age cannot be nil.')
101
+ end
102
+
103
+ if @max_age.nil?
104
+ invalid_properties.push('invalid value for "max_age", max_age cannot be nil.')
105
+ end
106
+
107
+ if @amount.nil?
108
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
109
+ end
110
+
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
+ return false if @min_age.nil?
119
+ return false if @max_age.nil?
120
+ return false if @amount.nil?
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method with validation
125
+ # @param [Object] min_age Value to be assigned
126
+ def min_age=(min_age)
127
+ if min_age.nil?
128
+ fail ArgumentError, 'min_age cannot be nil'
129
+ end
130
+
131
+ @min_age = min_age
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] max_age Value to be assigned
136
+ def max_age=(max_age)
137
+ if max_age.nil?
138
+ fail ArgumentError, 'max_age cannot be nil'
139
+ end
140
+
141
+ @max_age = max_age
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] amount Value to be assigned
146
+ def amount=(amount)
147
+ if amount.nil?
148
+ fail ArgumentError, 'amount cannot be nil'
149
+ end
150
+
151
+ @amount = amount
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ min_age == o.min_age &&
160
+ max_age == o.max_age &&
161
+ amount == o.amount
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [min_age, max_age, amount].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ attributes = attributes.transform_keys(&:to_sym)
182
+ transformed_hash = {}
183
+ openapi_types.each_pair do |key, type|
184
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = nil
186
+ elsif type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[attribute_map[key]].is_a?(Array)
190
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
+ end
192
+ elsif !attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
+ end
195
+ end
196
+ new(transformed_hash)
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ end
216
+
217
+ end