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

#add_participant(project_id, chat_id, add_participant_request, opts = {}) ⇒ AddParticipant200Response

Add participant to chat

Parameters:

  • project_id (String)
  • chat_id (String)
  • add_participant_request (AddParticipantRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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

def add_participant(project_id, chat_id, add_participant_request, opts = {})
  data, _status_code, _headers = add_participant_with_http_info(project_id, chat_id, add_participant_request, opts)
  data
end

#add_participant_with_http_info(project_id, chat_id, add_participant_request, opts = {}) ⇒ Array<(AddParticipant200Response, Integer, Hash)>

Add participant to chat

Parameters:

  • project_id (String)
  • chat_id (String)
  • add_participant_request (AddParticipantRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AddParticipant200Response data, response status code and response headers



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

def add_participant_with_http_info(project_id, chat_id, add_participant_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.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.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.add_participant"
  end
  # verify the required parameter 'add_participant_request' is set
  if @api_client.config.client_side_validation && add_participant_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_participant_request' when calling ChatApi.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(add_participant_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#add_reaction(project_id, chat_id, message_id, add_reaction_request, opts = {}) ⇒ AddReaction200Response

Add reaction to message

Parameters:

  • project_id (String)
  • chat_id (String)
  • message_id (String)
  • add_reaction_request (AddReactionRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



107
108
109
110
# File 'lib/mudbase/api/chat_api.rb', line 107

def add_reaction(project_id, chat_id, message_id, add_reaction_request, opts = {})
  data, _status_code, _headers = add_reaction_with_http_info(project_id, chat_id, message_id, add_reaction_request, opts)
  data
end

#add_reaction_with_http_info(project_id, chat_id, message_id, add_reaction_request, opts = {}) ⇒ Array<(AddReaction200Response, Integer, Hash)>

Add reaction to message

Parameters:

  • project_id (String)
  • chat_id (String)
  • message_id (String)
  • add_reaction_request (AddReactionRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    AddReaction200Response data, response status code and response headers



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

def add_reaction_with_http_info(project_id, chat_id, message_id, add_reaction_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.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.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.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.add_reaction"
  end
  # verify the required parameter 'add_reaction_request' is set
  if @api_client.config.client_side_validation && add_reaction_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_reaction_request' when calling ChatApi.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(add_reaction_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#create_chat(project_id, create_chat_request, opts = {}) ⇒ CreateChat201Response

Create new chat

Parameters:

  • project_id (String)
  • create_chat_request (CreateChatRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



189
190
191
192
# File 'lib/mudbase/api/chat_api.rb', line 189

def create_chat(project_id, create_chat_request, opts = {})
  data, _status_code, _headers = create_chat_with_http_info(project_id, create_chat_request, opts)
  data
end

#create_chat_with_http_info(project_id, create_chat_request, opts = {}) ⇒ Array<(CreateChat201Response, Integer, Hash)>

Create new chat

Parameters:

  • project_id (String)
  • create_chat_request (CreateChatRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    CreateChat201Response data, response status code and response headers



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

def create_chat_with_http_info(project_id, create_chat_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.create_chat ...'
  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.create_chat"
  end
  # verify the required parameter 'create_chat_request' is set
  if @api_client.config.client_side_validation && create_chat_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_chat_request' when calling ChatApi.create_chat"
  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(create_chat_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

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

Delete message

Parameters:

  • project_id (String)
  • chat_id (String)
  • message_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



262
263
264
265
# File 'lib/mudbase/api/chat_api.rb', line 262

def delete_message(project_id, chat_id, message_id, opts = {})
  data, _status_code, _headers = delete_message_with_http_info(project_id, chat_id, message_id, opts)
  data
end

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

Delete message

Parameters:

  • project_id (String)
  • chat_id (String)
  • message_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



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
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/mudbase/api/chat_api.rb', line 273

def 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.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.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.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.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] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#edit_message(project_id, chat_id, message_id, edit_message_request, opts = {}) ⇒ EditMessage200Response

Edit message

Parameters:

  • project_id (String)
  • chat_id (String)
  • message_id (String)
  • edit_message_request (EditMessageRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



336
337
338
339
# File 'lib/mudbase/api/chat_api.rb', line 336

def edit_message(project_id, chat_id, message_id, edit_message_request, opts = {})
  data, _status_code, _headers = edit_message_with_http_info(project_id, chat_id, message_id, edit_message_request, opts)
  data
end

#edit_message_with_http_info(project_id, chat_id, message_id, edit_message_request, opts = {}) ⇒ Array<(EditMessage200Response, Integer, Hash)>

Edit message

Parameters:

  • project_id (String)
  • chat_id (String)
  • message_id (String)
  • edit_message_request (EditMessageRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    EditMessage200Response data, response status code and response headers



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
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
# File 'lib/mudbase/api/chat_api.rb', line 348

def edit_message_with_http_info(project_id, chat_id, message_id, edit_message_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.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.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.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.edit_message"
  end
  # verify the required parameter 'edit_message_request' is set
  if @api_client.config.client_side_validation && edit_message_request.nil?
    fail ArgumentError, "Missing the required parameter 'edit_message_request' when calling ChatApi.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(edit_message_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#get_chat_details(project_id, chat_id, opts = {}) ⇒ GetChatDetails200Response

Get chat details

Parameters:

  • project_id (String)
  • chat_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



418
419
420
421
# File 'lib/mudbase/api/chat_api.rb', line 418

def get_chat_details(project_id, chat_id, opts = {})
  data, _status_code, _headers = get_chat_details_with_http_info(project_id, chat_id, opts)
  data
end

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

Get chat details

Parameters:

  • project_id (String)
  • chat_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    GetChatDetails200Response data, response status code and response headers



428
429
430
431
432
433
434
435
436
437
438
439
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
# File 'lib/mudbase/api/chat_api.rb', line 428

def get_chat_details_with_http_info(project_id, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.get_chat_details ...'
  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.get_chat_details"
  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.get_chat_details"
  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] || 'GetChatDetails200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#get_chat_e2ee_participant_keys(project_id, chat_id, opts = {}) ⇒ GetChatE2eeParticipantKeys200Response

List participant E2EE public keys Returns registered identity public keys for users in this chat (for client-side key distribution).

Parameters:

  • project_id (String)
  • chat_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



486
487
488
489
# File 'lib/mudbase/api/chat_api.rb', line 486

def get_chat_e2ee_participant_keys(project_id, chat_id, opts = {})
  data, _status_code, _headers = get_chat_e2ee_participant_keys_with_http_info(project_id, chat_id, opts)
  data
end

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

List participant E2EE public keys Returns registered identity public keys for users in this chat (for client-side key distribution).

Parameters:

  • project_id (String)
  • chat_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
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
# File 'lib/mudbase/api/chat_api.rb', line 497

def get_chat_e2ee_participant_keys_with_http_info(project_id, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.get_chat_e2ee_participant_keys ...'
  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.get_chat_e2ee_participant_keys"
  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.get_chat_e2ee_participant_keys"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/chats/{chatId}/e2ee/participant-keys'.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] || 'GetChatE2eeParticipantKeys200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#get_chat_messages(project_id, chat_id, opts = {}) ⇒ GetChatMessages200Response

Get chat messages

Parameters:

  • project_id (String)
  • chat_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :limit (Integer) — default: default to 50
  • :before (Time)
  • :after (Time)

Returns:



558
559
560
561
# File 'lib/mudbase/api/chat_api.rb', line 558

def get_chat_messages(project_id, chat_id, opts = {})
  data, _status_code, _headers = get_chat_messages_with_http_info(project_id, chat_id, opts)
  data
end

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

Get chat messages

Parameters:

  • project_id (String)
  • chat_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :limit (Integer) — default: default to 50
  • :before (Time)
  • :after (Time)

Returns:

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

    GetChatMessages200Response data, response status code and response headers



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
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
# File 'lib/mudbase/api/chat_api.rb', line 572

def get_chat_messages_with_http_info(project_id, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.get_chat_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.get_chat_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.get_chat_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] || 'GetChatMessages200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#get_user_chats(project_id, opts = {}) ⇒ GetUserChats200Response

Get user chats

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :limit (Integer) — default: default to 20

Returns:



634
635
636
637
# File 'lib/mudbase/api/chat_api.rb', line 634

def get_user_chats(project_id, opts = {})
  data, _status_code, _headers = get_user_chats_with_http_info(project_id, opts)
  data
end

#get_user_chats_with_http_info(project_id, opts = {}) ⇒ Array<(GetUserChats200Response, Integer, Hash)>

Get user chats

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :limit (Integer) — default: default to 20

Returns:

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

    GetUserChats200Response data, response status code and response headers



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
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
# File 'lib/mudbase/api/chat_api.rb', line 645

def get_user_chats_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.get_user_chats ...'
  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.get_user_chats"
  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] || 'GetUserChats200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#mark_messages_as_read(project_id, chat_id, mark_messages_as_read_request, opts = {}) ⇒ MarkMessagesAsRead200Response

Mark messages as read

Parameters:

  • project_id (String)
  • chat_id (String)
  • mark_messages_as_read_request (MarkMessagesAsReadRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



701
702
703
704
# File 'lib/mudbase/api/chat_api.rb', line 701

def mark_messages_as_read(project_id, chat_id, mark_messages_as_read_request, opts = {})
  data, _status_code, _headers = mark_messages_as_read_with_http_info(project_id, chat_id, mark_messages_as_read_request, opts)
  data
end

#mark_messages_as_read_with_http_info(project_id, chat_id, mark_messages_as_read_request, opts = {}) ⇒ Array<(MarkMessagesAsRead200Response, Integer, Hash)>

Mark messages as read

Parameters:

  • project_id (String)
  • chat_id (String)
  • mark_messages_as_read_request (MarkMessagesAsReadRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
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
# File 'lib/mudbase/api/chat_api.rb', line 712

def mark_messages_as_read_with_http_info(project_id, chat_id, mark_messages_as_read_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.mark_messages_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.mark_messages_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.mark_messages_as_read"
  end
  # verify the required parameter 'mark_messages_as_read_request' is set
  if @api_client.config.client_side_validation && mark_messages_as_read_request.nil?
    fail ArgumentError, "Missing the required parameter 'mark_messages_as_read_request' when calling ChatApi.mark_messages_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(mark_messages_as_read_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#put_chat_e2ee_key(project_id, put_chat_e2ee_key_request, opts = {}) ⇒ PutChatE2eeKey200Response

Register chat E2EE identity public key Stores your long-term public key for end-to-end encrypted chat (key agreement). Private keys never leave the client. Required for other participants to encrypt to you.

Parameters:

  • project_id (String)
  • put_chat_e2ee_key_request (PutChatE2eeKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



779
780
781
782
# File 'lib/mudbase/api/chat_api.rb', line 779

def put_chat_e2ee_key(project_id, put_chat_e2ee_key_request, opts = {})
  data, _status_code, _headers = put_chat_e2ee_key_with_http_info(project_id, put_chat_e2ee_key_request, opts)
  data
end

#put_chat_e2ee_key_with_http_info(project_id, put_chat_e2ee_key_request, opts = {}) ⇒ Array<(PutChatE2eeKey200Response, Integer, Hash)>

Register chat E2EE identity public key Stores your long-term public key for end-to-end encrypted chat (key agreement). Private keys never leave the client. Required for other participants to encrypt to you.

Parameters:

  • project_id (String)
  • put_chat_e2ee_key_request (PutChatE2eeKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    PutChatE2eeKey200Response data, response status code and response headers



790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
# File 'lib/mudbase/api/chat_api.rb', line 790

def put_chat_e2ee_key_with_http_info(project_id, put_chat_e2ee_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.put_chat_e2ee_key ...'
  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.put_chat_e2ee_key"
  end
  # verify the required parameter 'put_chat_e2ee_key_request' is set
  if @api_client.config.client_side_validation && put_chat_e2ee_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_chat_e2ee_key_request' when calling ChatApi.put_chat_e2ee_key"
  end
  # resource path
  local_var_path = '/api/chat/projects/{projectId}/me/chat-e2ee-key'.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(put_chat_e2ee_key_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#remove_participant(project_id, chat_id, remove_participant_request, opts = {}) ⇒ MessageResponse

Remove participant from chat

Parameters:

  • project_id (String)
  • chat_id (String)
  • remove_participant_request (RemoveParticipantRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



853
854
855
856
# File 'lib/mudbase/api/chat_api.rb', line 853

def remove_participant(project_id, chat_id, remove_participant_request, opts = {})
  data, _status_code, _headers = remove_participant_with_http_info(project_id, chat_id, remove_participant_request, opts)
  data
end

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

Remove participant from chat

Parameters:

  • project_id (String)
  • chat_id (String)
  • remove_participant_request (RemoveParticipantRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
# File 'lib/mudbase/api/chat_api.rb', line 864

def remove_participant_with_http_info(project_id, chat_id, remove_participant_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.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.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.remove_participant"
  end
  # verify the required parameter 'remove_participant_request' is set
  if @api_client.config.client_side_validation && remove_participant_request.nil?
    fail ArgumentError, "Missing the required parameter 'remove_participant_request' when calling ChatApi.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(remove_participant_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#remove_reaction(project_id, chat_id, message_id, add_reaction_request, opts = {}) ⇒ RemoveReaction200Response

Remove reaction from message

Parameters:

  • project_id (String)
  • chat_id (String)
  • message_id (String)
  • add_reaction_request (AddReactionRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



932
933
934
935
# File 'lib/mudbase/api/chat_api.rb', line 932

def remove_reaction(project_id, chat_id, message_id, add_reaction_request, opts = {})
  data, _status_code, _headers = remove_reaction_with_http_info(project_id, chat_id, message_id, add_reaction_request, opts)
  data
end

#remove_reaction_with_http_info(project_id, chat_id, message_id, add_reaction_request, opts = {}) ⇒ Array<(RemoveReaction200Response, Integer, Hash)>

Remove reaction from message

Parameters:

  • project_id (String)
  • chat_id (String)
  • message_id (String)
  • add_reaction_request (AddReactionRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    RemoveReaction200Response data, response status code and response headers



944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/mudbase/api/chat_api.rb', line 944

def remove_reaction_with_http_info(project_id, chat_id, message_id, add_reaction_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.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.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.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.remove_reaction"
  end
  # verify the required parameter 'add_reaction_request' is set
  if @api_client.config.client_side_validation && add_reaction_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_reaction_request' when calling ChatApi.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(add_reaction_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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

#send_message(project_id, chat_id, send_message_request, opts = {}) ⇒ SendMessage201Response

Send message

Parameters:

  • project_id (String)
  • chat_id (String)
  • send_message_request (SendMessageRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1015
1016
1017
1018
# File 'lib/mudbase/api/chat_api.rb', line 1015

def send_message(project_id, chat_id, send_message_request, opts = {})
  data, _status_code, _headers = send_message_with_http_info(project_id, chat_id, send_message_request, opts)
  data
end

#send_message_with_http_info(project_id, chat_id, send_message_request, opts = {}) ⇒ Array<(SendMessage201Response, Integer, Hash)>

Send message

Parameters:

  • project_id (String)
  • chat_id (String)
  • send_message_request (SendMessageRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    SendMessage201Response data, response status code and response headers



1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
# File 'lib/mudbase/api/chat_api.rb', line 1026

def send_message_with_http_info(project_id, chat_id, send_message_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatApi.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.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.send_message"
  end
  # verify the required parameter 'send_message_request' is set
  if @api_client.config.client_side_validation && send_message_request.nil?
    fail ArgumentError, "Missing the required parameter 'send_message_request' when calling ChatApi.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(send_message_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

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