Class: Ingenico::Connect::SDK::Domain::Errors::APIError

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/errors/api_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#categoryObject

String



14
15
16
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 14

def category
  @category
end

#codeObject

String



17
18
19
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 17

def code
  @code
end

#http_status_codeObject

Integer



20
21
22
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 20

def http_status_code
  @http_status_code
end

#idObject

String



23
24
25
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 23

def id
  @id
end

#messageObject

String



26
27
28
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 26

def message
  @message
end

#property_nameObject

String



29
30
31
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 29

def property_name
  @property_name
end

#request_idObject

String



32
33
34
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 32

def request_id
  @request_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 46

def from_hash(hash)
  super
  if hash.has_key?('category')
    @category = hash['category']
  end
  if hash.has_key?('code')
    @code = hash['code']
  end
  if hash.has_key?('httpStatusCode')
    @http_status_code = hash['httpStatusCode']
  end
  if hash.has_key?('id')
    @id = hash['id']
  end
  if hash.has_key?('message')
    @message = hash['message']
  end
  if hash.has_key?('propertyName')
    @property_name = hash['propertyName']
  end
  if hash.has_key?('requestId')
    @request_id = hash['requestId']
  end
end

#to_hObject



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 34

def to_h
  hash = super
  add_to_hash(hash, 'category', @category)
  add_to_hash(hash, 'code', @code)
  add_to_hash(hash, 'httpStatusCode', @http_status_code)
  add_to_hash(hash, 'id', @id)
  add_to_hash(hash, 'message', @message)
  add_to_hash(hash, 'propertyName', @property_name)
  add_to_hash(hash, 'requestId', @request_id)
  hash
end