Class: Azure::ARM::Compute::Models::ApiError
- Inherits:
-
Object
- Object
- Azure::ARM::Compute::Models::ApiError
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_compute/Models/api_error.rb
Overview
Api error.
Instance Attribute Summary collapse
-
#code ⇒ String
Gets or sets the error code.
-
#details ⇒ Array<ApiErrorBase>
Gets or sets the Api error details.
-
#innererror ⇒ InnerError
Gets or sets the Api inner error.
-
#message ⇒ String
Gets or sets the error message.
-
#target ⇒ String
Gets or sets the target of the particular error.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ ApiError
Deserializes given Ruby Hash into Model object.
-
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
Instance Method Summary collapse
-
#validate ⇒ Object
Validate the object.
Instance Attribute Details
#code ⇒ String
Returns Gets or sets the error code.
22 23 24 |
# File 'lib/azure_mgmt_compute/Models/api_error.rb', line 22 def code @code end |
#details ⇒ Array<ApiErrorBase>
Returns 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 |
#innererror ⇒ InnerError
Returns 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 |
#message ⇒ String
Returns Gets or sets the error message.
28 29 30 |
# File 'lib/azure_mgmt_compute/Models/api_error.rb', line 28 def @message end |
#target ⇒ String
Returns 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.
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 117 118 |
# 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? deserializedArray = []; deserialized_property.each do |element1| unless element1.nil? element1 = ApiErrorBase.deserialize_object(element1) end deserializedArray.push(element1); end deserialized_property = deserializedArray; 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. = deserialized_property output_object.validate output_object end |
.serialize_object(object) ⇒ Hash
Serializes given Model object into 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. output_object['message'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
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 |