Class: PaypalServerSdk::OrderUpdateCallbackErrorResponseDetails

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb

Overview

The error details. Required for client-side ‘4XX` errors.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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) ⇒ OrderUpdateCallbackErrorResponseDetails

Returns a new instance of OrderUpdateCallbackErrorResponseDetails.



47
48
49
50
51
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 47

def initialize(issue:, field: SKIP, value: SKIP)
  @field = field unless field == SKIP
  @value = value unless value == SKIP
  @issue = issue
end

Instance Attribute Details

#fieldString

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.

Returns:

  • (String)


15
16
17
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 15

def field
  @field
end

#issueString

The unique, fine-grained application-level error code.

Returns:

  • (String)


23
24
25
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 23

def issue
  @issue
end

#valueString

The value of the field that caused the error.

Returns:

  • (String)


19
20
21
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 19

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 54

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

  # Create object from extracted values.
  OrderUpdateCallbackErrorResponseDetails.new(issue: issue,
                                              field: field,
                                              value: value)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['field'] = 'field'
  @_hash['value'] = 'value'
  @_hash['issue'] = 'issue'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 35

def self.optionals
  %w[
    field
    value
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



75
76
77
78
79
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 75

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} field: #{@field.inspect}, value: #{@value.inspect}, issue:"\
  " #{@issue.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



69
70
71
72
# File 'lib/paypal_server_sdk/models/order_update_callback_error_response_details.rb', line 69

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} field: #{@field}, value: #{@value}, issue: #{@issue}>"
end