trophy_api_client 1.7.0 → 1.8.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.
- checksums.yaml +4 -4
- data/lib/gemconfig.rb +1 -1
- data/lib/trophy_api_client/admin/points/boosts/client.rb +258 -39
- data/lib/trophy_api_client/admin/points/client.rb +21 -0
- data/lib/trophy_api_client/admin/points/levels/client.rb +402 -0
- data/lib/trophy_api_client/admin/points/systems/client.rb +374 -0
- data/lib/trophy_api_client/admin/points/triggers/client.rb +402 -0
- data/lib/trophy_api_client/types/{created_points_boost.rb → admin_points_boost.rb} +39 -23
- data/lib/trophy_api_client/types/{created_points_boost_rounding.rb → admin_points_boost_rounding.rb} +1 -1
- data/lib/trophy_api_client/types/{created_points_boost_status.rb → admin_points_boost_status.rb} +1 -1
- data/lib/trophy_api_client/types/admin_points_boost_user_attributes_item.rb +65 -0
- data/lib/trophy_api_client/types/admin_points_level.rb +109 -0
- data/lib/trophy_api_client/types/admin_points_level_badge.rb +55 -0
- data/lib/trophy_api_client/types/admin_points_system.rb +118 -0
- data/lib/trophy_api_client/types/admin_points_system_badge.rb +55 -0
- data/lib/trophy_api_client/types/admin_points_system_status.rb +9 -0
- data/lib/trophy_api_client/types/admin_points_trigger.rb +175 -0
- data/lib/trophy_api_client/types/admin_points_trigger_event_attributes_item.rb +66 -0
- data/lib/trophy_api_client/types/admin_points_trigger_status.rb +9 -0
- data/lib/trophy_api_client/types/admin_points_trigger_time_unit.rb +9 -0
- data/lib/trophy_api_client/types/admin_points_trigger_type.rb +12 -0
- data/lib/trophy_api_client/types/admin_points_trigger_user_attributes_item.rb +65 -0
- data/lib/trophy_api_client/types/create_points_boost_request_item.rb +125 -0
- data/lib/trophy_api_client/types/create_points_boost_request_item_rounding.rb +10 -0
- data/lib/trophy_api_client/types/create_points_boost_request_item_user_attributes_item.rb +67 -0
- data/lib/trophy_api_client/types/create_points_boosts_request.rb +7 -0
- data/lib/trophy_api_client/types/create_points_boosts_response.rb +4 -4
- data/lib/trophy_api_client/types/create_points_level_request_item.rb +103 -0
- data/lib/trophy_api_client/types/create_points_level_request_item_badge.rb +56 -0
- data/lib/trophy_api_client/types/create_points_levels_request.rb +7 -0
- data/lib/trophy_api_client/types/create_points_levels_response.rb +74 -0
- data/lib/trophy_api_client/types/create_points_system_request_item.rb +140 -0
- data/lib/trophy_api_client/types/create_points_system_request_item_badge.rb +55 -0
- data/lib/trophy_api_client/types/create_points_systems_request.rb +7 -0
- data/lib/trophy_api_client/types/create_points_systems_response.rb +74 -0
- data/lib/trophy_api_client/types/create_points_trigger_request_item.rb +167 -0
- data/lib/trophy_api_client/types/create_points_trigger_request_item_event_attributes_item.rb +67 -0
- data/lib/trophy_api_client/types/create_points_trigger_request_item_status.rb +9 -0
- data/lib/trophy_api_client/types/create_points_trigger_request_item_time_unit.rb +9 -0
- data/lib/trophy_api_client/types/create_points_trigger_request_item_type.rb +12 -0
- data/lib/trophy_api_client/types/create_points_trigger_request_item_user_attributes_item.rb +67 -0
- data/lib/trophy_api_client/types/create_points_triggers_request.rb +7 -0
- data/lib/trophy_api_client/types/create_points_triggers_response.rb +74 -0
- data/lib/trophy_api_client/types/created_admin_points_system.rb +163 -0
- data/lib/trophy_api_client/types/delete_points_levels_response.rb +74 -0
- data/lib/trophy_api_client/types/delete_points_systems_response.rb +74 -0
- data/lib/trophy_api_client/types/delete_points_triggers_response.rb +75 -0
- data/lib/trophy_api_client/types/list_points_boosts_response.rb +7 -0
- data/lib/trophy_api_client/types/list_points_levels_response.rb +7 -0
- data/lib/trophy_api_client/types/list_points_systems_response.rb +7 -0
- data/lib/trophy_api_client/types/list_points_triggers_response.rb +7 -0
- data/lib/trophy_api_client/types/patch_points_boosts_request.rb +7 -0
- data/lib/trophy_api_client/types/patch_points_boosts_request_item.rb +118 -0
- data/lib/trophy_api_client/types/patch_points_boosts_request_item_rounding.rb +10 -0
- data/lib/trophy_api_client/types/patch_points_boosts_request_item_user_attributes_item.rb +67 -0
- data/lib/trophy_api_client/types/patch_points_boosts_response.rb +74 -0
- data/lib/trophy_api_client/types/patch_points_levels_request.rb +7 -0
- data/lib/trophy_api_client/types/patch_points_levels_request_item.rb +100 -0
- data/lib/trophy_api_client/types/patch_points_levels_request_item_badge.rb +55 -0
- data/lib/trophy_api_client/types/patch_points_levels_response.rb +74 -0
- data/lib/trophy_api_client/types/patch_points_triggers_request.rb +7 -0
- data/lib/trophy_api_client/types/patch_points_triggers_request_item.rb +174 -0
- data/lib/trophy_api_client/types/patch_points_triggers_request_item_event_attributes_item.rb +67 -0
- data/lib/trophy_api_client/types/patch_points_triggers_request_item_status.rb +9 -0
- data/lib/trophy_api_client/types/patch_points_triggers_request_item_time_unit.rb +9 -0
- data/lib/trophy_api_client/types/patch_points_triggers_request_item_type.rb +13 -0
- data/lib/trophy_api_client/types/patch_points_triggers_request_item_user_attributes_item.rb +67 -0
- data/lib/trophy_api_client/types/patch_points_triggers_response.rb +74 -0
- data/lib/trophy_api_client/types/update_points_system_request_item.rb +102 -0
- data/lib/trophy_api_client/types/update_points_system_request_item_badge.rb +55 -0
- data/lib/trophy_api_client/types/update_points_systems_request.rb +7 -0
- data/lib/trophy_api_client/types/update_points_systems_response.rb +74 -0
- data/lib/trophy_api_client/version.rb +1 -1
- data/lib/types_export.rb +64 -5
- metadata +68 -6
- data/lib/trophy_api_client/admin/points/boosts/types/create_points_boosts_request_boosts_item.rb +0 -111
- data/lib/trophy_api_client/admin/points/boosts/types/create_points_boosts_request_boosts_item_rounding.rb +0 -16
data/lib/trophy_api_client/admin/points/boosts/types/create_points_boosts_request_boosts_item.rb
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "create_points_boosts_request_boosts_item_rounding"
|
|
4
|
-
require "ostruct"
|
|
5
|
-
require "json"
|
|
6
|
-
|
|
7
|
-
module TrophyApiClient
|
|
8
|
-
module Admin
|
|
9
|
-
module Points
|
|
10
|
-
class Boosts
|
|
11
|
-
class CreatePointsBoostsRequestBoostsItem
|
|
12
|
-
# @return [String] The ID of the user to create a boost for.
|
|
13
|
-
attr_reader :user_id
|
|
14
|
-
# @return [String] The name of the boost.
|
|
15
|
-
attr_reader :name
|
|
16
|
-
# @return [String] The start date of the boost (YYYY-MM-DD).
|
|
17
|
-
attr_reader :start
|
|
18
|
-
# @return [String] The end date of the boost (YYYY-MM-DD). If null, the boost has no end date.
|
|
19
|
-
attr_reader :end_
|
|
20
|
-
# @return [Float] The points multiplier. Must be greater than 0, not equal to 1, and less than
|
|
21
|
-
# 100.
|
|
22
|
-
attr_reader :multiplier
|
|
23
|
-
# @return [TrophyApiClient::Admin::Points::Boosts::CreatePointsBoostsRequestBoostsItemRounding] How to round the boosted points. Defaults to 'down'.
|
|
24
|
-
attr_reader :rounding
|
|
25
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
|
-
attr_reader :additional_properties
|
|
27
|
-
# @return [Object]
|
|
28
|
-
attr_reader :_field_set
|
|
29
|
-
protected :_field_set
|
|
30
|
-
|
|
31
|
-
OMIT = Object.new
|
|
32
|
-
|
|
33
|
-
# @param user_id [String] The ID of the user to create a boost for.
|
|
34
|
-
# @param name [String] The name of the boost.
|
|
35
|
-
# @param start [String] The start date of the boost (YYYY-MM-DD).
|
|
36
|
-
# @param end_ [String] The end date of the boost (YYYY-MM-DD). If null, the boost has no end date.
|
|
37
|
-
# @param multiplier [Float] The points multiplier. Must be greater than 0, not equal to 1, and less than
|
|
38
|
-
# 100.
|
|
39
|
-
# @param rounding [TrophyApiClient::Admin::Points::Boosts::CreatePointsBoostsRequestBoostsItemRounding] How to round the boosted points. Defaults to 'down'.
|
|
40
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
41
|
-
# @return [TrophyApiClient::Admin::Points::Boosts::CreatePointsBoostsRequestBoostsItem]
|
|
42
|
-
def initialize(user_id:, name:, start:, multiplier:, end_: OMIT, rounding: OMIT, additional_properties: nil)
|
|
43
|
-
@user_id = user_id
|
|
44
|
-
@name = name
|
|
45
|
-
@start = start
|
|
46
|
-
@end_ = end_ if end_ != OMIT
|
|
47
|
-
@multiplier = multiplier
|
|
48
|
-
@rounding = rounding if rounding != OMIT
|
|
49
|
-
@additional_properties = additional_properties
|
|
50
|
-
@_field_set = {
|
|
51
|
-
"userId": user_id,
|
|
52
|
-
"name": name,
|
|
53
|
-
"start": start,
|
|
54
|
-
"end": end_,
|
|
55
|
-
"multiplier": multiplier,
|
|
56
|
-
"rounding": rounding
|
|
57
|
-
}.reject do |_k, v|
|
|
58
|
-
v == OMIT
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Deserialize a JSON object to an instance of CreatePointsBoostsRequestBoostsItem
|
|
63
|
-
#
|
|
64
|
-
# @param json_object [String]
|
|
65
|
-
# @return [TrophyApiClient::Admin::Points::Boosts::CreatePointsBoostsRequestBoostsItem]
|
|
66
|
-
def self.from_json(json_object:)
|
|
67
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
68
|
-
parsed_json = JSON.parse(json_object)
|
|
69
|
-
user_id = parsed_json["userId"]
|
|
70
|
-
name = parsed_json["name"]
|
|
71
|
-
start = parsed_json["start"]
|
|
72
|
-
end_ = parsed_json["end"]
|
|
73
|
-
multiplier = parsed_json["multiplier"]
|
|
74
|
-
rounding = parsed_json["rounding"]
|
|
75
|
-
new(
|
|
76
|
-
user_id: user_id,
|
|
77
|
-
name: name,
|
|
78
|
-
start: start,
|
|
79
|
-
end_: end_,
|
|
80
|
-
multiplier: multiplier,
|
|
81
|
-
rounding: rounding,
|
|
82
|
-
additional_properties: struct
|
|
83
|
-
)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# Serialize an instance of CreatePointsBoostsRequestBoostsItem to a JSON object
|
|
87
|
-
#
|
|
88
|
-
# @return [String]
|
|
89
|
-
def to_json(*_args)
|
|
90
|
-
@_field_set&.to_json
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
94
|
-
# hash and check each fields type against the current object's property
|
|
95
|
-
# definitions.
|
|
96
|
-
#
|
|
97
|
-
# @param obj [Object]
|
|
98
|
-
# @return [Void]
|
|
99
|
-
def self.validate_raw(obj:)
|
|
100
|
-
obj.user_id.is_a?(String) != false || raise("Passed value for field obj.user_id is not the expected type, validation failed.")
|
|
101
|
-
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
102
|
-
obj.start.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
103
|
-
obj.end_&.is_a?(String) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
|
104
|
-
obj.multiplier.is_a?(Float) != false || raise("Passed value for field obj.multiplier is not the expected type, validation failed.")
|
|
105
|
-
obj.rounding&.is_a?(TrophyApiClient::Admin::Points::Boosts::CreatePointsBoostsRequestBoostsItemRounding) != false || raise("Passed value for field obj.rounding is not the expected type, validation failed.")
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module TrophyApiClient
|
|
4
|
-
module Admin
|
|
5
|
-
module Points
|
|
6
|
-
class Boosts
|
|
7
|
-
# How to round the boosted points. Defaults to 'down'.
|
|
8
|
-
class CreatePointsBoostsRequestBoostsItemRounding
|
|
9
|
-
DOWN = "down"
|
|
10
|
-
UP = "up"
|
|
11
|
-
NEAREST = "nearest"
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|