repull 0.2.8 → 0.2.10

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +1443 -182
  3. data/lib/repull/api/availability_api.rb +24 -92
  4. data/lib/repull/api/billing_api.rb +186 -15
  5. data/lib/repull/api/booking_com_api.rb +532 -41
  6. data/lib/repull/api/listings_api.rb +74 -0
  7. data/lib/repull/api/plumguide_api.rb +245 -0
  8. data/lib/repull/api/reservations_api.rb +0 -197
  9. data/lib/repull/api/sandbox_api.rb +136 -0
  10. data/lib/repull/api/vrbo_api.rb +0 -126
  11. data/lib/repull/models/acknowledge_booking_reservations_request.rb +176 -0
  12. data/lib/repull/models/{create_studio_project201_response_data.rb → airbnb_alteration.rb} +44 -52
  13. data/lib/repull/models/airbnb_amenity.rb +171 -0
  14. data/lib/repull/models/{get_studio_deployment200_response.rb → airbnb_availability_write_request.rb} +52 -10
  15. data/lib/repull/models/airbnb_calendar_operation.rb +250 -0
  16. data/lib/repull/models/airbnb_listing_action_request.rb +198 -0
  17. data/lib/repull/models/{update_availability_request.rb → airbnb_pricing_write_request.rb} +100 -11
  18. data/lib/repull/models/booking_availability_update.rb +276 -0
  19. data/lib/repull/models/booking_availability_update_request.rb +230 -0
  20. data/lib/repull/models/{generate_studio_completion_request_project_id.rb → booking_availability_update_request_property_id.rb} +2 -2
  21. data/lib/repull/models/booking_availability_update_request_updates_inner.rb +104 -0
  22. data/lib/repull/models/booking_pricing_rate_update.rb +1 -0
  23. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +65 -6
  24. data/lib/repull/models/booking_setup_request.rb +220 -0
  25. data/lib/repull/models/create_airbnb_alteration_request.rb +195 -0
  26. data/lib/repull/models/{create_studio_deployment201_response_data.rb → create_airbnb_offer_request.rb} +42 -30
  27. data/lib/repull/models/{create_studio_project_request.rb → create_booking_webhook_request.rb} +36 -47
  28. data/lib/repull/models/{generate_studio_completion200_response.rb → delete_airbnb_listing_photo200_response.rb} +10 -10
  29. data/lib/repull/models/{delete_studio_project200_response.rb → get_airbnb_alteration200_response.rb} +50 -7
  30. data/lib/repull/models/{delete_studio_project_file200_response.rb → get_airbnb_listing_quality200_response.rb} +37 -7
  31. data/lib/repull/models/{create_studio_project_generation201_response.rb → get_airbnb_listing_settings200_response.rb} +37 -7
  32. data/lib/repull/models/{delete_studio_deployment200_response.rb → get_airbnb_thread200_response.rb} +50 -7
  33. data/lib/repull/models/{list_studio_deployments200_response.rb → get_usage_logs200_response.rb} +17 -8
  34. data/lib/repull/models/get_usage_logs200_response_data_inner.rb +264 -0
  35. data/lib/repull/models/{create_studio_deployment201_response.rb → get_usage_logs200_response_pagination.rb} +29 -10
  36. data/lib/repull/models/get_usage_summary200_response.rb +232 -0
  37. data/lib/repull/models/get_usage_summary200_response_breakdown_inner.rb +183 -0
  38. data/lib/repull/models/{delete_studio_deployment200_response_data.rb → get_usage_summary200_response_limits.rb} +18 -16
  39. data/lib/repull/models/{delete_studio_project200_response_data.rb → get_usage_summary200_response_remaining.rb} +18 -16
  40. data/lib/repull/models/{create_studio_project_generation201_response_data.rb → get_usage_summary200_response_status_distribution.rb} +31 -22
  41. data/lib/repull/models/{upsert_studio_project_file_request.rb → get_usage_summary200_response_timeline_inner.rb} +28 -28
  42. data/lib/repull/models/{create_studio_project_generation_request.rb → get_usage_summary200_response_totals.rb} +28 -28
  43. data/lib/repull/models/{create_studio_project201_response.rb → get_usage_summary200_response_used.rb} +19 -10
  44. data/lib/repull/models/get_usage_tier200_response.rb +183 -0
  45. data/lib/repull/models/{list_studio_projects200_response.rb → get_usage_tier200_response_limits.rb} +31 -12
  46. data/lib/repull/models/{update_reservation_request.rb → get_usage_tier200_response_remaining.rb} +25 -31
  47. data/lib/repull/models/{get_studio_project200_response.rb → get_usage_tier200_response_used.rb} +28 -10
  48. data/lib/repull/models/list_airbnb_alterations200_response.rb +192 -0
  49. data/lib/repull/models/list_airbnb_listing_amenities200_response.rb +190 -0
  50. data/lib/repull/models/{create_studio_deployment_request.rb → list_airbnb_listing_amenities200_response_data.rb} +23 -28
  51. data/lib/repull/models/{list_studio_project_files200_response.rb → list_airbnb_transactions200_response.rb} +50 -7
  52. data/lib/repull/models/listing_content_update_request.rb +243 -0
  53. data/lib/repull/models/{upsert_studio_project_file200_response.rb → listing_content_update_request_address.rb} +53 -10
  54. data/lib/repull/models/listing_content_update_request_amenities.rb +105 -0
  55. data/lib/repull/models/listing_content_update_request_amenities_one_of_inner.rb +196 -0
  56. data/lib/repull/models/listing_content_update_request_occupancy.rb +179 -0
  57. data/lib/repull/{api/ai_api.rb → models/listing_content_update_request_photos_inner.rb} +77 -59
  58. data/lib/repull/models/{generate_studio_completion200_response_data.rb → listing_content_update_request_photos_inner_one_of.rb} +81 -66
  59. data/lib/repull/models/listing_content_update_request_policies.rb +253 -0
  60. data/lib/repull/models/{create_ai_operation200_response.rb → listing_content_update_response.rb} +32 -16
  61. data/lib/repull/models/map_airbnb_listing_request.rb +215 -0
  62. data/lib/repull/models/{create_reservation_request.rb → map_airbnb_listing_response.rb} +137 -116
  63. data/lib/repull/models/property.rb +42 -69
  64. data/lib/repull/models/property_availability.rb +222 -0
  65. data/lib/repull/models/property_availability_day.rb +247 -0
  66. data/lib/repull/models/reservation.rb +28 -1
  67. data/lib/repull/models/sandbox_fixture_ref.rb +193 -0
  68. data/lib/repull/models/{delete_studio_project_file200_response_data.rb → sandbox_reset_result.rb} +72 -11
  69. data/lib/repull/models/sandbox_reset_result_deleted.rb +216 -0
  70. data/lib/repull/models/sandbox_seed_result.rb +278 -0
  71. data/lib/repull/models/{update_studio_project_request.rb → update_airbnb_message_request.rb} +43 -24
  72. data/lib/repull/models/update_booking_charges_request.rb +194 -0
  73. data/lib/repull/version.rb +1 -1
  74. data/lib/repull.rb +59 -34
  75. data/openapi/v1.json +3956 -2522
  76. metadata +61 -36
  77. data/lib/repull/api/studio_api.rb +0 -1094
  78. data/lib/repull/models/generate_studio_completion_request.rb +0 -305
  79. data/lib/repull/models/upsert_studio_project_file200_response_data.rb +0 -147
