Class: TrophyApiClient::BulkInsertIssue
- Inherits:
-
Object
- Object
- TrophyApiClient::BulkInsertIssue
- Defined in:
- lib/trophy_api_client/types/bulk_insert_issue.rb
Overview
An issue encountered while bulk inserting data.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#level ⇒ TrophyApiClient::BulkInsertIssueLevel
readonly
The severity level of the issue.
-
#reason ⇒ String
readonly
A human-readable description of the issue.
-
#user_id ⇒ String
readonly
The ID of the user the issue relates to.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ TrophyApiClient::BulkInsertIssue
Deserialize a JSON object to an instance of BulkInsertIssue.
-
.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(user_id:, level:, reason:, additional_properties: nil) ⇒ TrophyApiClient::BulkInsertIssue constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of BulkInsertIssue to a JSON object.
Constructor Details
#initialize(user_id:, level:, reason:, additional_properties: nil) ⇒ TrophyApiClient::BulkInsertIssue
29 30 31 32 33 34 35 |
# File 'lib/trophy_api_client/types/bulk_insert_issue.rb', line 29 def initialize(user_id:, level:, reason:, additional_properties: nil) @user_id = user_id @level = level @reason = reason @additional_properties = additional_properties @_field_set = { "userId": user_id, "level": level, "reason": reason } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
17 18 19 |
# File 'lib/trophy_api_client/types/bulk_insert_issue.rb', line 17 def additional_properties @additional_properties end |
#level ⇒ TrophyApiClient::BulkInsertIssueLevel (readonly)
13 14 15 |
# File 'lib/trophy_api_client/types/bulk_insert_issue.rb', line 13 def level @level end |
#reason ⇒ String (readonly)
15 16 17 |
# File 'lib/trophy_api_client/types/bulk_insert_issue.rb', line 15 def reason @reason end |
#user_id ⇒ String (readonly)
11 12 13 |
# File 'lib/trophy_api_client/types/bulk_insert_issue.rb', line 11 def user_id @user_id end |
Class Method Details
.from_json(json_object:) ⇒ TrophyApiClient::BulkInsertIssue
Deserialize a JSON object to an instance of BulkInsertIssue
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/trophy_api_client/types/bulk_insert_issue.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) user_id = parsed_json["userId"] level = parsed_json["level"] reason = parsed_json["reason"] new( user_id: user_id, level: level, reason: reason, 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.
68 69 70 71 72 |
# File 'lib/trophy_api_client/types/bulk_insert_issue.rb', line 68 def self.validate_raw(obj:) obj.user_id.is_a?(String) != false || raise("Passed value for field obj.user_id is not the expected type, validation failed.") obj.level.is_a?(TrophyApiClient::BulkInsertIssueLevel) != false || raise("Passed value for field obj.level is not the expected type, validation failed.") obj.reason.is_a?(String) != false || raise("Passed value for field obj.reason is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of BulkInsertIssue to a JSON object
58 59 60 |
# File 'lib/trophy_api_client/types/bulk_insert_issue.rb', line 58 def to_json(*_args) @_field_set&.to_json end |