trophy_api_client 1.0.27 → 1.0.29
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/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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 057cf20c78c80caa66eff19b3a3252ba56e92d84645219cc40a996afda1b6a83
|
4
|
+
data.tar.gz: 13b109f1d873161c2328189bfb54aebcf9f83dcc1d00570629a357f71ad34028
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 597eba515aec1cb420d4de9cc034175a52872a494042f15ff6e05a76843ec6c953ef87f8431fae75a80195c55aaa6572982d069afb03b01eec600e4693b4252e
|
7
|
+
data.tar.gz: 6ff81aa42cc68cccf65381bac4eddf79ce6eb7e36b194e3d5b0090126baffa3a311074b33c90575baadbde6030e02ea8eefe9528c30fa9dbe3beaea44d8064ac
|
data/lib/environment.rb
CHANGED
data/lib/gemconfig.rb
CHANGED
data/lib/requests.rb
CHANGED
@@ -22,10 +22,9 @@ module TrophyApiClient
|
|
22
22
|
# @param timeout_in_seconds [Long]
|
23
23
|
# @param api_key [String]
|
24
24
|
# @return [TrophyApiClient::RequestClient]
|
25
|
-
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::
|
25
|
+
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::PRODUCTION, max_retries: nil,
|
26
26
|
timeout_in_seconds: nil)
|
27
27
|
@default_environment = environment
|
28
|
-
@base_url = environment || base_url
|
29
28
|
@api_key = api_key
|
30
29
|
@conn = Faraday.new do |faraday|
|
31
30
|
faraday.request :json
|
@@ -36,9 +35,10 @@ module TrophyApiClient
|
|
36
35
|
end
|
37
36
|
|
38
37
|
# @param request_options [TrophyApiClient::RequestOptions]
|
38
|
+
# @param environment [String]
|
39
39
|
# @return [String]
|
40
|
-
def get_url(request_options: nil)
|
41
|
-
request_options&.base_url || @default_environment || @base_url
|
40
|
+
def get_url(environment:, request_options: nil)
|
41
|
+
request_options&.base_url || @default_environment[environment] || @base_url
|
42
42
|
end
|
43
43
|
|
44
44
|
# @return [Hash{String => String}]
|
@@ -65,10 +65,9 @@ module TrophyApiClient
|
|
65
65
|
# @param timeout_in_seconds [Long]
|
66
66
|
# @param api_key [String]
|
67
67
|
# @return [TrophyApiClient::AsyncRequestClient]
|
68
|
-
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::
|
68
|
+
def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::PRODUCTION, max_retries: nil,
|
69
69
|
timeout_in_seconds: nil)
|
70
70
|
@default_environment = environment
|
71
|
-
@base_url = environment || base_url
|
72
71
|
@api_key = api_key
|
73
72
|
@conn = Faraday.new do |faraday|
|
74
73
|
faraday.request :json
|
@@ -80,9 +79,10 @@ module TrophyApiClient
|
|
80
79
|
end
|
81
80
|
|
82
81
|
# @param request_options [TrophyApiClient::RequestOptions]
|
82
|
+
# @param environment [String]
|
83
83
|
# @return [String]
|
84
|
-
def get_url(request_options: nil)
|
85
|
-
request_options&.base_url || @default_environment || @base_url
|
84
|
+
def get_url(environment:, request_options: nil)
|
85
|
+
request_options&.base_url || @default_environment[environment] || @base_url
|
86
86
|
end
|
87
87
|
|
88
88
|
# @return [Hash{String => String}]
|
@@ -25,7 +25,7 @@ module TrophyApiClient
|
|
25
25
|
# @example
|
26
26
|
# api = TrophyApiClient::Client.new(
|
27
27
|
# base_url: "https://api.example.com",
|
28
|
-
# environment: TrophyApiClient::Environment::
|
28
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
29
29
|
# api_key: "YOUR_API_KEY"
|
30
30
|
# )
|
31
31
|
# api.achievements.all
|
@@ -44,7 +44,7 @@ module TrophyApiClient
|
|
44
44
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
45
45
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
46
46
|
end
|
47
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/achievements"
|
47
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/achievements"
|
48
48
|
end
|
49
49
|
parsed_json = JSON.parse(response.body)
|
50
50
|
parsed_json&.map do |item|
|
@@ -69,7 +69,7 @@ module TrophyApiClient
|
|
69
69
|
# @example
|
70
70
|
# api = TrophyApiClient::Client.new(
|
71
71
|
# base_url: "https://api.example.com",
|
72
|
-
# environment: TrophyApiClient::Environment::
|
72
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
73
73
|
# api_key: "YOUR_API_KEY"
|
74
74
|
# )
|
75
75
|
# api.achievements.complete(key: "finish-onboarding", user: { email: "user@example.com", tz: "Europe/London", id: "user-id" })
|
@@ -86,7 +86,8 @@ module TrophyApiClient
|
|
86
86
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
87
87
|
end
|
88
88
|
req.body = { **(request_options&.additional_body_parameters || {}), user: user }.compact
|
89
|
-
req.url "#{@request_client.get_url(
|
89
|
+
req.url "#{@request_client.get_url(environment: api,
|
90
|
+
request_options: request_options)}/achievements/#{key}/complete"
|
90
91
|
end
|
91
92
|
TrophyApiClient::AchievementCompletionResponse.from_json(json_object: response.body)
|
92
93
|
end
|
@@ -109,7 +110,7 @@ module TrophyApiClient
|
|
109
110
|
# @example
|
110
111
|
# api = TrophyApiClient::Client.new(
|
111
112
|
# base_url: "https://api.example.com",
|
112
|
-
# environment: TrophyApiClient::Environment::
|
113
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
113
114
|
# api_key: "YOUR_API_KEY"
|
114
115
|
# )
|
115
116
|
# api.achievements.all
|
@@ -129,7 +130,7 @@ module TrophyApiClient
|
|
129
130
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
130
131
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
131
132
|
end
|
132
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/achievements"
|
133
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/achievements"
|
133
134
|
end
|
134
135
|
parsed_json = JSON.parse(response.body)
|
135
136
|
parsed_json&.map do |item|
|
@@ -155,7 +156,7 @@ module TrophyApiClient
|
|
155
156
|
# @example
|
156
157
|
# api = TrophyApiClient::Client.new(
|
157
158
|
# base_url: "https://api.example.com",
|
158
|
-
# environment: TrophyApiClient::Environment::
|
159
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
159
160
|
# api_key: "YOUR_API_KEY"
|
160
161
|
# )
|
161
162
|
# api.achievements.complete(key: "finish-onboarding", user: { email: "user@example.com", tz: "Europe/London", id: "user-id" })
|
@@ -173,7 +174,8 @@ module TrophyApiClient
|
|
173
174
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
174
175
|
end
|
175
176
|
req.body = { **(request_options&.additional_body_parameters || {}), user: user }.compact
|
176
|
-
req.url "#{@request_client.get_url(
|
177
|
+
req.url "#{@request_client.get_url(environment: api,
|
178
|
+
request_options: request_options)}/achievements/#{key}/complete"
|
177
179
|
end
|
178
180
|
TrophyApiClient::AchievementCompletionResponse.from_json(json_object: response.body)
|
179
181
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../requests"
|
4
|
+
require_relative "streaks/client"
|
5
|
+
|
6
|
+
module TrophyApiClient
|
7
|
+
module Admin
|
8
|
+
class Client
|
9
|
+
# @return [TrophyApiClient::Admin::Streaks::Client]
|
10
|
+
attr_reader :admin
|
11
|
+
|
12
|
+
# @param request_client [TrophyApiClient::RequestClient]
|
13
|
+
# @return [TrophyApiClient::Admin::Client]
|
14
|
+
def initialize(request_client:)
|
15
|
+
@admin = TrophyApiClient::Admin::Streaks::Client.new(request_client: request_client)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class AsyncClient
|
20
|
+
# @return [TrophyApiClient::Admin::Streaks::AsyncClient]
|
21
|
+
attr_reader :admin
|
22
|
+
|
23
|
+
# @param request_client [TrophyApiClient::AsyncRequestClient]
|
24
|
+
# @return [TrophyApiClient::Admin::AsyncClient]
|
25
|
+
def initialize(request_client:)
|
26
|
+
@admin = TrophyApiClient::Admin::Streaks::AsyncClient.new(request_client: request_client)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../requests"
|
4
|
+
require_relative "freezes/client"
|
5
|
+
|
6
|
+
module TrophyApiClient
|
7
|
+
module Admin
|
8
|
+
module Streaks
|
9
|
+
class Client
|
10
|
+
# @return [TrophyApiClient::Admin::Streaks::FreezesClient]
|
11
|
+
attr_reader :freezes
|
12
|
+
|
13
|
+
# @param request_client [TrophyApiClient::RequestClient]
|
14
|
+
# @return [TrophyApiClient::Admin::Streaks::Client]
|
15
|
+
def initialize(request_client:)
|
16
|
+
@freezes = TrophyApiClient::Admin::Streaks::FreezesClient.new(request_client: request_client)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class AsyncClient
|
21
|
+
# @return [TrophyApiClient::Admin::Streaks::AsyncFreezesClient]
|
22
|
+
attr_reader :freezes
|
23
|
+
|
24
|
+
# @param request_client [TrophyApiClient::AsyncRequestClient]
|
25
|
+
# @return [TrophyApiClient::Admin::Streaks::AsyncClient]
|
26
|
+
def initialize(request_client:)
|
27
|
+
@freezes = TrophyApiClient::Admin::Streaks::AsyncFreezesClient.new(request_client: request_client)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../../requests"
|
4
|
+
require_relative "types/create_streak_freezes_request_freezes_item"
|
5
|
+
require_relative "../../../types/create_streak_freezes_response"
|
6
|
+
require "async"
|
7
|
+
|
8
|
+
module TrophyApiClient
|
9
|
+
module Admin
|
10
|
+
module Streaks
|
11
|
+
class FreezesClient
|
12
|
+
# @return [TrophyApiClient::RequestClient]
|
13
|
+
attr_reader :request_client
|
14
|
+
|
15
|
+
# @param request_client [TrophyApiClient::RequestClient]
|
16
|
+
# @return [TrophyApiClient::Admin::Streaks::FreezesClient]
|
17
|
+
def initialize(request_client:)
|
18
|
+
@request_client = request_client
|
19
|
+
end
|
20
|
+
|
21
|
+
# Create streak freezes for multiple users.
|
22
|
+
#
|
23
|
+
# @param freezes [Array<Hash>] Array of freezes to create. Maximum 1,000 freezes per request.Request of type Array<TrophyApiClient::Admin::Streaks::Freezes::CreateStreakFreezesRequestFreezesItem>, as a Hash
|
24
|
+
# * :user_id (String)
|
25
|
+
# @param request_options [TrophyApiClient::RequestOptions]
|
26
|
+
# @return [TrophyApiClient::CreateStreakFreezesResponse]
|
27
|
+
# @example
|
28
|
+
# api = TrophyApiClient::Client.new(
|
29
|
+
# base_url: "https://api.example.com",
|
30
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
31
|
+
# api_key: "YOUR_API_KEY"
|
32
|
+
# )
|
33
|
+
# api.admin.streaks.freezes.create(freezes: [{ user_id: "user-123" }, { user_id: "user-456" }, { user_id: "user-123" }])
|
34
|
+
def create(freezes:, request_options: nil)
|
35
|
+
response = @request_client.conn.post do |req|
|
36
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
37
|
+
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
38
|
+
req.headers = {
|
39
|
+
**(req.headers || {}),
|
40
|
+
**@request_client.get_headers,
|
41
|
+
**(request_options&.additional_headers || {})
|
42
|
+
}.compact
|
43
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
44
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
45
|
+
end
|
46
|
+
req.body = { **(request_options&.additional_body_parameters || {}), freezes: freezes }.compact
|
47
|
+
req.url "#{@request_client.get_url(environment: admin, request_options: request_options)}/streaks/freezes"
|
48
|
+
end
|
49
|
+
TrophyApiClient::CreateStreakFreezesResponse.from_json(json_object: response.body)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class AsyncFreezesClient
|
54
|
+
# @return [TrophyApiClient::AsyncRequestClient]
|
55
|
+
attr_reader :request_client
|
56
|
+
|
57
|
+
# @param request_client [TrophyApiClient::AsyncRequestClient]
|
58
|
+
# @return [TrophyApiClient::Admin::Streaks::AsyncFreezesClient]
|
59
|
+
def initialize(request_client:)
|
60
|
+
@request_client = request_client
|
61
|
+
end
|
62
|
+
|
63
|
+
# Create streak freezes for multiple users.
|
64
|
+
#
|
65
|
+
# @param freezes [Array<Hash>] Array of freezes to create. Maximum 1,000 freezes per request.Request of type Array<TrophyApiClient::Admin::Streaks::Freezes::CreateStreakFreezesRequestFreezesItem>, as a Hash
|
66
|
+
# * :user_id (String)
|
67
|
+
# @param request_options [TrophyApiClient::RequestOptions]
|
68
|
+
# @return [TrophyApiClient::CreateStreakFreezesResponse]
|
69
|
+
# @example
|
70
|
+
# api = TrophyApiClient::Client.new(
|
71
|
+
# base_url: "https://api.example.com",
|
72
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
73
|
+
# api_key: "YOUR_API_KEY"
|
74
|
+
# )
|
75
|
+
# api.admin.streaks.freezes.create(freezes: [{ user_id: "user-123" }, { user_id: "user-456" }, { user_id: "user-123" }])
|
76
|
+
def create(freezes:, request_options: nil)
|
77
|
+
Async do
|
78
|
+
response = @request_client.conn.post do |req|
|
79
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
80
|
+
req.headers["X-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
81
|
+
req.headers = {
|
82
|
+
**(req.headers || {}),
|
83
|
+
**@request_client.get_headers,
|
84
|
+
**(request_options&.additional_headers || {})
|
85
|
+
}.compact
|
86
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
87
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
88
|
+
end
|
89
|
+
req.body = { **(request_options&.additional_body_parameters || {}), freezes: freezes }.compact
|
90
|
+
req.url "#{@request_client.get_url(environment: admin, request_options: request_options)}/streaks/freezes"
|
91
|
+
end
|
92
|
+
TrophyApiClient::CreateStreakFreezesResponse.from_json(json_object: response.body)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
data/lib/trophy_api_client/admin/streaks/freezes/types/create_streak_freezes_request_freezes_item.rb
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module TrophyApiClient
|
7
|
+
module Admin
|
8
|
+
module Streaks
|
9
|
+
class Freezes
|
10
|
+
class CreateStreakFreezesRequestFreezesItem
|
11
|
+
# @return [String] The ID of the user to create a freeze for.
|
12
|
+
attr_reader :user_id
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param user_id [String] The ID of the user to create a freeze for.
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [TrophyApiClient::Admin::Streaks::Freezes::CreateStreakFreezesRequestFreezesItem]
|
24
|
+
def initialize(user_id:, additional_properties: nil)
|
25
|
+
@user_id = user_id
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
@_field_set = { "userId": user_id }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of
|
31
|
+
# CreateStreakFreezesRequestFreezesItem
|
32
|
+
#
|
33
|
+
# @param json_object [String]
|
34
|
+
# @return [TrophyApiClient::Admin::Streaks::Freezes::CreateStreakFreezesRequestFreezesItem]
|
35
|
+
def self.from_json(json_object:)
|
36
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
+
parsed_json = JSON.parse(json_object)
|
38
|
+
user_id = parsed_json["userId"]
|
39
|
+
new(user_id: user_id, additional_properties: struct)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Serialize an instance of CreateStreakFreezesRequestFreezesItem to a JSON object
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
def to_json(*_args)
|
46
|
+
@_field_set&.to_json
|
47
|
+
end
|
48
|
+
|
49
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
50
|
+
# hash and check each fields type against the current object's property
|
51
|
+
# definitions.
|
52
|
+
#
|
53
|
+
# @param obj [Object]
|
54
|
+
# @return [Void]
|
55
|
+
def self.validate_raw(obj:)
|
56
|
+
obj.user_id.is_a?(String) != false || raise("Passed value for field obj.user_id is not the expected type, validation failed.")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -24,7 +24,7 @@ module TrophyApiClient
|
|
24
24
|
# @example
|
25
25
|
# api = TrophyApiClient::Client.new(
|
26
26
|
# base_url: "https://api.example.com",
|
27
|
-
# environment: TrophyApiClient::Environment::
|
27
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
28
28
|
# api_key: "YOUR_API_KEY"
|
29
29
|
# )
|
30
30
|
# api.leaderboards.all
|
@@ -43,7 +43,7 @@ module TrophyApiClient
|
|
43
43
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
44
44
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
45
45
|
end
|
46
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/leaderboards"
|
46
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/leaderboards"
|
47
47
|
end
|
48
48
|
parsed_json = JSON.parse(response.body)
|
49
49
|
parsed_json&.map do |item|
|
@@ -66,7 +66,7 @@ module TrophyApiClient
|
|
66
66
|
# @example
|
67
67
|
# api = TrophyApiClient::Client.new(
|
68
68
|
# base_url: "https://api.example.com",
|
69
|
-
# environment: TrophyApiClient::Environment::
|
69
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
70
70
|
# api_key: "YOUR_API_KEY"
|
71
71
|
# )
|
72
72
|
# api.leaderboards.get(
|
@@ -93,7 +93,7 @@ module TrophyApiClient
|
|
93
93
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
94
94
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
95
95
|
end
|
96
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/leaderboards/#{key}"
|
96
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/leaderboards/#{key}"
|
97
97
|
end
|
98
98
|
TrophyApiClient::LeaderboardResponseWithRankings.from_json(json_object: response.body)
|
99
99
|
end
|
@@ -116,7 +116,7 @@ module TrophyApiClient
|
|
116
116
|
# @example
|
117
117
|
# api = TrophyApiClient::Client.new(
|
118
118
|
# base_url: "https://api.example.com",
|
119
|
-
# environment: TrophyApiClient::Environment::
|
119
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
120
120
|
# api_key: "YOUR_API_KEY"
|
121
121
|
# )
|
122
122
|
# api.leaderboards.all
|
@@ -136,7 +136,7 @@ module TrophyApiClient
|
|
136
136
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
137
137
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
138
138
|
end
|
139
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/leaderboards"
|
139
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/leaderboards"
|
140
140
|
end
|
141
141
|
parsed_json = JSON.parse(response.body)
|
142
142
|
parsed_json&.map do |item|
|
@@ -160,7 +160,7 @@ module TrophyApiClient
|
|
160
160
|
# @example
|
161
161
|
# api = TrophyApiClient::Client.new(
|
162
162
|
# base_url: "https://api.example.com",
|
163
|
-
# environment: TrophyApiClient::Environment::
|
163
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
164
164
|
# api_key: "YOUR_API_KEY"
|
165
165
|
# )
|
166
166
|
# api.leaderboards.get(
|
@@ -188,7 +188,7 @@ module TrophyApiClient
|
|
188
188
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
189
189
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
190
190
|
end
|
191
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/leaderboards/#{key}"
|
191
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/leaderboards/#{key}"
|
192
192
|
end
|
193
193
|
TrophyApiClient::LeaderboardResponseWithRankings.from_json(json_object: response.body)
|
194
194
|
end
|
@@ -36,7 +36,7 @@ module TrophyApiClient
|
|
36
36
|
# @example
|
37
37
|
# api = TrophyApiClient::Client.new(
|
38
38
|
# base_url: "https://api.example.com",
|
39
|
-
# environment: TrophyApiClient::Environment::
|
39
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
40
40
|
# api_key: "YOUR_API_KEY"
|
41
41
|
# )
|
42
42
|
# api.metrics.event(
|
@@ -65,7 +65,7 @@ module TrophyApiClient
|
|
65
65
|
value: value,
|
66
66
|
attributes: attributes
|
67
67
|
}.compact
|
68
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/metrics/#{key}/event"
|
68
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/metrics/#{key}/event"
|
69
69
|
end
|
70
70
|
TrophyApiClient::EventResponse.from_json(json_object: response.body)
|
71
71
|
end
|
@@ -101,7 +101,7 @@ module TrophyApiClient
|
|
101
101
|
# @example
|
102
102
|
# api = TrophyApiClient::Client.new(
|
103
103
|
# base_url: "https://api.example.com",
|
104
|
-
# environment: TrophyApiClient::Environment::
|
104
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
105
105
|
# api_key: "YOUR_API_KEY"
|
106
106
|
# )
|
107
107
|
# api.metrics.event(
|
@@ -131,7 +131,7 @@ module TrophyApiClient
|
|
131
131
|
value: value,
|
132
132
|
attributes: attributes
|
133
133
|
}.compact
|
134
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/metrics/#{key}/event"
|
134
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/metrics/#{key}/event"
|
135
135
|
end
|
136
136
|
TrophyApiClient::EventResponse.from_json(json_object: response.body)
|
137
137
|
end
|
@@ -28,7 +28,7 @@ module TrophyApiClient
|
|
28
28
|
# @example
|
29
29
|
# api = TrophyApiClient::Client.new(
|
30
30
|
# base_url: "https://api.example.com",
|
31
|
-
# environment: TrophyApiClient::Environment::
|
31
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
32
32
|
# api_key: "YOUR_API_KEY"
|
33
33
|
# )
|
34
34
|
# api.points.summary(key: "points-system-key", user_attributes: "plan-type:premium,region:us-east")
|
@@ -48,7 +48,7 @@ module TrophyApiClient
|
|
48
48
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
49
49
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
50
50
|
end
|
51
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/points/#{key}/summary"
|
51
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/points/#{key}/summary"
|
52
52
|
end
|
53
53
|
parsed_json = JSON.parse(response.body)
|
54
54
|
parsed_json&.map do |item|
|
@@ -65,7 +65,7 @@ module TrophyApiClient
|
|
65
65
|
# @example
|
66
66
|
# api = TrophyApiClient::Client.new(
|
67
67
|
# base_url: "https://api.example.com",
|
68
|
-
# environment: TrophyApiClient::Environment::
|
68
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
69
69
|
# api_key: "YOUR_API_KEY"
|
70
70
|
# )
|
71
71
|
# api.points.system(key: "points-system-key")
|
@@ -84,7 +84,7 @@ module TrophyApiClient
|
|
84
84
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
85
85
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
86
86
|
end
|
87
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/points/#{key}"
|
87
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/points/#{key}"
|
88
88
|
end
|
89
89
|
TrophyApiClient::PointsSystemResponse.from_json(json_object: response.body)
|
90
90
|
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.points.summary(key: "points-system-key", user_attributes: "plan-type:premium,region:us-east")
|
@@ -132,7 +132,7 @@ module TrophyApiClient
|
|
132
132
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
133
133
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
134
134
|
end
|
135
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/points/#{key}/summary"
|
135
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/points/#{key}/summary"
|
136
136
|
end
|
137
137
|
parsed_json = JSON.parse(response.body)
|
138
138
|
parsed_json&.map do |item|
|
@@ -150,7 +150,7 @@ module TrophyApiClient
|
|
150
150
|
# @example
|
151
151
|
# api = TrophyApiClient::Client.new(
|
152
152
|
# base_url: "https://api.example.com",
|
153
|
-
# environment: TrophyApiClient::Environment::
|
153
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
154
154
|
# api_key: "YOUR_API_KEY"
|
155
155
|
# )
|
156
156
|
# api.points.system(key: "points-system-key")
|
@@ -170,7 +170,7 @@ module TrophyApiClient
|
|
170
170
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
171
171
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
172
172
|
end
|
173
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/points/#{key}"
|
173
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/points/#{key}"
|
174
174
|
end
|
175
175
|
TrophyApiClient::PointsSystemResponse.from_json(json_object: response.body)
|
176
176
|
end
|
@@ -27,7 +27,7 @@ module TrophyApiClient
|
|
27
27
|
# @example
|
28
28
|
# api = TrophyApiClient::Client.new(
|
29
29
|
# base_url: "https://api.example.com",
|
30
|
-
# environment: TrophyApiClient::Environment::
|
30
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
31
31
|
# api_key: "YOUR_API_KEY"
|
32
32
|
# )
|
33
33
|
# api.streaks.list
|
@@ -44,7 +44,7 @@ module TrophyApiClient
|
|
44
44
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
45
45
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
46
46
|
end
|
47
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/streaks"
|
47
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/streaks"
|
48
48
|
end
|
49
49
|
parsed_json = JSON.parse(response.body)
|
50
50
|
parsed_json&.map do |item|
|
@@ -62,7 +62,7 @@ module TrophyApiClient
|
|
62
62
|
# @example
|
63
63
|
# api = TrophyApiClient::Client.new(
|
64
64
|
# base_url: "https://api.example.com",
|
65
|
-
# environment: TrophyApiClient::Environment::
|
65
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
66
66
|
# api_key: "YOUR_API_KEY"
|
67
67
|
# )
|
68
68
|
# api.streaks.rankings
|
@@ -79,7 +79,7 @@ module TrophyApiClient
|
|
79
79
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
80
80
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
81
81
|
end
|
82
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/streaks/rankings"
|
82
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/streaks/rankings"
|
83
83
|
end
|
84
84
|
parsed_json = JSON.parse(response.body)
|
85
85
|
parsed_json&.map do |item|
|
@@ -108,7 +108,7 @@ module TrophyApiClient
|
|
108
108
|
# @example
|
109
109
|
# api = TrophyApiClient::Client.new(
|
110
110
|
# base_url: "https://api.example.com",
|
111
|
-
# environment: TrophyApiClient::Environment::
|
111
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
112
112
|
# api_key: "YOUR_API_KEY"
|
113
113
|
# )
|
114
114
|
# api.streaks.list
|
@@ -126,7 +126,7 @@ module TrophyApiClient
|
|
126
126
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
127
127
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
128
128
|
end
|
129
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/streaks"
|
129
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/streaks"
|
130
130
|
end
|
131
131
|
parsed_json = JSON.parse(response.body)
|
132
132
|
parsed_json&.map do |item|
|
@@ -145,7 +145,7 @@ module TrophyApiClient
|
|
145
145
|
# @example
|
146
146
|
# api = TrophyApiClient::Client.new(
|
147
147
|
# base_url: "https://api.example.com",
|
148
|
-
# environment: TrophyApiClient::Environment::
|
148
|
+
# environment: TrophyApiClient::Environment::PRODUCTION,
|
149
149
|
# api_key: "YOUR_API_KEY"
|
150
150
|
# )
|
151
151
|
# api.streaks.rankings
|
@@ -163,7 +163,7 @@ module TrophyApiClient
|
|
163
163
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
164
164
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
165
165
|
end
|
166
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/streaks/rankings"
|
166
|
+
req.url "#{@request_client.get_url(environment: api, request_options: request_options)}/streaks/rankings"
|
167
167
|
end
|
168
168
|
parsed_json = JSON.parse(response.body)
|
169
169
|
parsed_json&.map do |item|
|