@@ -14,13 +14,19 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- class ListStudioProjects200Response < ApiModelBase
18
- attr_accessor :data
17
+ class GetUsageTier200ResponseLimits < ApiModelBase
18
+ attr_accessor :monthly_requests
19
+
20
+ attr_accessor :daily_ai_requests
21
+
22
+ attr_accessor :dynamic_pricing_listings
19
23
 
20
24
  # Attribute mapping from ruby-style variable name to JSON key.
21
25
  def self.attribute_map
22
26
  {
23
- :'data' => :'data'
27
+ :'monthly_requests' => :'monthly_requests',
28
+ :'daily_ai_requests' => :'daily_ai_requests',
29
+ :'dynamic_pricing_listings' => :'dynamic_pricing_listings'
24
30
  }
25
31
  end
26
32
 
@@ -37,13 +43,18 @@ module Repull
37
43
  # Attribute type mapping.
38
44
  def self.openapi_types
39
45
  {
40
- :'data' => :'Array<StudioProject>'
46
+ :'monthly_requests' => :'Integer',
47
+ :'daily_ai_requests' => :'Integer',
48
+ :'dynamic_pricing_listings' => :'Integer'
41
49
  }
42
50
  end
43
51
 
44
52
  # List of attributes with nullable: true
45
53
  def self.openapi_nullable
