Class: Mudbase::ChatApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mudbase/api/chat_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ChatApi

Returns a new instance of ChatApi.



19
20
21
# File 'lib/mudbase/api/chat_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/mudbase/api/chat_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#chat_add_participant(project_id, chat_id, chat_add_participant_request, opts = {}) ⇒ ChatAddParticipant200Response

Add participant to chat Add a user to the chat with an optional role (admin or member).

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • chat_add_participant_request (ChatAddParticipantRequest)

    User ID to add and optional role (admin, member).

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

    the optional parameters

Returns:



29
30
31
32
# File 'lib/mudbase/api/chat_api.rb', line 29

def chat_add_participant(project_id, chat_id, chat_add_participant_request, opts = {})
  data, _status_code, _headers = chat_add_participant_with_http_info(project_id, chat_id, chat_add_participant_request, opts)
  data
end

#chat_add_participant_with_http_info(project_id, chat_id, chat_add_participant_request, opts = {}) ⇒ Array<(ChatAddParticipant200Response, Integer, Hash)>

Add participant to chat Add a user to the chat with an optional role (admin or member).

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • chat_add_participant_request (ChatAddParticipantRequest)

    User ID to add and optional role (admin, member).

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

    the optional parameters

Returns:



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
95
96
97
98
99
100
# File 'lib/mudbase/api/chat_api.rb', line 41

