Class: Zyphr::InboxApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zyphr/api/inbox_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InboxApi

Returns a new instance of InboxApi.



19
20
21
# File 'lib/zyphr/api/inbox_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/zyphr/api/inbox_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#archive_inbox_notification(id, opts = {}) ⇒ InboxNotificationResponse

Archive a notification Archive a specific in-app notification.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



28
29
30
31
# File 'lib/zyphr/api/inbox_api.rb', line 28

def archive_inbox_notification(id, opts = {})
  data, _status_code, _headers = archive_inbox_notification_with_http_info(id, opts)
  data
end

#archive_inbox_notification_with_http_info(id, opts = {}) ⇒ Array<(InboxNotificationResponse, Integer, Hash)>

Archive a notification Archive a specific in-app notification.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    InboxNotificationResponse 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
# File 'lib/zyphr/api/inbox_api.rb', line 39

def archive_inbox_notification_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.archive_inbox_notification ...'
  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 InboxApi.archive_inbox_notification"
  end
  # resource path
  local_var_path = '/inbox/{id}/archive'.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[:'mark_inbox_read_request'])

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

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

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

#archive_subscriber_notification(id, opts = {}) ⇒ nil

Archive a notification

Parameters:

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

    the optional parameters

Returns:

  • (nil)


96
97
98
99
# File 'lib/zyphr/api/inbox_api.rb', line 96

def archive_subscriber_notification(id, opts = {})
  archive_subscriber_notification_with_http_info(id, opts)
  nil
end

#archive_subscriber_notification_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Archive a notification

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



105
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
# File 'lib/zyphr/api/inbox_api.rb', line 105

def archive_subscriber_notification_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.archive_subscriber_notification ...'
  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 InboxApi.archive_subscriber_notification"
  end
  # resource path
  local_var_path = '/subscriber-inbox/{id}/archive'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_inbox_notification(id, opts = {}) ⇒ nil

Delete a notification Permanently delete an in-app notification.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)
  • :external_id (String)

Returns:

  • (nil)


158
159
160
161
# File 'lib/zyphr/api/inbox_api.rb', line 158

def delete_inbox_notification(id, opts = {})
  delete_inbox_notification_with_http_info(id, opts)
  nil
end

#delete_inbox_notification_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a notification Permanently delete an in-app notification.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)
  • :external_id (String)

Returns:

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

    nil, response status code and response headers



170
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
# File 'lib/zyphr/api/inbox_api.rb', line 170

def delete_inbox_notification_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.delete_inbox_notification ...'
  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 InboxApi.delete_inbox_notification"
  end
  # resource path
  local_var_path = '/inbox/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'subscriber_id'] = opts[:'subscriber_id'] if !opts[:'subscriber_id'].nil?
  query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#delete_subscriber_notification(id, opts = {}) ⇒ nil

Delete a notification

Parameters:

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

    the optional parameters

Returns:

  • (nil)


222
223
224
225
# File 'lib/zyphr/api/inbox_api.rb', line 222

def delete_subscriber_notification(id, opts = {})
  delete_subscriber_notification_with_http_info(id, opts)
  nil
end

#delete_subscriber_notification_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a notification

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/zyphr/api/inbox_api.rb', line 231

def delete_subscriber_notification_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.delete_subscriber_notification ...'
  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 InboxApi.delete_subscriber_notification"
  end
  # resource path
  local_var_path = '/subscriber-inbox/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#generate_subscriber_token(generate_subscriber_token_request, opts = {}) ⇒ GenerateSubscriberToken200Response

