Class: UspsApi::ContainersErrorMessageErrorErrors
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::ContainersErrorMessageErrorErrors
- Defined in:
- lib/usps_api/models/containers_error_message_error_errors.rb
Overview
ContainersErrorMessageErrorErrors Model.
Instance Attribute Summary collapse
-
#code ⇒ String
An internal subordinate code used for error diagnosis.
-
#detail ⇒ String
A human-readable description of the error that occurred.
-
#source ⇒ Source
The element that is suspected of originating the error.
-
#status ⇒ String
The status code response returned to the client.
-
#title ⇒ String
A human-readable title that identifies the 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(status: SKIP, code: SKIP, title: SKIP, detail: SKIP, source: SKIP, additional_properties: nil) ⇒ ContainersErrorMessageErrorErrors
constructor
A new instance of ContainersErrorMessageErrorErrors.
-
#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(status: SKIP, code: SKIP, title: SKIP, detail: SKIP, source: SKIP, additional_properties: nil) ⇒ ContainersErrorMessageErrorErrors
Returns a new instance of ContainersErrorMessageErrorErrors.
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 60 def initialize(status: SKIP, code: SKIP, title: SKIP, detail: SKIP, source: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @status = status unless status == SKIP @code = code unless code == SKIP @title = title unless title == SKIP @detail = detail unless detail == SKIP @source = source unless source == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#code ⇒ String
An internal subordinate code used for error diagnosis.
18 19 20 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 18 def code @code end |
#detail ⇒ String
A human-readable description of the error that occurred.
26 27 28 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 26 def detail @detail end |
#source ⇒ Source
The element that is suspected of originating the error. Helps to pinpoint the problem.
31 32 33 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 31 def source @source end |
#status ⇒ String
The status code response returned to the client.
14 15 16 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 14 def status @status end |
#title ⇒ String
A human-readable title that identifies the error.
22 23 24 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 22 def title @title end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. status = hash.key?('status') ? hash['status'] : SKIP code = hash.key?('code') ? hash['code'] : SKIP title = hash.key?('title') ? hash['title'] : SKIP detail = hash.key?('detail') ? hash['detail'] : SKIP source = Source.from_hash(hash['source']) if hash['source'] # 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. ContainersErrorMessageErrorErrors.new(status: status, code: code, title: title, detail: detail, source: source, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['status'] = 'status' @_hash['code'] = 'code' @_hash['title'] = 'title' @_hash['detail'] = 'detail' @_hash['source'] = 'source' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 53 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 45 def self.optionals %w[ status code title detail source ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
108 109 110 111 112 113 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 108 def inspect class_name = self.class.name.split('::').last "<#{class_name} status: #{@status.inspect}, code: #{@code.inspect}, title:"\ " #{@title.inspect}, detail: #{@detail.inspect}, source: #{@source.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
101 102 103 104 105 |
# File 'lib/usps_api/models/containers_error_message_error_errors.rb', line 101 def to_s class_name = self.class.name.split('::').last "<#{class_name} status: #{@status}, code: #{@code}, title: #{@title}, detail: #{@detail},"\ " source: #{@source}, additional_properties: #{@additional_properties}>" end |