Class: ApimaticApi::ValidationEntry
- Defined in:
- lib/apimatic_api/models/validation_entry.rb
Overview
ValidationEntry Model.
Instance Attribute Summary collapse
-
#additional_references ⇒ Array[String]
TODO: Write general description for this method.
-
#file_reference ⇒ String
TODO: Write general description for this method.
-
#json_reference_path ⇒ String
TODO: Write general description for this method.
-
#line_info ⇒ LineInfo
TODO: Write general description for this method.
-
#message ⇒ String
TODO: Write general description for this method.
-
#metadata ⇒ Hash[String, String]
TODO: Write general description for this method.
-
#rule_documentation_reference ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(message:, line_info: SKIP, json_reference_path: SKIP, file_reference: SKIP, metadata: SKIP, rule_documentation_reference: SKIP, additional_references: SKIP, additional_properties: nil) ⇒ ValidationEntry
constructor
A new instance of ValidationEntry.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(message:, line_info: SKIP, json_reference_path: SKIP, file_reference: SKIP, metadata: SKIP, rule_documentation_reference: SKIP, additional_references: SKIP, additional_properties: nil) ⇒ ValidationEntry
Returns a new instance of ValidationEntry.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 70 def initialize(message:, line_info: SKIP, json_reference_path: SKIP, file_reference: SKIP, metadata: SKIP, rule_documentation_reference: SKIP, additional_references: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @message = @line_info = line_info unless line_info == SKIP @json_reference_path = json_reference_path unless json_reference_path == SKIP @file_reference = file_reference unless file_reference == SKIP @metadata = unless == SKIP unless rule_documentation_reference == SKIP @rule_documentation_reference = rule_documentation_reference end @additional_references = additional_references unless additional_references == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#additional_references ⇒ Array[String]
TODO: Write general description for this method
38 39 40 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 38 def additional_references @additional_references end |
#file_reference ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 26 def file_reference @file_reference end |
#json_reference_path ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 22 def json_reference_path @json_reference_path end |
#line_info ⇒ LineInfo
TODO: Write general description for this method
18 19 20 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 18 def line_info @line_info end |
#message ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 14 def @message end |
#metadata ⇒ Hash[String, String]
TODO: Write general description for this method
30 31 32 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 30 def @metadata end |
#rule_documentation_reference ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 34 def rule_documentation_reference @rule_documentation_reference end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = hash.key?('message') ? hash['message'] : nil line_info = LineInfo.from_hash(hash['lineInfo']) if hash['lineInfo'] json_reference_path = hash.key?('jsonReferencePath') ? hash['jsonReferencePath'] : SKIP file_reference = hash.key?('fileReference') ? hash['fileReference'] : SKIP = hash.key?('metadata') ? hash['metadata'] : SKIP rule_documentation_reference = hash.key?('ruleDocumentationReference') ? hash['ruleDocumentationReference'] : SKIP additional_references = hash.key?('additionalReferences') ? hash['additionalReferences'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ValidationEntry.new(message: , line_info: line_info, json_reference_path: json_reference_path, file_reference: file_reference, metadata: , rule_documentation_reference: rule_documentation_reference, additional_references: additional_references, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['message'] = 'message' @_hash['line_info'] = 'lineInfo' @_hash['json_reference_path'] = 'jsonReferencePath' @_hash['file_reference'] = 'fileReference' @_hash['metadata'] = 'metadata' @_hash['rule_documentation_reference'] = 'ruleDocumentationReference' @_hash['additional_references'] = 'additionalReferences' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 66 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 54 def self.optionals %w[ line_info json_reference_path file_reference metadata rule_documentation_reference additional_references ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
134 135 136 137 138 139 140 141 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 134 def inspect class_name = self.class.name.split('::').last "<#{class_name} message: #{@message.inspect}, line_info: #{@line_info.inspect},"\ " json_reference_path: #{@json_reference_path.inspect}, file_reference:"\ " #{@file_reference.inspect}, metadata: #{@metadata.inspect}, rule_documentation_reference:"\ " #{@rule_documentation_reference.inspect}, additional_references:"\ " #{@additional_references.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
125 126 127 128 129 130 131 |
# File 'lib/apimatic_api/models/validation_entry.rb', line 125 def to_s class_name = self.class.name.split('::').last "<#{class_name} message: #{@message}, line_info: #{@line_info}, json_reference_path:"\ " #{@json_reference_path}, file_reference: #{@file_reference}, metadata: #{@metadata},"\ " rule_documentation_reference: #{@rule_documentation_reference}, additional_references:"\ " #{@additional_references}, additional_properties: #{@additional_properties}>" end |