trophy_api_client 1.0.26 → 1.0.28
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/environment.rb +1 -1
- data/lib/gemconfig.rb +1 -1
- data/lib/requests.rb +8 -8
- data/lib/trophy_api_client/achievements/client.rb +10 -8
- data/lib/trophy_api_client/admin/client.rb +30 -0
- data/lib/trophy_api_client/admin/streaks/client.rb +32 -0
- data/lib/trophy_api_client/admin/streaks/freezes/client.rb +98 -0
- data/lib/trophy_api_client/admin/streaks/freezes/types/create_streak_freezes_request_freezes_item.rb +62 -0
- data/lib/trophy_api_client/leaderboards/client.rb +8 -8
- data/lib/trophy_api_client/metrics/client.rb +4 -4
- data/lib/trophy_api_client/points/client.rb +8 -8
- data/lib/trophy_api_client/streaks/client.rb +8 -8
- data/lib/trophy_api_client/types/base_streak_response.rb +42 -2
- data/lib/trophy_api_client/types/bulk_insert_issue.rb +74 -0
- data/lib/trophy_api_client/types/bulk_insert_issue_level.rb +9 -0
- data/lib/trophy_api_client/types/create_streak_freezes_response.rb +60 -0
- data/lib/trophy_api_client/types/leaderboard_event.rb +8 -8
- data/lib/trophy_api_client/types/metric_event_streak_response.rb +42 -2
- data/lib/trophy_api_client/types/streak_response.rb +42 -2
- data/lib/trophy_api_client/types/streak_response_streak_history_item.rb +18 -2
- data/lib/trophy_api_client/users/client.rb +60 -48
- data/lib/trophy_api_client/version.rb +1 -1
- data/lib/trophy_api_client.rb +9 -2
- data/lib/types_export.rb +4 -0
- metadata +8 -1
@@ -42,7 +42,7 @@ module TrophyApiClient
|
|
42
42
|
# @example
|
43
43
|
# api = TrophyApiClient::Client.new(
|
44
44
|
# base_url: "https://api.example.com",
|
45
|
-
# environment: TrophyApiClient::Environment::
|
45
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
46
46
|
# api_key: "YOUR_API_KEY"
|
47
47
|
# )
|
48
48
|
# api.users.create(request: { id: "user-id" })
|
@@ -59,7 +59,7 @@ module TrophyApiClient
|
|
59
59
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
60
60
|
end
|
61
61
|
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
62
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users"
|
62
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users"
|
63
63
|
end
|
64
64
|
TrophyApiClient::User.from_json(json_object: response.body)
|
65
65
|
end
|
@@ -72,7 +72,7 @@ module TrophyApiClient
|
|
72
72
|
# @example
|
73
73
|
# api = TrophyApiClient::Client.new(
|
74
74
|
# base_url: "https://api.example.com",
|
75
|
-
# environment: TrophyApiClient::Environment::
|
75
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
76
76
|
# api_key: "YOUR_API_KEY"
|
77
77
|
# )
|
78
78
|
# api.users.get(id: "userId")
|
@@ -91,7 +91,7 @@ module TrophyApiClient
|
|
91
91
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
92
92
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
93
93
|
end
|
94
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}"
|
94
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}"
|
95
95
|
end
|
96
96
|
TrophyApiClient::User.from_json(json_object: response.body)
|
97
97
|
end
|
@@ -111,7 +111,7 @@ module TrophyApiClient
|
|
111
111
|
# @example
|
112
112
|
# api = TrophyApiClient::Client.new(
|
113
113
|
# base_url: "https://api.example.com",
|
114
|
-
# environment: TrophyApiClient::Environment::
|
114
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
115
115
|
# api_key: "YOUR_API_KEY"
|
116
116
|
# )
|
117
117
|
# api.users.identify(id: "id", request: { email: "user@example.com", tz: "Europe/London", attributes: { "department": "engineering", "role": "developer" } })
|
@@ -128,7 +128,7 @@ module TrophyApiClient
|
|
128
128
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
129
129
|
end
|
130
130
|
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
131
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}"
|
131
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}"
|
132
132
|
end
|
133
133
|
TrophyApiClient::User.from_json(json_object: response.body)
|
134
134
|
end
|
@@ -148,7 +148,7 @@ module TrophyApiClient
|
|
148
148
|
# @example
|
149
149
|
# api = TrophyApiClient::Client.new(
|
150
150
|
# base_url: "https://api.example.com",
|
151
|
-
# environment: TrophyApiClient::Environment::
|
151
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
152
152
|
# api_key: "YOUR_API_KEY"
|
153
153
|
# )
|
154
154
|
# api.users.update(id: "id", request: { email: "user@example.com", tz: "Europe/London", attributes: { "department": "engineering", "role": "developer" } })
|
@@ -165,7 +165,7 @@ module TrophyApiClient
|
|
165
165
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
166
166
|
end
|
167
167
|
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
168
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}"
|
168
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}"
|
169
169
|
end
|
170
170
|
TrophyApiClient::User.from_json(json_object: response.body)
|
171
171
|
end
|
@@ -178,7 +178,7 @@ module TrophyApiClient
|
|
178
178
|
# @example
|
179
179
|
# api = TrophyApiClient::Client.new(
|
180
180
|
# base_url: "https://api.example.com",
|
181
|
-
# environment: TrophyApiClient::Environment::
|
181
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
182
182
|
# api_key: "YOUR_API_KEY"
|
183
183
|
# )
|
184
184
|
# api.users.all_metrics(id: "userId")
|
@@ -197,7 +197,7 @@ module TrophyApiClient
|
|
197
197
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
198
198
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
199
199
|
end
|
200
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}/metrics"
|
200
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}/metrics"
|
201
201
|
end
|
202
202
|
parsed_json = JSON.parse(response.body)
|
203
203
|
parsed_json&.map do |item|
|
@@ -215,7 +215,7 @@ module TrophyApiClient
|
|
215
215
|
# @example
|
216
216
|
# api = TrophyApiClient::Client.new(
|
217
217
|
# base_url: "https://api.example.com",
|
218
|
-
# environment: TrophyApiClient::Environment::
|
218
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
219
219
|
# api_key: "YOUR_API_KEY"
|
220
220
|
# )
|
221
221
|
# api.users.single_metric(id: "userId", key: "key")
|
@@ -234,7 +234,8 @@ module TrophyApiClient
|
|
234
234
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
235
235
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
236
236
|
end
|
237
|
-
req.url "#{@request_client.get_url(
|
237
|
+
req.url "#{@request_client.get_url(environment: api,
|
238
|
+
request_options: request_options)}/users/#{id}/metrics/#{key}"
|
238
239
|
end
|
239
240
|
TrophyApiClient::MetricResponse.from_json(json_object: response.body)
|
240
241
|
end
|
@@ -253,7 +254,7 @@ module TrophyApiClient
|
|
253
254
|
# @example
|
254
255
|
# api = TrophyApiClient::Client.new(
|
255
256
|
# base_url: "https://api.example.com",
|
256
|
-
# environment: TrophyApiClient::Environment::
|
257
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
257
258
|
# api_key: "YOUR_API_KEY"
|
258
259
|
# )
|
259
260
|
# api.users.metric_event_summary(
|
@@ -281,7 +282,8 @@ module TrophyApiClient
|
|
281
282
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
282
283
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
283
284
|
end
|
284
|
-
req.url "#{@request_client.get_url(
|
285
|
+
req.url "#{@request_client.get_url(environment: api,
|
286
|
+
request_options: request_options)}/users/#{id}/metrics/#{key}/event-summary"
|
285
287
|
end
|
286
288
|
parsed_json = JSON.parse(response.body)
|
287
289
|
parsed_json&.map do |item|
|
@@ -301,7 +303,7 @@ module TrophyApiClient
|
|
301
303
|
# @example
|
302
304
|
# api = TrophyApiClient::Client.new(
|
303
305
|
# base_url: "https://api.example.com",
|
304
|
-
# environment: TrophyApiClient::Environment::
|
306
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
305
307
|
# api_key: "YOUR_API_KEY"
|
306
308
|
# )
|
307
309
|
# api.users.achievements(id: "userId")
|
@@ -321,7 +323,8 @@ module TrophyApiClient
|
|
321
323
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
322
324
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
323
325
|
end
|
324
|
-
req.url "#{@request_client.get_url(
|
326
|
+
req.url "#{@request_client.get_url(environment: api,
|
327
|
+
request_options: request_options)}/users/#{id}/achievements"
|
325
328
|
end
|
326
329
|
parsed_json = JSON.parse(response.body)
|
327
330
|
parsed_json&.map do |item|
|
@@ -340,7 +343,7 @@ module TrophyApiClient
|
|
340
343
|
# @example
|
341
344
|
# api = TrophyApiClient::Client.new(
|
342
345
|
# base_url: "https://api.example.com",
|
343
|
-
# environment: TrophyApiClient::Environment::
|
346
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
344
347
|
# api_key: "YOUR_API_KEY"
|
345
348
|
# )
|
346
349
|
# api.users.streak(id: "userId")
|
@@ -360,7 +363,7 @@ module TrophyApiClient
|
|
360
363
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
361
364
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
362
365
|
end
|
363
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}/streak"
|
366
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}/streak"
|
364
367
|
end
|
365
368
|
TrophyApiClient::StreakResponse.from_json(json_object: response.body)
|
366
369
|
end
|
@@ -375,7 +378,7 @@ module TrophyApiClient
|
|
375
378
|
# @example
|
376
379
|
# api = TrophyApiClient::Client.new(
|
377
380
|
# base_url: "https://api.example.com",
|
378
|
-
# environment: TrophyApiClient::Environment::
|
381
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
379
382
|
# api_key: "YOUR_API_KEY"
|
380
383
|
# )
|
381
384
|
# api.users.points(id: "userId", key: "points-system-key")
|
@@ -392,7 +395,8 @@ module TrophyApiClient
|
|
392
395
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
393
396
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
394
397
|
end
|
395
|
-
req.url "#{@request_client.get_url(
|
398
|
+
req.url "#{@request_client.get_url(environment: api,
|
399
|
+
request_options: request_options)}/users/#{id}/points/#{key}"
|
396
400
|
end
|
397
401
|
TrophyApiClient::GetUserPointsResponse.from_json(json_object: response.body)
|
398
402
|
end
|
@@ -412,7 +416,7 @@ module TrophyApiClient
|
|
412
416
|
# @example
|
413
417
|
# api = TrophyApiClient::Client.new(
|
414
418
|
# base_url: "https://api.example.com",
|
415
|
-
# environment: TrophyApiClient::Environment::
|
419
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
416
420
|
# api_key: "YOUR_API_KEY"
|
417
421
|
# )
|
418
422
|
# api.users.points_event_summary(
|
@@ -440,7 +444,8 @@ module TrophyApiClient
|
|
440
444
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
441
445
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
442
446
|
end
|
443
|
-
req.url "#{@request_client.get_url(
|
447
|
+
req.url "#{@request_client.get_url(environment: api,
|
448
|
+
request_options: request_options)}/users/#{id}/points/#{key}/event-summary"
|
444
449
|
end
|
445
450
|
parsed_json = JSON.parse(response.body)
|
446
451
|
parsed_json&.map do |item|
|
@@ -460,7 +465,7 @@ module TrophyApiClient
|
|
460
465
|
# @example
|
461
466
|
# api = TrophyApiClient::Client.new(
|
462
467
|
# base_url: "https://api.example.com",
|
463
|
-
# environment: TrophyApiClient::Environment::
|
468
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
464
469
|
# api_key: "YOUR_API_KEY"
|
465
470
|
# )
|
466
471
|
# api.users.leaderboard(
|
@@ -481,7 +486,8 @@ module TrophyApiClient
|
|
481
486
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
482
487
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
483
488
|
end
|
484
|
-
req.url "#{@request_client.get_url(
|
489
|
+
req.url "#{@request_client.get_url(environment: api,
|
490
|
+
request_options: request_options)}/users/#{id}/leaderboards/#{key}"
|
485
491
|
end
|
486
492
|
TrophyApiClient::UserLeaderboardResponse.from_json(json_object: response.body)
|
487
493
|
end
|
@@ -512,7 +518,7 @@ module TrophyApiClient
|
|
512
518
|
# @example
|
513
519
|
# api = TrophyApiClient::Client.new(
|
514
520
|
# base_url: "https://api.example.com",
|
515
|
-
# environment: TrophyApiClient::Environment::
|
521
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
516
522
|
# api_key: "YOUR_API_KEY"
|
517
523
|
# )
|
518
524
|
# api.users.create(request: { id: "user-id" })
|
@@ -530,7 +536,7 @@ module TrophyApiClient
|
|
530
536
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
531
537
|
end
|
532
538
|
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
533
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users"
|
539
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users"
|
534
540
|
end
|
535
541
|
TrophyApiClient::User.from_json(json_object: response.body)
|
536
542
|
end
|
@@ -544,7 +550,7 @@ module TrophyApiClient
|
|
544
550
|
# @example
|
545
551
|
# api = TrophyApiClient::Client.new(
|
546
552
|
# base_url: "https://api.example.com",
|
547
|
-
# environment: TrophyApiClient::Environment::
|
553
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
548
554
|
# api_key: "YOUR_API_KEY"
|
549
555
|
# )
|
550
556
|
# api.users.get(id: "userId")
|
@@ -564,7 +570,7 @@ module TrophyApiClient
|
|
564
570
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
565
571
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
566
572
|
end
|
567
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}"
|
573
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}"
|
568
574
|
end
|
569
575
|
TrophyApiClient::User.from_json(json_object: response.body)
|
570
576
|
end
|
@@ -585,7 +591,7 @@ module TrophyApiClient
|
|
585
591
|
# @example
|
586
592
|
# api = TrophyApiClient::Client.new(
|
587
593
|
# base_url: "https://api.example.com",
|
588
|
-
# environment: TrophyApiClient::Environment::
|
594
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
589
595
|
# api_key: "YOUR_API_KEY"
|
590
596
|
# )
|
591
597
|
# api.users.identify(id: "id", request: { email: "user@example.com", tz: "Europe/London", attributes: { "department": "engineering", "role": "developer" } })
|
@@ -603,7 +609,7 @@ module TrophyApiClient
|
|
603
609
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
604
610
|
end
|
605
611
|
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
606
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}"
|
612
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}"
|
607
613
|
end
|
608
614
|
TrophyApiClient::User.from_json(json_object: response.body)
|
609
615
|
end
|
@@ -624,7 +630,7 @@ module TrophyApiClient
|
|
624
630
|
# @example
|
625
631
|
# api = TrophyApiClient::Client.new(
|
626
632
|
# base_url: "https://api.example.com",
|
627
|
-
# environment: TrophyApiClient::Environment::
|
633
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
628
634
|
# api_key: "YOUR_API_KEY"
|
629
635
|
# )
|
630
636
|
# api.users.update(id: "id", request: { email: "user@example.com", tz: "Europe/London", attributes: { "department": "engineering", "role": "developer" } })
|
@@ -642,7 +648,7 @@ module TrophyApiClient
|
|
642
648
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
643
649
|
end
|
644
650
|
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
645
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}"
|
651
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}"
|
646
652
|
end
|
647
653
|
TrophyApiClient::User.from_json(json_object: response.body)
|
648
654
|
end
|
@@ -656,7 +662,7 @@ module TrophyApiClient
|
|
656
662
|
# @example
|
657
663
|
# api = TrophyApiClient::Client.new(
|
658
664
|
# base_url: "https://api.example.com",
|
659
|
-
# environment: TrophyApiClient::Environment::
|
665
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
660
666
|
# api_key: "YOUR_API_KEY"
|
661
667
|
# )
|
662
668
|
# api.users.all_metrics(id: "userId")
|
@@ -676,7 +682,7 @@ module TrophyApiClient
|
|
676
682
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
677
683
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
678
684
|
end
|
679
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}/metrics"
|
685
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}/metrics"
|
680
686
|
end
|
681
687
|
parsed_json = JSON.parse(response.body)
|
682
688
|
parsed_json&.map do |item|
|
@@ -695,7 +701,7 @@ module TrophyApiClient
|
|
695
701
|
# @example
|
696
702
|
# api = TrophyApiClient::Client.new(
|
697
703
|
# base_url: "https://api.example.com",
|
698
|
-
# environment: TrophyApiClient::Environment::
|
704
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
699
705
|
# api_key: "YOUR_API_KEY"
|
700
706
|
# )
|
701
707
|
# api.users.single_metric(id: "userId", key: "key")
|
@@ -715,7 +721,8 @@ module TrophyApiClient
|
|
715
721
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
716
722
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
717
723
|
end
|
718
|
-
req.url "#{@request_client.get_url(
|
724
|
+
req.url "#{@request_client.get_url(environment: api,
|
725
|
+
request_options: request_options)}/users/#{id}/metrics/#{key}"
|
719
726
|
end
|
720
727
|
TrophyApiClient::MetricResponse.from_json(json_object: response.body)
|
721
728
|
end
|
@@ -735,7 +742,7 @@ module TrophyApiClient
|
|
735
742
|
# @example
|
736
743
|
# api = TrophyApiClient::Client.new(
|
737
744
|
# base_url: "https://api.example.com",
|
738
|
-
# environment: TrophyApiClient::Environment::
|
745
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
739
746
|
# api_key: "YOUR_API_KEY"
|
740
747
|
# )
|
741
748
|
# api.users.metric_event_summary(
|
@@ -764,7 +771,8 @@ module TrophyApiClient
|
|
764
771
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
765
772
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
766
773
|
end
|
767
|
-
req.url "#{@request_client.get_url(
|
774
|
+
req.url "#{@request_client.get_url(environment: api,
|
775
|
+
request_options: request_options)}/users/#{id}/metrics/#{key}/event-summary"
|
768
776
|
end
|
769
777
|
parsed_json = JSON.parse(response.body)
|
770
778
|
parsed_json&.map do |item|
|
@@ -785,7 +793,7 @@ module TrophyApiClient
|
|
785
793
|
# @example
|
786
794
|
# api = TrophyApiClient::Client.new(
|
787
795
|
# base_url: "https://api.example.com",
|
788
|
-
# environment: TrophyApiClient::Environment::
|
796
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
789
797
|
# api_key: "YOUR_API_KEY"
|
790
798
|
# )
|
791
799
|
# api.users.achievements(id: "userId")
|
@@ -806,7 +814,8 @@ module TrophyApiClient
|
|
806
814
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
807
815
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
808
816
|
end
|
809
|
-
req.url "#{@request_client.get_url(
|
817
|
+
req.url "#{@request_client.get_url(environment: api,
|
818
|
+
request_options: request_options)}/users/#{id}/achievements"
|
810
819
|
end
|
811
820
|
parsed_json = JSON.parse(response.body)
|
812
821
|
parsed_json&.map do |item|
|
@@ -826,7 +835,7 @@ module TrophyApiClient
|
|
826
835
|
# @example
|
827
836
|
# api = TrophyApiClient::Client.new(
|
828
837
|
# base_url: "https://api.example.com",
|
829
|
-
# environment: TrophyApiClient::Environment::
|
838
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
830
839
|
# api_key: "YOUR_API_KEY"
|
831
840
|
# )
|
832
841
|
# api.users.streak(id: "userId")
|
@@ -847,7 +856,7 @@ module TrophyApiClient
|
|
847
856
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
848
857
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
849
858
|
end
|
850
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/users/#{id}/streak"
|
859
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/users/#{id}/streak"
|
851
860
|
end
|
852
861
|
TrophyApiClient::StreakResponse.from_json(json_object: response.body)
|
853
862
|
end
|
@@ -863,7 +872,7 @@ module TrophyApiClient
|
|
863
872
|
# @example
|
864
873
|
# api = TrophyApiClient::Client.new(
|
865
874
|
# base_url: "https://api.example.com",
|
866
|
-
# environment: TrophyApiClient::Environment::
|
875
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
867
876
|
# api_key: "YOUR_API_KEY"
|
868
877
|
# )
|
869
878
|
# api.users.points(id: "userId", key: "points-system-key")
|
@@ -881,7 +890,8 @@ module TrophyApiClient
|
|
881
890
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
882
891
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
883
892
|
end
|
884
|
-
req.url "#{@request_client.get_url(
|
893
|
+
req.url "#{@request_client.get_url(environment: api,
|
894
|
+
request_options: request_options)}/users/#{id}/points/#{key}"
|
885
895
|
end
|
886
896
|
TrophyApiClient::GetUserPointsResponse.from_json(json_object: response.body)
|
887
897
|
end
|
@@ -902,7 +912,7 @@ module TrophyApiClient
|
|
902
912
|
# @example
|
903
913
|
# api = TrophyApiClient::Client.new(
|
904
914
|
# base_url: "https://api.example.com",
|
905
|
-
# environment: TrophyApiClient::Environment::
|
915
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
906
916
|
# api_key: "YOUR_API_KEY"
|
907
917
|
# )
|
908
918
|
# api.users.points_event_summary(
|
@@ -931,7 +941,8 @@ module TrophyApiClient
|
|
931
941
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
932
942
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
933
943
|
end
|
934
|
-
req.url "#{@request_client.get_url(
|
944
|
+
req.url "#{@request_client.get_url(environment: api,
|
945
|
+
request_options: request_options)}/users/#{id}/points/#{key}/event-summary"
|
935
946
|
end
|
936
947
|
parsed_json = JSON.parse(response.body)
|
937
948
|
parsed_json&.map do |item|
|
@@ -952,7 +963,7 @@ module TrophyApiClient
|
|
952
963
|
# @example
|
953
964
|
# api = TrophyApiClient::Client.new(
|
954
965
|
# base_url: "https://api.example.com",
|
955
|
-
# environment: TrophyApiClient::Environment::
|
966
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
956
967
|
# api_key: "YOUR_API_KEY"
|
957
968
|
# )
|
958
969
|
# api.users.leaderboard(
|
@@ -974,7 +985,8 @@ module TrophyApiClient
|
|
974
985
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
975
986
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
976
987
|
end
|
977
|
-
req.url "#{@request_client.get_url(
|
988
|
+
req.url "#{@request_client.get_url(environment: api,
|
989
|
+
request_options: request_options)}/users/#{id}/leaderboards/#{key}"
|
978
990
|
end
|
979
991
|
TrophyApiClient::UserLeaderboardResponse.from_json(json_object: response.body)
|
980
992
|
end
|
data/lib/trophy_api_client.rb
CHANGED
@@ -9,6 +9,7 @@ require_relative "trophy_api_client/users/client"
|
|
9
9
|
require_relative "trophy_api_client/streaks/client"
|
10
10
|
require_relative "trophy_api_client/points/client"
|
11
11
|
require_relative "trophy_api_client/leaderboards/client"
|
12
|
+
require_relative "trophy_api_client/admin/client"
|
12
13
|
|
13
14
|
module TrophyApiClient
|
14
15
|
class Client
|
@@ -24,6 +25,8 @@ module TrophyApiClient
|
|
24
25
|
attr_reader :points
|
25
26
|
# @return [TrophyApiClient::LeaderboardsClient]
|
26
27
|
attr_reader :leaderboards
|
28
|
+
# @return [TrophyApiClient::Admin::Client]
|
29
|
+
attr_reader :admin
|
27
30
|
|
28
31
|
# @param base_url [String]
|
29
32
|
# @param environment [TrophyApiClient::Environment]
|
@@ -31,7 +34,7 @@ module TrophyApiClient
|
|
31
34
|
# @param timeout_in_seconds [Long]
|
32
35
|
# @param api_key [String]
|
33
36
|
# @return [TrophyApiClient::Client]
|
34
|
-
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::
|
37
|
+
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::PRODUCTION, max_retries: nil,
|
35
38
|
timeout_in_seconds: nil)
|
36
39
|
@request_client = TrophyApiClient::RequestClient.new(
|
37
40
|
base_url: base_url,
|
@@ -46,6 +49,7 @@ module TrophyApiClient
|
|
46
49
|
@streaks = TrophyApiClient::StreaksClient.new(request_client: @request_client)
|
47
50
|
@points = TrophyApiClient::PointsClient.new(request_client: @request_client)
|
48
51
|
@leaderboards = TrophyApiClient::LeaderboardsClient.new(request_client: @request_client)
|
52
|
+
@admin = TrophyApiClient::Admin::Client.new(request_client: @request_client)
|
49
53
|
end
|
50
54
|
end
|
51
55
|
|
@@ -62,6 +66,8 @@ module TrophyApiClient
|
|
62
66
|
attr_reader :points
|
63
67
|
# @return [TrophyApiClient::AsyncLeaderboardsClient]
|
64
68
|
attr_reader :leaderboards
|
69
|
+
# @return [TrophyApiClient::Admin::AsyncClient]
|
70
|
+
attr_reader :admin
|
65
71
|
|
66
72
|
# @param base_url [String]
|
67
73
|
# @param environment [TrophyApiClient::Environment]
|
@@ -69,7 +75,7 @@ module TrophyApiClient
|
|
69
75
|
# @param timeout_in_seconds [Long]
|
70
76
|
# @param api_key [String]
|
71
77
|
# @return [TrophyApiClient::AsyncClient]
|
72
|
-
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::
|
78
|
+
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::PRODUCTION, max_retries: nil,
|
73
79
|
timeout_in_seconds: nil)
|
74
80
|
@async_request_client = TrophyApiClient::AsyncRequestClient.new(
|
75
81
|
base_url: base_url,
|
@@ -84,6 +90,7 @@ module TrophyApiClient
|
|
84
90
|
@streaks = TrophyApiClient::AsyncStreaksClient.new(request_client: @async_request_client)
|
85
91
|
@points = TrophyApiClient::AsyncPointsClient.new(request_client: @async_request_client)
|
86
92
|
@leaderboards = TrophyApiClient::AsyncLeaderboardsClient.new(request_client: @async_request_client)
|
93
|
+
@admin = TrophyApiClient::Admin::AsyncClient.new(request_client: @async_request_client)
|
87
94
|
end
|
88
95
|
end
|
89
96
|
end
|
data/lib/types_export.rb
CHANGED
@@ -5,6 +5,7 @@ require_relative "trophy_api_client/users/types/users_metric_event_summary_respo
|
|
5
5
|
require_relative "trophy_api_client/users/types/users_points_event_summary_request_aggregation"
|
6
6
|
require_relative "trophy_api_client/users/types/users_points_event_summary_response_item"
|
7
7
|
require_relative "trophy_api_client/streaks/types/streaks_rankings_request_type"
|
8
|
+
require_relative "trophy_api_client/admin/streaks/freezes/types/create_streak_freezes_request_freezes_item"
|
8
9
|
require_relative "trophy_api_client/types/metric_status"
|
9
10
|
require_relative "trophy_api_client/types/streak_frequency"
|
10
11
|
require_relative "trophy_api_client/types/base_streak_response"
|
@@ -48,3 +49,6 @@ require_relative "trophy_api_client/types/streak_ranking_user"
|
|
48
49
|
require_relative "trophy_api_client/types/leaderboard_ranking"
|
49
50
|
require_relative "trophy_api_client/types/leaderboard_event"
|
50
51
|
require_relative "trophy_api_client/types/user_leaderboard_response"
|
52
|
+
require_relative "trophy_api_client/types/create_streak_freezes_response"
|
53
|
+
require_relative "trophy_api_client/types/bulk_insert_issue_level"
|
54
|
+
require_relative "trophy_api_client/types/bulk_insert_issue"
|
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.0.
|
4
|
+
version: 1.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trophy Labs, Inc
|
@@ -100,6 +100,10 @@ files:
|
|
100
100
|
- lib/requests.rb
|
101
101
|
- lib/trophy_api_client.rb
|
102
102
|
- lib/trophy_api_client/achievements/client.rb
|
103
|
+
- lib/trophy_api_client/admin/client.rb
|
104
|
+
- lib/trophy_api_client/admin/streaks/client.rb
|
105
|
+
- lib/trophy_api_client/admin/streaks/freezes/client.rb
|
106
|
+
- lib/trophy_api_client/admin/streaks/freezes/types/create_streak_freezes_request_freezes_item.rb
|
103
107
|
- lib/trophy_api_client/leaderboards/client.rb
|
104
108
|
- lib/trophy_api_client/metrics/client.rb
|
105
109
|
- lib/trophy_api_client/points/client.rb
|
@@ -112,9 +116,12 @@ files:
|
|
112
116
|
- lib/trophy_api_client/types/achievement_with_stats_response_event_attribute.rb
|
113
117
|
- lib/trophy_api_client/types/achievement_with_stats_response_user_attributes_item.rb
|
114
118
|
- lib/trophy_api_client/types/base_streak_response.rb
|
119
|
+
- lib/trophy_api_client/types/bulk_insert_issue.rb
|
120
|
+
- lib/trophy_api_client/types/bulk_insert_issue_level.rb
|
115
121
|
- lib/trophy_api_client/types/bulk_streak_response.rb
|
116
122
|
- lib/trophy_api_client/types/bulk_streak_response_item.rb
|
117
123
|
- lib/trophy_api_client/types/completed_achievement_response.rb
|
124
|
+
- lib/trophy_api_client/types/create_streak_freezes_response.rb
|
118
125
|
- lib/trophy_api_client/types/error_body.rb
|
119
126
|
- lib/trophy_api_client/types/event_response.rb
|
120
127
|
- lib/trophy_api_client/types/get_user_points_response.rb
|