def chat_add_participant_with_http_info(project_id, chat_id, chat_add_participant_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_add_participant ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_add_participant"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_add_participant"
  end
  # verify the required parameter 'chat_add_participant_request' is set
  if @api_client.config.client_side_validation && chat_add_participant_request.nil?
    fail ArgumentError, "Missing the required parameter 'chat_add_participant_request' when calling ChatApi.chat_add_participant"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/participants'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_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(chat_add_participant_request)

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

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

  new_options = opts.merge(
    :operation => :"ChatApi.chat_add_participant",
    :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: ChatApi#chat_add_participant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#chat_add_reaction(project_id, chat_id, message_id, chat_add_reaction_request, opts = {}) ⇒ ChatAddReaction200Response

Add reaction to message Add an emoji reaction to a message.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • message_id (String)

    Message ID.

  • chat_add_reaction_request (ChatAddReactionRequest)

    Emoji reaction (e.g. 👍, ❤️).

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

    the optional parameters

Returns:



110
111
112
113
# File 'lib/mudbase/api/chat_api.rb', line 110

def chat_add_reaction(project_id, chat_id, message_id, chat_add_reaction_request, opts = {})
  data, _status_code, _headers = chat_add_reaction_with_http_info(project_id, chat_id, message_id, chat_add_reaction_request, opts)
  data
end

#chat_add_reaction_with_http_info(project_id, chat_id, message_id, chat_add_reaction_request, opts = {}) ⇒ Array<(ChatAddReaction200Response, Integer, Hash)>

Add reaction to message Add an emoji reaction to a message.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • message_id (String)

    Message ID.

  • chat_add_reaction_request (ChatAddReactionRequest)

    Emoji reaction (e.g. 👍, ❤️).

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

    the optional parameters

Returns:

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

    ChatAddReaction200Response data, response status code and response headers



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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/mudbase/api/chat_api.rb', line 123

def chat_add_reaction_with_http_info(project_id, chat_id, message_id, chat_add_reaction_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_add_reaction ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_add_reaction"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_add_reaction"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatApi.chat_add_reaction"
  end
  # verify the required parameter 'chat_add_reaction_request' is set
  if @api_client.config.client_side_validation && chat_add_reaction_request.nil?
    fail ArgumentError, "Missing the required parameter 'chat_add_reaction_request' when calling ChatApi.chat_add_reaction"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/messages/{messageId}/reactions'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(message_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(chat_add_reaction_request)

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

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

  new_options = opts.merge(
    :operation => :"ChatApi.chat_add_reaction",
    :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: ChatApi#chat_add_reaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#chat_create(project_id, chat_create_request, opts = {}) ⇒ ChatCreate201Response

Create new chat Create a new chat (direct, group, channel, or broadcast) with name, type, participants, and optional settings.

Parameters:

  • project_id (String)

    Project ID.

  • chat_create_request (ChatCreateRequest)

    Chat name, type (direct/group/channel/broadcast), participants array, optional description and settings.

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

    the optional parameters

Returns:



194
195
196
197
# File 'lib/mudbase/api/chat_api.rb', line 194

def chat_create(project_id, chat_create_request, opts = {})
  data, _status_code, _headers = chat_create_with_http_info(project_id, chat_create_request, opts)
  data
end

#chat_create_with_http_info(project_id, chat_create_request, opts = {}) ⇒ Array<(ChatCreate201Response, Integer, Hash)>

Create new chat Create a new chat (direct, group, channel, or broadcast) with name, type, participants, and optional settings.

Parameters:

  • project_id (String)

    Project ID.

  • chat_create_request (ChatCreateRequest)

    Chat name, type (direct/group/channel/broadcast), participants array, optional description and settings.

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

    the optional parameters

Returns:

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

    ChatCreate201Response data, response status code and response headers



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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/mudbase/api/chat_api.rb', line 205

def chat_create_with_http_info(project_id, chat_create_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_create ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_create"
  end
  # verify the required parameter 'chat_create_request' is set
  if @api_client.config.client_side_validation && chat_create_request.nil?
    fail ArgumentError, "Missing the required parameter 'chat_create_request' when calling ChatApi.chat_create"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats'.sub('{' + 'projectId' + '}', CGI.escape(project_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(chat_create_request)

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

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

  new_options = opts.merge(
    :operation => :"ChatApi.chat_create",
    :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: ChatApi#chat_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#chat_delete_message(project_id, chat_id, message_id, opts = {}) ⇒ MessageResponse

Delete message Delete a message from the chat (sender or admin). May be soft-delete or permanent depending on implementation.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • message_id (String)

    Message ID.

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

    the optional parameters

Returns:



269
270
271
272
# File 'lib/mudbase/api/chat_api.rb', line 269

def chat_delete_message(project_id, chat_id, message_id, opts = {})
  data, _status_code, _headers = chat_delete_message_with_http_info(project_id, chat_id, message_id, opts)
  data
end

#chat_delete_message_with_http_info(project_id, chat_id, message_id, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Delete message Delete a message from the chat (sender or admin). May be soft-delete or permanent depending on implementation.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • message_id (String)

    Message ID.

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

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/mudbase/api/chat_api.rb', line 281

def chat_delete_message_with_http_info(project_id, chat_id, message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_delete_message ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_delete_message"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_delete_message"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatApi.chat_delete_message"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/messages/{messageId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(message_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] || 'MessageResponse'

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

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

#chat_edit_message(project_id, chat_id, message_id, chat_edit_message_request, opts = {}) ⇒ ChatEditMessage200Response

Edit message Update the content of a message (sender only; supports edit history).

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • message_id (String)

    Message ID.

  • chat_edit_message_request (ChatEditMessageRequest)

    New message content.

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

    the optional parameters

Returns:



345
346
347
348
# File 'lib/mudbase/api/chat_api.rb', line 345

def chat_edit_message(project_id, chat_id, message_id, chat_edit_message_request, opts = {})
  data, _status_code, _headers = chat_edit_message_with_http_info(project_id, chat_id, message_id, chat_edit_message_request, opts)
  data
end

#chat_edit_message_with_http_info(project_id, chat_id, message_id, chat_edit_message_request, opts = {}) ⇒ Array<(ChatEditMessage200Response, Integer, Hash)>

Edit message Update the content of a message (sender only; supports edit history).

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • message_id (String)

    Message ID.

  • chat_edit_message_request (ChatEditMessageRequest)

    New message content.

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

    the optional parameters

Returns:

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

    ChatEditMessage200Response data, response status code and response headers



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
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
# File 'lib/mudbase/api/chat_api.rb', line 358

def chat_edit_message_with_http_info(project_id, chat_id, message_id, chat_edit_message_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_edit_message ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_edit_message"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_edit_message"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatApi.chat_edit_message"
  end
  # verify the required parameter 'chat_edit_message_request' is set
  if @api_client.config.client_side_validation && chat_edit_message_request.nil?
    fail ArgumentError, "Missing the required parameter 'chat_edit_message_request' when calling ChatApi.chat_edit_message"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/messages/{messageId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(message_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(chat_edit_message_request)

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

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

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

#chat_get(project_id, chat_id, opts = {}) ⇒ ChatGet200Response

Get chat details Returns full chat metadata including participants and roles for a single chat.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

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

    the optional parameters

Returns:



429
430
431
432
# File 'lib/mudbase/api/chat_api.rb', line 429

def chat_get(project_id, chat_id, opts = {})
  data, _status_code, _headers = chat_get_with_http_info(project_id, chat_id, opts)
  data
end

#chat_get_messages(project_id, chat_id, opts = {}) ⇒ ChatGetMessages200Response

Get chat messages Returns paginated messages for a chat with optional before/after cursor for time-based pagination.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :limit (Integer)

    Number of messages per page. (default to 50)

  • :before (Time)

    Return messages before this timestamp (cursor).

  • :after (Time)

    Return messages after this timestamp (cursor).

Returns:



502
503
504
505
# File 'lib/mudbase/api/chat_api.rb', line 502

def chat_get_messages(project_id, chat_id, opts = {})
  data, _status_code, _headers = chat_get_messages_with_http_info(project_id, chat_id, opts)
  data
end

#chat_get_messages_with_http_info(project_id, chat_id, opts = {}) ⇒ Array<(ChatGetMessages200Response, Integer, Hash)>

Get chat messages Returns paginated messages for a chat with optional before/after cursor for time-based pagination.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :limit (Integer)

    Number of messages per page. (default to 50)

  • :before (Time)

    Return messages before this timestamp (cursor).

  • :after (Time)

    Return messages after this timestamp (cursor).

Returns:

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

    ChatGetMessages200Response data, response status code and response headers



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
# File 'lib/mudbase/api/chat_api.rb', line 517

def chat_get_messages_with_http_info(project_id, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_get_messages ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_get_messages"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_get_messages"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/messages'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].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] || 'ChatGetMessages200Response'

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

  new_options = opts.merge(
    :operation => :"ChatApi.chat_get_messages",
    :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: ChatApi#chat_get_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#chat_get_with_http_info(project_id, chat_id, opts = {}) ⇒ Array<(ChatGet200Response, Integer, Hash)>

Get chat details Returns full chat metadata including participants and roles for a single chat.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

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

    the optional parameters

Returns:

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

    ChatGet200Response data, response status code and response headers



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
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
# File 'lib/mudbase/api/chat_api.rb', line 440

def chat_get_with_http_info(project_id, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_get ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_get"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_get"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_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] || 'ChatGet200Response'

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

  new_options = opts.merge(
    :operation => :"ChatApi.chat_get",
    :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: ChatApi#chat_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#chat_list(project_id, opts = {}) ⇒ ChatList200Response

Get user chats Returns paginated list of chats for the current user in the project, with last message and unread count.

Parameters:

  • project_id (String)

    Project ID.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :limit (Integer)

    Number of chats per page. (default to 20)

Returns:



580
581
582
583
# File 'lib/mudbase/api/chat_api.rb', line 580

def chat_list(project_id, opts = {})
  data, _status_code, _headers = chat_list_with_http_info(project_id, opts)
  data
end

#chat_list_with_http_info(project_id, opts = {}) ⇒ Array<(ChatList200Response, Integer, Hash)>

Get user chats Returns paginated list of chats for the current user in the project, with last message and unread count.

Parameters:

  • project_id (String)

    Project ID.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :limit (Integer)

    Number of chats per page. (default to 20)

Returns:

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

    ChatList200Response data, response status code and response headers



592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/mudbase/api/chat_api.rb', line 592

def chat_list_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_list ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_list"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'ChatList200Response'

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

  new_options = opts.merge(
    :operation => :"ChatApi.chat_list",
    :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: ChatApi#chat_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#chat_mark_as_read(project_id, chat_id, chat_mark_as_read_request, opts = {}) ⇒ ChatMarkAsRead200Response

Mark messages as read Mark one or more messages as read for the current user in the chat.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • chat_mark_as_read_request (ChatMarkAsReadRequest)

    Array of message IDs to mark as read.

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

    the optional parameters

Returns:



649
650
651
652
# File 'lib/mudbase/api/chat_api.rb', line 649

def chat_mark_as_read(project_id, chat_id, chat_mark_as_read_request, opts = {})
  data, _status_code, _headers = chat_mark_as_read_with_http_info(project_id, chat_id, chat_mark_as_read_request, opts)
  data
end

#chat_mark_as_read_with_http_info(project_id, chat_id, chat_mark_as_read_request, opts = {}) ⇒ Array<(ChatMarkAsRead200Response, Integer, Hash)>

Mark messages as read Mark one or more messages as read for the current user in the chat.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • chat_mark_as_read_request (ChatMarkAsReadRequest)

    Array of message IDs to mark as read.

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

    the optional parameters

Returns:

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

    ChatMarkAsRead200Response data, response status code and response headers



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/mudbase/api/chat_api.rb', line 661

def chat_mark_as_read_with_http_info(project_id, chat_id, chat_mark_as_read_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_mark_as_read ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_mark_as_read"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_mark_as_read"
  end
  # verify the required parameter 'chat_mark_as_read_request' is set
  if @api_client.config.client_side_validation && chat_mark_as_read_request.nil?
    fail ArgumentError, "Missing the required parameter 'chat_mark_as_read_request' when calling ChatApi.chat_mark_as_read"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/messages/read'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_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(chat_mark_as_read_request)

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

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

  new_options = opts.merge(
    :operation => :"ChatApi.chat_mark_as_read",
    :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: ChatApi#chat_mark_as_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#chat_remove_participant(project_id, chat_id, chat_remove_participant_request, opts = {}) ⇒ MessageResponse

Remove participant from chat Remove a user from the chat by userId.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • chat_remove_participant_request (ChatRemoveParticipantRequest)

    User ID of the participant to remove.

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

    the optional parameters

Returns:



729
730
731
732
# File 'lib/mudbase/api/chat_api.rb', line 729

def chat_remove_participant(project_id, chat_id, chat_remove_participant_request, opts = {})
  data, _status_code, _headers = chat_remove_participant_with_http_info(project_id, chat_id, chat_remove_participant_request, opts)
  data
end

#chat_remove_participant_with_http_info(project_id, chat_id, chat_remove_participant_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Remove participant from chat Remove a user from the chat by userId.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • chat_remove_participant_request (ChatRemoveParticipantRequest)

    User ID of the participant to remove.

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

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
# File 'lib/mudbase/api/chat_api.rb', line 741

def chat_remove_participant_with_http_info(project_id, chat_id, chat_remove_participant_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_remove_participant ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_remove_participant"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_remove_participant"
  end
  # verify the required parameter 'chat_remove_participant_request' is set
  if @api_client.config.client_side_validation && chat_remove_participant_request.nil?
    fail ArgumentError, "Missing the required parameter 'chat_remove_participant_request' when calling ChatApi.chat_remove_participant"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/participants'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_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(chat_remove_participant_request)

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

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

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

#chat_remove_reaction(project_id, chat_id, message_id, chat_add_reaction_request, opts = {}) ⇒ ChatRemoveReaction200Response

Remove reaction from message Remove the current user’s emoji reaction from a message.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • message_id (String)

    Message ID.

  • chat_add_reaction_request (ChatAddReactionRequest)

    Emoji to remove (must match the reaction added by the user).

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

    the optional parameters

Returns:



810
811
812
813
# File 'lib/mudbase/api/chat_api.rb', line 810

def chat_remove_reaction(project_id, chat_id, message_id, chat_add_reaction_request, opts = {})
  data, _status_code, _headers = chat_remove_reaction_with_http_info(project_id, chat_id, message_id, chat_add_reaction_request, opts)
  data
end

#chat_remove_reaction_with_http_info(project_id, chat_id, message_id, chat_add_reaction_request, opts = {}) ⇒ Array<(ChatRemoveReaction200Response, Integer, Hash)>

Remove reaction from message Remove the current user&#39;s emoji reaction from a message.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • message_id (String)

    Message ID.

  • chat_add_reaction_request (ChatAddReactionRequest)

    Emoji to remove (must match the reaction added by the user).

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

    the optional parameters

Returns:



823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
# File 'lib/mudbase/api/chat_api.rb', line 823

def chat_remove_reaction_with_http_info(project_id, chat_id, message_id, chat_add_reaction_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_remove_reaction ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_remove_reaction"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_remove_reaction"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatApi.chat_remove_reaction"
  end
  # verify the required parameter 'chat_add_reaction_request' is set
  if @api_client.config.client_side_validation && chat_add_reaction_request.nil?
    fail ArgumentError, "Missing the required parameter 'chat_add_reaction_request' when calling ChatApi.chat_remove_reaction"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/messages/{messageId}/reactions'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(message_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(chat_add_reaction_request)

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

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

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

#chat_send_message(project_id, chat_id, chat_send_message_request, opts = {}) ⇒ ChatSendMessage201Response

Send message Send a message (text, image, video, audio, file, location, contact) to a chat with optional replyTo and mentions.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • chat_send_message_request (ChatSendMessageRequest)

    Message type, content, optional replyTo and mentions.

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

    the optional parameters

Returns:



895
896
897
898
# File 'lib/mudbase/api/chat_api.rb', line 895

def chat_send_message(project_id, chat_id, chat_send_message_request, opts = {})
  data, _status_code, _headers = chat_send_message_with_http_info(project_id, chat_id, chat_send_message_request, opts)
  data
end

#chat_send_message_with_http_info(project_id, chat_id, chat_send_message_request, opts = {}) ⇒ Array<(ChatSendMessage201Response, Integer, Hash)>

Send message Send a message (text, image, video, audio, file, location, contact) to a chat with optional replyTo and mentions.

Parameters:

  • project_id (String)

    Project ID.

  • chat_id (String)

    Chat ID.

  • chat_send_message_request (ChatSendMessageRequest)

    Message type, content, optional replyTo and mentions.

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

    the optional parameters

Returns:

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

    ChatSendMessage201Response data, response status code and response headers



907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
# File 'lib/mudbase/api/chat_api.rb', line 907

def chat_send_message_with_http_info(project_id, chat_id, chat_send_message_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.chat_send_message ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling ChatApi.chat_send_message"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatApi.chat_send_message"
  end
  # verify the required parameter 'chat_send_message_request' is set
  if @api_client.config.client_side_validation && chat_send_message_request.nil?
    fail ArgumentError, "Missing the required parameter 'chat_send_message_request' when calling ChatApi.chat_send_message"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/messages'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'chatId' + '}', CGI.escape(chat_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(chat_send_message_request)

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

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

  new_options = opts.merge(
    :operation => :"ChatApi.chat_send_message",
    :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: ChatApi#chat_send_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end