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
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "admin_points_trigger"
|
|
4
|
+
require_relative "admin_issue"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module TrophyApiClient
|
|
9
|
+
# Response containing created triggers and any per-item issues.
|
|
10
|
+
class CreatePointsTriggersResponse
|
|
11
|
+
# @return [Array<TrophyApiClient::AdminPointsTrigger>] Array of successfully created triggers.
|
|
12
|
+
attr_reader :created
|
|
13
|
+
# @return [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during trigger creation.
|
|
14
|
+
attr_reader :issues
|
|
15
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
16
|
+
attr_reader :additional_properties
|
|
17
|
+
# @return [Object]
|
|
18
|
+
attr_reader :_field_set
|
|
19
|
+
protected :_field_set
|
|
20
|
+
|
|
21
|
+
OMIT = Object.new
|
|
22
|
+
|
|
23
|
+
# @param created [Array<TrophyApiClient::AdminPointsTrigger>] Array of successfully created triggers.
|
|
24
|
+
# @param issues [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during trigger creation.
|
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
|
+
# @return [TrophyApiClient::CreatePointsTriggersResponse]
|
|
27
|
+
def initialize(created:, issues:, additional_properties: nil)
|
|
28
|
+
@created = created
|
|
29
|
+
@issues = issues
|
|
30
|
+
@additional_properties = additional_properties
|
|
31
|
+
@_field_set = { "created": created, "issues": issues }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Deserialize a JSON object to an instance of CreatePointsTriggersResponse
|
|
35
|
+
#
|
|
36
|
+
# @param json_object [String]
|
|
37
|
+
# @return [TrophyApiClient::CreatePointsTriggersResponse]
|
|
38
|
+
def self.from_json(json_object:)
|
|
39
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
40
|
+
parsed_json = JSON.parse(json_object)
|
|
41
|
+
created = parsed_json["created"]&.map do |item|
|
|
42
|
+
item = item.to_json
|
|
43
|
+
TrophyApiClient::AdminPointsTrigger.from_json(json_object: item)
|
|
44
|
+
end
|
|
45
|
+
issues = parsed_json["issues"]&.map do |item|
|
|
46
|
+
item = item.to_json
|
|
47
|
+
TrophyApiClient::AdminIssue.from_json(json_object: item)
|
|
48
|
+
end
|
|
49
|
+
new(
|
|
50
|
+
created: created,
|
|
51
|
+
issues: issues,
|
|
52
|
+
additional_properties: struct
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Serialize an instance of CreatePointsTriggersResponse to a JSON object
|
|
57
|
+
#
|
|
58
|
+
# @return [String]
|
|
59
|
+
def to_json(*_args)
|
|
60
|
+
@_field_set&.to_json
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
64
|
+
# hash and check each fields type against the current object's property
|
|
65
|
+
# definitions.
|
|
66
|
+
#
|
|
67
|
+
# @param obj [Object]
|
|
68
|
+
# @return [Void]
|
|
69
|
+
def self.validate_raw(obj:)
|
|
70
|
+
obj.created.is_a?(Array) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
|
|
71
|
+
obj.issues.is_a?(Array) != false || raise("Passed value for field obj.issues is not the expected type, validation failed.")
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "admin_points_level"
|
|
4
|
+
require_relative "admin_points_boost"
|
|
5
|
+
require_relative "admin_points_trigger"
|
|
6
|
+
require_relative "admin_points_system_status"
|
|
7
|
+
require_relative "admin_points_system_badge"
|
|
8
|
+
require "ostruct"
|
|
9
|
+
require "json"
|
|
10
|
+
|
|
11
|
+
module TrophyApiClient
|
|
12
|
+
# A points system returned from the creation endpoint. Extends AdminPointsSystem
|
|
13
|
+
# with optional sub-entity arrays that are present when those sub-entities were
|
|
14
|
+
# included in the creation request.
|
|
15
|
+
class CreatedAdminPointsSystem
|
|
16
|
+
# @return [Array<TrophyApiClient::AdminPointsLevel>] Levels created alongside the system. Present when levels were provided in the
|
|
17
|
+
# request.
|
|
18
|
+
attr_reader :levels
|
|
19
|
+
# @return [Array<TrophyApiClient::AdminPointsBoost>] Boosts created alongside the system. Present when boosts were provided in the
|
|
20
|
+
# request.
|
|
21
|
+
attr_reader :boosts
|
|
22
|
+
# @return [Array<TrophyApiClient::AdminPointsTrigger>] Triggers created alongside the system. Present when triggers were provided in
|
|
23
|
+
# the request.
|
|
24
|
+
attr_reader :triggers
|
|
25
|
+
# @return [String] The UUID of the points system.
|
|
26
|
+
attr_reader :id
|
|
27
|
+
# @return [String] The points system name.
|
|
28
|
+
attr_reader :name
|
|
29
|
+
# @return [String] The points system key.
|
|
30
|
+
attr_reader :key
|
|
31
|
+
# @return [String] The points system description.
|
|
32
|
+
attr_reader :description
|
|
33
|
+
# @return [TrophyApiClient::AdminPointsSystemStatus] The points system status.
|
|
34
|
+
attr_reader :status
|
|
35
|
+
# @return [TrophyApiClient::AdminPointsSystemBadge] The badge for the points system.
|
|
36
|
+
attr_reader :badge
|
|
37
|
+
# @return [Integer] The maximum points a user can earn.
|
|
38
|
+
attr_reader :max_points
|
|
39
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
40
|
+
attr_reader :additional_properties
|
|
41
|
+
# @return [Object]
|
|
42
|
+
attr_reader :_field_set
|
|
43
|
+
protected :_field_set
|
|
44
|
+
|
|
45
|
+
OMIT = Object.new
|
|
46
|
+
|
|
47
|
+
# @param levels [Array<TrophyApiClient::AdminPointsLevel>] Levels created alongside the system. Present when levels were provided in the
|
|
48
|
+
# request.
|
|
49
|
+
# @param boosts [Array<TrophyApiClient::AdminPointsBoost>] Boosts created alongside the system. Present when boosts were provided in the
|
|
50
|
+
# request.
|
|
51
|
+
# @param triggers [Array<TrophyApiClient::AdminPointsTrigger>] Triggers created alongside the system. Present when triggers were provided in
|
|
52
|
+
# the request.
|
|
53
|
+
# @param id [String] The UUID of the points system.
|
|
54
|
+
# @param name [String] The points system name.
|
|
55
|
+
# @param key [String] The points system key.
|
|
56
|
+
# @param description [String] The points system description.
|
|
57
|
+
# @param status [TrophyApiClient::AdminPointsSystemStatus] The points system status.
|
|
58
|
+
# @param badge [TrophyApiClient::AdminPointsSystemBadge] The badge for the points system.
|
|
59
|
+
# @param max_points [Integer] The maximum points a user can earn.
|
|
60
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
61
|
+
# @return [TrophyApiClient::CreatedAdminPointsSystem]
|
|
62
|
+
def initialize(id:, name:, key:, description:, status:, levels: OMIT, boosts: OMIT, triggers: OMIT, badge: OMIT,
|
|
63
|
+
max_points: OMIT, additional_properties: nil)
|
|
64
|
+
@levels = levels if levels != OMIT
|
|
65
|
+
@boosts = boosts if boosts != OMIT
|
|
66
|
+
@triggers = triggers if triggers != OMIT
|
|
67
|
+
@id = id
|
|
68
|
+
@name = name
|
|
69
|
+
@key = key
|
|
70
|
+
@description = description
|
|
71
|
+
@status = status
|
|
72
|
+
@badge = badge if badge != OMIT
|
|
73
|
+
@max_points = max_points if max_points != OMIT
|
|
74
|
+
@additional_properties = additional_properties
|
|
75
|
+
@_field_set = {
|
|
76
|
+
"levels": levels,
|
|
77
|
+
"boosts": boosts,
|
|
78
|
+
"triggers": triggers,
|
|
79
|
+
"id": id,
|
|
80
|
+
"name": name,
|
|
81
|
+
"key": key,
|
|
82
|
+
"description": description,
|
|
83
|
+
"status": status,
|
|
84
|
+
"badge": badge,
|
|
85
|
+
"maxPoints": max_points
|
|
86
|
+
}.reject do |_k, v|
|
|
87
|
+
v == OMIT
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Deserialize a JSON object to an instance of CreatedAdminPointsSystem
|
|
92
|
+
#
|
|
93
|
+
# @param json_object [String]
|
|
94
|
+
# @return [TrophyApiClient::CreatedAdminPointsSystem]
|
|
95
|
+
def self.from_json(json_object:)
|
|
96
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
97
|
+
parsed_json = JSON.parse(json_object)
|
|
98
|
+
levels = parsed_json["levels"]&.map do |item|
|
|
99
|
+
item = item.to_json
|
|
100
|
+
TrophyApiClient::AdminPointsLevel.from_json(json_object: item)
|
|
101
|
+
end
|
|
102
|
+
boosts = parsed_json["boosts"]&.map do |item|
|
|
103
|
+
item = item.to_json
|
|
104
|
+
TrophyApiClient::AdminPointsBoost.from_json(json_object: item)
|
|
105
|
+
end
|
|
106
|
+
triggers = parsed_json["triggers"]&.map do |item|
|
|
107
|
+
item = item.to_json
|
|
108
|
+
TrophyApiClient::AdminPointsTrigger.from_json(json_object: item)
|
|
109
|
+
end
|
|
110
|
+
id = parsed_json["id"]
|
|
111
|
+
name = parsed_json["name"]
|
|
112
|
+
key = parsed_json["key"]
|
|
113
|
+
description = parsed_json["description"]
|
|
114
|
+
status = parsed_json["status"]
|
|
115
|
+
if parsed_json["badge"].nil?
|
|
116
|
+
badge = nil
|
|
117
|
+
else
|
|
118
|
+
badge = parsed_json["badge"].to_json
|
|
119
|
+
badge = TrophyApiClient::AdminPointsSystemBadge.from_json(json_object: badge)
|
|
120
|
+
end
|
|
121
|
+
max_points = parsed_json["maxPoints"]
|
|
122
|
+
new(
|
|
123
|
+
levels: levels,
|
|
124
|
+
boosts: boosts,
|
|
125
|
+
triggers: triggers,
|
|
126
|
+
id: id,
|
|
127
|
+
name: name,
|
|
128
|
+
key: key,
|
|
129
|
+
description: description,
|
|
130
|
+
status: status,
|
|
131
|
+
badge: badge,
|
|
132
|
+
max_points: max_points,
|
|
133
|
+
additional_properties: struct
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Serialize an instance of CreatedAdminPointsSystem to a JSON object
|
|
138
|
+
#
|
|
139
|
+
# @return [String]
|
|
140
|
+
def to_json(*_args)
|
|
141
|
+
@_field_set&.to_json
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
145
|
+
# hash and check each fields type against the current object's property
|
|
146
|
+
# definitions.
|
|
147
|
+
#
|
|
148
|
+
# @param obj [Object]
|
|
149
|
+
# @return [Void]
|
|
150
|
+
def self.validate_raw(obj:)
|
|
151
|
+
obj.levels&.is_a?(Array) != false || raise("Passed value for field obj.levels is not the expected type, validation failed.")
|
|
152
|
+
obj.boosts&.is_a?(Array) != false || raise("Passed value for field obj.boosts is not the expected type, validation failed.")
|
|
153
|
+
obj.triggers&.is_a?(Array) != false || raise("Passed value for field obj.triggers is not the expected type, validation failed.")
|
|
154
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
155
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
156
|
+
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
|
157
|
+
obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
158
|
+
obj.status.is_a?(TrophyApiClient::AdminPointsSystemStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
|
159
|
+
obj.badge.nil? || TrophyApiClient::AdminPointsSystemBadge.validate_raw(obj: obj.badge)
|
|
160
|
+
obj.max_points&.is_a?(Integer) != false || raise("Passed value for field obj.max_points is not the expected type, validation failed.")
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "deleted_resource"
|
|
4
|
+
require_relative "admin_issue"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module TrophyApiClient
|
|
9
|
+
# Response containing the points levels that were deleted and any per-item issues.
|
|
10
|
+
class DeletePointsLevelsResponse
|
|
11
|
+
# @return [Array<TrophyApiClient::DeletedResource>] Array of deleted points levels represented by ID.
|
|
12
|
+
attr_reader :deleted
|
|
13
|
+
# @return [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during level deletion.
|
|
14
|
+
attr_reader :issues
|
|
15
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
16
|
+
attr_reader :additional_properties
|
|
17
|
+
# @return [Object]
|
|
18
|
+
attr_reader :_field_set
|
|
19
|
+
protected :_field_set
|
|
20
|
+
|
|
21
|
+
OMIT = Object.new
|
|
22
|
+
|
|
23
|
+
# @param deleted [Array<TrophyApiClient::DeletedResource>] Array of deleted points levels represented by ID.
|
|
24
|
+
# @param issues [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during level deletion.
|
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
|
+
# @return [TrophyApiClient::DeletePointsLevelsResponse]
|
|
27
|
+
def initialize(deleted:, issues:, additional_properties: nil)
|
|
28
|
+
@deleted = deleted
|
|
29
|
+
@issues = issues
|
|
30
|
+
@additional_properties = additional_properties
|
|
31
|
+
@_field_set = { "deleted": deleted, "issues": issues }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Deserialize a JSON object to an instance of DeletePointsLevelsResponse
|
|
35
|
+
#
|
|
36
|
+
# @param json_object [String]
|
|
37
|
+
# @return [TrophyApiClient::DeletePointsLevelsResponse]
|
|
38
|
+
def self.from_json(json_object:)
|
|
39
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
40
|
+
parsed_json = JSON.parse(json_object)
|
|
41
|
+
deleted = parsed_json["deleted"]&.map do |item|
|
|
42
|
+
item = item.to_json
|
|
43
|
+
TrophyApiClient::DeletedResource.from_json(json_object: item)
|
|
44
|
+
end
|
|
45
|
+
issues = parsed_json["issues"]&.map do |item|
|
|
46
|
+
item = item.to_json
|
|
47
|
+
TrophyApiClient::AdminIssue.from_json(json_object: item)
|
|
48
|
+
end
|
|
49
|
+
new(
|
|
50
|
+
deleted: deleted,
|
|
51
|
+
issues: issues,
|
|
52
|
+
additional_properties: struct
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Serialize an instance of DeletePointsLevelsResponse to a JSON object
|
|
57
|
+
#
|
|
58
|
+
# @return [String]
|
|
59
|
+
def to_json(*_args)
|
|
60
|
+
@_field_set&.to_json
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
64
|
+
# hash and check each fields type against the current object's property
|
|
65
|
+
# definitions.
|
|
66
|
+
#
|
|
67
|
+
# @param obj [Object]
|
|
68
|
+
# @return [Void]
|
|
69
|
+
def self.validate_raw(obj:)
|
|
70
|
+
obj.deleted.is_a?(Array) != false || raise("Passed value for field obj.deleted is not the expected type, validation failed.")
|
|
71
|
+
obj.issues.is_a?(Array) != false || raise("Passed value for field obj.issues is not the expected type, validation failed.")
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "deleted_resource"
|
|
4
|
+
require_relative "admin_issue"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module TrophyApiClient
|
|
9
|
+
# Response containing deleted points system IDs and any per-item issues.
|
|
10
|
+
class DeletePointsSystemsResponse
|
|
11
|
+
# @return [Array<TrophyApiClient::DeletedResource>] Array of deleted points system IDs.
|
|
12
|
+
attr_reader :deleted
|
|
13
|
+
# @return [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during deletion.
|
|
14
|
+
attr_reader :issues
|
|
15
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
16
|
+
attr_reader :additional_properties
|
|
17
|
+
# @return [Object]
|
|
18
|
+
attr_reader :_field_set
|
|
19
|
+
protected :_field_set
|
|
20
|
+
|
|
21
|
+
OMIT = Object.new
|
|
22
|
+
|
|
23
|
+
# @param deleted [Array<TrophyApiClient::DeletedResource>] Array of deleted points system IDs.
|
|
24
|
+
# @param issues [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during deletion.
|
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
|
+
# @return [TrophyApiClient::DeletePointsSystemsResponse]
|
|
27
|
+
def initialize(deleted:, issues:, additional_properties: nil)
|
|
28
|
+
@deleted = deleted
|
|
29
|
+
@issues = issues
|
|
30
|
+
@additional_properties = additional_properties
|
|
31
|
+
@_field_set = { "deleted": deleted, "issues": issues }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Deserialize a JSON object to an instance of DeletePointsSystemsResponse
|
|
35
|
+
#
|
|
36
|
+
# @param json_object [String]
|
|
37
|
+
# @return [TrophyApiClient::DeletePointsSystemsResponse]
|
|
38
|
+
def self.from_json(json_object:)
|
|
39
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
40
|
+
parsed_json = JSON.parse(json_object)
|
|
41
|
+
deleted = parsed_json["deleted"]&.map do |item|
|
|
42
|
+
item = item.to_json
|
|
43
|
+
TrophyApiClient::DeletedResource.from_json(json_object: item)
|
|
44
|
+
end
|
|
45
|
+
issues = parsed_json["issues"]&.map do |item|
|
|
46
|
+
item = item.to_json
|
|
47
|
+
TrophyApiClient::AdminIssue.from_json(json_object: item)
|
|
48
|
+
end
|
|
49
|
+
new(
|
|
50
|
+
deleted: deleted,
|
|
51
|
+
issues: issues,
|
|
52
|
+
additional_properties: struct
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Serialize an instance of DeletePointsSystemsResponse to a JSON object
|
|
57
|
+
#
|
|
58
|
+
# @return [String]
|
|
59
|
+
def to_json(*_args)
|
|
60
|
+
@_field_set&.to_json
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
64
|
+
# hash and check each fields type against the current object's property
|
|
65
|
+
# definitions.
|
|
66
|
+
#
|
|
67
|
+
# @param obj [Object]
|
|
68
|
+
# @return [Void]
|
|
69
|
+
def self.validate_raw(obj:)
|
|
70
|
+
obj.deleted.is_a?(Array) != false || raise("Passed value for field obj.deleted is not the expected type, validation failed.")
|
|
71
|
+
obj.issues.is_a?(Array) != false || raise("Passed value for field obj.issues is not the expected type, validation failed.")
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "deleted_resource"
|
|
4
|
+
require_relative "admin_issue"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module TrophyApiClient
|
|
9
|
+
# Response containing the points triggers that were deleted and any per-item
|
|
10
|
+
# issues.
|
|
11
|
+
class DeletePointsTriggersResponse
|
|
12
|
+
# @return [Array<TrophyApiClient::DeletedResource>] Array of deleted points triggers represented by ID.
|
|
13
|
+
attr_reader :deleted
|
|
14
|
+
# @return [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during trigger deletion.
|
|
15
|
+
attr_reader :issues
|
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
17
|
+
attr_reader :additional_properties
|
|
18
|
+
# @return [Object]
|
|
19
|
+
attr_reader :_field_set
|
|
20
|
+
protected :_field_set
|
|
21
|
+
|
|
22
|
+
OMIT = Object.new
|
|
23
|
+
|
|
24
|
+
# @param deleted [Array<TrophyApiClient::DeletedResource>] Array of deleted points triggers represented by ID.
|
|
25
|
+
# @param issues [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during trigger deletion.
|
|
26
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
27
|
+
# @return [TrophyApiClient::DeletePointsTriggersResponse]
|
|
28
|
+
def initialize(deleted:, issues:, additional_properties: nil)
|
|
29
|
+
@deleted = deleted
|
|
30
|
+
@issues = issues
|
|
31
|
+
@additional_properties = additional_properties
|
|
32
|
+
@_field_set = { "deleted": deleted, "issues": issues }
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Deserialize a JSON object to an instance of DeletePointsTriggersResponse
|
|
36
|
+
#
|
|
37
|
+
# @param json_object [String]
|
|
38
|
+
# @return [TrophyApiClient::DeletePointsTriggersResponse]
|
|
39
|
+
def self.from_json(json_object:)
|
|
40
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
41
|
+
parsed_json = JSON.parse(json_object)
|
|
42
|
+
deleted = parsed_json["deleted"]&.map do |item|
|
|
43
|
+
item = item.to_json
|
|
44
|
+
TrophyApiClient::DeletedResource.from_json(json_object: item)
|
|
45
|
+
end
|
|
46
|
+
issues = parsed_json["issues"]&.map do |item|
|
|
47
|
+
item = item.to_json
|
|
48
|
+
TrophyApiClient::AdminIssue.from_json(json_object: item)
|
|
49
|
+
end
|
|
50
|
+
new(
|
|
51
|
+
deleted: deleted,
|
|
52
|
+
issues: issues,
|
|
53
|
+
additional_properties: struct
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Serialize an instance of DeletePointsTriggersResponse to a JSON object
|
|
58
|
+
#
|
|
59
|
+
# @return [String]
|
|
60
|
+
def to_json(*_args)
|
|
61
|
+
@_field_set&.to_json
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
65
|
+
# hash and check each fields type against the current object's property
|
|
66
|
+
# definitions.
|
|
67
|
+
#
|
|
68
|
+
# @param obj [Object]
|
|
69
|
+
# @return [Void]
|
|
70
|
+
def self.validate_raw(obj:)
|
|
71
|
+
obj.deleted.is_a?(Array) != false || raise("Passed value for field obj.deleted is not the expected type, validation failed.")
|
|
72
|
+
obj.issues.is_a?(Array) != false || raise("Passed value for field obj.issues is not the expected type, validation failed.")
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "patch_points_boosts_request_item_rounding"
|
|
4
|
+
require_relative "patch_points_boosts_request_item_user_attributes_item"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module TrophyApiClient
|
|
9
|
+
class PatchPointsBoostsRequestItem
|
|
10
|
+
# @return [String] The UUID of the boost to update.
|
|
11
|
+
attr_reader :id
|
|
12
|
+
# @return [String] Updated name for the boost.
|
|
13
|
+
attr_reader :name
|
|
14
|
+
# @return [String] Updated start date (YYYY-MM-DD).
|
|
15
|
+
attr_reader :start
|
|
16
|
+
# @return [String] Updated end date (YYYY-MM-DD) or null to remove end date.
|
|
17
|
+
attr_reader :end_
|
|
18
|
+
# @return [Float] Updated points multiplier.
|
|
19
|
+
attr_reader :multiplier
|
|
20
|
+
# @return [TrophyApiClient::PatchPointsBoostsRequestItemRounding] Updated rounding strategy.
|
|
21
|
+
attr_reader :rounding
|
|
22
|
+
# @return [Array<TrophyApiClient::PatchPointsBoostsRequestItemUserAttributesItem>] Updated user attribute filters. Cannot be set on user-specific boosts. Set to
|
|
23
|
+
# null to clear.
|
|
24
|
+
attr_reader :user_attributes
|
|
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 id [String] The UUID of the boost to update.
|
|
34
|
+
# @param name [String] Updated name for the boost.
|
|
35
|
+
# @param start [String] Updated start date (YYYY-MM-DD).
|
|
36
|
+
# @param end_ [String] Updated end date (YYYY-MM-DD) or null to remove end date.
|
|
37
|
+
# @param multiplier [Float] Updated points multiplier.
|
|
38
|
+
# @param rounding [TrophyApiClient::PatchPointsBoostsRequestItemRounding] Updated rounding strategy.
|
|
39
|
+
# @param user_attributes [Array<TrophyApiClient::PatchPointsBoostsRequestItemUserAttributesItem>] Updated user attribute filters. Cannot be set on user-specific boosts. Set to
|
|
40
|
+
# null to clear.
|
|
41
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
42
|
+
# @return [TrophyApiClient::PatchPointsBoostsRequestItem]
|
|
43
|
+
def initialize(id:, name: OMIT, start: OMIT, end_: OMIT, multiplier: OMIT, rounding: OMIT, user_attributes: OMIT,
|
|
44
|
+
additional_properties: nil)
|
|
45
|
+
@id = id
|
|
46
|
+
@name = name if name != OMIT
|
|
47
|
+
@start = start if start != OMIT
|
|
48
|
+
@end_ = end_ if end_ != OMIT
|
|
49
|
+
@multiplier = multiplier if multiplier != OMIT
|
|
50
|
+
@rounding = rounding if rounding != OMIT
|
|
51
|
+
@user_attributes = user_attributes if user_attributes != OMIT
|
|
52
|
+
@additional_properties = additional_properties
|
|
53
|
+
@_field_set = {
|
|
54
|
+
"id": id,
|
|
55
|
+
"name": name,
|
|
56
|
+
"start": start,
|
|
57
|
+
"end": end_,
|
|
58
|
+
"multiplier": multiplier,
|
|
59
|
+
"rounding": rounding,
|
|
60
|
+
"userAttributes": user_attributes
|
|
61
|
+
}.reject do |_k, v|
|
|
62
|
+
v == OMIT
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Deserialize a JSON object to an instance of PatchPointsBoostsRequestItem
|
|
67
|
+
#
|
|
68
|
+
# @param json_object [String]
|
|
69
|
+
# @return [TrophyApiClient::PatchPointsBoostsRequestItem]
|
|
70
|
+
def self.from_json(json_object:)
|
|
71
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
72
|
+
parsed_json = JSON.parse(json_object)
|
|
73
|
+
id = parsed_json["id"]
|
|
74
|
+
name = parsed_json["name"]
|
|
75
|
+
start = parsed_json["start"]
|
|
76
|
+
end_ = parsed_json["end"]
|
|
77
|
+
multiplier = parsed_json["multiplier"]
|
|
78
|
+
rounding = parsed_json["rounding"]
|
|
79
|
+
user_attributes = parsed_json["userAttributes"]&.map do |item|
|
|
80
|
+
item = item.to_json
|
|
81
|
+
TrophyApiClient::PatchPointsBoostsRequestItemUserAttributesItem.from_json(json_object: item)
|
|
82
|
+
end
|
|
83
|
+
new(
|
|
84
|
+
id: id,
|
|
85
|
+
name: name,
|
|
86
|
+
start: start,
|
|
87
|
+
end_: end_,
|
|
88
|
+
multiplier: multiplier,
|
|
89
|
+
rounding: rounding,
|
|
90
|
+
user_attributes: user_attributes,
|
|
91
|
+
additional_properties: struct
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Serialize an instance of PatchPointsBoostsRequestItem to a JSON object
|
|
96
|
+
#
|
|
97
|
+
# @return [String]
|
|
98
|
+
def to_json(*_args)
|
|
99
|
+
@_field_set&.to_json
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
103
|
+
# hash and check each fields type against the current object's property
|
|
104
|
+
# definitions.
|
|
105
|
+
#
|
|
106
|
+
# @param obj [Object]
|
|
107
|
+
# @return [Void]
|
|
108
|
+
def self.validate_raw(obj:)
|
|
109
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
110
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
111
|
+
obj.start&.is_a?(String) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
|
112
|
+
obj.end_&.is_a?(String) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
|
113
|
+
obj.multiplier&.is_a?(Float) != false || raise("Passed value for field obj.multiplier is not the expected type, validation failed.")
|
|
114
|
+
obj.rounding&.is_a?(TrophyApiClient::PatchPointsBoostsRequestItemRounding) != false || raise("Passed value for field obj.rounding is not the expected type, validation failed.")
|
|
115
|
+
obj.user_attributes&.is_a?(Array) != false || raise("Passed value for field obj.user_attributes is not the expected type, validation failed.")
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|