Generate a subscriber token Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to ‘@zyphr/inbox-react`’s ‘<ZyphrProvider subscriberToken="…">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.

Parameters:

Returns:



282
283
284
285
# File 'lib/zyphr/api/inbox_api.rb', line 282

def generate_subscriber_token(generate_subscriber_token_request, opts = {})
  data, _status_code, _headers = generate_subscriber_token_with_http_info(generate_subscriber_token_request, opts)
  data
end

#generate_subscriber_token_with_http_info(generate_subscriber_token_request, opts = {}) ⇒ Array<(GenerateSubscriberToken200Response, Integer, Hash)>

Generate a subscriber token Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to &#x60;@zyphr/inbox-react&#x60;&#39;s &#x60;&lt;ZyphrProvider subscriberToken&#x3D;&quot;…&quot;&gt;&#x60; or use it as &#x60;Authorization: Bearer &lt;token&gt;&#x60; for client-side inbox API calls and WebSocket connections. The token expires in 7 days.

Parameters:

Returns:



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
336
337
338
339
340
341
342
343
# File 'lib/zyphr/api/inbox_api.rb', line 292

def generate_subscriber_token_with_http_info(generate_subscriber_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.generate_subscriber_token ...'
  end
  # verify the required parameter 'generate_subscriber_token_request' is set
  if @api_client.config.client_side_validation && generate_subscriber_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'generate_subscriber_token_request' when calling InboxApi.generate_subscriber_token"
  end
  # resource path
  local_var_path = '/subscriber-inbox/token'

  # 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(generate_subscriber_token_request)

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

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

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

#get_inbox_notification(id, opts = {}) ⇒ InboxNotificationResponse

Get a notification Get a specific in-app notification by ID.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)
  • :external_id (String)

Returns:



352
353
354
355
# File 'lib/zyphr/api/inbox_api.rb', line 352

def get_inbox_notification(id, opts = {})
  data, _status_code, _headers = get_inbox_notification_with_http_info(id, opts)
  data
end

#get_inbox_notification_with_http_info(id, opts = {}) ⇒ Array<(InboxNotificationResponse, Integer, Hash)>

Get a notification Get a specific in-app notification by ID.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)
  • :external_id (String)

Returns:

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

    InboxNotificationResponse data, response status code and response headers



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
# File 'lib/zyphr/api/inbox_api.rb', line 364

def get_inbox_notification_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.get_inbox_notification ...'
  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 InboxApi.get_inbox_notification"
  end
  # resource path
  local_var_path = '/inbox/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'subscriber_id'] = opts[:'subscriber_id'] if !opts[:'subscriber_id'].nil?
  query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_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] || 'InboxNotificationResponse'

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

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

#get_subscriber_inbox_preferences(opts = {}) ⇒ nil

Get subscriber preferences Get notification preferences grouped by category for the authenticated subscriber.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


418
419
420
421
# File 'lib/zyphr/api/inbox_api.rb', line 418

def get_subscriber_inbox_preferences(opts = {})
  get_subscriber_inbox_preferences_with_http_info(opts)
  nil
end

#get_subscriber_inbox_preferences_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get subscriber preferences Get notification preferences grouped by category for the authenticated subscriber.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/zyphr/api/inbox_api.rb', line 427

def get_subscriber_inbox_preferences_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.get_subscriber_inbox_preferences ...'
  end
  # resource path
  local_var_path = '/subscriber-inbox/preferences'

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#get_subscriber_notification(id, opts = {}) ⇒ nil

Get a notification Get a specific notification by ID for the authenticated subscriber.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


474
475
476
477
# File 'lib/zyphr/api/inbox_api.rb', line 474

def get_subscriber_notification(id, opts = {})
  get_subscriber_notification_with_http_info(id, opts)
  nil
end

#get_subscriber_notification_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get a notification Get a specific notification by ID for the authenticated subscriber.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



484
485
486
487
488
489
490
491
492
493
494
495
496
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
# File 'lib/zyphr/api/inbox_api.rb', line 484

def get_subscriber_notification_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.get_subscriber_notification ...'
  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 InboxApi.get_subscriber_notification"
  end
  # resource path
  local_var_path = '/subscriber-inbox/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#get_subscriber_unread_count(opts = {}) ⇒ nil

Get unread count Get the unread notification count for the authenticated subscriber.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


534
535
536
537
# File 'lib/zyphr/api/inbox_api.rb', line 534

def get_subscriber_unread_count(opts = {})
  get_subscriber_unread_count_with_http_info(opts)
  nil
end

#get_subscriber_unread_count_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get unread count Get the unread notification count for the authenticated subscriber.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/zyphr/api/inbox_api.rb', line 543

def get_subscriber_unread_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.get_subscriber_unread_count ...'
  end
  # resource path
  local_var_path = '/subscriber-inbox/unread-count'

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#get_unread_count(opts = {}) ⇒ UnreadCountResponse

Get unread notification count Get the count of unread in-app notifications for a subscriber.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)
  • :external_id (String)

Returns:



591
592
593
594
# File 'lib/zyphr/api/inbox_api.rb', line 591

def get_unread_count(opts = {})
  data, _status_code, _headers = get_unread_count_with_http_info(opts)
  data
end

#get_unread_count_with_http_info(opts = {}) ⇒ Array<(UnreadCountResponse, Integer, Hash)>

Get unread notification count Get the count of unread in-app notifications for a subscriber.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)
  • :external_id (String)

Returns:

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

    UnreadCountResponse data, response status code and response headers



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
641
642
643
644
645
646
# File 'lib/zyphr/api/inbox_api.rb', line 602

def get_unread_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.get_unread_count ...'
  end
  # resource path
  local_var_path = '/inbox/unread-count'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'subscriber_id'] = opts[:'subscriber_id'] if !opts[:'subscriber_id'].nil?
  query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_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] || 'UnreadCountResponse'

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

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

#list_all_inbox(opts = {}) ⇒ nil

List all project notifications List all in-app notifications for the current project. Used by the dashboard to display all notifications without requiring a subscriber selection.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)

    Optional subscriber filter

  • :status (String)

    Filter by notification status

  • :category (String)

    Filter by category

  • :search (String)

    Search by title or body

  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0

Returns:

  • (nil)


658
659
660
661
# File 'lib/zyphr/api/inbox_api.rb', line 658

def list_all_inbox(opts = {})
  list_all_inbox_with_http_info(opts)
  nil
end

#list_all_inbox_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

List all project notifications List all in-app notifications for the current project. Used by the dashboard to display all notifications without requiring a subscriber selection.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)

    Optional subscriber filter

  • :status (String)

    Filter by notification status

  • :category (String)

    Filter by category

  • :search (String)

    Search by title or body

  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0

Returns:

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

    nil, response status code and response headers



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
721
722
723
724
725
726
727
# File 'lib/zyphr/api/inbox_api.rb', line 673

def list_all_inbox_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.list_all_inbox ...'
  end
  allowable_values = ["unread", "read", "archived"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling InboxApi.list_all_inbox, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/inbox/all'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'subscriber_id'] = opts[:'subscriber_id'] if !opts[:'subscriber_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#list_inbox(opts = {}) ⇒ InboxListResponse

List inbox notifications Retrieve in-app notifications for a subscriber. Requires subscriber_id or external_id.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)

    Subscriber ID

  • :external_id (String)

    Subscriber external ID

  • :category (String)

    Filter by notification category

  • :include_read (Boolean) — default: default to false
  • :include_archived (Boolean) — default: default to false
  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0
  • :cursor (String)

    Cursor for pagination

Returns:



741
742
743
744
# File 'lib/zyphr/api/inbox_api.rb', line 741

def list_inbox(opts = {})
  data, _status_code, _headers = list_inbox_with_http_info(opts)
  data
end

#list_inbox_with_http_info(opts = {}) ⇒ Array<(InboxListResponse, Integer, Hash)>

List inbox notifications Retrieve in-app notifications for a subscriber. Requires subscriber_id or external_id.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscriber_id (String)

    Subscriber ID

  • :external_id (String)

    Subscriber external ID

  • :category (String)

    Filter by notification category

  • :include_read (Boolean) — default: default to false
  • :include_archived (Boolean) — default: default to false
  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0
  • :cursor (String)

    Cursor for pagination

Returns:

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

    InboxListResponse data, response status code and response headers



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
801
802
803
804
805
806
807
808
809
810
811
812
# File 'lib/zyphr/api/inbox_api.rb', line 758

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

  # resource path
  local_var_path = '/inbox'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'subscriber_id'] = opts[:'subscriber_id'] if !opts[:'subscriber_id'].nil?
  query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil?
  query_params[:'include_read'] = opts[:'include_read'] if !opts[:'include_read'].nil?
  query_params[:'include_archived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

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

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

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

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

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

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

#list_subscriber_notifications(opts = {}) ⇒ nil

List subscriber notifications List notifications for the authenticated subscriber. Supports cursor-based pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :category (String)

    Filter by notification category

  • :include_read (Boolean)

    Include read notifications (default to false)

  • :include_archived (Boolean)

    Include archived notifications (default to false)

  • :limit (Integer) — default: default to 50
  • :cursor (String)

    Pagination cursor from previous response

Returns:

  • (nil)


823
824
825
826
# File 'lib/zyphr/api/inbox_api.rb', line 823

def list_subscriber_notifications(opts = {})
  list_subscriber_notifications_with_http_info(opts)
  nil
end

#list_subscriber_notifications_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

List subscriber notifications List notifications for the authenticated subscriber. Supports cursor-based pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :category (String)

    Filter by notification category

  • :include_read (Boolean)

    Include read notifications (default to false)

  • :include_archived (Boolean)

    Include archived notifications (default to false)

  • :limit (Integer) — default: default to 50
  • :cursor (String)

    Pagination cursor from previous response

Returns:

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

    nil, response status code and response headers



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/zyphr/api/inbox_api.rb', line 837

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

  # resource path
  local_var_path = '/subscriber-inbox'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil?
  query_params[:'include_read'] = opts[:'include_read'] if !opts[:'include_read'].nil?
  query_params[:'include_archived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#mark_all_inbox_read(mark_all_inbox_read_request, opts = {}) ⇒ MarkAllReadResponse

Mark all notifications as read Mark all unread in-app notifications as read for a subscriber. Optionally filter by category.

Parameters:

Returns:



893
894
895
896
# File 'lib/zyphr/api/inbox_api.rb', line 893

def mark_all_inbox_read(mark_all_inbox_read_request, opts = {})
  data, _status_code, _headers = mark_all_inbox_read_with_http_info(mark_all_inbox_read_request, opts)
  data
end

#mark_all_inbox_read_with_http_info(mark_all_inbox_read_request, opts = {}) ⇒ Array<(MarkAllReadResponse, Integer, Hash)>

Mark all notifications as read Mark all unread in-app notifications as read for a subscriber. Optionally filter by category.

Parameters:

Returns:

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

    MarkAllReadResponse data, response status code and response headers



903
904
905
906
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
# File 'lib/zyphr/api/inbox_api.rb', line 903

def mark_all_inbox_read_with_http_info(mark_all_inbox_read_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.mark_all_inbox_read ...'
  end
  # verify the required parameter 'mark_all_inbox_read_request' is set
  if @api_client.config.client_side_validation && mark_all_inbox_read_request.nil?
    fail ArgumentError, "Missing the required parameter 'mark_all_inbox_read_request' when calling InboxApi.mark_all_inbox_read"
  end
  # resource path
  local_var_path = '/inbox/read-all'

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

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

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

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

#mark_all_subscriber_notifications_read(opts = {}) ⇒ nil

Mark all notifications as read

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


960
961
962
963
# File 'lib/zyphr/api/inbox_api.rb', line 960

def mark_all_subscriber_notifications_read(opts = {})
  mark_all_subscriber_notifications_read_with_http_info(opts)
  nil
end

#mark_all_subscriber_notifications_read_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Mark all notifications as read

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



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
1008
1009
1010
1011
1012
1013
1014
# File 'lib/zyphr/api/inbox_api.rb', line 969

def mark_all_subscriber_notifications_read_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.mark_all_subscriber_notifications_read ...'
  end
  # resource path
  local_var_path = '/subscriber-inbox/read-all'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # 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[:'mark_all_subscriber_notifications_read_request'])

  # return_type
  return_type = opts[:debug_return_type]

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

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

#mark_inbox_read(id, opts = {}) ⇒ InboxNotificationResponse

Mark notification as read Mark a specific in-app notification as read.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



1022
1023
1024
1025
# File 'lib/zyphr/api/inbox_api.rb', line 1022

def mark_inbox_read(id, opts = {})
  data, _status_code, _headers = mark_inbox_read_with_http_info(id, opts)
  data
end

#mark_inbox_read_with_http_info(id, opts = {}) ⇒ Array<(InboxNotificationResponse, Integer, Hash)>

Mark notification as read Mark a specific in-app notification as read.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    InboxNotificationResponse data, response status code and response headers



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
# File 'lib/zyphr/api/inbox_api.rb', line 1033

def mark_inbox_read_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.mark_inbox_read ...'
  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 InboxApi.mark_inbox_read"
  end
  # resource path
  local_var_path = '/inbox/{id}/read'.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[:'mark_inbox_read_request'])

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

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

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

#mark_subscriber_notification_read(id, opts = {}) ⇒ nil

Mark notification as read

Parameters:

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

    the optional parameters

Returns:

  • (nil)


1090
1091
1092
1093
# File 'lib/zyphr/api/inbox_api.rb', line 1090

def mark_subscriber_notification_read(id, opts = {})
  mark_subscriber_notification_read_with_http_info(id, opts)
  nil
end

#mark_subscriber_notification_read_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Mark notification as read

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
# File 'lib/zyphr/api/inbox_api.rb', line 1099

def mark_subscriber_notification_read_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.mark_subscriber_notification_read ...'
  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 InboxApi.mark_subscriber_notification_read"
  end
  # resource path
  local_var_path = '/subscriber-inbox/{id}/read'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#send_batch_in_app(send_batch_in_app_request, opts = {}) ⇒ SendBatchInAppResponse

Send batch in-app notifications Send in-app notifications to multiple subscribers in a single request (max 100).

Parameters:

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

    the optional parameters

Returns:



1150
1151
1152
1153
# File 'lib/zyphr/api/inbox_api.rb', line 1150

def send_batch_in_app(send_batch_in_app_request, opts = {})
  data, _status_code, _headers = send_batch_in_app_with_http_info(send_batch_in_app_request, opts)
  data
end

#send_batch_in_app_with_http_info(send_batch_in_app_request, opts = {}) ⇒ Array<(SendBatchInAppResponse, Integer, Hash)>

Send batch in-app notifications Send in-app notifications to multiple subscribers in a single request (max 100).

Parameters:

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

    the optional parameters

Returns:

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

    SendBatchInAppResponse data, response status code and response headers



1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
# File 'lib/zyphr/api/inbox_api.rb', line 1160

def send_batch_in_app_with_http_info(send_batch_in_app_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.send_batch_in_app ...'
  end
  # verify the required parameter 'send_batch_in_app_request' is set
  if @api_client.config.client_side_validation && send_batch_in_app_request.nil?
    fail ArgumentError, "Missing the required parameter 'send_batch_in_app_request' when calling InboxApi.send_batch_in_app"
  end
  # resource path
  local_var_path = '/inbox/send/batch'

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

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

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

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

#send_in_app(send_in_app_request, opts = {}) ⇒ SendInAppResponse

Send an in-app notification Create and deliver an in-app notification to a subscriber. Checks subscriber preferences before delivery.

Parameters:

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

    the optional parameters

Returns:



1218
1219
1220
1221
# File 'lib/zyphr/api/inbox_api.rb', line 1218

def send_in_app(send_in_app_request, opts = {})
  data, _status_code, _headers = send_in_app_with_http_info(send_in_app_request, opts)
  data
end

#send_in_app_with_http_info(send_in_app_request, opts = {}) ⇒ Array<(SendInAppResponse, Integer, Hash)>

Send an in-app notification Create and deliver an in-app notification to a subscriber. Checks subscriber preferences before delivery.

Parameters:

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

    the optional parameters

Returns:

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

    SendInAppResponse data, response status code and response headers



1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
# File 'lib/zyphr/api/inbox_api.rb', line 1228

def send_in_app_with_http_info(send_in_app_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.send_in_app ...'
  end
  # verify the required parameter 'send_in_app_request' is set
  if @api_client.config.client_side_validation && send_in_app_request.nil?
    fail ArgumentError, "Missing the required parameter 'send_in_app_request' when calling InboxApi.send_in_app"
  end
  # resource path
  local_var_path = '/inbox/send'

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

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

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

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

#update_subscriber_preferences(update_subscriber_preferences_request, opts = {}) ⇒ nil

Update subscriber preferences Update notification channel preferences for specific categories or globally.

Parameters:

Returns:

  • (nil)


1286
1287
1288
1289
# File 'lib/zyphr/api/inbox_api.rb', line 1286

def update_subscriber_preferences(update_subscriber_preferences_request, opts = {})
  update_subscriber_preferences_with_http_info(update_subscriber_preferences_request, opts)
  nil
end

#update_subscriber_preferences_with_http_info(update_subscriber_preferences_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update subscriber preferences Update notification channel preferences for specific categories or globally.

Parameters:

Returns:

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

    nil, response status code and response headers



1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
# File 'lib/zyphr/api/inbox_api.rb', line 1296

def update_subscriber_preferences_with_http_info(update_subscriber_preferences_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxApi.update_subscriber_preferences ...'
  end
  # verify the required parameter 'update_subscriber_preferences_request' is set
  if @api_client.config.client_side_validation && update_subscriber_preferences_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_subscriber_preferences_request' when calling InboxApi.update_subscriber_preferences"
  end
  # resource path
  local_var_path = '/subscriber-inbox/preferences'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # 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(update_subscriber_preferences_request)

  # return_type
  return_type = opts[:debug_return_type]

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

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