Class: Azure::ARM::Compute::Models::ApiError

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_compute/models/api_error.rb

Overview

Api error.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeString

Returns Gets or sets the error code.

Returns:

  • (String)

    Gets or sets the error code.



22
23
24
# File 'lib/azure_mgmt_compute/models/api_error.rb', line 22

def code
  @code
end

#detailsArray<ApiErrorBase>

Returns Gets or sets the Api error details.

Returns:

  • (Array<ApiErrorBase>)

    Gets or sets the Api error details



16
17
18
# File 'lib/azure_mgmt_compute/models/api_error.rb', line 16

def details
  @details
end

#innererrorInnerError

Returns Gets or sets the Api inner error.

Returns:

  • (InnerError)

    Gets or sets the Api inner error



19
20
21
# File 'lib/azure_mgmt_compute/models/api_error.rb', line 19

def innererror
  @innererror
end

#messageString

Returns Gets or sets the error message.

Returns:

  • (String)

    Gets or sets the error message.



28
29
30
# File 'lib/azure_mgmt_compute/models/api_error.rb', line 28

def message
  @message
end

#targetString

Returns Gets or sets the target of the particular error.

Returns:

  • (String)

    Gets or sets the target of the particular error.



25
26
27
# File 'lib/azure_mgmt_compute/models/api_error.rb', line 25

def target
  @target
end

Class Method Details

.deserialize_object(object) ⇒ ApiError

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/azure_mgmt_compute/models/api_error.rb', line 83

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

  deserialized_property = object['details']
  unless deserialized_property.nil?
    deserialized_array = []
    deserialized_property.each do |element1|
      unless element1.nil?
        element1 = ApiErrorBase.deserialize_object(element1)
      end
      deserialized_array.push(element1)
    end
    deserialized_property = deserialized_array
  end
  output_object.details = deserialized_property

  deserialized_property = object['innererror']
  unless deserialized_property.nil?
    deserialized_property = InnerError.deserialize_object(deserialized_property)
  end
  output_object.innererror = deserialized_property

  deserialized_property = object['code']
  output_object.code = deserialized_property

  deserialized_property = object['target']
  output_object.target = deserialized_property

  deserialized_property = object['message']
  output_object.message = deserialized_property

  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/azure_mgmt_compute/models/api_error.rb', line 43

def self.serialize_object(object)
  object.validate
  output_object = {}

  serialized_property = object.details
  unless serialized_property.nil?
    serializedArray = []
    serialized_property.each do |element|
      unless element.nil?
        element = ApiErrorBase.serialize_object(element)
      end
      serializedArray.push(element)
    end
    serialized_property = serializedArray
  end
  output_object['details'] = serialized_property unless serialized_property.nil?

  serialized_property = object.innererror
  unless serialized_property.nil?
    serialized_property = InnerError.serialize_object(serialized_property)
  end
  output_object['innererror'] = serialized_property unless serialized_property.nil?

  serialized_property = object.code
  output_object['code'] = serialized_property unless serialized_property.nil?

  serialized_property = object.target
  output_object['target'] = serialized_property unless serialized_property.nil?

  serialized_property = object.message
  output_object['message'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



33
34
35
36
# File 'lib/azure_mgmt_compute/models/api_error.rb', line 33

def validate
  @details.each{ |e| e.validate if e.respond_to?(:validate) } unless @details.nil?
  @innererror.validate unless @innererror.nil?
end