trophy_api_client 1.8.0 → 1.9.1
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.
- checksums.yaml +4 -4
- data/lib/gemconfig.rb +1 -1
- data/lib/requests.rb +34 -8
- data/lib/trophy_api_client/achievements/client.rb +4 -0
- data/lib/trophy_api_client/admin/attributes/client.rb +10 -0
- data/lib/trophy_api_client/admin/client.rb +7 -0
- data/lib/trophy_api_client/admin/leaderboards/client.rb +10 -0
- data/lib/trophy_api_client/admin/metrics/client.rb +10 -0
- data/lib/trophy_api_client/admin/points/boosts/client.rb +10 -0
- data/lib/trophy_api_client/admin/points/levels/client.rb +10 -0
- data/lib/trophy_api_client/admin/points/systems/client.rb +10 -0
- data/lib/trophy_api_client/admin/points/triggers/client.rb +10 -0
- data/lib/trophy_api_client/admin/streaks/client.rb +2 -0
- data/lib/trophy_api_client/admin/streaks/freezes/client.rb +2 -0
- data/lib/trophy_api_client/admin/tenants/client.rb +376 -0
- data/lib/trophy_api_client/leaderboards/client.rb +4 -0
- data/lib/trophy_api_client/metrics/client.rb +2 -0
- data/lib/trophy_api_client/points/client.rb +10 -0
- data/lib/trophy_api_client/streaks/client.rb +4 -0
- data/lib/trophy_api_client/types/admin_points_boost.rb +2 -2
- data/lib/trophy_api_client/types/admin_tenant.rb +103 -0
- data/lib/trophy_api_client/types/admin_tenant_status.rb +9 -0
- data/lib/trophy_api_client/types/create_tenant_request_item.rb +66 -0
- data/lib/trophy_api_client/types/create_tenants_request.rb +7 -0
- data/lib/trophy_api_client/types/create_tenants_response.rb +74 -0
- data/lib/trophy_api_client/types/delete_tenants_response.rb +74 -0
- data/lib/trophy_api_client/types/list_tenants_response.rb +7 -0
- data/lib/trophy_api_client/types/update_tenant_request_item.rb +75 -0
- data/lib/trophy_api_client/types/update_tenants_request.rb +7 -0
- data/lib/trophy_api_client/types/update_tenants_response.rb +74 -0
- data/lib/trophy_api_client/users/client.rb +32 -0
- data/lib/trophy_api_client/version.rb +1 -1
- data/lib/trophy_api_client.rb +12 -4
- data/lib/types_export.rb +10 -0
- metadata +13 -2
|
@@ -54,6 +54,7 @@ module TrophyApiClient
|
|
|
54
54
|
response = @request_client.conn.post do |req|
|
|
55
55
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
56
56
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
57
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
57
58
|
req.headers = {
|
|
58
59
|
**(req.headers || {}),
|
|
59
60
|
**@request_client.get_headers,
|
|
@@ -84,6 +85,7 @@ module TrophyApiClient
|
|
|
84
85
|
response = @request_client.conn.get do |req|
|
|
85
86
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
86
87
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
88
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
87
89
|
req.headers = {
|
|
88
90
|
**(req.headers || {}),
|
|
89
91
|
**@request_client.get_headers,
|
|
@@ -123,6 +125,7 @@ module TrophyApiClient
|
|
|
123
125
|
response = @request_client.conn.put do |req|
|
|
124
126
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
125
127
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
128
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
126
129
|
req.headers = {
|
|
127
130
|
**(req.headers || {}),
|
|
128
131
|
**@request_client.get_headers,
|
|
@@ -160,6 +163,7 @@ module TrophyApiClient
|
|
|
160
163
|
response = @request_client.conn.patch do |req|
|
|
161
164
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
162
165
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
166
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
163
167
|
req.headers = {
|
|
164
168
|
**(req.headers || {}),
|
|
165
169
|
**@request_client.get_headers,
|
|
@@ -190,6 +194,7 @@ module TrophyApiClient
|
|
|
190
194
|
response = @request_client.conn.get do |req|
|
|
191
195
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
192
196
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
197
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
193
198
|
req.headers = {
|
|
194
199
|
**(req.headers || {}),
|
|
195
200
|
**@request_client.get_headers,
|
|
@@ -227,6 +232,7 @@ module TrophyApiClient
|
|
|
227
232
|
response = @request_client.conn.patch do |req|
|
|
228
233
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
229
234
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
235
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
230
236
|
req.headers = {
|
|
231
237
|
**(req.headers || {}),
|
|
232
238
|
**@request_client.get_headers,
|
|
@@ -257,6 +263,7 @@ module TrophyApiClient
|
|
|
257
263
|
response = @request_client.conn.get do |req|
|
|
258
264
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
259
265
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
266
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
260
267
|
req.headers = {
|
|
261
268
|
**(req.headers || {}),
|
|
262
269
|
**@request_client.get_headers,
|
|
@@ -294,6 +301,7 @@ module TrophyApiClient
|
|
|
294
301
|
response = @request_client.conn.get do |req|
|
|
295
302
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
296
303
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
304
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
297
305
|
req.headers = {
|
|
298
306
|
**(req.headers || {}),
|
|
299
307
|
**@request_client.get_headers,
|
|
@@ -339,6 +347,7 @@ module TrophyApiClient
|
|
|
339
347
|
response = @request_client.conn.get do |req|
|
|
340
348
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
341
349
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
350
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
342
351
|
req.headers = {
|
|
343
352
|
**(req.headers || {}),
|
|
344
353
|
**@request_client.get_headers,
|
|
@@ -382,6 +391,7 @@ module TrophyApiClient
|
|
|
382
391
|
response = @request_client.conn.get do |req|
|
|
383
392
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
384
393
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
394
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
385
395
|
req.headers = {
|
|
386
396
|
**(req.headers || {}),
|
|
387
397
|
**@request_client.get_headers,
|
|
@@ -422,6 +432,7 @@ module TrophyApiClient
|
|
|
422
432
|
response = @request_client.conn.get do |req|
|
|
423
433
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
424
434
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
435
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
425
436
|
req.headers = {
|
|
426
437
|
**(req.headers || {}),
|
|
427
438
|
**@request_client.get_headers,
|
|
@@ -461,6 +472,7 @@ module TrophyApiClient
|
|
|
461
472
|
response = @request_client.conn.get do |req|
|
|
462
473
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
463
474
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
475
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
464
476
|
req.headers = {
|
|
465
477
|
**(req.headers || {}),
|
|
466
478
|
**@request_client.get_headers,
|
|
@@ -494,6 +506,7 @@ module TrophyApiClient
|
|
|
494
506
|
response = @request_client.conn.get do |req|
|
|
495
507
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
496
508
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
509
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
497
510
|
req.headers = {
|
|
498
511
|
**(req.headers || {}),
|
|
499
512
|
**@request_client.get_headers,
|
|
@@ -544,6 +557,7 @@ module TrophyApiClient
|
|
|
544
557
|
response = @request_client.conn.get do |req|
|
|
545
558
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
546
559
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
560
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
547
561
|
req.headers = {
|
|
548
562
|
**(req.headers || {}),
|
|
549
563
|
**@request_client.get_headers,
|
|
@@ -593,6 +607,7 @@ module TrophyApiClient
|
|
|
593
607
|
response = @request_client.conn.get do |req|
|
|
594
608
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
595
609
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
610
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
596
611
|
req.headers = {
|
|
597
612
|
**(req.headers || {}),
|
|
598
613
|
**@request_client.get_headers,
|
|
@@ -630,6 +645,7 @@ module TrophyApiClient
|
|
|
630
645
|
response = @request_client.conn.get do |req|
|
|
631
646
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
632
647
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
648
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
633
649
|
req.headers = {
|
|
634
650
|
**(req.headers || {}),
|
|
635
651
|
**@request_client.get_headers,
|
|
@@ -679,6 +695,7 @@ module TrophyApiClient
|
|
|
679
695
|
response = @request_client.conn.post do |req|
|
|
680
696
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
681
697
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
698
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
682
699
|
req.headers = {
|
|
683
700
|
**(req.headers || {}),
|
|
684
701
|
**@request_client.get_headers,
|
|
@@ -711,6 +728,7 @@ module TrophyApiClient
|
|
|
711
728
|
response = @request_client.conn.get do |req|
|
|
712
729
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
713
730
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
731
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
714
732
|
req.headers = {
|
|
715
733
|
**(req.headers || {}),
|
|
716
734
|
**@request_client.get_headers,
|
|
@@ -752,6 +770,7 @@ module TrophyApiClient
|
|
|
752
770
|
response = @request_client.conn.put do |req|
|
|
753
771
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
754
772
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
773
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
755
774
|
req.headers = {
|
|
756
775
|
**(req.headers || {}),
|
|
757
776
|
**@request_client.get_headers,
|
|
@@ -791,6 +810,7 @@ module TrophyApiClient
|
|
|
791
810
|
response = @request_client.conn.patch do |req|
|
|
792
811
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
793
812
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
813
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
794
814
|
req.headers = {
|
|
795
815
|
**(req.headers || {}),
|
|
796
816
|
**@request_client.get_headers,
|
|
@@ -823,6 +843,7 @@ module TrophyApiClient
|
|
|
823
843
|
response = @request_client.conn.get do |req|
|
|
824
844
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
825
845
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
846
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
826
847
|
req.headers = {
|
|
827
848
|
**(req.headers || {}),
|
|
828
849
|
**@request_client.get_headers,
|
|
@@ -863,6 +884,7 @@ module TrophyApiClient
|
|
|
863
884
|
response = @request_client.conn.patch do |req|
|
|
864
885
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
865
886
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
887
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
866
888
|
req.headers = {
|
|
867
889
|
**(req.headers || {}),
|
|
868
890
|
**@request_client.get_headers,
|
|
@@ -896,6 +918,7 @@ module TrophyApiClient
|
|
|
896
918
|
response = @request_client.conn.get do |req|
|
|
897
919
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
898
920
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
921
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
899
922
|
req.headers = {
|
|
900
923
|
**(req.headers || {}),
|
|
901
924
|
**@request_client.get_headers,
|
|
@@ -935,6 +958,7 @@ module TrophyApiClient
|
|
|
935
958
|
response = @request_client.conn.get do |req|
|
|
936
959
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
937
960
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
961
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
938
962
|
req.headers = {
|
|
939
963
|
**(req.headers || {}),
|
|
940
964
|
**@request_client.get_headers,
|
|
@@ -982,6 +1006,7 @@ module TrophyApiClient
|
|
|
982
1006
|
response = @request_client.conn.get do |req|
|
|
983
1007
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
984
1008
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
1009
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
985
1010
|
req.headers = {
|
|
986
1011
|
**(req.headers || {}),
|
|
987
1012
|
**@request_client.get_headers,
|
|
@@ -1027,6 +1052,7 @@ module TrophyApiClient
|
|
|
1027
1052
|
response = @request_client.conn.get do |req|
|
|
1028
1053
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
1029
1054
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
1055
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
1030
1056
|
req.headers = {
|
|
1031
1057
|
**(req.headers || {}),
|
|
1032
1058
|
**@request_client.get_headers,
|
|
@@ -1069,6 +1095,7 @@ module TrophyApiClient
|
|
|
1069
1095
|
response = @request_client.conn.get do |req|
|
|
1070
1096
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
1071
1097
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
1098
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
1072
1099
|
req.headers = {
|
|
1073
1100
|
**(req.headers || {}),
|
|
1074
1101
|
**@request_client.get_headers,
|
|
@@ -1110,6 +1137,7 @@ module TrophyApiClient
|
|
|
1110
1137
|
response = @request_client.conn.get do |req|
|
|
1111
1138
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
1112
1139
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
1140
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
1113
1141
|
req.headers = {
|
|
1114
1142
|
**(req.headers || {}),
|
|
1115
1143
|
**@request_client.get_headers,
|
|
@@ -1145,6 +1173,7 @@ module TrophyApiClient
|
|
|
1145
1173
|
response = @request_client.conn.get do |req|
|
|
1146
1174
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
1147
1175
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
1176
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
1148
1177
|
req.headers = {
|
|
1149
1178
|
**(req.headers || {}),
|
|
1150
1179
|
**@request_client.get_headers,
|
|
@@ -1197,6 +1226,7 @@ module TrophyApiClient
|
|
|
1197
1226
|
response = @request_client.conn.get do |req|
|
|
1198
1227
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
1199
1228
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
1229
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
1200
1230
|
req.headers = {
|
|
1201
1231
|
**(req.headers || {}),
|
|
1202
1232
|
**@request_client.get_headers,
|
|
@@ -1248,6 +1278,7 @@ module TrophyApiClient
|
|
|
1248
1278
|
response = @request_client.conn.get do |req|
|
|
1249
1279
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
1250
1280
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
1281
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
1251
1282
|
req.headers = {
|
|
1252
1283
|
**(req.headers || {}),
|
|
1253
1284
|
**@request_client.get_headers,
|
|
@@ -1287,6 +1318,7 @@ module TrophyApiClient
|
|
|
1287
1318
|
response = @request_client.conn.get do |req|
|
|
1288
1319
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
1289
1320
|
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
1321
|
+
req.headers["Tenant-ID"] = request_options.tenant_id unless request_options&.tenant_id.nil?
|
|
1290
1322
|
req.headers = {
|
|
1291
1323
|
**(req.headers || {}),
|
|
1292
1324
|
**@request_client.get_headers,
|
data/lib/trophy_api_client.rb
CHANGED
|
@@ -33,15 +33,19 @@ module TrophyApiClient
|
|
|
33
33
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
|
34
34
|
# @param timeout_in_seconds [Long]
|
|
35
35
|
# @param api_key [String]
|
|
36
|
+
# @param tenant_id [String] The tenant identifier for multi-tenant organisations. Required when the
|
|
37
|
+
# organisation has multi-tenancy enabled. The value should be your internal ID for
|
|
38
|
+
# the tenant. Ignored for single-tenant organisations.
|
|
36
39
|
# @return [TrophyApiClient::Client]
|
|
37
40
|
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::PRODUCTION, max_retries: nil,
|
|
38
|
-
timeout_in_seconds: nil)
|
|
41
|
+
timeout_in_seconds: nil, tenant_id: nil)
|
|
39
42
|
@request_client = TrophyApiClient::RequestClient.new(
|
|
40
43
|
base_url: base_url,
|
|
41
44
|
environment: environment,
|
|
42
45
|
max_retries: max_retries,
|
|
43
46
|
timeout_in_seconds: timeout_in_seconds,
|
|
44
|
-
api_key: api_key
|
|
47
|
+
api_key: api_key,
|
|
48
|
+
tenant_id: tenant_id
|
|
45
49
|
)
|
|
46
50
|
@achievements = TrophyApiClient::AchievementsClient.new(request_client: @request_client)
|
|
47
51
|
@metrics = TrophyApiClient::MetricsClient.new(request_client: @request_client)
|
|
@@ -74,15 +78,19 @@ module TrophyApiClient
|
|
|
74
78
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
|
75
79
|
# @param timeout_in_seconds [Long]
|
|
76
80
|
# @param api_key [String]
|
|
81
|
+
# @param tenant_id [String] The tenant identifier for multi-tenant organisations. Required when the
|
|
82
|
+
# organisation has multi-tenancy enabled. The value should be your internal ID for
|
|
83
|
+
# the tenant. Ignored for single-tenant organisations.
|
|
77
84
|
# @return [TrophyApiClient::AsyncClient]
|
|
78
85
|
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::PRODUCTION, max_retries: nil,
|
|
79
|
-
timeout_in_seconds: nil)
|
|
86
|
+
timeout_in_seconds: nil, tenant_id: nil)
|
|
80
87
|
@async_request_client = TrophyApiClient::AsyncRequestClient.new(
|
|
81
88
|
base_url: base_url,
|
|
82
89
|
environment: environment,
|
|
83
90
|
max_retries: max_retries,
|
|
84
91
|
timeout_in_seconds: timeout_in_seconds,
|
|
85
|
-
api_key: api_key
|
|
92
|
+
api_key: api_key,
|
|
93
|
+
tenant_id: tenant_id
|
|
86
94
|
)
|
|
87
95
|
@achievements = TrophyApiClient::AsyncAchievementsClient.new(request_client: @async_request_client)
|
|
88
96
|
@metrics = TrophyApiClient::AsyncMetricsClient.new(request_client: @async_request_client)
|
data/lib/types_export.rb
CHANGED
|
@@ -208,3 +208,13 @@ require_relative "trophy_api_client/types/update_points_systems_request"
|
|
|
208
208
|
require_relative "trophy_api_client/types/update_points_system_request_item_badge"
|
|
209
209
|
require_relative "trophy_api_client/types/update_points_systems_response"
|
|
210
210
|
require_relative "trophy_api_client/types/delete_points_systems_response"
|
|
211
|
+
require_relative "trophy_api_client/types/admin_tenant_status"
|
|
212
|
+
require_relative "trophy_api_client/types/admin_tenant"
|
|
213
|
+
require_relative "trophy_api_client/types/list_tenants_response"
|
|
214
|
+
require_relative "trophy_api_client/types/create_tenant_request_item"
|
|
215
|
+
require_relative "trophy_api_client/types/create_tenants_request"
|
|
216
|
+
require_relative "trophy_api_client/types/create_tenants_response"
|
|
217
|
+
require_relative "trophy_api_client/types/update_tenant_request_item"
|
|
218
|
+
require_relative "trophy_api_client/types/update_tenants_request"
|
|
219
|
+
require_relative "trophy_api_client/types/update_tenants_response"
|
|
220
|
+
require_relative "trophy_api_client/types/delete_tenants_response"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trophy_api_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Trophy Labs, Inc
|
|
@@ -113,6 +113,7 @@ files:
|
|
|
113
113
|
- lib/trophy_api_client/admin/streaks/freezes/client.rb
|
|
114
114
|
- lib/trophy_api_client/admin/streaks/freezes/types/create_streak_freezes_request_freezes_item.rb
|
|
115
115
|
- lib/trophy_api_client/admin/streaks/types/restore_streaks_request_users_item.rb
|
|
116
|
+
- lib/trophy_api_client/admin/tenants/client.rb
|
|
116
117
|
- lib/trophy_api_client/leaderboards/client.rb
|
|
117
118
|
- lib/trophy_api_client/leaderboards/types/leaderboards_all_response_item.rb
|
|
118
119
|
- lib/trophy_api_client/leaderboards/types/leaderboards_all_response_item_status.rb
|
|
@@ -150,6 +151,8 @@ files:
|
|
|
150
151
|
- lib/trophy_api_client/types/admin_points_trigger_time_unit.rb
|
|
151
152
|
- lib/trophy_api_client/types/admin_points_trigger_type.rb
|
|
152
153
|
- lib/trophy_api_client/types/admin_points_trigger_user_attributes_item.rb
|
|
154
|
+
- lib/trophy_api_client/types/admin_tenant.rb
|
|
155
|
+
- lib/trophy_api_client/types/admin_tenant_status.rb
|
|
153
156
|
- lib/trophy_api_client/types/base_streak_response.rb
|
|
154
157
|
- lib/trophy_api_client/types/bulk_streak_response.rb
|
|
155
158
|
- lib/trophy_api_client/types/bulk_streak_response_item.rb
|
|
@@ -189,6 +192,9 @@ files:
|
|
|
189
192
|
- lib/trophy_api_client/types/create_points_triggers_request.rb
|
|
190
193
|
- lib/trophy_api_client/types/create_points_triggers_response.rb
|
|
191
194
|
- lib/trophy_api_client/types/create_streak_freezes_response.rb
|
|
195
|
+
- lib/trophy_api_client/types/create_tenant_request_item.rb
|
|
196
|
+
- lib/trophy_api_client/types/create_tenants_request.rb
|
|
197
|
+
- lib/trophy_api_client/types/create_tenants_response.rb
|
|
192
198
|
- lib/trophy_api_client/types/created_admin_points_system.rb
|
|
193
199
|
- lib/trophy_api_client/types/created_metric.rb
|
|
194
200
|
- lib/trophy_api_client/types/created_metric_unit_type.rb
|
|
@@ -199,6 +205,7 @@ files:
|
|
|
199
205
|
- lib/trophy_api_client/types/delete_points_levels_response.rb
|
|
200
206
|
- lib/trophy_api_client/types/delete_points_systems_response.rb
|
|
201
207
|
- lib/trophy_api_client/types/delete_points_triggers_response.rb
|
|
208
|
+
- lib/trophy_api_client/types/delete_tenants_response.rb
|
|
202
209
|
- lib/trophy_api_client/types/deleted_resource.rb
|
|
203
210
|
- lib/trophy_api_client/types/error_body.rb
|
|
204
211
|
- lib/trophy_api_client/types/event_response.rb
|
|
@@ -217,6 +224,7 @@ files:
|
|
|
217
224
|
- lib/trophy_api_client/types/list_points_levels_response.rb
|
|
218
225
|
- lib/trophy_api_client/types/list_points_systems_response.rb
|
|
219
226
|
- lib/trophy_api_client/types/list_points_triggers_response.rb
|
|
227
|
+
- lib/trophy_api_client/types/list_tenants_response.rb
|
|
220
228
|
- lib/trophy_api_client/types/metric_event_leaderboard_response.rb
|
|
221
229
|
- lib/trophy_api_client/types/metric_event_leaderboard_response_breakdown_attribute_values_item.rb
|
|
222
230
|
- lib/trophy_api_client/types/metric_event_points_response.rb
|
|
@@ -284,6 +292,9 @@ files:
|
|
|
284
292
|
- lib/trophy_api_client/types/update_points_system_request_item_badge.rb
|
|
285
293
|
- lib/trophy_api_client/types/update_points_systems_request.rb
|
|
286
294
|
- lib/trophy_api_client/types/update_points_systems_response.rb
|
|
295
|
+
- lib/trophy_api_client/types/update_tenant_request_item.rb
|
|
296
|
+
- lib/trophy_api_client/types/update_tenants_request.rb
|
|
297
|
+
- lib/trophy_api_client/types/update_tenants_response.rb
|
|
287
298
|
- lib/trophy_api_client/types/updated_user.rb
|
|
288
299
|
- lib/trophy_api_client/types/upserted_user.rb
|
|
289
300
|
- lib/trophy_api_client/types/user.rb
|
|
@@ -346,7 +357,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
346
357
|
- !ruby/object:Gem::Version
|
|
347
358
|
version: '0'
|
|
348
359
|
requirements: []
|
|
349
|
-
rubygems_version: 4.0.
|
|
360
|
+
rubygems_version: 4.0.10
|
|
350
361
|
specification_version: 4
|
|
351
362
|
summary: Ruby library for the Trophy API.
|
|
352
363
|
test_files: []
|