46
54
  Set.new([
55
+ :'monthly_requests',
56
+ :'daily_ai_requests',
57
+ :'dynamic_pricing_listings'
47
58
  ])
48
59
  end
49
60
 
@@ -51,22 +62,28 @@ module Repull
51
62
  # @param [Hash] attributes Model attributes in the form of hash
52
63
  def initialize(attributes = {})
53
64
  if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListStudioProjects200Response` initialize method"
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::GetUsageTier200ResponseLimits` initialize method"
55
66
  end
56
67
 
57
68
  # check to see if the attribute exists and convert string to symbol for hash key
58
69
  acceptable_attribute_map = self.class.acceptable_attribute_map
59
70
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
71
  if (!acceptable_attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListStudioProjects200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::GetUsageTier200ResponseLimits`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
73
  end
63
74
  h[k.to_sym] = v
64
75
  }
65
76
 
66
- if attributes.key?(:'data')
67
- if (value = attributes[:'data']).is_a?(Array)
68
- self.data = value
69
- end
77
+ if attributes.key?(:'monthly_requests')
78
+ self.monthly_requests = attributes[:'monthly_requests']
79
+ end
80
+
81
+ if attributes.key?(:'daily_ai_requests')
82
+ self.daily_ai_requests = attributes[:'daily_ai_requests']
83
+ end
84
+
85
+ if attributes.key?(:'dynamic_pricing_listings')
86
+ self.dynamic_pricing_listings = attributes[:'dynamic_pricing_listings']
70
87
  end
71
88
  end
72
89
 
@@ -90,7 +107,9 @@ module Repull
90
107
  def ==(o)
91
108
  return true if self.equal?(o)
92
109
  self.class == o.class &&
93
- data == o.data
110
+ monthly_requests == o.monthly_requests &&
111
+ daily_ai_requests == o.daily_ai_requests &&
112
+ dynamic_pricing_listings == o.dynamic_pricing_listings
94
113
  end
95
114
 
96
115
  # @see the `==` method
@@ -102,7 +121,7 @@ module Repull
102
121
  # Calculates hash code according to all attributes.
103
122
  # @return [Integer] Hash code
104
123
  def hash
105
- [data].hash
124
+ [monthly_requests, daily_ai_requests, dynamic_pricing_listings].hash
106
125
  end
107
126
 
108
127
  # Builds the object from hash
@@ -14,22 +14,19 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- class UpdateReservationRequest < ApiModelBase
18
- attr_accessor :check_in
17
+ class GetUsageTier200ResponseRemaining < ApiModelBase
18
+ attr_accessor :monthly
19
19
 
20
- attr_accessor :check_out
20
+ attr_accessor :daily_ai
21
21
 
22
- attr_accessor :status
23
-
24
- attr_accessor :total_price
22
+ attr_accessor :dynamic_pricing_listings
25
23
 
26
24
  # Attribute mapping from ruby-style variable name to JSON key.
27
25
  def self.attribute_map
28
26
  {
29
- :'check_in' => :'checkIn',
30
- :'check_out' => :'checkOut',
31
- :'status' => :'status',
32
- :'total_price' => :'totalPrice'
27
+ :'monthly' => :'monthly',
28
+ :'daily_ai' => :'daily_ai',
29
+ :'dynamic_pricing_listings' => :'dynamic_pricing_listings'
33
30
  }
34
31
  end
35
32
 
@@ -46,16 +43,18 @@ module Repull
46
43
  # Attribute type mapping.
47
44
  def self.openapi_types
48
45
  {
49
- :'check_in' => :'Date',
50
- :'check_out' => :'Date',
51
- :'status' => :'String',
52
- :'total_price' => :'Float'
46
+ :'monthly' => :'Integer',
47
+ :'daily_ai' => :'Integer',
48
+ :'dynamic_pricing_listings' => :'Integer'
53
49
  }
54
50
  end
55
51
 
56
52
  # List of attributes with nullable: true
57
53
  def self.openapi_nullable
58
54
  Set.new([
55
+ :'monthly',
56
+ :'daily_ai',
57
+ :'dynamic_pricing_listings'
59
58
  ])
60
59
  end
61
60
 
@@ -63,32 +62,28 @@ module Repull
63
62
  # @param [Hash] attributes Model attributes in the form of hash
64
63
  def initialize(attributes = {})
65
64
  if (!attributes.is_a?(Hash))
66
- fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::UpdateReservationRequest` initialize method"
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::GetUsageTier200ResponseRemaining` initialize method"
67
66
  end
68
67
 
69
68
  # check to see if the attribute exists and convert string to symbol for hash key
70
69
  acceptable_attribute_map = self.class.acceptable_attribute_map
71
70
  attributes = attributes.each_with_object({}) { |(k, v), h|
72
71
  if (!acceptable_attribute_map.key?(k.to_sym))
73
- fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::UpdateReservationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::GetUsageTier200ResponseRemaining`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
73
  end
75
74
  h[k.to_sym] = v
76
75
  }
