Class: Haipa::Client::CloudErrorData

Inherits:
Object
  • Object
show all
Defined in:
lib/haipa_rest/cloud_error_data.rb

Overview

Class which represents keeps aux data about Haipa invalid response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#additionalInfoArray<TypedErrorInfo>

Returns the list of additional error info parsed from the body of the http error response.

Returns:

  • (Array<TypedErrorInfo>)

    the list of additional error info parsed from the body of the http error response.



21
22
23
# File 'lib/haipa_rest/cloud_error_data.rb', line 21

def additionalInfo
  @additionalInfo
end

#codeString

Returns the error code parsed from the body of the http error response.

Returns:

  • (String)

    the error code parsed from the body of the http error response.



12
13
14
# File 'lib/haipa_rest/cloud_error_data.rb', line 12

def code
  @code
end

#messageString

Returns the error message parsed from the body of the http error response.

Returns:

  • (String)

    the error message parsed from the body of the http error response.



15
16
17
# File 'lib/haipa_rest/cloud_error_data.rb', line 15

def message
  @message
end

#targetString

Returns the error target parsed from the body of the http error response.

Returns:

  • (String)

    the error target parsed from the body of the http error response.



18
19
20
# File 'lib/haipa_rest/cloud_error_data.rb', line 18

def target
  @target
end

Class Method Details

.deserialize_object(object) ⇒ CloudErrorData

Deserializes given hash into CloudErrorData object.

Parameters:

  • object (Hash)

    object to deserialize.

Returns:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/haipa_rest/cloud_error_data.rb', line 28

def self.deserialize_object(object)
  return if object.nil?
  output_object = CloudErrorData.new

  output_object.code = object['code']

  output_object.message = object['message']

  output_object.target = object['target']

  unless object['additionalInfo'].nil?
    output_object.additionalInfo = []
    object['additionalInfo'].each do |info|
      output_object.additionalInfo << Haipa::Client::TypedErrorInfo.deserialize_object(info)
    end
  end

  output_object
end