repull 0.2.62 → 0.2.64

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.
@@ -0,0 +1,344 @@
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
+ # Booking.com only: the booking's payout and price breakdown as Booking.com's Payments API reports it (read when Booking.com notifies a payout change). Null on other channels and for bookings not read yet. Money is in `currency`.
18
+ class TransactionBookingPaymentsApi < ApiModelBase
19
+ attr_accessor :source
20
+
21
+ # `PAYMENTS_BY_BOOKING`, `PAYMENT_AT_PROPERTY` or `SMART_PAYMENT_AT_PROPERTY`.
22
+ attr_accessor :payment_tags
23
+
24
+ # `GROSS`, `NET` or `UNKNOWN`; null when the property collects the payment.
25
+ attr_accessor :payout_type
26
+
27
+ # `PENDING`, `PAID`, `CANCELLED` or `UNKNOWN`.
28
+ attr_accessor :payout_status
29
+
30
+ attr_accessor :currency
31
+
32
+ # What the guest paid Booking.com.
33
+ attr_accessor :gross_amount
34
+
35
+ attr_accessor :commission
36
+
37
+ # Payments service charge.
38
+ attr_accessor :payment_charge
39
+
40
+ attr_accessor :vat
41
+
42
+ # VAT on commission and on the payment charge.
43
+ attr_accessor :vat_on_fees
44
+
45
+ # City tax, withheld and other taxes.
46
+ attr_accessor :taxes
47
+
48
+ # Estimated payout to the property.
49
+ attr_accessor :net_amount
50
+
51
+ # Estimated amount the property collects itself (e.g. city tax, or the whole stay when the property collects the payment).
52
+ attr_accessor :amount_to_collect_at_property
53
+
54
+ attr_accessor :bank_transfer
55
+
56
+ # Per-room price lines as Booking.com reports them.
57
+ attr_accessor :charges
58
+
59
+ attr_accessor :fetched_at
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'source' => :'source',
87
+ :'payment_tags' => :'paymentTags',
88
+ :'payout_type' => :'payoutType',
89
+ :'payout_status' => :'payoutStatus',
90
+ :'currency' => :'currency',
91
+ :'gross_amount' => :'grossAmount',
92
+ :'commission' => :'commission',
93
+ :'payment_charge' => :'paymentCharge',
94
+ :'vat' => :'vat',
95
+ :'vat_on_fees' => :'vatOnFees',
96
+ :'taxes' => :'taxes',
97
+ :'net_amount' => :'netAmount',
98
+ :'amount_to_collect_at_property' => :'amountToCollectAtProperty',
99
+ :'bank_transfer' => :'bankTransfer',
100
+ :'charges' => :'charges',
101
+ :'fetched_at' => :'fetchedAt'
102
+ }
103
+ end
104
+
105
+ # Returns attribute mapping this model knows about
106
+ def self.acceptable_attribute_map
107
+ attribute_map
108
+ end
109
+
110
+ # Returns all the JSON keys this model knows about
111
+ def self.acceptable_attributes
112
+ acceptable_attribute_map.values
113
+ end
114
+
115
+ # Attribute type mapping.
116
+ def self.openapi_types
117
+ {
118
+ :'source' => :'String',
119
+ :'payment_tags' => :'Array<String>',
120
+ :'payout_type' => :'String',
121
+ :'payout_status' => :'String',
122
+ :'currency' => :'String',
123
+ :'gross_amount' => :'Float',
124
+ :'commission' => :'Float',
125
+ :'payment_charge' => :'Float',
126
+ :'vat' => :'Float',
127
+ :'vat_on_fees' => :'Float',
128
+ :'taxes' => :'Float',
129
+ :'net_amount' => :'Float',
130
+ :'amount_to_collect_at_property' => :'Float',
131
+ :'bank_transfer' => :'TransactionBookingPaymentsApiBankTransfer',
132
+ :'charges' => :'Array<TransactionBookingPaymentsApiChargesInner>',
133
+ :'fetched_at' => :'Time'
134
+ }
135
+ end
136
+
137
+ # List of attributes with nullable: true
138
+ def self.openapi_nullable
139
+ Set.new([
140
+ :'payout_type',
141
+ :'payout_status',
142
+ :'currency',
143
+ :'gross_amount',
144
+ :'commission',
145
+ :'payment_charge',
146
+ :'vat',
147
+ :'vat_on_fees',
148
+ :'taxes',
149
+ :'net_amount',
150
+ :'amount_to_collect_at_property',
151
+ :'bank_transfer',
152
+ :'fetched_at'
153
+ ])
154
+ end
155
+
156
+ # Initializes the object
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ def initialize(attributes = {})
159
+ if (!attributes.is_a?(Hash))
160
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TransactionBookingPaymentsApi` initialize method"
161
+ end
162
+
163
+ # check to see if the attribute exists and convert string to symbol for hash key
164
+ acceptable_attribute_map = self.class.acceptable_attribute_map
165
+ attributes = attributes.each_with_object({}) { |(k, v), h|
166
+ if (!acceptable_attribute_map.key?(k.to_sym))
167
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TransactionBookingPaymentsApi`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
168
+ end
169
+ h[k.to_sym] = v
170
+ }
171
+
172
+ if attributes.key?(:'source')
173
+ self.source = attributes[:'source']
174
+ end
175
+
176
+ if attributes.key?(:'payment_tags')
177
+ if (value = attributes[:'payment_tags']).is_a?(Array)
178
+ self.payment_tags = value
179
+ end
180
+ end
181
+
182
+ if attributes.key?(:'payout_type')
183
+ self.payout_type = attributes[:'payout_type']
184
+ end
185
+
186
+ if attributes.key?(:'payout_status')
187
+ self.payout_status = attributes[:'payout_status']
188
+ end
189
+
190
+ if attributes.key?(:'currency')
191
+ self.currency = attributes[:'currency']
192
+ end
193
+
194
+ if attributes.key?(:'gross_amount')
195
+ self.gross_amount = attributes[:'gross_amount']
196
+ end
197
+
198
+ if attributes.key?(:'commission')
199
+ self.commission = attributes[:'commission']
200
+ end
201
+
202
+ if attributes.key?(:'payment_charge')
203
+ self.payment_charge = attributes[:'payment_charge']
204
+ end
205
+
206
+ if attributes.key?(:'vat')
207
+ self.vat = attributes[:'vat']
208
+ end
209
+
210
+ if attributes.key?(:'vat_on_fees')
211
+ self.vat_on_fees = attributes[:'vat_on_fees']
212
+ end
213
+
214
+ if attributes.key?(:'taxes')
215
+ self.taxes = attributes[:'taxes']
216
+ end
217
+
218
+ if attributes.key?(:'net_amount')
219
+ self.net_amount = attributes[:'net_amount']
220
+ end
221
+
222
+ if attributes.key?(:'amount_to_collect_at_property')
223
+ self.amount_to_collect_at_property = attributes[:'amount_to_collect_at_property']
224
+ end
225
+
226
+ if attributes.key?(:'bank_transfer')
227
+ self.bank_transfer = attributes[:'bank_transfer']
228
+ end
229
+
230
+ if attributes.key?(:'charges')
231
+ if (value = attributes[:'charges']).is_a?(Array)
232
+ self.charges = value
233
+ end
234
+ end
235
+
236
+ if attributes.key?(:'fetched_at')
237
+ self.fetched_at = attributes[:'fetched_at']
238
+ end
239
+ end
240
+
241
+ # Show invalid properties with the reasons. Usually used together with valid?
242
+ # @return Array for valid properties with the reasons
243
+ def list_invalid_properties
244
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
245
+ invalid_properties = Array.new
246
+ invalid_properties
247
+ end
248
+
249
+ # Check to see if the all the properties in the model are valid
250
+ # @return true if the model is valid
251
+ def valid?
252
+ warn '[DEPRECATED] the `valid?` method is obsolete'
253
+ source_validator = EnumAttributeValidator.new('String', ["payments_api"])
254
+ return false unless source_validator.valid?(@source)
255
+ true
256
+ end
257
+
258
+ # Custom attribute writer method checking allowed values (enum).
259
+ # @param [Object] source Object to be assigned
260
+ def source=(source)
261
+ validator = EnumAttributeValidator.new('String', ["payments_api"])
262
+ unless validator.valid?(source)
263
+ fail ArgumentError, "invalid value for \"source\", must be one of #{validator.allowable_values}."
264
+ end
265
+ @source = source
266
+ end
267
+
268
+ # Checks equality by comparing each attribute.
269
+ # @param [Object] Object to be compared
270
+ def ==(o)
271
+ return true if self.equal?(o)
272
+ self.class == o.class &&
273
+ source == o.source &&
274
+ payment_tags == o.payment_tags &&
275
+ payout_type == o.payout_type &&
276
+ payout_status == o.payout_status &&
277
+ currency == o.currency &&
278
+ gross_amount == o.gross_amount &&
279
+ commission == o.commission &&
280
+ payment_charge == o.payment_charge &&
281
+ vat == o.vat &&
282
+ vat_on_fees == o.vat_on_fees &&
283
+ taxes == o.taxes &&
284
+ net_amount == o.net_amount &&
285
+ amount_to_collect_at_property == o.amount_to_collect_at_property &&
286
+ bank_transfer == o.bank_transfer &&
287
+ charges == o.charges &&
288
+ fetched_at == o.fetched_at
289
+ end
290
+
291
+ # @see the `==` method
292
+ # @param [Object] Object to be compared
293
+ def eql?(o)
294
+ self == o
295
+ end
296
+
297
+ # Calculates hash code according to all attributes.
298
+ # @return [Integer] Hash code
299
+ def hash
300
+ [source, payment_tags, payout_type, payout_status, currency, gross_amount, commission, payment_charge, vat, vat_on_fees, taxes, net_amount, amount_to_collect_at_property, bank_transfer, charges, fetched_at].hash
301
+ end
302
+
303
+ # Builds the object from hash
304
+ # @param [Hash] attributes Model attributes in the form of hash
305
+ # @return [Object] Returns the model itself
306
+ def self.build_from_hash(attributes)
307
+ return nil unless attributes.is_a?(Hash)
308
+ attributes = attributes.transform_keys(&:to_sym)
309
+ transformed_hash = {}
310
+ openapi_types.each_pair do |key, type|
311
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
312
+ transformed_hash["#{key}"] = nil
313
+ elsif type =~ /\AArray<(.*)>/i
314
+ # check to ensure the input is an array given that the attribute
315
+ # is documented as an array but the input is not
316
+ if attributes[attribute_map[key]].is_a?(Array)
317
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
318
+ end
319
+ elsif !attributes[attribute_map[key]].nil?
320
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
321
+ end
322
+ end
323
+ new(transformed_hash)
324
+ end
325
+
326
+ # Returns the object in the form of hash
327
+ # @return [Hash] Returns the object in the form of hash
328
+ def to_hash
329
+ hash = {}
330
+ self.class.attribute_map.each_pair do |attr, param|
331
+ value = self.send(attr)
332
+ if value.nil?
333
+ is_nullable = self.class.openapi_nullable.include?(attr)
334
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
335
+ end
336
+
337
+ hash[param] = _to_hash(value)
338
+ end
339
+ hash
340
+ end
341
+
342
+ end
343
+
344
+ end
@@ -0,0 +1,169 @@
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 TransactionBookingPaymentsApiBankTransfer < ApiModelBase
18
+ # Booking.com bank-transfer reference; matches the payout on your bank statement.
19
+ attr_accessor :reference
20
+
21
+ attr_accessor :status
22
+
23
+ attr_accessor :date
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'reference' => :'reference',
29
+ :'status' => :'status',
30
+ :'date' => :'date'
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
+ :'reference' => :'String',
48
+ :'status' => :'String',
49
+ :'date' => :'String'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ :'reference',
57
+ :'status',
58
+ :'date'
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TransactionBookingPaymentsApiBankTransfer` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TransactionBookingPaymentsApiBankTransfer`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'reference')
79
+ self.reference = attributes[:'reference']
80
+ end
81
+
82
+ if attributes.key?(:'status')
83
+ self.status = attributes[:'status']
84
+ end
85
+
86
+ if attributes.key?(:'date')
87
+ self.date = attributes[:'date']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ reference == o.reference &&
112
+ status == o.status &&
113
+ date == o.date
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [reference, status, date].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Returns the object in the form of hash
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_hash
154
+ hash = {}
155
+ self.class.attribute_map.each_pair do |attr, param|
156
+ value = self.send(attr)
157
+ if value.nil?
158
+ is_nullable = self.class.openapi_nullable.include?(attr)
159
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
160
+ end
161
+
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ end
168
+
169
+ end