77
76
 
78
- if attributes.key?(:'check_in')
79
- self.check_in = attributes[:'check_in']
80
- end
81
-
82
- if attributes.key?(:'check_out')
83
- self.check_out = attributes[:'check_out']
77
+ if attributes.key?(:'monthly')
78
+ self.monthly = attributes[:'monthly']
84
79
  end
85
80
 
86
- if attributes.key?(:'status')
87
- self.status = attributes[:'status']
81
+ if attributes.key?(:'daily_ai')
82
+ self.daily_ai = attributes[:'daily_ai']
88
83
  end
89
84
 
90
- if attributes.key?(:'total_price')
91
- self.total_price = attributes[:'total_price']
85
+ if attributes.key?(:'dynamic_pricing_listings')
86
+ self.dynamic_pricing_listings = attributes[:'dynamic_pricing_listings']
92
87
  end
93
88
  end
94
89
 
@@ -112,10 +107,9 @@ module Repull
112
107
  def ==(o)
113
108
  return true if self.equal?(o)
114
109
  self.class == o.class &&
115
- check_in == o.check_in &&
116
- check_out == o.check_out &&
117
- status == o.status &&
118
- total_price == o.total_price
110
+ monthly == o.monthly &&
111
+ daily_ai == o.daily_ai &&
112
+ dynamic_pricing_listings == o.dynamic_pricing_listings
119
113
  end
120
114
 
121
115
  # @see the `==` method
@@ -127,7 +121,7 @@ module Repull
127
121
  # Calculates hash code according to all attributes.
128
122
  # @return [Integer] Hash code
129
123
  def hash
130
- [check_in, check_out, status, total_price].hash
124
+ [monthly, daily_ai, dynamic_pricing_listings].hash
131
125
  end
132
126
 
133
127
  # Builds the object from hash
@@ -14,13 +14,19 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- class GetStudioProject200Response < ApiModelBase
18
- attr_accessor :data
17
+ class GetUsageTier200ResponseUsed < ApiModelBase
18
+ attr_accessor :monthly
19
+
20
+ attr_accessor :daily_ai
21
+
22
+ attr_accessor :dynamic_pricing_listings
19
23
 
20
24
  # Attribute mapping from ruby-style variable name to JSON key.
21
25
  def self.attribute_map
22
26
  {
23
- :'data' => :'data'
27
+ :'monthly' => :'monthly',
28
+ :'daily_ai' => :'daily_ai',
29
+ :'dynamic_pricing_listings' => :'dynamic_pricing_listings'
24
30
  }
