Class: ApimaticApi::ValidationSummary
- Defined in:
- lib/apimatic_api/models/validation_summary.rb
Overview
ValidationSummary Model.
Instance Attribute Summary collapse
-
#blocking ⇒ Array[ValidationEntry]
TODO: Write general description for this method.
-
#errors ⇒ Array[ValidationEntry]
TODO: Write general description for this method.
-
#information ⇒ Array[ValidationEntry]
TODO: Write general description for this method.
-
#is_success ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#warnings ⇒ Array[ValidationEntry]
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(is_success:, blocking:, errors:, warnings:, information:, additional_properties: nil) ⇒ ValidationSummary
constructor
A new instance of ValidationSummary.
-
#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(is_success:, blocking:, errors:, warnings:, information:, additional_properties: nil) ⇒ ValidationSummary
Returns a new instance of ValidationSummary.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 53 def initialize(is_success:, blocking:, errors:, warnings:, information:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @is_success = is_success @blocking = blocking @errors = errors @warnings = warnings @information = information @additional_properties = additional_properties end |
Instance Attribute Details
#blocking ⇒ Array[ValidationEntry]
TODO: Write general description for this method
18 19 20 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 18 def blocking @blocking end |
#errors ⇒ Array[ValidationEntry]
TODO: Write general description for this method
22 23 24 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 22 def errors @errors end |
#information ⇒ Array[ValidationEntry]
TODO: Write general description for this method
30 31 32 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 30 def information @information end |
#is_success ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 14 def is_success @is_success end |
#warnings ⇒ Array[ValidationEntry]
TODO: Write general description for this method
26 27 28 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 26 def warnings @warnings end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 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 123 124 125 126 127 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. is_success = hash.key?('isSuccess') ? hash['isSuccess'] : nil # Parameter is an array, so we need to iterate through it blocking = nil unless hash['blocking'].nil? blocking = [] hash['blocking'].each do |structure| blocking << (ValidationEntry.from_hash(structure) if structure) end end blocking = nil unless hash.key?('blocking') # Parameter is an array, so we need to iterate through it errors = nil unless hash['errors'].nil? errors = [] hash['errors'].each do |structure| errors << (ValidationEntry.from_hash(structure) if structure) end end errors = nil unless hash.key?('errors') # Parameter is an array, so we need to iterate through it warnings = nil unless hash['warnings'].nil? warnings = [] hash['warnings'].each do |structure| warnings << (ValidationEntry.from_hash(structure) if structure) end end warnings = nil unless hash.key?('warnings') # Parameter is an array, so we need to iterate through it information = nil unless hash['information'].nil? information = [] hash['information'].each do |structure| information << (ValidationEntry.from_hash(structure) if structure) end end information = nil unless hash.key?('information') # 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. ValidationSummary.new(is_success: is_success, blocking: blocking, errors: errors, warnings: warnings, information: information, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['is_success'] = 'isSuccess' @_hash['blocking'] = 'blocking' @_hash['errors'] = 'errors' @_hash['warnings'] = 'warnings' @_hash['information'] = 'information' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 44 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
138 139 140 141 142 143 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 138 def inspect class_name = self.class.name.split('::').last "<#{class_name} is_success: #{@is_success.inspect}, blocking: #{@blocking.inspect}, errors:"\ " #{@errors.inspect}, warnings: #{@warnings.inspect}, information: #{@information.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
130 131 132 133 134 135 |
# File 'lib/apimatic_api/models/validation_summary.rb', line 130 def to_s class_name = self.class.name.split('::').last "<#{class_name} is_success: #{@is_success}, blocking: #{@blocking}, errors: #{@errors},"\ " warnings: #{@warnings}, information: #{@information}, additional_properties:"\ " #{@additional_properties}>" end |