Class: Norbelys::MessagesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/norbelys/api/messages_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MessagesApi

Returns a new instance of MessagesApi.



19
20
21
# File 'lib/norbelys/api/messages_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/norbelys/api/messages_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#messages_attachment(id, attachment_id, opts = {}) ⇒ MessageAttachmentDownload

Download a message attachment Download one attachment's Base64 content by its id from the attachments list — works for both sent (read from the immutable R2 source) and received (saved at ingest) messages.

Parameters:

  • id (String)
  • attachment_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/norbelys/api/messages_api.rb', line 28

def messages_attachment(id, attachment_id, opts = {})
  data, _status_code, _headers = messages_attachment_with_http_info(id, attachment_id, opts)
  data
end

#messages_attachment_with_http_info(id, attachment_id, opts = {}) ⇒ Array<(MessageAttachmentDownload, Integer, Hash)>

Download a message attachment Download one attachment's Base64 content by its id from the attachments list — works for both sent (read from the immutable R2 source) and received (saved at ingest) messages.

Parameters:

  • id (String)
  • attachment_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    MessageAttachmentDownload 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
# File 'lib/norbelys/api/messages_api.rb', line 39

def messages_attachment_with_http_info(id, attachment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessagesApi.messages_attachment ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MessagesApi.messages_attachment"
  end
  # verify the required parameter 'attachment_id' is set
  if @api_client.config.client_side_validation && attachment_id.nil?
    fail ArgumentError, "Missing the required parameter 'attachment_id' when calling MessagesApi.messages_attachment"
  end
  # resource path
  local_var_path = '/messages/{id}/attachments/{attachmentId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'attachmentId' + '}', CGI.escape(attachment_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] || 'MessageAttachmentDownload'

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

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

#messages_attachments(id, opts = {}) ⇒ MessageAttachmentList

List a message's attachments List every file carried on a sent or received message — metadata only; fetch each file's content with messages.attachment.

Parameters:

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

    the optional parameters

Returns:



96
97
98
99
# File 'lib/norbelys/api/messages_api.rb', line 96

def messages_attachments(id, opts = {})
  data, _status_code, _headers = messages_attachments_with_http_info(id, opts)
  data
end

#messages_attachments_with_http_info(id, opts = {}) ⇒ Array<(MessageAttachmentList, Integer, Hash)>

List a message's attachments List every file carried on a sent or received message — metadata only; fetch each file's content with messages.attachment.

Parameters:

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

    the optional parameters

Returns:

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

    MessageAttachmentList data, response status code and response headers



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/norbelys/api/messages_api.rb', line 106

def messages_attachments_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessagesApi.messages_attachments ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MessagesApi.messages_attachments"
  end
  # resource path
  local_var_path = '/messages/{id}/attachments'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

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

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

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

#messages_create(message_create_params, opts = {}) ⇒ Message

Send a message Send a real email — the one send door for all outbound mail. from is a sender id (snd_…) or any address on a provisioned sending domain (e.g. "david@hola.com" or "Acme david@hola.com"; the identity is created on first use). Provide content inline (subject + html/text) or render a stored template with variantId + data. Reply to an inbound message by passing inReplyTo (the send threads to that conversation); set test:true for a one-off preview that is excluded from campaign stats. For a paced (cold) sender, pass sequence to enroll the person instead of sending now.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



160
161
162
163
# File 'lib/norbelys/api/messages_api.rb', line 160

def messages_create(message_create_params, opts = {})
  data, _status_code, _headers = messages_create_with_http_info(message_create_params, opts)
  data
end

#messages_create_with_http_info(message_create_params, opts = {}) ⇒ Array<(Message, Integer, Hash)>

Send a message Send a real email — the one send door for all outbound mail. `from` is a sender id (snd_…) or any address on a provisioned sending domain (e.g. &quot;david@hola.com&quot; or &quot;Acme <david@hola.com>&quot;; the identity is created on first use). Provide content inline (subject + html/text) or render a stored template with variantId + data. Reply to an inbound message by passing inReplyTo (the send threads to that conversation); set test:true for a one-off preview that is excluded from campaign stats. For a paced (cold) sender, pass sequence to enroll the person instead of sending now.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    Message data, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/norbelys/api/messages_api.rb', line 171

