Class: PaypalServerSdk::TransactionSearchErrorDetails
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::TransactionSearchErrorDetails
- Defined in:
- lib/paypal_server_sdk/models/transaction_search_error_details.rb
Overview
The error details. Required for client-side ‘4XX` errors.
Instance Attribute Summary collapse
-
#description ⇒ String
The human-readable description for an issue.
-
#field ⇒ String
The field that caused the error.
-
#issue ⇒ String
The unique, fine-grained application-level error code.
-
#location ⇒ String
The location of the field that caused the error.
-
#value ⇒ String
The value of the field that caused 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(issue:, field: SKIP, value: SKIP, location: 'body', description: SKIP) ⇒ TransactionSearchErrorDetails
constructor
A new instance of TransactionSearchErrorDetails.
-
#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(issue:, field: SKIP, value: SKIP, location: 'body', description: SKIP) ⇒ TransactionSearchErrorDetails
Returns a new instance of TransactionSearchErrorDetails.
61 62 63 64 65 66 67 68 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 61 def initialize(issue:, field: SKIP, value: SKIP, location: 'body', description: SKIP) @field = field unless field == SKIP @value = value unless value == SKIP @location = location unless location == SKIP @issue = issue @description = description unless description == SKIP end |
Instance Attribute Details
#description ⇒ String
The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value.
33 34 35 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 33 def description @description end |
#field ⇒ String
The field that caused the error. If this field is in the body, set this value to the field’s JSON pointer value. Required for client-side errors.
15 16 17 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 15 def field @field end |
#issue ⇒ String
The unique, fine-grained application-level error code.
28 29 30 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 28 def issue @issue end |
#location ⇒ String
The location of the field that caused the error. Value is ‘body`, `path`, or `query`.
24 25 26 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 24 def location @location end |
#value ⇒ String
The value of the field that caused the error.
19 20 21 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 19 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. issue = hash.key?('issue') ? hash['issue'] : nil field = hash.key?('field') ? hash['field'] : SKIP value = hash.key?('value') ? hash['value'] : SKIP location = hash['location'] ||= 'body' description = hash.key?('description') ? hash['description'] : SKIP # Create object from extracted values. TransactionSearchErrorDetails.new(issue: issue, field: field, value: value, location: location, description: description) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 43 44 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['field'] = 'field' @_hash['value'] = 'value' @_hash['location'] = 'location' @_hash['issue'] = 'issue' @_hash['description'] = 'description' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 50 51 52 53 54 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 47 def self.optionals %w[ field value location description ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
97 98 99 100 101 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 97 def inspect class_name = self.class.name.split('::').last "<#{class_name} field: #{@field.inspect}, value: #{@value.inspect}, location:"\ " #{@location.inspect}, issue: #{@issue.inspect}, description: #{@description.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
90 91 92 93 94 |
# File 'lib/paypal_server_sdk/models/transaction_search_error_details.rb', line 90 def to_s class_name = self.class.name.split('::').last "<#{class_name} field: #{@field}, value: #{@value}, location: #{@location}, issue:"\ " #{@issue}, description: #{@description}>" end |