Class: Repull::PricingApi
- Inherits:
-
Object
- Object
- Repull::PricingApi
- Defined in:
- lib/repull/api/pricing_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#apply_listing_pricing(id, listing_pricing_apply_request, opts = {}) ⇒ ListingPricingApplyResponse
Apply or decline pricing recommendations Apply: writes the recommended price to the listing’s calendar for the given dates and triggers the platform fan-out (Airbnb / Booking.com / VRBO).
-
#apply_listing_pricing_with_http_info(id, listing_pricing_apply_request, opts = {}) ⇒ Array<(ListingPricingApplyResponse, Integer, Hash)>
Apply or decline pricing recommendations Apply: writes the recommended price to the listing's calendar for the given dates and triggers the platform fan-out (Airbnb / Booking.com / VRBO).
-
#bulk_apply_pricing(bulk_pricing_request, opts = {}) ⇒ BulkPricingResponse
Bulk apply or decline pricing recommendations Apply or decline pending Atlas pricing recommendations across many listings in one call.
-
#bulk_apply_pricing_with_http_info(bulk_pricing_request, opts = {}) ⇒ Array<(BulkPricingResponse, Integer, Hash)>
Bulk apply or decline pricing recommendations Apply or decline pending Atlas pricing recommendations across many listings in one call.
-
#get_listing_pricing(id, opts = {}) ⇒ ListingPricingResponse
Get pricing recommendations Returns date-by-date pricing recommendations for a listing’s upcoming calendar window, plus the listing’s base-price context and a 5km comp summary.
-
#get_listing_pricing_history(id, opts = {}) ⇒ ListingPricingHistoryResponse
Pricing recommendation audit trail Cursor-paginated audit trail of pricing recommendations vs applied prices for a listing across a date window.
-
#get_listing_pricing_history_with_http_info(id, opts = {}) ⇒ Array<(ListingPricingHistoryResponse, Integer, Hash)>
Pricing recommendation audit trail Cursor-paginated audit trail of pricing recommendations vs applied prices for a listing across a date window.
-
#get_listing_pricing_strategy(id, opts = {}) ⇒ ListingPricingStrategy
Get pricing strategy Returns the strategy that constrains how the Atlas pricing model behaves for this listing.
-
#get_listing_pricing_strategy_with_http_info(id, opts = {}) ⇒ Array<(ListingPricingStrategy, Integer, Hash)>
Get pricing strategy Returns the strategy that constrains how the Atlas pricing model behaves for this listing.
-
#get_listing_pricing_with_http_info(id, opts = {}) ⇒ Array<(ListingPricingResponse, Integer, Hash)>
Get pricing recommendations Returns date-by-date pricing recommendations for a listing's upcoming calendar window, plus the listing's base-price context and a 5km comp summary.
-
#initialize(api_client = ApiClient.default) ⇒ PricingApi
constructor
A new instance of PricingApi.
-
#update_listing_pricing_strategy(id, listing_pricing_strategy_input, opts = {}) ⇒ UpdateListingPricingStrategy200Response
Update pricing strategy Upserts the strategy on ‘(listing_id, customer_id)` — repeated PUTs are idempotent.
-
#update_listing_pricing_strategy_with_http_info(id, listing_pricing_strategy_input, opts = {}) ⇒ Array<(UpdateListingPricingStrategy200Response, Integer, Hash)>
Update pricing strategy Upserts the strategy on `(listing_id, customer_id)` — repeated PUTs are idempotent.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ PricingApi
Returns a new instance of PricingApi.
19 20 21 |
# File 'lib/repull/api/pricing_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/repull/api/pricing_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#apply_listing_pricing(id, listing_pricing_apply_request, opts = {}) ⇒ ListingPricingApplyResponse
Apply or decline pricing recommendations Apply: writes the recommended price to the listing’s calendar for the given dates and triggers the platform fan-out (Airbnb / Booking.com / VRBO). Decline: marks the recommendation as ‘declined` so it stops surfacing — the model can re-recommend on the next training cycle.
28 29 30 31 |
# File 'lib/repull/api/pricing_api.rb', line 28 def apply_listing_pricing(id, listing_pricing_apply_request, opts = {}) data, _status_code, _headers = apply_listing_pricing_with_http_info(id, listing_pricing_apply_request, opts) data end |
#apply_listing_pricing_with_http_info(id, listing_pricing_apply_request, opts = {}) ⇒ Array<(ListingPricingApplyResponse, Integer, Hash)>
Apply or decline pricing recommendations Apply: writes the recommended price to the listing's calendar for the given dates and triggers the platform fan-out (Airbnb / Booking.com / VRBO). Decline: marks the recommendation as `declined` so it stops surfacing — the model can re-recommend on the next training cycle.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/repull/api/pricing_api.rb', line 39 def apply_listing_pricing_with_http_info(id, listing_pricing_apply_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PricingApi.apply_listing_pricing ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.apply_listing_pricing" end # verify the required parameter 'listing_pricing_apply_request' is set if @api_client.config.client_side_validation && listing_pricing_apply_request.nil? fail ArgumentError, "Missing the required parameter 'listing_pricing_apply_request' when calling PricingApi.apply_listing_pricing" end # resource path local_var_path = '/v1/listings/{id}/pricing'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(listing_pricing_apply_request) # return_type return_type = opts[:debug_return_type] || 'ListingPricingApplyResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PricingApi.apply_listing_pricing", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PricingApi#apply_listing_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#bulk_apply_pricing(bulk_pricing_request, opts = {}) ⇒ BulkPricingResponse
Bulk apply or decline pricing recommendations Apply or decline pending Atlas pricing recommendations across many listings in one call. Built for power users with hundreds of listings who would otherwise need 500 sequential single-listing POSTs. - ‘items` is capped at 500 entries per request — exceeding returns 422. - Per-item failures (stale listing IDs, no pending recs, channel auth blips) DO NOT fail the whole batch — partial success is the norm at this scale and the granular `failed[]` array lets the SDK retry just the bad entries. - Tier-limit accounting: this endpoint counts as **1 API call** regardless of how many items the body contains. Apply path writes the recommended price to each listing’s calendar via the calendar service (which fans out to Airbnb/Booking/VRBO) then marks the Atlas recommendation ‘applied`. Decline path is Atlas-only — fast.
101 102 103 104 |
# File 'lib/repull/api/pricing_api.rb', line 101 def bulk_apply_pricing(bulk_pricing_request, opts = {}) data, _status_code, _headers = bulk_apply_pricing_with_http_info(bulk_pricing_request, opts) data end |
#bulk_apply_pricing_with_http_info(bulk_pricing_request, opts = {}) ⇒ Array<(BulkPricingResponse, Integer, Hash)>
Bulk apply or decline pricing recommendations Apply or decline pending Atlas pricing recommendations across many listings in one call. Built for power users with hundreds of listings who would otherwise need 500 sequential single-listing POSTs. - `items` is capped at 500 entries per request — exceeding returns 422. - Per-item failures (stale listing IDs, no pending recs, channel auth blips) DO NOT fail the whole batch — partial success is the norm at this scale and the granular `failed[]` array lets the SDK retry just the bad entries. - Tier-limit accounting: this endpoint counts as **1 API call** regardless of how many items the body contains. Apply path writes the recommended price to each listing's calendar via the calendar service (which fans out to Airbnb/Booking/VRBO) then marks the Atlas recommendation `applied`. Decline path is Atlas-only — fast.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/repull/api/pricing_api.rb', line 111 def bulk_apply_pricing_with_http_info(bulk_pricing_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PricingApi.bulk_apply_pricing ...' end # verify the required parameter 'bulk_pricing_request' is set if @api_client.config.client_side_validation && bulk_pricing_request.nil? fail ArgumentError, "Missing the required parameter 'bulk_pricing_request' when calling PricingApi.bulk_apply_pricing" end # resource path local_var_path = '/v1/listings/pricing/bulk' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(bulk_pricing_request) # return_type return_type = opts[:debug_return_type] || 'BulkPricingResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PricingApi.bulk_apply_pricing", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PricingApi#bulk_apply_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_listing_pricing(id, opts = {}) ⇒ ListingPricingResponse
Get pricing recommendations Returns date-by-date pricing recommendations for a listing’s upcoming calendar window, plus the listing’s base-price context and a 5km comp summary. Recommendations come from the Atlas pricing model — pre-computed nightly and stored in ‘pricing_recommendations`. Use POST to apply or decline pending recommendations.
171 172 173 174 |
# File 'lib/repull/api/pricing_api.rb', line 171 def get_listing_pricing(id, opts = {}) data, _status_code, _headers = get_listing_pricing_with_http_info(id, opts) data end |
#get_listing_pricing_history(id, opts = {}) ⇒ ListingPricingHistoryResponse
Pricing recommendation audit trail Cursor-paginated audit trail of pricing recommendations vs applied prices for a listing across a date window. Use ‘pagination.nextCursor` from one response as the `cursor` query param of the next request. Defaults to ±90 days from today. Cursor is a keyset on `date ASC` — stable even if rows are added during a partner’s pagination walk. ‘limit` is capped at 500 — exceeding returns 422.
242 243 244 245 |
# File 'lib/repull/api/pricing_api.rb', line 242 def get_listing_pricing_history(id, opts = {}) data, _status_code, _headers = get_listing_pricing_history_with_http_info(id, opts) data end |
#get_listing_pricing_history_with_http_info(id, opts = {}) ⇒ Array<(ListingPricingHistoryResponse, Integer, Hash)>
Pricing recommendation audit trail Cursor-paginated audit trail of pricing recommendations vs applied prices for a listing across a date window. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request. Defaults to ±90 days from today. Cursor is a keyset on `date ASC` — stable even if rows are added during a partner's pagination walk. `limit` is capped at 500 — exceeding returns 422.
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/repull/api/pricing_api.rb', line 256 def get_listing_pricing_history_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PricingApi.get_listing_pricing_history ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.get_listing_pricing_history" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PricingApi.get_listing_pricing_history, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PricingApi.get_listing_pricing_history, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/listings/{id}/pricing/history'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListingPricingHistoryResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PricingApi.get_listing_pricing_history", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PricingApi#get_listing_pricing_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_listing_pricing_strategy(id, opts = {}) ⇒ ListingPricingStrategy
Get pricing strategy Returns the strategy that constrains how the Atlas pricing model behaves for this listing. If no strategy row exists yet, returns sane defaults flagged with ‘isDefault: true`.
321 322 323 324 |
# File 'lib/repull/api/pricing_api.rb', line 321 def get_listing_pricing_strategy(id, opts = {}) data, _status_code, _headers = get_listing_pricing_strategy_with_http_info(id, opts) data end |
#get_listing_pricing_strategy_with_http_info(id, opts = {}) ⇒ Array<(ListingPricingStrategy, Integer, Hash)>
Get pricing strategy Returns the strategy that constrains how the Atlas pricing model behaves for this listing. If no strategy row exists yet, returns sane defaults flagged with `isDefault: true`.
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/repull/api/pricing_api.rb', line 331 def get_listing_pricing_strategy_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PricingApi.get_listing_pricing_strategy ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.get_listing_pricing_strategy" end # resource path local_var_path = '/v1/listings/{id}/pricing/strategy'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListingPricingStrategy' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PricingApi.get_listing_pricing_strategy", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PricingApi#get_listing_pricing_strategy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_listing_pricing_with_http_info(id, opts = {}) ⇒ Array<(ListingPricingResponse, Integer, Hash)>
Get pricing recommendations Returns date-by-date pricing recommendations for a listing's upcoming calendar window, plus the listing's base-price context and a 5km comp summary. Recommendations come from the Atlas pricing model — pre-computed nightly and stored in `pricing_recommendations`. Use POST to apply or decline pending recommendations.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/repull/api/pricing_api.rb', line 183 def get_listing_pricing_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PricingApi.get_listing_pricing ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.get_listing_pricing" end # resource path local_var_path = '/v1/listings/{id}/pricing'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListingPricingResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PricingApi.get_listing_pricing", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PricingApi#get_listing_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_listing_pricing_strategy(id, listing_pricing_strategy_input, opts = {}) ⇒ UpdateListingPricingStrategy200Response
Update pricing strategy Upserts the strategy on ‘(listing_id, customer_id)` — repeated PUTs are idempotent. Send only the fields you want to change; omitted fields take server-side defaults.
385 386 387 388 |
# File 'lib/repull/api/pricing_api.rb', line 385 def update_listing_pricing_strategy(id, listing_pricing_strategy_input, opts = {}) data, _status_code, _headers = update_listing_pricing_strategy_with_http_info(id, listing_pricing_strategy_input, opts) data end |
#update_listing_pricing_strategy_with_http_info(id, listing_pricing_strategy_input, opts = {}) ⇒ Array<(UpdateListingPricingStrategy200Response, Integer, Hash)>
Update pricing strategy Upserts the strategy on `(listing_id, customer_id)` — repeated PUTs are idempotent. Send only the fields you want to change; omitted fields take server-side defaults.
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/repull/api/pricing_api.rb', line 396 def update_listing_pricing_strategy_with_http_info(id, listing_pricing_strategy_input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PricingApi.update_listing_pricing_strategy ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.update_listing_pricing_strategy" end # verify the required parameter 'listing_pricing_strategy_input' is set if @api_client.config.client_side_validation && listing_pricing_strategy_input.nil? fail ArgumentError, "Missing the required parameter 'listing_pricing_strategy_input' when calling PricingApi.update_listing_pricing_strategy" end # resource path local_var_path = '/v1/listings/{id}/pricing/strategy'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(listing_pricing_strategy_input) # return_type return_type = opts[:debug_return_type] || 'UpdateListingPricingStrategy200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PricingApi.update_listing_pricing_strategy", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PricingApi#update_listing_pricing_strategy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |