Class: Repull::ListingsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/repull/api/listings_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ListingsApi

Returns a new instance of ListingsApi.



19
20
21
# File 'lib/repull/api/listings_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/repull/api/listings_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_listing(listing_create_request, opts = {}) ⇒ ListingCreateResponse

Create a Repull listing Create a new vacation-rental listing under the authenticated workspace. The listing is stored in the canonical Vanio listings tables and can be published to multiple channels (Airbnb, Booking.com) via the publish endpoints.

Parameters:

  • listing_create_request (ListingCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/repull/api/listings_api.rb', line 27

def create_listing(listing_create_request, opts = {})
  data, _status_code, _headers = create_listing_with_http_info(listing_create_request, opts)
  data
end

#create_listing_with_http_info(listing_create_request, opts = {}) ⇒ Array<(ListingCreateResponse, Integer, Hash)>

Create a Repull listing Create a new vacation-rental listing under the authenticated workspace. The listing is stored in the canonical Vanio listings tables and can be published to multiple channels (Airbnb, Booking.com) via the publish endpoints.

Parameters:

  • listing_create_request (ListingCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListingCreateResponse, Integer, Hash)>)

    ListingCreateResponse data, response status code and response headers



37
38
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
# File 'lib/repull/api/listings_api.rb', line 37

def create_listing_with_http_info(listing_create_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListingsApi.create_listing ...'
  end
  # verify the required parameter 'listing_create_request' is set
  if @api_client.config.client_side_validation && listing_create_request.nil?
    fail ArgumentError, "Missing the required parameter 'listing_create_request' when calling ListingsApi.create_listing"
  end
  # resource path
  local_var_path = '/v1/listings'

  # 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_create_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ListingCreateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ListingsApi.create_listing",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListingsApi#create_listing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_listing_content(id, opts = {}) ⇒ ListingGenerateContentResponse

AI-generate listing content Generate guest-facing copy (title, summary, description, amenities, etc.) for a listing using Kimi K2. When ‘photos` are provided the vision model is used for photo-grounded copy. Persists into the listing by default.

Parameters:

  • id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



96
97
98
99
# File 'lib/repull/api/listings_api.rb', line 96

def generate_listing_content(id, opts = {})
  data, _status_code, _headers = generate_listing_content_with_http_info(id, opts)
  data
end

#generate_listing_content_with_http_info(id, opts = {}) ⇒ Array<(ListingGenerateContentResponse, Integer, Hash)>

AI-generate listing content Generate guest-facing copy (title, summary, description, amenities, etc.) for a listing using Kimi K2. When &#x60;photos&#x60; are provided the vision model is used for photo-grounded copy. Persists into the listing by default.

Parameters:

  • id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



107
108
109
110
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
# File 'lib/repull/api/listings_api.rb', line 107

def generate_listing_content_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListingsApi.generate_listing_content ...'
  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 ListingsApi.generate_listing_content"
  end
  # resource path
  local_var_path = '/v1/listings/{id}/generate-content'.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(opts[:'listing_generate_content_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'ListingGenerateContentResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ListingsApi.generate_listing_content",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListingsApi#generate_listing_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_listing(id, opts = {}) ⇒ Listing

Get a listing Fetch a single listing by id. Returns the same shape as one element of the ‘GET /v1/listings` response, so you can bind the result to the same model. Cross-tenant access (a listing that belongs to a different workspace) returns 404 — never 403, never reveals the listing’s existence.

Parameters:

  • id (Integer)

    Repull listing id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_schema (String)

    Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.

Returns:



166
167
168
169
# File 'lib/repull/api/listings_api.rb', line 166

def get_listing(id, opts = {})
  data, _status_code, _headers = get_listing_with_http_info(id, opts)
  data
end

#get_listing_publish_status(id, opts = {}) ⇒ ListingPublishStatusResponse

Per-channel publish status Returns one row per platform the listing has been pushed/pulled to, with last push timestamp and any dirty fields not yet synced.

Parameters:

  • id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



231
232
233
234
# File 'lib/repull/api/listings_api.rb', line 231

def get_listing_publish_status(id, opts = {})
  data, _status_code, _headers = get_listing_publish_status_with_http_info(id, opts)
  data
end

#get_listing_publish_status_with_http_info(id, opts = {}) ⇒ Array<(ListingPublishStatusResponse, Integer, Hash)>

Per-channel publish status Returns one row per platform the listing has been pushed/pulled to, with last push timestamp and any dirty fields not yet synced.

Parameters:

  • id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
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
# File 'lib/repull/api/listings_api.rb', line 241

def get_listing_publish_status_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListingsApi.get_listing_publish_status ...'
  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 ListingsApi.get_listing_publish_status"
  end
  # resource path
  local_var_path = '/v1/listings/{id}/publish-status'.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] || 'ListingPublishStatusResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ListingsApi.get_listing_publish_status",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListingsApi#get_listing_publish_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_listing_with_http_info(id, opts = {}) ⇒ Array<(Listing, Integer, Hash)>

Get a listing Fetch a single listing by id. Returns the same shape as one element of the &#x60;GET /v1/listings&#x60; response, so you can bind the result to the same model. Cross-tenant access (a listing that belongs to a different workspace) returns 404 — never 403, never reveals the listing&#39;s existence.

Parameters:

  • id (Integer)

    Repull listing id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_schema (String)

    Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.

Returns:

  • (Array<(Listing, Integer, Hash)>)

    Listing data, response status code and response headers



177
178
179
180
181
182
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
# File 'lib/repull/api/listings_api.rb', line 177