def messages_create_with_http_info(message_create_params, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessagesApi.messages_create ...'
  end
  # verify the required parameter 'message_create_params' is set
  if @api_client.config.client_side_validation && message_create_params.nil?
    fail ArgumentError, "Missing the required parameter 'message_create_params' when calling MessagesApi.messages_create"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling MessagesApi.messages_create, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/messages'

  # 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
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(message_create_params)

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

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

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

#messages_find(id, opts = {}) ⇒ Message

Get a message Read one message by id — an outbound send or an inbound reply.

Parameters:

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

    the optional parameters

Returns:



234
235
236
237
# File 'lib/norbelys/api/messages_api.rb', line 234

def messages_find(id, opts = {})
  data, _status_code, _headers = messages_find_with_http_info(id, opts)
  data
end

#messages_find_with_http_info(id, opts = {}) ⇒ Array<(Message, Integer, Hash)>

Get a message Read one message by id — an outbound send or an inbound reply.

Parameters:

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

    the optional parameters

Returns:

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

    Message data, response status code and response headers



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/norbelys/api/messages_api.rb', line 244

def messages_find_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessagesApi.messages_find ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MessagesApi.messages_find"
  end
  # resource path
  local_var_path = '/messages/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

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

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

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

#messages_list(opts = {}) ⇒ MessageList

List messages List the unified message log — outbound and inbound interleaved by time, newest first. Pass direction=inbound for the unibox (replies only), senderId for one mailbox's full history, or programId / personId / threadId to scope; filter by status, classification, isRead, or channel.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :include_archived (Boolean)
  • :channel (String)
  • :classification (String)
  • :dir (String)
  • :direction (String)
  • :email (String)
  • :is_read (Boolean)
  • :limit (Integer)
  • :order_by (String)
  • :page (Integer)
  • :person_id (String)
  • :program_id (String)
  • :search (String)
  • :sender_id (String)
  • :status (String)
  • :step_id (String)
  • :thread_id (String)

Returns:



314
315
316
317
# File 'lib/norbelys/api/messages_api.rb', line 314

def messages_list(opts = {})
  data, _status_code, _headers = messages_list_with_http_info(opts)
  data
end

#messages_list_with_http_info(opts = {}) ⇒ Array<(MessageList, Integer, Hash)>

List messages List the unified message log — outbound and inbound interleaved by time, newest first. Pass direction=inbound for the unibox (replies only), senderId for one mailbox's full history, or programId / personId / threadId to scope; filter by status, classification, isRead, or channel.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :include_archived (Boolean)
  • :channel (String)
  • :classification (String)
  • :dir (String)
  • :direction (String)
  • :email (String)
  • :is_read (Boolean)
  • :limit (Integer)
  • :order_by (String)
  • :page (Integer)
  • :person_id (String)
  • :program_id (String)
  • :search (String)
  • :sender_id (String)
  • :status (String)
  • :step_id (String)
  • :thread_id (String)

Returns:

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

    MessageList data, response status code and response headers



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/norbelys/api/messages_api.rb', line 341

def messages_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessagesApi.messages_list ...'
  end
  allowable_values = ["email", "call", "sms", "linkedin"]
  if @api_client.config.client_side_validation && opts[:'channel'] && !allowable_values.include?(opts[:'channel'])
    fail ArgumentError, "invalid value for \"channel\", must be one of #{allowable_values}"
  end
  allowable_values = ["interested", "out_of_office", "not_interested", "auto_reply", "bounce", "complaint", "unsubscribe", "uncategorized"]
  if @api_client.config.client_side_validation && opts[:'classification'] && !allowable_values.include?(opts[:'classification'])
    fail ArgumentError, "invalid value for \"classification\", must be one of #{allowable_values}"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'dir'] && !allowable_values.include?(opts[:'dir'])
    fail ArgumentError, "invalid value for \"dir\", must be one of #{allowable_values}"
  end
  allowable_values = ["outbound", "inbound"]
  if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction'])
    fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessagesApi.messages_list, must be smaller than or equal to 500.'
  end

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

  allowable_values = ["occurredAt", "subject"]
  if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by'])
    fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling MessagesApi.messages_list, must be greater than or equal to 1.'
  end

  allowable_values = ["queued", "sent", "delivered", "failed", "bounced", "cancelled"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/messages'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
  query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
  query_params[:'classification'] = opts[:'classification'] if !opts[:'classification'].nil?
  query_params[:'dir'] = opts[:'dir'] if !opts[:'dir'].nil?
  query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
  query_params[:'isRead'] = opts[:'is_read'] if !opts[:'is_read'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'personId'] = opts[:'person_id'] if !opts[:'person_id'].nil?
  query_params[:'programId'] = opts[:'program_id'] if !opts[:'program_id'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'senderId'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'stepId'] = opts[:'step_id'] if !opts[:'step_id'].nil?
  query_params[:'threadId'] = opts[:'thread_id'] if !opts[:'thread_id'].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] || 'MessageList'

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

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

#messages_source(id, opts = {}) ⇒ MessageSource

Get a sent message's source Return the exact bytes that left — the fully personalized email (final subject, HTML and text, with tracking and footer applied) as persisted to R2 at send time. Outbound messages only; inbound bodies ride on the message itself.

Parameters:

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

    the optional parameters

Returns:



444
445
446
447
# File 'lib/norbelys/api/messages_api.rb', line 444

def messages_source(id, opts = {})
  data, _status_code, _headers = messages_source_with_http_info(id, opts)
  data
end

#messages_source_with_http_info(id, opts = {}) ⇒ Array<(MessageSource, Integer, Hash)>

Get a sent message's source Return the exact bytes that left — the fully personalized email (final subject, HTML and text, with tracking and footer applied) as persisted to R2 at send time. Outbound messages only; inbound bodies ride on the message itself.

Parameters:

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

    the optional parameters

Returns:

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

    MessageSource data, response status code and response headers



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
491
492
493
494
495
496
497
498
499
500
# File 'lib/norbelys/api/messages_api.rb', line 454

def messages_source_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessagesApi.messages_source ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MessagesApi.messages_source"
  end
  # resource path
  local_var_path = '/messages/{id}/source'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

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

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

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

#messages_update(id, opts = {}) ⇒ Message

Triage an inbound message Triage an inbound reply: mark it read or unread, re-classify its intent, and/or assign it to a teammate. Inbound messages only.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



508
509
510
511
# File 'lib/norbelys/api/messages_api.rb', line 508

def messages_update(id, opts = {})
  data, _status_code, _headers = messages_update_with_http_info(id, opts)
  data
end

#messages_update_with_http_info(id, opts = {}) ⇒ Array<(Message, Integer, Hash)>

Triage an inbound message Triage an inbound reply: mark it read or unread, re-classify its intent, and/or assign it to a teammate. Inbound messages only.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Message data, response status code and response headers



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
# File 'lib/norbelys/api/messages_api.rb', line 519

def messages_update_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessagesApi.messages_update ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MessagesApi.messages_update"
  end
  # resource path
  local_var_path = '/messages/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'message_update_params'])

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

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

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