repull 0.2.34 → 0.2.36

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +6 -6
  3. data/lib/repull/api/health_api.rb +3 -3
  4. data/lib/repull/api/listings_api.rb +8 -8
  5. data/lib/repull/api/migrate_api.rb +68 -0
  6. data/lib/repull/models/{calendar_updated_event.rb → booking_unacknowledged_event.rb} +4 -4
  7. data/lib/repull/models/booking_unacknowledged_payload.rb +229 -0
  8. data/lib/repull/models/channel_degraded_event.rb +279 -0
  9. data/lib/repull/models/channel_degraded_payload.rb +174 -0
  10. data/lib/repull/models/channel_degraded_payload_object.rb +262 -0
  11. data/lib/repull/models/channel_sync_failed_event.rb +280 -0
  12. data/lib/repull/models/channel_sync_failure_payload.rb +214 -0
  13. data/lib/repull/models/channel_sync_failure_payload_failures_inner.rb +213 -0
  14. data/lib/repull/models/channel_sync_failure_payload_object.rb +289 -0
  15. data/lib/repull/models/charge_per.rb +42 -0
  16. data/lib/repull/models/connect_session_completed_payload.rb +1 -1
  17. data/lib/repull/models/connect_status_accounts_inner.rb +12 -1
  18. data/lib/repull/models/create_connect_session_request.rb +26 -2
  19. data/lib/repull/models/create_connection_request.rb +3 -23
  20. data/lib/repull/models/{plumguide_listing_list_response.rb → import_from_channex200_response.rb} +8 -19
  21. data/lib/repull/models/import_from_channex200_response_data.rb +324 -0
  22. data/lib/repull/models/import_from_channex200_response_data_channels_inner.rb +263 -0
  23. data/lib/repull/models/import_from_channex200_response_data_properties_inner.rb +222 -0
  24. data/lib/repull/models/import_from_channex200_response_data_summary.rb +201 -0
  25. data/lib/repull/models/import_from_channex200_response_data_summary_bookings.rb +165 -0
  26. data/lib/repull/models/import_from_channex200_response_data_summary_properties.rb +165 -0
  27. data/lib/repull/models/import_from_channex_request.rb +223 -0
  28. data/lib/repull/models/list_connection_units200_response.rb +12 -1
  29. data/lib/repull/models/list_connection_units200_response_units_inner.rb +1 -0
  30. data/lib/repull/models/listing.rb +82 -1
  31. data/lib/repull/models/listing_address.rb +62 -5
  32. data/lib/repull/models/listing_content_photo.rb +206 -0
  33. data/lib/repull/models/listing_fee.rb +229 -0
  34. data/lib/repull/models/listing_policies.rb +257 -0
  35. data/lib/repull/models/{calendar_updated_payload.rb → listing_policies_check_in.rb} +33 -38
  36. data/lib/repull/models/listing_policies_check_out.rb +148 -0
  37. data/lib/repull/models/{calendar_updated_payload_range.rb → listing_policies_quiet_hours.rb} +5 -5
  38. data/lib/repull/models/listing_pricing_settings.rb +233 -0
  39. data/lib/repull/models/listing_room.rb +190 -0
  40. data/lib/repull/models/{plumguide_listing.rb → listing_room_beds_inner.rb} +16 -27
  41. data/lib/repull/models/listing_rules.rb +212 -0
  42. data/lib/repull/models/listing_tax.rb +241 -0
  43. data/lib/repull/models/message.rb +24 -1
  44. data/lib/repull/models/postal_address.rb +216 -0
  45. data/lib/repull/models/property.rb +12 -2
  46. data/lib/repull/models/reservation_thread_assigned_event.rb +279 -0
  47. data/lib/repull/models/reservation_thread_assigned_payload.rb +174 -0
  48. data/lib/repull/models/reservation_thread_assigned_payload_object.rb +249 -0
  49. data/lib/repull/models/webhook_event.rb +8 -2
  50. data/lib/repull/models/webhook_event_type.rb +5 -2
  51. data/lib/repull/version.rb +1 -1
  52. data/lib/repull.rb +33 -6
  53. data/openapi/v1.json +1712 -352
  54. metadata +35 -10
  55. data/lib/repull/api/plumguide_api.rb +0 -552
  56. data/spec/api/plumguide_api_spec.rb +0 -85
