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,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module TrophyApiClient
|
|
7
|
+
class PatchPointsBoostsRequestItemUserAttributesItem
|
|
8
|
+
# @return [String] The UUID of the user attribute.
|
|
9
|
+
attr_reader :attribute_id
|
|
10
|
+
# @return [String] The value to match.
|
|
11
|
+
attr_reader :attribute_value
|
|
12
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
13
|
+
attr_reader :additional_properties
|
|
14
|
+
# @return [Object]
|
|
15
|
+
attr_reader :_field_set
|
|
16
|
+
protected :_field_set
|
|
17
|
+
|
|
18
|
+
OMIT = Object.new
|
|
19
|
+
|
|
20
|
+
# @param attribute_id [String] The UUID of the user attribute.
|
|
21
|
+
# @param attribute_value [String] The value to match.
|
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
23
|
+
# @return [TrophyApiClient::PatchPointsBoostsRequestItemUserAttributesItem]
|
|
24
|
+
def initialize(attribute_id:, attribute_value:, additional_properties: nil)
|
|
25
|
+
@attribute_id = attribute_id
|
|
26
|
+
@attribute_value = attribute_value
|
|
27
|
+
@additional_properties = additional_properties
|
|
28
|
+
@_field_set = { "attributeId": attribute_id, "attributeValue": attribute_value }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Deserialize a JSON object to an instance of
|
|
32
|
+
# PatchPointsBoostsRequestItemUserAttributesItem
|
|
33
|
+
#
|
|
34
|
+
# @param json_object [String]
|
|
35
|
+
# @return [TrophyApiClient::PatchPointsBoostsRequestItemUserAttributesItem]
|
|
36
|
+
def self.from_json(json_object:)
|
|
37
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
38
|
+
parsed_json = JSON.parse(json_object)
|
|
39
|
+
attribute_id = parsed_json["attributeId"]
|
|
40
|
+
attribute_value = parsed_json["attributeValue"]
|
|
41
|
+
new(
|
|
42
|
+
attribute_id: attribute_id,
|
|
43
|
+
attribute_value: attribute_value,
|
|
44
|
+
additional_properties: struct
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Serialize an instance of PatchPointsBoostsRequestItemUserAttributesItem to a
|
|
49
|
+
# JSON object
|
|
50
|
+
#
|
|
51
|
+
# @return [String]
|
|
52
|
+
def to_json(*_args)
|
|
53
|
+
@_field_set&.to_json
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
57
|
+
# hash and check each fields type against the current object's property
|
|
58
|
+
# definitions.
|
|
59
|
+
#
|
|
60
|
+
# @param obj [Object]
|
|
61
|
+
# @return [Void]
|
|
62
|
+
def self.validate_raw(obj:)
|
|
63
|
+
obj.attribute_id.is_a?(String) != false || raise("Passed value for field obj.attribute_id is not the expected type, validation failed.")
|
|
64
|
+
obj.attribute_value.is_a?(String) != false || raise("Passed value for field obj.attribute_value is not the expected type, validation failed.")
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "admin_points_boost"
|
|
4
|
+
require_relative "admin_issue"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module TrophyApiClient
|
|
9
|
+
# Response containing updated boosts and any issues encountered.
|
|
10
|
+
class PatchPointsBoostsResponse
|
|
11
|
+
# @return [Array<TrophyApiClient::AdminPointsBoost>] Array of successfully updated boosts.
|
|
12
|
+
attr_reader :updated
|
|
13
|
+
# @return [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during boost updates.
|
|
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 updated [Array<TrophyApiClient::AdminPointsBoost>] Array of successfully updated boosts.
|
|
24
|
+
# @param issues [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during boost updates.
|
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
|
+
# @return [TrophyApiClient::PatchPointsBoostsResponse]
|
|
27
|
+
def initialize(updated:, issues:, additional_properties: nil)
|
|
28
|
+
@updated = updated
|
|
29
|
+
@issues = issues
|
|
30
|
+
@additional_properties = additional_properties
|
|
31
|
+
@_field_set = { "updated": updated, "issues": issues }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Deserialize a JSON object to an instance of PatchPointsBoostsResponse
|
|
35
|
+
#
|
|
36
|
+
# @param json_object [String]
|
|
37
|
+
# @return [TrophyApiClient::PatchPointsBoostsResponse]
|
|
38
|
+
def self.from_json(json_object:)
|
|
39
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
40
|
+
parsed_json = JSON.parse(json_object)
|
|
41
|
+
updated = parsed_json["updated"]&.map do |item|
|
|
42
|
+
item = item.to_json
|
|
43
|
+
TrophyApiClient::AdminPointsBoost.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
|
+
updated: updated,
|
|
51
|
+
issues: issues,
|
|
52
|
+
additional_properties: struct
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Serialize an instance of PatchPointsBoostsResponse 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.updated.is_a?(Array) != false || raise("Passed value for field obj.updated 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,100 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "patch_points_levels_request_item_badge"
|
|
4
|
+
require "ostruct"
|
|
5
|
+
require "json"
|
|
6
|
+
|
|
7
|
+
module TrophyApiClient
|
|
8
|
+
class PatchPointsLevelsRequestItem
|
|
9
|
+
# @return [String] The UUID of the level to update.
|
|
10
|
+
attr_reader :id
|
|
11
|
+
# @return [String] The updated level name.
|
|
12
|
+
attr_reader :name
|
|
13
|
+
# @return [Integer] The updated threshold points value.
|
|
14
|
+
attr_reader :points
|
|
15
|
+
# @return [String] The updated level description.
|
|
16
|
+
attr_reader :description
|
|
17
|
+
# @return [TrophyApiClient::PatchPointsLevelsRequestItemBadge] The updated badge, or `null` to clear it.
|
|
18
|
+
attr_reader :badge
|
|
19
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
20
|
+
attr_reader :additional_properties
|
|
21
|
+
# @return [Object]
|
|
22
|
+
attr_reader :_field_set
|
|
23
|
+
protected :_field_set
|
|
24
|
+
|
|
25
|
+
OMIT = Object.new
|
|
26
|
+
|
|
27
|
+
# @param id [String] The UUID of the level to update.
|
|
28
|
+
# @param name [String] The updated level name.
|
|
29
|
+
# @param points [Integer] The updated threshold points value.
|
|
30
|
+
# @param description [String] The updated level description.
|
|
31
|
+
# @param badge [TrophyApiClient::PatchPointsLevelsRequestItemBadge] The updated badge, or `null` to clear it.
|
|
32
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
33
|
+
# @return [TrophyApiClient::PatchPointsLevelsRequestItem]
|
|
34
|
+
def initialize(id:, name: OMIT, points: OMIT, description: OMIT, badge: OMIT, additional_properties: nil)
|
|
35
|
+
@id = id
|
|
36
|
+
@name = name if name != OMIT
|
|
37
|
+
@points = points if points != OMIT
|
|
38
|
+
@description = description if description != OMIT
|
|
39
|
+
@badge = badge if badge != OMIT
|
|
40
|
+
@additional_properties = additional_properties
|
|
41
|
+
@_field_set = {
|
|
42
|
+
"id": id,
|
|
43
|
+
"name": name,
|
|
44
|
+
"points": points,
|
|
45
|
+
"description": description,
|
|
46
|
+
"badge": badge
|
|
47
|
+
}.reject do |_k, v|
|
|
48
|
+
v == OMIT
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Deserialize a JSON object to an instance of PatchPointsLevelsRequestItem
|
|
53
|
+
#
|
|
54
|
+
# @param json_object [String]
|
|
55
|
+
# @return [TrophyApiClient::PatchPointsLevelsRequestItem]
|
|
56
|
+
def self.from_json(json_object:)
|
|
57
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
58
|
+
parsed_json = JSON.parse(json_object)
|
|
59
|
+
id = parsed_json["id"]
|
|
60
|
+
name = parsed_json["name"]
|
|
61
|
+
points = parsed_json["points"]
|
|
62
|
+
description = parsed_json["description"]
|
|
63
|
+
if parsed_json["badge"].nil?
|
|
64
|
+
badge = nil
|
|
65
|
+
else
|
|
66
|
+
badge = parsed_json["badge"].to_json
|
|
67
|
+
badge = TrophyApiClient::PatchPointsLevelsRequestItemBadge.from_json(json_object: badge)
|
|
68
|
+
end
|
|
69
|
+
new(
|
|
70
|
+
id: id,
|
|
71
|
+
name: name,
|
|
72
|
+
points: points,
|
|
73
|
+
description: description,
|
|
74
|
+
badge: badge,
|
|
75
|
+
additional_properties: struct
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Serialize an instance of PatchPointsLevelsRequestItem to a JSON object
|
|
80
|
+
#
|
|
81
|
+
# @return [String]
|
|
82
|
+
def to_json(*_args)
|
|
83
|
+
@_field_set&.to_json
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
87
|
+
# hash and check each fields type against the current object's property
|
|
88
|
+
# definitions.
|
|
89
|
+
#
|
|
90
|
+
# @param obj [Object]
|
|
91
|
+
# @return [Void]
|
|
92
|
+
def self.validate_raw(obj:)
|
|
93
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
94
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
95
|
+
obj.points&.is_a?(Integer) != false || raise("Passed value for field obj.points is not the expected type, validation failed.")
|
|
96
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
97
|
+
obj.badge.nil? || TrophyApiClient::PatchPointsLevelsRequestItemBadge.validate_raw(obj: obj.badge)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module TrophyApiClient
|
|
7
|
+
class PatchPointsLevelsRequestItemBadge
|
|
8
|
+
# @return [String] The URL of the badge image.
|
|
9
|
+
attr_reader :url
|
|
10
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
11
|
+
attr_reader :additional_properties
|
|
12
|
+
# @return [Object]
|
|
13
|
+
attr_reader :_field_set
|
|
14
|
+
protected :_field_set
|
|
15
|
+
|
|
16
|
+
OMIT = Object.new
|
|
17
|
+
|
|
18
|
+
# @param url [String] The URL of the badge image.
|
|
19
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
20
|
+
# @return [TrophyApiClient::PatchPointsLevelsRequestItemBadge]
|
|
21
|
+
def initialize(url:, additional_properties: nil)
|
|
22
|
+
@url = url
|
|
23
|
+
@additional_properties = additional_properties
|
|
24
|
+
@_field_set = { "url": url }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Deserialize a JSON object to an instance of PatchPointsLevelsRequestItemBadge
|
|
28
|
+
#
|
|
29
|
+
# @param json_object [String]
|
|
30
|
+
# @return [TrophyApiClient::PatchPointsLevelsRequestItemBadge]
|
|
31
|
+
def self.from_json(json_object:)
|
|
32
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
33
|
+
parsed_json = JSON.parse(json_object)
|
|
34
|
+
url = parsed_json["url"]
|
|
35
|
+
new(url: url, additional_properties: struct)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Serialize an instance of PatchPointsLevelsRequestItemBadge to a JSON object
|
|
39
|
+
#
|
|
40
|
+
# @return [String]
|
|
41
|
+
def to_json(*_args)
|
|
42
|
+
@_field_set&.to_json
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
46
|
+
# hash and check each fields type against the current object's property
|
|
47
|
+
# definitions.
|
|
48
|
+
#
|
|
49
|
+
# @param obj [Object]
|
|
50
|
+
# @return [Void]
|
|
51
|
+
def self.validate_raw(obj:)
|
|
52
|
+
obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "admin_points_level"
|
|
4
|
+
require_relative "admin_issue"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module TrophyApiClient
|
|
9
|
+
# Response containing updated levels and any issues encountered.
|
|
10
|
+
class PatchPointsLevelsResponse
|
|
11
|
+
# @return [Array<TrophyApiClient::AdminPointsLevel>] Array of successfully updated levels.
|
|
12
|
+
attr_reader :updated
|
|
13
|
+
# @return [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during level updates.
|
|
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 updated [Array<TrophyApiClient::AdminPointsLevel>] Array of successfully updated levels.
|
|
24
|
+
# @param issues [Array<TrophyApiClient::AdminIssue>] Array of issues encountered during level updates.
|
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
|
+
# @return [TrophyApiClient::PatchPointsLevelsResponse]
|
|
27
|
+
def initialize(updated:, issues:, additional_properties: nil)
|
|
28
|
+
@updated = updated
|
|
29
|
+
@issues = issues
|
|
30
|
+
@additional_properties = additional_properties
|
|
31
|
+
@_field_set = { "updated": updated, "issues": issues }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Deserialize a JSON object to an instance of PatchPointsLevelsResponse
|
|
35
|
+
#
|
|
36
|
+
# @param json_object [String]
|
|
37
|
+
# @return [TrophyApiClient::PatchPointsLevelsResponse]
|
|
38
|
+
def self.from_json(json_object:)
|
|
39
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
40
|
+
parsed_json = JSON.parse(json_object)
|
|
41
|
+
updated = parsed_json["updated"]&.map do |item|
|
|
42
|
+
item = item.to_json
|
|
43
|
+
TrophyApiClient::AdminPointsLevel.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
|
+
updated: updated,
|
|
51
|
+
issues: issues,
|
|
52
|
+
additional_properties: struct
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Serialize an instance of PatchPointsLevelsResponse 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.updated.is_a?(Array) != false || raise("Passed value for field obj.updated 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,174 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "patch_points_triggers_request_item_type"
|
|
4
|
+
require_relative "patch_points_triggers_request_item_status"
|
|
5
|
+
require_relative "patch_points_triggers_request_item_user_attributes_item"
|
|
6
|
+
require_relative "patch_points_triggers_request_item_event_attributes_item"
|
|
7
|
+
require_relative "patch_points_triggers_request_item_time_unit"
|
|
8
|
+
require "ostruct"
|
|
9
|
+
require "json"
|
|
10
|
+
|
|
11
|
+
module TrophyApiClient
|
|
12
|
+
class PatchPointsTriggersRequestItem
|
|
13
|
+
# @return [String] The UUID of the trigger to update.
|
|
14
|
+
attr_reader :id
|
|
15
|
+
# @return [TrophyApiClient::PatchPointsTriggersRequestItemType] Updated trigger type. Can only be changed when the trigger is inactive. Required
|
|
16
|
+
# fields for the new type must be provided.
|
|
17
|
+
attr_reader :type
|
|
18
|
+
# @return [Integer] Updated points value.
|
|
19
|
+
attr_reader :points
|
|
20
|
+
# @return [TrophyApiClient::PatchPointsTriggersRequestItemStatus] Updated status.
|
|
21
|
+
attr_reader :status
|
|
22
|
+
# @return [Array<TrophyApiClient::PatchPointsTriggersRequestItemUserAttributesItem>] Updated user attribute filters. Set to null to clear.
|
|
23
|
+
attr_reader :user_attributes
|
|
24
|
+
# @return [String] Updated metric ID. Only permitted for metric triggers.
|
|
25
|
+
attr_reader :metric_id
|
|
26
|
+
# @return [Integer] Updated metric threshold. Only permitted for metric triggers.
|
|
27
|
+
attr_reader :metric_threshold
|
|
28
|
+
# @return [Array<TrophyApiClient::PatchPointsTriggersRequestItemEventAttributesItem>] Updated event attribute filters. Only permitted for metric triggers. Set to null
|
|
29
|
+
# to clear.
|
|
30
|
+
attr_reader :event_attributes
|
|
31
|
+
# @return [String] Updated achievement ID. Only permitted for achievement triggers.
|
|
32
|
+
attr_reader :achievement_id
|
|
33
|
+
# @return [Integer] Updated streak length. Only permitted for streak triggers.
|
|
34
|
+
attr_reader :streak_length
|
|
35
|
+
# @return [TrophyApiClient::PatchPointsTriggersRequestItemTimeUnit] Updated time unit. Only permitted for time triggers.
|
|
36
|
+
attr_reader :time_unit
|
|
37
|
+
# @return [Integer] Updated time interval. Only permitted for time triggers.
|
|
38
|
+
attr_reader :time_interval
|
|
39
|
+
# @return [Boolean] Updated block-if-out-of-points setting.
|
|
40
|
+
attr_reader :block_if_out_of_points
|
|
41
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
42
|
+
attr_reader :additional_properties
|
|
43
|
+
# @return [Object]
|
|
44
|
+
attr_reader :_field_set
|
|
45
|
+
protected :_field_set
|
|
46
|
+
|
|
47
|
+
OMIT = Object.new
|
|
48
|
+
|
|
49
|
+
# @param id [String] The UUID of the trigger to update.
|
|
50
|
+
# @param type [TrophyApiClient::PatchPointsTriggersRequestItemType] Updated trigger type. Can only be changed when the trigger is inactive. Required
|
|
51
|
+
# fields for the new type must be provided.
|
|
52
|
+
# @param points [Integer] Updated points value.
|
|
53
|
+
# @param status [TrophyApiClient::PatchPointsTriggersRequestItemStatus] Updated status.
|
|
54
|
+
# @param user_attributes [Array<TrophyApiClient::PatchPointsTriggersRequestItemUserAttributesItem>] Updated user attribute filters. Set to null to clear.
|
|
55
|
+
# @param metric_id [String] Updated metric ID. Only permitted for metric triggers.
|
|
56
|
+
# @param metric_threshold [Integer] Updated metric threshold. Only permitted for metric triggers.
|
|
57
|
+
# @param event_attributes [Array<TrophyApiClient::PatchPointsTriggersRequestItemEventAttributesItem>] Updated event attribute filters. Only permitted for metric triggers. Set to null
|
|
58
|
+
# to clear.
|
|
59
|
+
# @param achievement_id [String] Updated achievement ID. Only permitted for achievement triggers.
|
|
60
|
+
# @param streak_length [Integer] Updated streak length. Only permitted for streak triggers.
|
|
61
|
+
# @param time_unit [TrophyApiClient::PatchPointsTriggersRequestItemTimeUnit] Updated time unit. Only permitted for time triggers.
|
|
62
|
+
# @param time_interval [Integer] Updated time interval. Only permitted for time triggers.
|
|
63
|
+
# @param block_if_out_of_points [Boolean] Updated block-if-out-of-points setting.
|
|
64
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
65
|
+
# @return [TrophyApiClient::PatchPointsTriggersRequestItem]
|
|
66
|
+
def initialize(id:, type: OMIT, points: OMIT, status: OMIT, user_attributes: OMIT, metric_id: OMIT,
|
|
67
|
+
metric_threshold: OMIT, event_attributes: OMIT, achievement_id: OMIT, streak_length: OMIT, time_unit: OMIT, time_interval: OMIT, block_if_out_of_points: OMIT, additional_properties: nil)
|
|
68
|
+
@id = id
|
|
69
|
+
@type = type if type != OMIT
|
|
70
|
+
@points = points if points != OMIT
|
|
71
|
+
@status = status if status != OMIT
|
|
72
|
+
@user_attributes = user_attributes if user_attributes != OMIT
|
|
73
|
+
@metric_id = metric_id if metric_id != OMIT
|
|
74
|
+
@metric_threshold = metric_threshold if metric_threshold != OMIT
|
|
75
|
+
@event_attributes = event_attributes if event_attributes != OMIT
|
|
76
|
+
@achievement_id = achievement_id if achievement_id != OMIT
|
|
77
|
+
@streak_length = streak_length if streak_length != OMIT
|
|
78
|
+
@time_unit = time_unit if time_unit != OMIT
|
|
79
|
+
@time_interval = time_interval if time_interval != OMIT
|
|
80
|
+
@block_if_out_of_points = block_if_out_of_points if block_if_out_of_points != OMIT
|
|
81
|
+
@additional_properties = additional_properties
|
|
82
|
+
@_field_set = {
|
|
83
|
+
"id": id,
|
|
84
|
+
"type": type,
|
|
85
|
+
"points": points,
|
|
86
|
+
"status": status,
|
|
87
|
+
"userAttributes": user_attributes,
|
|
88
|
+
"metricId": metric_id,
|
|
89
|
+
"metricThreshold": metric_threshold,
|
|
90
|
+
"eventAttributes": event_attributes,
|
|
91
|
+
"achievementId": achievement_id,
|
|
92
|
+
"streakLength": streak_length,
|
|
93
|
+
"timeUnit": time_unit,
|
|
94
|
+
"timeInterval": time_interval,
|
|
95
|
+
"blockIfOutOfPoints": block_if_out_of_points
|
|
96
|
+
}.reject do |_k, v|
|
|
97
|
+
v == OMIT
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Deserialize a JSON object to an instance of PatchPointsTriggersRequestItem
|
|
102
|
+
#
|
|
103
|
+
# @param json_object [String]
|
|
104
|
+
# @return [TrophyApiClient::PatchPointsTriggersRequestItem]
|
|
105
|
+
def self.from_json(json_object:)
|
|
106
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
107
|
+
parsed_json = JSON.parse(json_object)
|
|
108
|
+
id = parsed_json["id"]
|
|
109
|
+
type = parsed_json["type"]
|
|
110
|
+
points = parsed_json["points"]
|
|
111
|
+
status = parsed_json["status"]
|
|
112
|
+
user_attributes = parsed_json["userAttributes"]&.map do |item|
|
|
113
|
+
item = item.to_json
|
|
114
|
+
TrophyApiClient::PatchPointsTriggersRequestItemUserAttributesItem.from_json(json_object: item)
|
|
115
|
+
end
|
|
116
|
+
metric_id = parsed_json["metricId"]
|
|
117
|
+
metric_threshold = parsed_json["metricThreshold"]
|
|
118
|
+
event_attributes = parsed_json["eventAttributes"]&.map do |item|
|
|
119
|
+
item = item.to_json
|
|
120
|
+
TrophyApiClient::PatchPointsTriggersRequestItemEventAttributesItem.from_json(json_object: item)
|
|
121
|
+
end
|
|
122
|
+
achievement_id = parsed_json["achievementId"]
|
|
123
|
+
streak_length = parsed_json["streakLength"]
|
|
124
|
+
time_unit = parsed_json["timeUnit"]
|
|
125
|
+
time_interval = parsed_json["timeInterval"]
|
|
126
|
+
block_if_out_of_points = parsed_json["blockIfOutOfPoints"]
|
|
127
|
+
new(
|
|
128
|
+
id: id,
|
|
129
|
+
type: type,
|
|
130
|
+
points: points,
|
|
131
|
+
status: status,
|
|
132
|
+
user_attributes: user_attributes,
|
|
133
|
+
metric_id: metric_id,
|
|
134
|
+
metric_threshold: metric_threshold,
|
|
135
|
+
event_attributes: event_attributes,
|
|
136
|
+
achievement_id: achievement_id,
|
|
137
|
+
streak_length: streak_length,
|
|
138
|
+
time_unit: time_unit,
|
|
139
|
+
time_interval: time_interval,
|
|
140
|
+
block_if_out_of_points: block_if_out_of_points,
|
|
141
|
+
additional_properties: struct
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Serialize an instance of PatchPointsTriggersRequestItem to a JSON object
|
|
146
|
+
#
|
|
147
|
+
# @return [String]
|
|
148
|
+
def to_json(*_args)
|
|
149
|
+
@_field_set&.to_json
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
153
|
+
# hash and check each fields type against the current object's property
|
|
154
|
+
# definitions.
|
|
155
|
+
#
|
|
156
|
+
# @param obj [Object]
|
|
157
|
+
# @return [Void]
|
|
158
|
+
def self.validate_raw(obj:)
|
|
159
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
160
|
+
obj.type&.is_a?(TrophyApiClient::PatchPointsTriggersRequestItemType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
|
161
|
+
obj.points&.is_a?(Integer) != false || raise("Passed value for field obj.points is not the expected type, validation failed.")
|
|
162
|
+
obj.status&.is_a?(TrophyApiClient::PatchPointsTriggersRequestItemStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
|
163
|
+
obj.user_attributes&.is_a?(Array) != false || raise("Passed value for field obj.user_attributes is not the expected type, validation failed.")
|
|
164
|
+
obj.metric_id&.is_a?(String) != false || raise("Passed value for field obj.metric_id is not the expected type, validation failed.")
|
|
165
|
+
obj.metric_threshold&.is_a?(Integer) != false || raise("Passed value for field obj.metric_threshold is not the expected type, validation failed.")
|
|
166
|
+
obj.event_attributes&.is_a?(Array) != false || raise("Passed value for field obj.event_attributes is not the expected type, validation failed.")
|
|
167
|
+
obj.achievement_id&.is_a?(String) != false || raise("Passed value for field obj.achievement_id is not the expected type, validation failed.")
|
|
168
|
+
obj.streak_length&.is_a?(Integer) != false || raise("Passed value for field obj.streak_length is not the expected type, validation failed.")
|
|
169
|
+
obj.time_unit&.is_a?(TrophyApiClient::PatchPointsTriggersRequestItemTimeUnit) != false || raise("Passed value for field obj.time_unit is not the expected type, validation failed.")
|
|
170
|
+
obj.time_interval&.is_a?(Integer) != false || raise("Passed value for field obj.time_interval is not the expected type, validation failed.")
|
|
171
|
+
obj.block_if_out_of_points&.is_a?(Boolean) != false || raise("Passed value for field obj.block_if_out_of_points is not the expected type, validation failed.")
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module TrophyApiClient
|
|
7
|
+
class PatchPointsTriggersRequestItemEventAttributesItem
|
|
8
|
+
# @return [String]
|
|
9
|
+
attr_reader :attribute_id
|
|
10
|
+
# @return [String]
|
|
11
|
+
attr_reader :attribute_value
|
|
12
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
13
|
+
attr_reader :additional_properties
|
|
14
|
+
# @return [Object]
|
|
15
|
+
attr_reader :_field_set
|
|
16
|
+
protected :_field_set
|
|
17
|
+
|
|
18
|
+
OMIT = Object.new
|
|
19
|
+
|
|
20
|
+
# @param attribute_id [String]
|
|
21
|
+
# @param attribute_value [String]
|
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
23
|
+
# @return [TrophyApiClient::PatchPointsTriggersRequestItemEventAttributesItem]
|
|
24
|
+
def initialize(attribute_id:, attribute_value:, additional_properties: nil)
|
|
25
|
+
@attribute_id = attribute_id
|
|
26
|
+
@attribute_value = attribute_value
|
|
27
|
+
@additional_properties = additional_properties
|
|
28
|
+
@_field_set = { "attributeId": attribute_id, "attributeValue": attribute_value }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Deserialize a JSON object to an instance of
|
|
32
|
+
# PatchPointsTriggersRequestItemEventAttributesItem
|
|
33
|
+
#
|
|
34
|
+
# @param json_object [String]
|
|
35
|
+
# @return [TrophyApiClient::PatchPointsTriggersRequestItemEventAttributesItem]
|
|
36
|
+
def self.from_json(json_object:)
|
|
37
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
38
|
+
parsed_json = JSON.parse(json_object)
|
|
39
|
+
attribute_id = parsed_json["attributeId"]
|
|
40
|
+
attribute_value = parsed_json["attributeValue"]
|
|
41
|
+
new(
|
|
42
|
+
attribute_id: attribute_id,
|
|
43
|
+
attribute_value: attribute_value,
|
|
44
|
+
additional_properties: struct
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Serialize an instance of PatchPointsTriggersRequestItemEventAttributesItem to a
|
|
49
|
+
# JSON object
|
|
50
|
+
#
|
|
51
|
+
# @return [String]
|
|
52
|
+
def to_json(*_args)
|
|
53
|
+
@_field_set&.to_json
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
57
|
+
# hash and check each fields type against the current object's property
|
|
58
|
+
# definitions.
|
|
59
|
+
#
|
|
60
|
+
# @param obj [Object]
|
|
61
|
+
# @return [Void]
|
|
62
|
+
def self.validate_raw(obj:)
|
|
63
|
+
obj.attribute_id.is_a?(String) != false || raise("Passed value for field obj.attribute_id is not the expected type, validation failed.")
|
|
64
|
+
obj.attribute_value.is_a?(String) != false || raise("Passed value for field obj.attribute_value is not the expected type, validation failed.")
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module TrophyApiClient
|
|
4
|
+
# Updated trigger type. Can only be changed when the trigger is inactive. Required
|
|
5
|
+
# fields for the new type must be provided.
|
|
6
|
+
class PatchPointsTriggersRequestItemType
|
|
7
|
+
METRIC = "metric"
|
|
8
|
+
ACHIEVEMENT = "achievement"
|
|
9
|
+
STREAK = "streak"
|
|
10
|
+
TIME = "time"
|
|
11
|
+
USER_CREATION = "user_creation"
|
|
12
|
+
end
|
|
13
|
+
end
|