def get_listing_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListingsApi.get_listing ...'
  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 ListingsApi.get_listing"
  end
  # resource path
  local_var_path = '/v1/listings/{id}'.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']
  header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Listing'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ListingsApi.get_listing",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListingsApi#get_listing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_listings(opts = {}) ⇒ ListingListResponse

List listings Cursor-paginated list of listings owned by the authenticated workspace. Use ‘pagination.nextCursor` from one response as the `cursor` query param of the next request to walk the full set. Filters: `q` (substring on name/street/city), `status`, `channel`.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_schema (String)

    Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.

  • :cursor (String)

    Opaque cursor returned in the previous response&#39;s &#x60;pagination.nextCursor&#x60;. Omit to fetch the first page.

  • :limit (Integer)

    Max items per page. Hard cap is 100. (default to 20)

  • :q (String)

    Case-insensitive substring search on name, street, or city.

  • :status (String)

    Filter by listing status.

  • :channel (String)

    Restrict to listings published on the given channel (&#x60;airbnb&#x60;, &#x60;booking&#x60;, &#x60;vrbo&#x60;, etc.). Joins through &#x60;listing_platform_links&#x60; and matches active links only.

Returns:



299
300
301
302
# File 'lib/repull/api/listings_api.rb', line 299

def list_listings(opts = {})
  data, _status_code, _headers = list_listings_with_http_info(opts)
  data
end

#list_listings_with_http_info(opts = {}) ⇒ Array<(ListingListResponse, Integer, Hash)>

List listings Cursor-paginated list of listings owned by the authenticated workspace. Use &#x60;pagination.nextCursor&#x60; from one response as the &#x60;cursor&#x60; query param of the next request to walk the full set. Filters: &#x60;q&#x60; (substring on name/street/city), &#x60;status&#x60;, &#x60;channel&#x60;.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_schema (String)

    Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.

  • :cursor (String)

    Opaque cursor returned in the previous response&#39;s &#x60;pagination.nextCursor&#x60;. Omit to fetch the first page.

  • :limit (Integer)

    Max items per page. Hard cap is 100. (default to 20)

  • :q (String)

    Case-insensitive substring search on name, street, or city.

  • :status (String)

    Filter by listing status.

  • :channel (String)

    Restrict to listings published on the given channel (&#x60;airbnb&#x60;, &#x60;booking&#x60;, &#x60;vrbo&#x60;, etc.). Joins through &#x60;listing_platform_links&#x60; and matches active links only.

Returns:

  • (Array<(ListingListResponse, Integer, Hash)>)

    ListingListResponse data, response status code and response headers



314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
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
# File 'lib/repull/api/listings_api.rb', line 314

def list_listings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListingsApi.list_listings ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListingsApi.list_listings, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListingsApi.list_listings, must be greater than or equal to 1.'
  end

  allowable_values = ["active", "inactive", "archived"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/listings'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].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']
  header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListingListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ListingsApi.list_listings",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListingsApi#list_listings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#publish_listing_to_airbnb(id, opts = {}) ⇒ ListingPublishResponse

Publish a listing to Airbnb Push a Repull listing to Airbnb. Pass ‘airbnbConnectionId` to update an already-mapped Airbnb listing, or `hostId` to create a brand-new Airbnb listing under that host.

Parameters:

  • id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



382
383
384
385
# File 'lib/repull/api/listings_api.rb', line 382

def publish_listing_to_airbnb(id, opts = {})
  data, _status_code, _headers = publish_listing_to_airbnb_with_http_info(id, opts)
  data
end

#publish_listing_to_airbnb_with_http_info(id, opts = {}) ⇒ Array<(ListingPublishResponse, Integer, Hash)>

Publish a listing to Airbnb Push a Repull listing to Airbnb. Pass &#x60;airbnbConnectionId&#x60; to update an already-mapped Airbnb listing, or &#x60;hostId&#x60; to create a brand-new Airbnb listing under that host.

Parameters:

  • id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(ListingPublishResponse, Integer, Hash)>)

    ListingPublishResponse data, response status code and response headers



393
394
395
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
# File 'lib/repull/api/listings_api.rb', line 393

def publish_listing_to_airbnb_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListingsApi.publish_listing_to_airbnb ...'
  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 ListingsApi.publish_listing_to_airbnb"
  end
  # resource path
  local_var_path = '/v1/listings/{id}/publish/airbnb'.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(opts[:'listing_publish_airbnb_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'ListingPublishResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ListingsApi.publish_listing_to_airbnb",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListingsApi#publish_listing_to_airbnb\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#publish_listing_to_booking(id, opts = {}) ⇒ ListingPublishResponse

Publish a listing to Booking.com Push a Repull listing to Booking.com. The listing must already be mapped to a Booking property + room (created via the Booking-claim Connect flow).

Parameters:

  • id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



451
452
453
454
# File 'lib/repull/api/listings_api.rb', line 451

def publish_listing_to_booking(id, opts = {})
  data, _status_code, _headers = publish_listing_to_booking_with_http_info(id, opts)
  data
end

#publish_listing_to_booking_with_http_info(id, opts = {}) ⇒ Array<(ListingPublishResponse, Integer, Hash)>

Publish a listing to Booking.com Push a Repull listing to Booking.com. The listing must already be mapped to a Booking property + room (created via the Booking-claim Connect flow).

Parameters:

  • id (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListingPublishResponse, Integer, Hash)>)

    ListingPublishResponse data, response status code and response headers



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/repull/api/listings_api.rb', line 461

def publish_listing_to_booking_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListingsApi.publish_listing_to_booking ...'
  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 ListingsApi.publish_listing_to_booking"
  end
  # resource path
  local_var_path = '/v1/listings/{id}/publish/booking'.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] || 'ListingPublishResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ListingsApi.publish_listing_to_booking",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListingsApi#publish_listing_to_booking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end