Class: OnlinePayments::SDK::Domain::APIError

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/api_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#categoryString

Returns the current value of category.

Returns:

  • (String)

    the current value of category



17
18
19
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 17

def category
  @category
end

#codeString

Returns the current value of code.

Returns:

  • (String)

    the current value of code



17
18
19
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 17

def code
  @code
end

#error_codeString

Returns the current value of error_code.

Returns:

  • (String)

    the current value of error_code



17
18
19
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 17

def error_code
  @error_code
end

#http_status_codeInteger

Returns the current value of http_status_code.

Returns:

  • (Integer)

    the current value of http_status_code



17
18
19
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 17

def http_status_code
  @http_status_code
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



17
18
19
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 17

def id
  @id
end

#messageString

Returns the current value of message.

Returns:

  • (String)

    the current value of message



17
18
19
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 17

def message
  @message
end

#property_nameString

Returns the current value of property_name.

Returns:

  • (String)

    the current value of property_name



17
18
19
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 17

def property_name
  @property_name
end

#retriabletrue/false

Returns the current value of retriable.

Returns:

  • (true/false)

    the current value of retriable



17
18
19
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 17

def retriable
  @retriable
end

Instance Method Details

#from_hash(hash) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 41

def from_hash(hash)
  super
  @category = hash['category'] if hash.key? 'category'
  @code = hash['code'] if hash.key? 'code'
  @error_code = hash['errorCode'] if hash.key? 'errorCode'
  @http_status_code = hash['httpStatusCode'] if hash.key? 'httpStatusCode'
  @id = hash['id'] if hash.key? 'id'
  @message = hash['message'] if hash.key? 'message'
  @property_name = hash['propertyName'] if hash.key? 'propertyName'
  @retriable = hash['retriable'] if hash.key? 'retriable'
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/onlinepayments/sdk/domain/api_error.rb', line 28

def to_h
  hash = super
  hash['category'] = @category unless @category.nil?
  hash['code'] = @code unless @code.nil?
  hash['errorCode'] = @error_code unless @error_code.nil?
  hash['httpStatusCode'] = @http_status_code unless @http_status_code.nil?
  hash['id'] = @id unless @id.nil?
  hash['message'] = @message unless @message.nil?
  hash['propertyName'] = @property_name unless @property_name.nil?
  hash['retriable'] = @retriable unless @retriable.nil?
  hash
end