@@ -0,0 +1,262 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | unlimited (10 included, then billed per listing) | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ class ChannelDegradedPayloadObject < ApiModelBase
18
+ attr_accessor :customer_id
19
+
20
+ attr_accessor :provider
21
+
22
+ # The provider's own account, host or hotel id.
23
+ attr_accessor :external_account_id
24
+
25
+ attr_accessor :status
26
+
27
+ # What we observed, in the provider's words where possible. A bare \"degraded\" tells nobody what to fix.
28
+ attr_accessor :detail
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'customer_id' => :'customerId',
56
+ :'provider' => :'provider',
57
+ :'external_account_id' => :'externalAccountId',
58
+ :'status' => :'status',
59
+ :'detail' => :'detail'
60
+ }
61
+ end
62
+
63
+ # Returns attribute mapping this model knows about
64
+ def self.acceptable_attribute_map
65
+ attribute_map
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ acceptable_attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'customer_id' => :'Integer',
77
+ :'provider' => :'String',
78
+ :'external_account_id' => :'String',
79
+ :'status' => :'String',
80
+ :'detail' => :'String'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ :'external_account_id',
88
+ :'detail'
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ChannelDegradedPayloadObject` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ acceptable_attribute_map = self.class.acceptable_attribute_map
101
+ attributes = attributes.each_with_object({}) { |(k, v), h|
102
+ if (!acceptable_attribute_map.key?(k.to_sym))
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ChannelDegradedPayloadObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
+ end
105
+ h[k.to_sym] = v
106
+ }
107
+
108
+ if attributes.key?(:'customer_id')
109
+ self.customer_id = attributes[:'customer_id']
110
+ else
111
+ self.customer_id = nil
112
+ end
113
+
114
+ if attributes.key?(:'provider')
115
+ self.provider = attributes[:'provider']
116
+ else
117
+ self.provider = nil
118
+ end
119
+
120
+ if attributes.key?(:'external_account_id')
121
+ self.external_account_id = attributes[:'external_account_id']
122
+ end
123
+
124
+ if attributes.key?(:'status')
125
+ self.status = attributes[:'status']
126
+ else
127
+ self.status = nil
128
+ end
129
+
130
+ if attributes.key?(:'detail')
131
+ self.detail = attributes[:'detail']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
+ invalid_properties = Array.new
140
+ if @customer_id.nil?
141
+ invalid_properties.push('invalid value for "customer_id", customer_id cannot be nil.')
142
+ end
143
+
144
+ if @provider.nil?
145
+ invalid_properties.push('invalid value for "provider", provider cannot be nil.')
146
+ end
147
+
148
+ if @status.nil?
149
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
159
+ return false if @customer_id.nil?
160
+ return false if @provider.nil?
161
+ return false if @status.nil?
162
+ status_validator = EnumAttributeValidator.new('String', ["degraded", "down"])
163
+ return false unless status_validator.valid?(@status)
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] customer_id Value to be assigned
169
+ def customer_id=(customer_id)
170
+ if customer_id.nil?
171
+ fail ArgumentError, 'customer_id cannot be nil'
172
+ end
173
+
174
+ @customer_id = customer_id
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] provider Value to be assigned
179
+ def provider=(provider)
180
+ if provider.nil?
181
+ fail ArgumentError, 'provider cannot be nil'
182
+ end
183
+
184
+ @provider = provider
185
+ end
186
+
187
+ # Custom attribute writer method checking allowed values (enum).
188
+ # @param [Object] status Object to be assigned
189
+ def status=(status)
190
+ validator = EnumAttributeValidator.new('String', ["degraded", "down"])
191
+ unless validator.valid?(status)
192
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
193
+ end
194
+ @status = status
195
+ end
196
+
197
+ # Checks equality by comparing each attribute.
198
+ # @param [Object] Object to be compared
199
+ def ==(o)
200
+ return true if self.equal?(o)
201
+ self.class == o.class &&
202
+ customer_id == o.customer_id &&
203
+ provider == o.provider &&
204
+ external_account_id == o.external_account_id &&
205
+ status == o.status &&
206
+ detail == o.detail
207
+ end
208
+
209
+ # @see the `==` method
210
+ # @param [Object] Object to be compared
211
+ def eql?(o)
212
+ self == o
213
+ end
214
+
215
+ # Calculates hash code according to all attributes.
216
+ # @return [Integer] Hash code
217
+ def hash
218
+ [customer_id, provider, external_account_id, status, detail].hash
219
+ end
220
+
221
+ # Builds the object from hash
222
+ # @param [Hash] attributes Model attributes in the form of hash
223
+ # @return [Object] Returns the model itself
224
+ def self.build_from_hash(attributes)
225
+ return nil unless attributes.is_a?(Hash)
226
+ attributes = attributes.transform_keys(&:to_sym)
227
+ transformed_hash = {}
228
+ openapi_types.each_pair do |key, type|
229
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
230
+ transformed_hash["#{key}"] = nil
231
+ elsif type =~ /\AArray<(.*)>/i
232
+ # check to ensure the input is an array given that the attribute
233
+ # is documented as an array but the input is not
234
+ if attributes[attribute_map[key]].is_a?(Array)
235
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
236
+ end
237
+ elsif !attributes[attribute_map[key]].nil?
238
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
239
+ end
240
+ end
241
+ new(transformed_hash)
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -0,0 +1,280 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | unlimited (10 included, then billed per listing) | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ class ChannelSyncFailedEvent < ApiModelBase
18
+ # The event name. This field is `event`, not `type`.
19
+ attr_accessor :event
20
+
21
+ # Stable across every delivery and replay of this logical event — dedupe on it.
22
+ attr_accessor :event_id
23
+
24
+ attr_accessor :api_version
25
+
26
+ attr_accessor :timestamp
27
+
28
+ attr_accessor :account
29
+
30
+ attr_accessor :data
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'event' => :'event',
36
+ :'event_id' => :'eventId',
37
+ :'api_version' => :'apiVersion',
38
+ :'timestamp' => :'timestamp',
39
+ :'account' => :'account',
40
+ :'data' => :'data'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'event' => :'String',
58
+ :'event_id' => :'String',
59
+ :'api_version' => :'String',
60
+ :'timestamp' => :'Time',
61
+ :'account' => :'WebhookEventAccount',
62
+ :'data' => :'ChannelSyncFailurePayload'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ :'account',
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ChannelSyncFailedEvent` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!acceptable_attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ChannelSyncFailedEvent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'event')
90
+ self.event = attributes[:'event']
91
+ else
92
+ self.event = nil
93
+ end
94
+
95
+ if attributes.key?(:'event_id')
96
+ self.event_id = attributes[:'event_id']
97
+ else
98
+ self.event_id = nil
99
+ end
100
+
101
+ if attributes.key?(:'api_version')
102
+ self.api_version = attributes[:'api_version']
103
+ else
104
+ self.api_version = nil
105
+ end
106
+
107
+ if attributes.key?(:'timestamp')
108
+ self.timestamp = attributes[:'timestamp']
109
+ else
110
+ self.timestamp = nil
111
+ end
112
+
113
+ if attributes.key?(:'account')
114
+ self.account = attributes[:'account']
115
+ end
116
+
117
+ if attributes.key?(:'data')
118
+ self.data = attributes[:'data']
119
+ else
120
+ self.data = nil
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
+ invalid_properties = Array.new
129
+ if @event.nil?
130
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
131
+ end
132
+
133
+ if @event_id.nil?
134
+ invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
135
+ end
136
+
137
+ if @api_version.nil?
138
+ invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
139
+ end
140
+
141
+ if @timestamp.nil?
142
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
143
+ end
144
+
145
+ if @data.nil?
146
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ warn '[DEPRECATED] the `valid?` method is obsolete'
156
+ return false if @event.nil?
157
+ return false if @event_id.nil?
158
+ return false if @api_version.nil?
159
+ return false if @timestamp.nil?
160
+ return false if @data.nil?
161
+ true
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] event Value to be assigned
166
+ def event=(event)
167
+ if event.nil?
168
+ fail ArgumentError, 'event cannot be nil'
169
+ end
170
+
171
+ @event = event
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] event_id Value to be assigned
176
+ def event_id=(event_id)
177
+ if event_id.nil?
178
+ fail ArgumentError, 'event_id cannot be nil'
179
+ end
180
+
181
+ @event_id = event_id
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] api_version Value to be assigned
186
+ def api_version=(api_version)
187
+ if api_version.nil?
188
+ fail ArgumentError, 'api_version cannot be nil'
189
+ end
190
+
191
+ @api_version = api_version
192
+ end
193
+
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] timestamp Value to be assigned
196
+ def timestamp=(timestamp)
197
+ if timestamp.nil?
198
+ fail ArgumentError, 'timestamp cannot be nil'
199
+ end
200
+
201
+ @timestamp = timestamp
202
+ end
203
+
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] data Value to be assigned
206
+ def data=(data)
207
+ if data.nil?
208
+ fail ArgumentError, 'data cannot be nil'
209
+ end
210
+
211
+ @data = data
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ event == o.event &&
220
+ event_id == o.event_id &&
221
+ api_version == o.api_version &&
222
+ timestamp == o.timestamp &&
223
+ account == o.account &&
224
+ data == o.data
225
+ end
226
+
227
+ # @see the `==` method
228
+ # @param [Object] Object to be compared
229
+ def eql?(o)
230
+ self == o
231
+ end
232
+
233
+ # Calculates hash code according to all attributes.
234
+ # @return [Integer] Hash code
235
+ def hash
236
+ [event, event_id, api_version, timestamp, account, data].hash
237
+ end
238
+
239
+ # Builds the object from hash
240
+ # @param [Hash] attributes Model attributes in the form of hash
241
+ # @return [Object] Returns the model itself
242
+ def self.build_from_hash(attributes)
243
+ return nil unless attributes.is_a?(Hash)
244
+ attributes = attributes.transform_keys(&:to_sym)
245
+ transformed_hash = {}
246
+ openapi_types.each_pair do |key, type|
247
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
248
+ transformed_hash["#{key}"] = nil
249
+ elsif type =~ /\AArray<(.*)>/i
250
+ # check to ensure the input is an array given that the attribute
251
+ # is documented as an array but the input is not
252
+ if attributes[attribute_map[key]].is_a?(Array)
253
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
254
+ end
255
+ elsif !attributes[attribute_map[key]].nil?
256
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
257
+ end
258
+ end
259
+ new(transformed_hash)
260
+ end
261
+
262
+ # Returns the object in the form of hash
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_hash
265
+ hash = {}
266
+ self.class.attribute_map.each_pair do |attr, param|
267
+ value = self.send(attr)
268
+ if value.nil?
269
+ is_nullable = self.class.openapi_nullable.include?(attr)
270
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
271
+ end
272
+
273
+ hash[param] = _to_hash(value)
274
+ end
275
+ hash
276
+ end
277
+
278
+ end
279
+
280
+ end