25
31
  end
26
32
 
@@ -37,7 +43,9 @@ module Repull
37
43
  # Attribute type mapping.
38
44
  def self.openapi_types
39
45
  {
40
- :'data' => :'StudioProject'
46
+ :'monthly' => :'Integer',
47
+ :'daily_ai' => :'Integer',
48
+ :'dynamic_pricing_listings' => :'Integer'
41
49
  }
42
50
  end
43
51
 
@@ -51,20 +59,28 @@ module Repull
51
59
  # @param [Hash] attributes Model attributes in the form of hash
52
60
  def initialize(attributes = {})
53
61
  if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::GetStudioProject200Response` initialize method"
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::GetUsageTier200ResponseUsed` initialize method"
55
63
  end
56
64
 
57
65
  # check to see if the attribute exists and convert string to symbol for hash key
58
66
  acceptable_attribute_map = self.class.acceptable_attribute_map
59
67
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
68
  if (!acceptable_attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::GetStudioProject200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::GetUsageTier200ResponseUsed`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
70
  end
63
71
  h[k.to_sym] = v
64
72
  }
65
73
 
66
- if attributes.key?(:'data')
67
- self.data = attributes[:'data']
74
+ if attributes.key?(:'monthly')
75
+ self.monthly = attributes[:'monthly']
76
+ end
77
+
78
+ if attributes.key?(:'daily_ai')
79
+ self.daily_ai = attributes[:'daily_ai']
80
+ end
81
+
82
+ if attributes.key?(:'dynamic_pricing_listings')
83
+ self.dynamic_pricing_listings = attributes[:'dynamic_pricing_listings']
68
84
  end
69
85
  end
70
86
 
@@ -88,7 +104,9 @@ module Repull
88
104
  def ==(o)
89
105
  return true if self.equal?(o)
90
106
  self.class == o.class &&
91
- data == o.data
107
+ monthly == o.monthly &&
108
+ daily_ai == o.daily_ai &&
109
+ dynamic_pricing_listings == o.dynamic_pricing_listings
92
110
  end
93
111
 
94
112
  # @see the `==` method
@@ -100,7 +118,7 @@ module Repull
100
118
  # Calculates hash code according to all attributes.
101
119
  # @return [Integer] Hash code
102
120
  def hash
103
- [data].hash
121
+ [monthly, daily_ai, dynamic_pricing_listings].hash
104
122
  end
105
123
 
106
124
  # Builds the object from hash
@@ -0,0 +1,192 @@
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_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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 `resets_at` 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` | 50 | | `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
+ Contact: ivan@vanio.ai
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 ListAirbnbAlterations200Response < 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' => :'data_freshness'
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' => :'Array<AirbnbAlteration>',
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::ListAirbnbAlterations200Response` 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::ListAirbnbAlterations200Response`. 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
+ if (value = attributes[:'data']).is_a?(Array)
72
+ self.data = value
73
+ end
74
+ else
75
+ self.data = nil
76
+ end
77
+
78
+ if attributes.key?(:'data_freshness')
79
+ self.data_freshness = attributes[:'data_freshness']
80
+ else
81
+ self.data_freshness = nil
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @data.nil?
91
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
92
+ end
93
+
94
+ if @data_freshness.nil?
95
+ invalid_properties.push('invalid value for "data_freshness", data_freshness cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ return false if @data.nil?
106
+ return false if @data_freshness.nil?
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] data Value to be assigned
112
+ def data=(data)
113
+ if data.nil?
114
+ fail ArgumentError, 'data cannot be nil'
115
+ end
116
+
117
+ @data = data
118
+ end
119
+
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] data_freshness Value to be assigned
122
+ def data_freshness=(data_freshness)
123
+ if data_freshness.nil?
124
+ fail ArgumentError, 'data_freshness cannot be nil'
125
+ end
126
+
127
+ @data_freshness = data_freshness
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ data == o.data &&
136
+ data_freshness == o.data_freshness
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [data, data_freshness].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ end
191
+
192
+ end