Class: FdxV660Api::Error2
- Defined in:
- lib/fdx_v660_api/models/error2.rb
Overview
Present if an error was encountered while retrieving this form
Instance Attribute Summary collapse
-
#code ⇒ String
Error code defined by FDX API Specification or Data Provider indicating the error situation which has occurred.
-
#debug_message ⇒ String
Message used to debug the root cause of the error.
-
#message ⇒ String
End user displayable information which might help the customer diagnose an error.
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(code: SKIP, message: SKIP, debug_message: SKIP, additional_properties: nil) ⇒ Error2
constructor
A new instance of Error2.
-
#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(code: SKIP, message: SKIP, debug_message: SKIP, additional_properties: nil) ⇒ Error2
Returns a new instance of Error2.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fdx_v660_api/models/error2.rb', line 52 def initialize(code: SKIP, message: SKIP, debug_message: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @code = code unless code == SKIP @message = unless == SKIP @debug_message = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#code ⇒ String
Error code defined by FDX API Specification or Data Provider indicating the error situation which has occurred
15 16 17 |
# File 'lib/fdx_v660_api/models/error2.rb', line 15 def code @code end |
#debug_message ⇒ String
Message used to debug the root cause of the error. Contents should not be used in consumer's business logic. Can change at any time and should only be used for consumer to communicate with the data provider about an issue. Provider can include an error GUID in message for their use.
27 28 29 |
# File 'lib/fdx_v660_api/models/error2.rb', line 27 def @debug_message end |
#message ⇒ String
End user displayable information which might help the customer diagnose an error
20 21 22 |
# File 'lib/fdx_v660_api/models/error2.rb', line 20 def @message end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/fdx_v660_api/models/error2.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash.key?('code') ? hash['code'] : SKIP = hash.key?('message') ? hash['message'] : SKIP = hash.key?('debugMessage') ? hash['debugMessage'] : 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. Error2.new(code: code, message: , debug_message: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 |
# File 'lib/fdx_v660_api/models/error2.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'code' @_hash['message'] = 'message' @_hash['debug_message'] = 'debugMessage' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 |
# File 'lib/fdx_v660_api/models/error2.rb', line 48 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 |
# File 'lib/fdx_v660_api/models/error2.rb', line 39 def self.optionals %w[ code message debug_message ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
94 95 96 97 98 |
# File 'lib/fdx_v660_api/models/error2.rb', line 94 def inspect class_name = self.class.name.split('::').last "<#{class_name} code: #{@code.inspect}, message: #{@message.inspect}, debug_message:"\ " #{@debug_message.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
87 88 89 90 91 |
# File 'lib/fdx_v660_api/models/error2.rb', line 87 def to_s class_name = self.class.name.split('::').last "<#{class_name} code: #{@code}, message: #{@message}, debug_message: #{@debug_message},"\ " additional_properties: #{@additional_properties}>" end |