teleflow 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md ADDED
@@ -0,0 +1,952 @@
1
+ # Teleflow Ruby client library
2
+
3
+ [![Gem Version](https://img.shields.io/gem/v/teleflow.svg)](https://rubygems.org/gems/teleflow)
4
+ [![Gem](https://img.shields.io/gem/dt/teleflow.svg)](https://rubygems.org/gems/teleflow/)
5
+
6
+ > This is a Ruby client library for communicating with the [Teleflow API](https://api-teleflow.khulnasoft.com/api).
7
+
8
+ ## Installation
9
+
10
+ You can install the client library via RubyGems:
11
+
12
+ ```ruby
13
+ gem install teleflow
14
+ ```
15
+
16
+ Or add it to your Gemfile:
17
+
18
+ ```ruby
19
+ gem 'teleflow'
20
+ ```
21
+
22
+ Then run `bundle install`.
23
+
24
+ ## Usage
25
+
26
+ To use the library, first initialize the client with your API token:
27
+
28
+ ```ruby
29
+ require 'teleflow'
30
+
31
+ client = Teleflow::Client.new(access_token: 'YOUR_TELEFLOW_API_TOKEN')
32
+ ```
33
+
34
+ You can then call methods on the client to interact with the Teleflow API:
35
+
36
+ ```ruby
37
+ client.notifications
38
+ ```
39
+
40
+ ## List of all methods
41
+
42
+ The client methods map directly to the Teleflow API endpoints. Here's a list of all the available methods. Check [the API docs](https://docs.teleflow.khulnasoft.com/api/overview) for list of available `methods`.
43
+
44
+ ### Blueprints
45
+
46
+ - Get V1blueprints: `get_blueprint(template_id)`
47
+
48
+ ```ruby
49
+ client.get_blueprint('<insert-template-id>')
50
+ ```
51
+
52
+ - Get V1blueprints by category: `group_blueprints_by_category()`
53
+
54
+ ```ruby
55
+ client.group_blueprints_by_category()
56
+ ```
57
+
58
+ ### Changes
59
+
60
+ - Get changes: `changes(query = {})`
61
+
62
+ ```ruby
63
+ client.changes({
64
+ 'page' => 1, # optional
65
+ 'limit' => 10, # optional
66
+ 'promoted' => 'hello'
67
+ })
68
+ ```
69
+
70
+ - Get changes count: `count_changes()`
71
+
72
+ ```ruby
73
+ client.count_changes()
74
+ ```
75
+
76
+ - Apply changes: `apply_bulk_changes()`
77
+ ```ruby
78
+ client.apply_bulk_changes({
79
+ 'changeIds' => ['<insert-all-the-change-ids>']
80
+ })
81
+ ```
82
+
83
+ - Apply change: `apply_change(change_id)`
84
+
85
+ ```ruby
86
+ client.apply_change('7789')
87
+ ```
88
+
89
+ ### Environments
90
+
91
+ - Get current environment: `current_environment()`
92
+ ```ruby
93
+ client.current_environment()
94
+ ```
95
+ - Create environment: `create_environment(body)`
96
+
97
+ ```ruby
98
+ payload = {
99
+ 'name' => 'Staging',
100
+ 'parentId' => '7789' # optional
101
+ }
102
+ client.create_environment(payload)
103
+ ```
104
+
105
+ - Get environments: `environments()`
106
+
107
+ ```ruby
108
+ client.environments()
109
+ ```
110
+
111
+ - Update environment by id: `update_environment(environment_id, body)`
112
+
113
+ ```ruby
114
+ client.update_environment('64a713bdexxxxxx', {
115
+ 'name' => 'Local', # optional
116
+ 'identifier' => 'local', # optional
117
+ 'parentId' => '7789', # optional
118
+ 'dns' => { # optional
119
+ 'inboundParseDomain' => 'dev.test' # optional
120
+ }
121
+ })
122
+ ```
123
+
124
+ - Get api keys: `api_keys()`
125
+
126
+ ```ruby
127
+ client.api_keys()
128
+ ```
129
+
130
+ - Regenerate api keys: `regenerate_api_keys()`
131
+
132
+ ```ruby
133
+ client.regenerate_api_keys()
134
+ ```
135
+
136
+ - `update_widget_settings(body)`
137
+
138
+ ```ruby
139
+ client.update_widget_settings({ 'notificationCenterEncryption' => true})
140
+ ```
141
+
142
+
143
+ ### Events
144
+
145
+ - Trigger event: `trigger_event(body)`
146
+
147
+ ```ruby
148
+ payload = {
149
+ 'name' => 'Trigger1',
150
+ 'payload' => { # optional
151
+ 'first-name' => 'Adam' # optional
152
+ },
153
+ 'to' => {
154
+ 'subscriberId' => '7789'
155
+ },
156
+ 'transactionId' => '89kjfke9893' #optional
157
+ }
158
+ client.trigger_event(payload)
159
+ ```
160
+
161
+ - Bulk trigger event: `trigger_bulk_event(body)`
162
+
163
+ ```ruby
164
+ payload = {
165
+ 'events' => [
166
+ {
167
+ 'name' => 'Trigger1',
168
+ 'payload' => { # optional
169
+ 'first-name' => 'Adam' # optional
170
+ },
171
+ 'to' => {
172
+ 'subscriberId' => '7789'
173
+ },
174
+ 'transactionId' => '89kjfke9893' #optional
175
+ },
176
+ {
177
+ 'name' => 'Trigger2',
178
+ 'payload' => { # optional
179
+ 'last-name' => 'Eve' # optional
180
+ },
181
+ 'to' => {
182
+ 'subscriberId' => '7789'
183
+ },
184
+ 'transactionId' => 'sw900999as' #optional
185
+ }
186
+ ]
187
+ }
188
+ client.trigger_bulk_event(payload)
189
+ ```
190
+
191
+ - Broadcast event to all: `broadcast_event(body)`
192
+
193
+ ```ruby
194
+ payload = {
195
+ 'name' => 'Trigger',
196
+ 'payload' => {
197
+ 'first-name' => 'Adam',
198
+ 'last-name' => 'Eve'
199
+ },
200
+ 'transactionId' => 'sw900999as' #optional
201
+ }
202
+ client.broadcast_event(payload)
203
+ ```
204
+
205
+ - Cancel triggered event: `cancel_triggered_event(transaction_id)`
206
+
207
+ ```ruby
208
+ client.cancel_triggered_event('8fxxxee-xxx-4f2b-a0e8-xxxxx')
209
+ ```
210
+
211
+
212
+ ### Execution Details
213
+
214
+ - Get execution details: `execution_details(query = {})`
215
+
216
+ ```ruby
217
+ client.execution_details({
218
+ 'notificationId' => '8fxxx-xxx-ef9xxxxce66',
219
+ 'subscriberId' => '7789'
220
+ })
221
+ ```
222
+
223
+ ### Feeds
224
+
225
+ - Create feed: `create_feed(body)`
226
+
227
+ ```ruby
228
+ client.create_feed({
229
+ 'name' => 'New feed'
230
+ })
231
+ ```
232
+
233
+ - Get feeds: `feeds()`
234
+
235
+ ```ruby
236
+ client.feeds()
237
+ ```
238
+
239
+ - Delete feed: `delete_feed(feed_id)`
240
+
241
+ ```ruby
242
+ client.delete_feed('xxxx714xxa8cbxxxxx2d932')
243
+ ```
244
+
245
+
246
+ ### Inbound Parse
247
+
248
+ - Validate the mx record setup for the inbound parse functionality: `validate_mx_record_setup_for_inbound_parse()`
249
+
250
+ ```ruby
251
+ client.validate_mx_record_setup_for_inbound_parse()
252
+ ```
253
+
254
+ ### Integrations
255
+
256
+ - Get integrations: `integrations()`
257
+
258
+ ```ruby
259
+ client.integrations()
260
+ ```
261
+
262
+ - Create integration: `create_integration(body)`
263
+
264
+ ```ruby
265
+ body = {
266
+ 'providerId' => '<insert-provider-id>',
267
+ 'channel' => '<insert-channel>',
268
+ 'credentials' => {
269
+ # insert all the fields
270
+ },
271
+ 'active' => true,
272
+ 'check' => true
273
+ }
274
+ client.create_integration(body)
275
+ ```
276
+
277
+ - Get active integrations: `active_integrations()`
278
+
279
+ ```ruby
280
+ client.active_integrations()
281
+ ```
282
+
283
+ - Get webhook support status for provider: `webhook_provider_status(provider_id)`
284
+
285
+ ```ruby
286
+ client.webhook_provider_status('<insert-provider-id>')
287
+ ```
288
+
289
+ - Update integration: `update_integration(integration_id, body)`
290
+
291
+ ```ruby
292
+ body = {
293
+ 'active' => true,
294
+ 'check' => true
295
+ 'credentials' => {
296
+ # insert all the fields
297
+ },
298
+ }
299
+ client.update_integration('<insert-provider-id>', body)
300
+ ```
301
+
302
+ - Delete integration: `delete_integration(integration_id)`
303
+
304
+ ```ruby
305
+ client.delete_integration('<insert-provider-id>')
306
+ ```
307
+
308
+ - Get channel limit: `channel_limit(channel_type)`
309
+
310
+ ```ruby
311
+ client.channel_limit('<insert-channel-type>')
312
+ ```
313
+
314
+ - Get in-app status: `in_app_status()`
315
+
316
+ ```ruby
317
+ client.in_app_status()
318
+ ```
319
+
320
+ - Set integration as primary: `set_integration_as_primary(integration_id)`
321
+
322
+ ```ruby
323
+ client.set_integration_as_primary('<insert-integration-id>')
324
+ ```
325
+
326
+
327
+ ### Layouts
328
+
329
+ - Layout creation: `create_layout(body)`
330
+
331
+ ```ruby
332
+ payload = {
333
+ 'name' => 'New layout',
334
+ 'content' => '{{{body}}}',
335
+ 'variables' => ['<list-variables-here>'], # optional
336
+ 'description' => 'This is a description for the new layout', # optional
337
+ 'isDefault' => true # optional
338
+ }
339
+ client.create_layout(payload)
340
+ ```
341
+
342
+ - Filter layouts: `layouts(query = {})`
343
+
344
+ ```ruby
345
+ client.layouts({
346
+ 'page' => 1, # optional
347
+ 'pageSize' => 10, # optional
348
+ 'sortBy' => 'createdAt', # optional
349
+ 'orderBy' => 1 # optional
350
+ })
351
+ ```
352
+
353
+ - Get layout: `layout(layout_id)`
354
+
355
+ ```ruby
356
+ client.layout('<insert-layout-id>')
357
+ ```
358
+
359
+ - Delete layout: `delete_layout(layout_id)`
360
+
361
+ ```ruby
362
+ client.delete_layout('<insert-layout-id>')
363
+ ```
364
+
365
+ - Update a layout: `update_layout(layout_id, body)`
366
+
367
+ ```ruby
368
+ payload = {
369
+ 'name' => 'Update layout', # optional
370
+ 'content' => '{{{body}}}', # optional
371
+ 'description' => 'This is a description for the new layout', # optional
372
+ 'isDefault' => true # optional
373
+ 'variables' => ['<list-variables-here>'], # optional
374
+ }
375
+ client.update_layout('<insert-layout-id>', payload)
376
+ ```
377
+
378
+ - Set default layout: `make_default_layout(layout_id)`
379
+
380
+ ```ruby
381
+ client.make_default_layout('<insert-layout-id>')
382
+ ```
383
+
384
+
385
+ ### Messages
386
+
387
+ - Get messages: `messages(query = {})`
388
+
389
+ ```ruby
390
+ payload = {
391
+ 'channel' => 'slack', # optional
392
+ 'subscriberId' => '7789', # optional
393
+ 'transactionId' =>'sw900999as', # optional
394
+ 'page' => 4, # optional
395
+ 'limit' => 10, # optional
396
+ }
397
+ client.messages(payload)
398
+ ```
399
+
400
+ - Delete message: `delete_message(message_id)`
401
+
402
+ ```ruby
403
+ client.delete_message('<insert-message-id>')
404
+ ```
405
+
406
+ ### Notification Groups
407
+
408
+ - Create Notification group: `create_notification_group(body)`
409
+
410
+ ```ruby
411
+ client.create_notification_group({
412
+ 'name' => '<insert-name>'
413
+ })
414
+ ```
415
+
416
+ - Get Notification groups: `notification_groups()`
417
+
418
+ ```ruby
419
+ client.notification_groups()
420
+ ```
421
+
422
+ ### Notification Templates
423
+
424
+ - Get notification templates: `notification_templates(query = {})`
425
+
426
+ ```ruby
427
+ client.notification_templates({
428
+ 'page' => 4, # optional
429
+ 'limit' => 10, # optional
430
+ })
431
+ ```
432
+
433
+ - Create notification template: `create_notification_template(body)`
434
+
435
+ ```ruby
436
+ body = {
437
+ 'name' => '<insert-name>',
438
+ 'notificationGroupId' => 'notificationGroupId',
439
+ 'tags' => ['tags'], # optional
440
+ 'description' => 'description', # optional
441
+ 'steps' => [ # optional
442
+ # insert all fields here
443
+ ],
444
+ 'active' => true, # optional
445
+ 'draft' => true, # optional
446
+ 'critical' => true, # optional
447
+ 'preferenceSettings' => { # optional
448
+ # insert all fields here
449
+ },
450
+ 'blueprintId' => 'blueprintId' # optional
451
+ }
452
+ client.create_notification_template(body)
453
+ ```
454
+
455
+ - Update notification template: `update_notification_template(template_id, body)`
456
+
457
+ ```ruby
458
+ body = {
459
+ 'name' => '<insert-name>',
460
+ 'notificationGroupId' => 'notificationGroupId',
461
+ 'tags' => ['tags'], # optional
462
+ 'description' => 'description', # optional
463
+ 'steps' => [ # optional
464
+ # insert all fields here
465
+ ],
466
+ 'active' => true, # optional
467
+ 'draft' => true, # optional
468
+ 'critical' => true, # optional
469
+ 'preferenceSettings' => { # optional
470
+ # insert all fields here
471
+ },
472
+ 'blueprintId' => 'blueprintId' # optional
473
+ }
474
+ client.update_notification_template('<insert-template-id>', body)
475
+ ```
476
+
477
+ - Delete notification template`delete_notification_template(template_id)`
478
+
479
+ ```ruby
480
+ client.delete_notification_template('<insert-template-id>')
481
+ ```
482
+
483
+ - Get a notification template: `notification_template(template_id)`
484
+
485
+ ```ruby
486
+ client.notification_template('<insert-template-id>')
487
+ ```
488
+
489
+ - Get a notification template blueprint: `notification_template_blueprint(template_id)`
490
+
491
+ ```ruby
492
+ client.notification_template_blueprint('<insert-template-id>')
493
+ ```
494
+
495
+ - Create a new notification template blueprint: `create_notification_template_blueprint(template_id)`
496
+
497
+ ```ruby
498
+ client.create_notification_template_blueprint('<insert-template-id>')
499
+ ```
500
+
501
+ - Update notification template status: `update_notification_template_status(template_id, body)`
502
+
503
+ ```ruby
504
+ client.update_notification_template_status('<insert-template-id>', { 'active' => true })
505
+ ```
506
+
507
+ ### Notification
508
+
509
+ - Get notifications: `notifications(query = {})`
510
+
511
+ ```ruby
512
+ body = {
513
+ 'channels' => ['<insert-channels>'],
514
+ 'templates' => ['<insert-templates>'],
515
+ 'emails' => ['<insert-emails>'],
516
+ 'search' => '<insert-search-string>'
517
+ 'page' => 2 , # optional
518
+ 'transactionId' =>'sw900999as', # optional
519
+ }
520
+ client.notifications(body)
521
+ ```
522
+
523
+ - Get notification statistics: `notifications_stats()`
524
+
525
+ ```ruby
526
+ client.notifications_stats()
527
+ ```
528
+
529
+ - Get notification graph statistics: `notifications_graph_stats(query = {})`
530
+
531
+ ```ruby
532
+ client.notifications_graph_stats({
533
+ 'days' => 5 # optional
534
+ })
535
+ ```
536
+
537
+ - Get notification: `notification(notification_id)`
538
+
539
+ ```ruby
540
+ client.notification('<insert-notification-id>')
541
+ ```
542
+
543
+ ### Organizations
544
+
545
+ - Create an organization: `create_organization(body)`
546
+
547
+ ```ruby
548
+ client.create_organization({
549
+ 'logo' => '<insert-organization-logo>',
550
+ 'name' => '<insert-organization-name>',
551
+ })
552
+ ```
553
+
554
+ - Get all organizations: `organizations()`
555
+
556
+ ```ruby
557
+ client.organizations()
558
+ ```
559
+
560
+ - Get current organization: `current_organization()`
561
+
562
+ ```ruby
563
+ client.current_organization()
564
+ ```
565
+
566
+ - Get all members of current organization: `current_organization_members()`
567
+
568
+ ```ruby
569
+ client.current_organization_members()
570
+ ```
571
+
572
+ - Rename organization: `rename_organization(body)`
573
+
574
+ ```ruby
575
+ client.rename_organization({
576
+ name: '<insert-organization-name>'
577
+ })
578
+ ```
579
+
580
+ - Rename organization: `organization_branding(body)`
581
+
582
+ ```ruby
583
+ client.organization_branding({
584
+ logo: '<insert-organization-logo>',
585
+ color: '<insert-organization-color>',
586
+ fontColor: '<insert-organization-fontColor>',
587
+ contentBackground: '<insert-organization-contentBackground>',
588
+ fontFamily: '<insert-organization-fontFamily>'
589
+ })
590
+ ```
591
+
592
+ - Delete member from organization: `delete_organization_member(member_id)`
593
+
594
+ ```ruby
595
+ client.delete_organization_member('<insert-member-id>')
596
+ ```
597
+
598
+ ### Subscribers
599
+
600
+ - Get subscribers: `subscribers(query = {}) `
601
+
602
+ ```ruby
603
+ client.subscribers({
604
+ 'page' => 1, # optional
605
+ 'limit' => 15, # optional
606
+ })
607
+ ```
608
+
609
+ - Create subscriber: `create_subscriber(body)`
610
+
611
+ ```ruby
612
+ payload = {
613
+ 'subscriberId' => '7789',
614
+ 'email' => '<insert-email>', # optional
615
+ 'firstName' => '<insert-firstName>', # optional
616
+ 'lastName' => '<insert-lastName>', # optional
617
+ 'phone' => '<insert-phone>', # optional
618
+ 'avatar' => '<insert-profile-avatar>' # optional
619
+ }
620
+ client.create_subscriber(payload)
621
+ ```
622
+
623
+ - `subscriber(subscriber_id)`
624
+
625
+ ```ruby
626
+ client.subscriber('<insert-subscriber-id>')
627
+ ```
628
+
629
+ - Update subscriber: `update_subscriber(subscriber_id, body)`
630
+
631
+ ```ruby
632
+ payload = {
633
+ 'email' => '<insert-email>', # optional
634
+ 'firstName' => '<insert-firstName>', # optional
635
+ 'lastName' => '<insert-lastName>', # optional
636
+ 'phone' => '<insert-phone>', # optional
637
+ 'avatar' => '<insert-profile-avatar>' # optional
638
+ }
639
+ client.update_subscriber('<insert-subscriber-id>', payload)
640
+ ```
641
+
642
+ - Delete subscriber: `delete_subscriber(subscriber_id)`
643
+
644
+ ```ruby
645
+ client.delete_subscriber('<insert-subscriber-id>')
646
+ ```
647
+
648
+ - Update subscriber credentials: `update_subscriber_credentials(subscriber_id, body)`
649
+
650
+ ```ruby
651
+ body = {
652
+ 'providerId' => '<insert-provider-id>',
653
+ 'credentials' => {
654
+ # Insert all fields here
655
+ }
656
+ }
657
+ client.update_subscriber_credentials('<insert-subscriber-id>', body)
658
+ ```
659
+
660
+ - Delete subscriber credentials by providerId: `delete_subscriber_credentials(subscriberId, providerId)`
661
+
662
+ ```ruby
663
+ client.delete_subscriber_credentials('<insert-subscriber-id>', '<insert-provider-id>')
664
+ ```
665
+
666
+ - Update subscriber online status: `update_subscriber_online_status(subscriber_id, body)`
667
+
668
+ ```ruby
669
+ client.update_subscriber_online_status('<insert-subscriber-id>', { 'isOnline' => true })
670
+ ```
671
+
672
+ - Get subscriber preferences: `subscriber_preferences(subscriber_id)`
673
+
674
+ ```ruby
675
+ client.subscriber_preferences('<insert-subscriber-id>')
676
+ ```
677
+
678
+ - Update subscriber preference: `update_subscriber_preference(subscriber_id, template_id, body)`
679
+
680
+ ```ruby
681
+ body = {
682
+ 'channel' => {
683
+ # Insert all fields here
684
+ },
685
+ 'enabled' => true
686
+ }
687
+ client.update_subscriber_preference('<insert-subscriber-id>', '<insert-template-id>', body)
688
+ ```
689
+
690
+ - Create bulk subscribers: `bulk_create_subscribers(body)`
691
+ ```ruby
692
+ payload = {
693
+ 'subscribers' => [
694
+ {
695
+ 'name' => 'subscriber-1',
696
+ 'email' => 'user1@example.com',
697
+ 'firstName' => 'test1',
698
+ 'lastName' => 'test1',
699
+ 'phone' => '08122442244',
700
+ 'subscriberId' => 'subscriber-test-1221'
701
+ },
702
+ {
703
+ 'name' => 'subscriber2',
704
+ 'email' => 'user2@example.com',
705
+ 'firstName' => 'test2',
706
+ 'lastName' => 'test2',
707
+ 'phone' => '0814422334',
708
+ 'subscriberId' => 'subscriber-test-9090'
709
+ }
710
+ ]
711
+ }
712
+ client.bulk_create_subscribers(payload)
713
+ ```
714
+
715
+
716
+ - Get in-app notification feed for a particular subscriber: `subscriber_notification_feed(subscriber_id, query = {})`
717
+
718
+ ```ruby
719
+ client.subscriber_notification_feed('<insert-subscriber-id>', {
720
+ 'page' => 3, # optional
721
+ 'limit' => 15, # optional
722
+ 'read' => true, # optional
723
+ 'seen' => true, # optional
724
+ })
725
+ ```
726
+
727
+ - Get the unseen in-app notifications count for subscribers feed: `subscriber_unseen_notification_count(subscriber_id, query = {})`
728
+
729
+ ```ruby
730
+ client.subscriber_unseen_notification_count('<insert-subscriber-id>', {
731
+ 'limit' => 15, # optional
732
+ 'seen' => false, # optional
733
+ })
734
+ ```
735
+
736
+ - Mark a subscriber feed message as seen: `mark_subscriber_feed_seen(subscriber_id, body)`
737
+
738
+ ```ruby
739
+ client.mark_subscriber_feed_seen('<insert-subscriber-id>', {
740
+ 'messageId' => '<insert-message-id>',
741
+ 'mark' => {
742
+ 'seen' => true,
743
+ 'read' => true
744
+ }
745
+ })
746
+ ```
747
+
748
+ - Mark message action as seen: `mark_message_action_seen(subscriber_id, message_id, type)`
749
+
750
+ ```ruby
751
+ client.mark_message_action_seen('<insert-subscriber-id>', '<insert-message-id>', '<insert-type>')
752
+ ```
753
+
754
+ - Marks all the subscriber messages: `mark_all_subscriber_messages(subscriber_id, body)`
755
+
756
+ ```ruby
757
+ body = {
758
+ 'markAs' => 'seen'
759
+ }
760
+ client.mark_all_subscriber_messages('<insert-subscriber-id>', body)
761
+ ```
762
+
763
+ - Handle providers OAUTH redirect: `provider_oauth_redirect(subscriber_id, provider_id, query)`
764
+ ```ruby
765
+ query = {
766
+ 'environmentId' => '<insert-environment-id>',
767
+ 'code' => '<insert-code>',
768
+ 'hmacHash' => '<insert-hmacHash>',
769
+ 'integrationIdentifier' => '<insert-integration-identifier>'
770
+ }
771
+ client.provider_oauth_redirect('<insert-subscriber-id>', '<insert-provider-id>', query)
772
+ ```
773
+
774
+ - Handle chat OAUTH: `chat_oauth(subscriber_id, provider_id, query)`
775
+ ```ruby
776
+ query = {
777
+ 'environmentId' => '<insert-environment-id>',
778
+ 'hmacHash' => '<insert-hmacHash>',
779
+ 'integrationIdentifier' => '<insert-integration-identifier>'
780
+ }
781
+ client.chat_oauth('<insert-subscriber-id>', '<insert-provider-id>', query)
782
+ ```
783
+
784
+ ### Tenants
785
+
786
+ - Tenant create: `create_tenant(body)`
787
+
788
+ ```ruby
789
+ client.create_tenant({
790
+ 'identifier' => '<a-unique-identifier>',
791
+ 'name' => '<name-of-the-tenant>',
792
+ 'data' => {
793
+ 'company' => 'a company',
794
+ 'date-registered' => '2023-0-15'
795
+ }
796
+ })
797
+ ```
798
+
799
+ - Get tenants: `tenants(query = {})`
800
+
801
+ ```ruby
802
+ client.tenants({
803
+ 'page' => 1, # optional
804
+ 'limit' => 10, # optional
805
+ })
806
+ ```
807
+
808
+ - Get tenant: `tenant(identifier)`
809
+
810
+ ```ruby
811
+ client.tenant('<a-unique-identifier>')
812
+ ```
813
+
814
+ - Update tenant: `update_tenant(identifier, body)`
815
+
816
+ ```ruby
817
+ client.update_tenant('<a-unique-identifier>', {
818
+ 'identifier' => '<a-unique-identifier>',
819
+ 'name' => '<name-of-the-tenant>',
820
+ })
821
+ ```
822
+
823
+ - Delete tenant: `delete_tenant(identifier)`
824
+
825
+ ```ruby
826
+ client.delete_tenant('<a-unique-identifier>')
827
+ ```
828
+
829
+ ### Topics
830
+
831
+ - Topic creation: `create_topic(body)`
832
+
833
+ ```ruby
834
+ client.create_topic({
835
+ 'key' => 'key',
836
+ 'name' => 'name'
837
+ })
838
+ ```
839
+
840
+ - Filter topics: `topics(query = {})`
841
+
842
+ ```ruby
843
+ client.topics({
844
+ 'name' => 'name', # optional
845
+ 'page' => 1, # optional
846
+ 'pageSize' => 10, # optional
847
+ })
848
+ ```
849
+
850
+ - Subscribers addition: `add_subscribers(topic_key, body)`
851
+
852
+ ```ruby
853
+ client.add_subscribers('<insert-topic-key>', {
854
+ 'subscribers' => ['<insert-list-of-subscribers>']
855
+ })
856
+ ```
857
+
858
+ - `remove_subscribers(topic_key, body)`
859
+
860
+ ```ruby
861
+ client.
862
+ ```
863
+
864
+ - Get topic: `topic(topic_key)`
865
+
866
+ ```ruby
867
+ client.topic('<insert-topic-key>')
868
+ ```
869
+
870
+ - Rename a topic: `rename_topic(topic_key, body)`
871
+
872
+ ```ruby
873
+ client.rename_topic('<insert-topic-key>', {
874
+ 'name' => 'new name'
875
+ })
876
+ ```
877
+
878
+ - Delete topic: `delete_topic(topic_key)`
879
+
880
+ ```ruby
881
+ client.delete_topic('<insert-topic-key>')
882
+ ```
883
+
884
+ - Check topic subsriber: `subscriber_topic(topic_key, externalSubscriberId)`
885
+
886
+ ```ruby
887
+ client.subscriber_topic('<insert-topic-key>', '<insert-externalSubscriberId>')
888
+ ```
889
+
890
+ ### Idempotent Request
891
+
892
+ This SDK allows you to perform idempotent requests, that is safely retrying requests without accidentally performing the same operation twice.
893
+ To achieve this, provide an `idempotency_key` argument during initialization of the TELEFLOW client. We strongly recommend that you use [UUID](https://datatracker.ietf.org/doc/html/rfc4122) format when you're generating your idempotency key.
894
+
895
+ ```ruby
896
+ client = Teleflow::Client.new(
897
+ access_token: '<your-teleflow-api_key>',
898
+ idempotency_key: '<your-idempotency-key>'
899
+ )
900
+ ```
901
+
902
+ ### Exponential Retry Mechanism
903
+
904
+ You can configure this SDK to retry failed requests. This is done by using [Exponential backoff strategy](https://en.wikipedia.org/wiki/Exponential_backoff). It is a common algorithm for retrying requests. The retries gradually extend the waiting time until reaching a specific limit. The concept is to prevent overloading the server with simultaneous requests once it is back online, especially in cases of temporary downtime.
905
+
906
+ ```ruby
907
+ client = Teleflow::Client.new(
908
+ access_token: '<your-teleflow-api_key>',
909
+ idempotency_key: '<your-idempotency-key>',
910
+ enable_retry: true, # it is disabled by default,
911
+ retry_config: {
912
+ max_retries: 3,
913
+ initial_delay: 4,
914
+ max_delay: 60
915
+ }
916
+ )
917
+ ```
918
+
919
+ ## The retry configuration is explained in the following table:
920
+ | Options | Detail | Default Value | Data Type |
921
+ | ------------- | -------------------------------------------------------------------| --------------- | --------- |
922
+ | max_retries | Specifies total number of retries to perform in case of failure | 1 | Integer |
923
+ | initial_delay | Specifies the minimum time to wait before retrying (in seconds) | 4 | Integer |
924
+ | max_delay | Specifies the maximum time to wait before retrying (in seconds) | 60 | Integer |
925
+ | enable_retry | enabling/disable the Exponential Retry mechanism | false | Boolean |
926
+
927
+
928
+ ### Custom backend URL
929
+
930
+ To use a custom backend URL, for example to be able to use the EU Teleflow API, you can pass a custom `backend_url` when initializing the client.
931
+
932
+ ```ruby
933
+ client = Teleflow::Client.new(
934
+ access_token: '<your-teleflow-api_key>',
935
+ backend_url: 'https://eu.api-teleflow.khulnasoft.com/v1'
936
+ )
937
+ ```
938
+
939
+ ### For more information about these methods and their parameters, see the [API documentation](https://docs.teleflow.khulnasoft.com/api-reference).
940
+
941
+ ## Contributing
942
+
943
+ Bug reports and pull requests are welcome [here.](https://github.com/nxpkg/teleflow-ruby)
944
+
945
+ ## Support and Feedback
946
+
947
+ Be sure to visit the Teleflow official [documentation website](https://docs.teleflow.khulnasoft.com/docs) for additional information about our API.
948
+ If you need additional assistance, join our Discord server [here](https://discord.teleflow.khulnasoft.com).
949
+
950
+ ## License
951
+
952
+ Teleflow Ruby SDK is licensed under the MIT License - see the [LICENSE](https://github.com/nxpkg/teleflow-ruby/blob/main/LICENSE.txt) file for details.