Class: TrophyApiClient::DeletePointsBoostsResponse
- Inherits:
-
Object
- Object
- TrophyApiClient::DeletePointsBoostsResponse
- Defined in:
- lib/trophy_api_client/types/delete_points_boosts_response.rb
Overview
Response containing the points boosts that were deleted and any per-item issues.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#deleted ⇒ Array<TrophyApiClient::DeletedResource>
readonly
Array of deleted points boosts represented by ID.
-
#issues ⇒ Array<TrophyApiClient::AdminIssue>
readonly
Array of issues encountered during boost archival.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ TrophyApiClient::DeletePointsBoostsResponse
Deserialize a JSON object to an instance of DeletePointsBoostsResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(deleted:, issues:, additional_properties: nil) ⇒ TrophyApiClient::DeletePointsBoostsResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of DeletePointsBoostsResponse to a JSON object.
Constructor Details
#initialize(deleted:, issues:, additional_properties: nil) ⇒ TrophyApiClient::DeletePointsBoostsResponse
27 28 29 30 31 32 |
# File 'lib/trophy_api_client/types/delete_points_boosts_response.rb', line 27 def initialize(deleted:, issues:, additional_properties: nil) @deleted = deleted @issues = issues @additional_properties = additional_properties @_field_set = { "deleted": deleted, "issues": issues } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/trophy_api_client/types/delete_points_boosts_response.rb', line 16 def additional_properties @additional_properties end |
#deleted ⇒ Array<TrophyApiClient::DeletedResource> (readonly)
Returns Array of deleted points boosts represented by ID.
12 13 14 |
# File 'lib/trophy_api_client/types/delete_points_boosts_response.rb', line 12 def deleted @deleted end |
#issues ⇒ Array<TrophyApiClient::AdminIssue> (readonly)
Returns Array of issues encountered during boost archival.
14 15 16 |
# File 'lib/trophy_api_client/types/delete_points_boosts_response.rb', line 14 def issues @issues end |
Class Method Details
.from_json(json_object:) ⇒ TrophyApiClient::DeletePointsBoostsResponse
Deserialize a JSON object to an instance of DeletePointsBoostsResponse
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/trophy_api_client/types/delete_points_boosts_response.rb', line 38 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) deleted = parsed_json["deleted"]&.map do |item| item = item.to_json TrophyApiClient::DeletedResource.from_json(json_object: item) end issues = parsed_json["issues"]&.map do |item| item = item.to_json TrophyApiClient::AdminIssue.from_json(json_object: item) end new( deleted: deleted, issues: issues, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
69 70 71 72 |
# File 'lib/trophy_api_client/types/delete_points_boosts_response.rb', line 69 def self.validate_raw(obj:) obj.deleted.is_a?(Array) != false || raise("Passed value for field obj.deleted is not the expected type, validation failed.") obj.issues.is_a?(Array) != false || raise("Passed value for field obj.issues is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of DeletePointsBoostsResponse to a JSON object
59 60 61 |
# File 'lib/trophy_api_client/types/delete_points_boosts_response.rb', line 59 def to_json(*_args) @_field_set&.to_json end |