Class: Azure::ARM::Network::Models::AzureAsyncOperationResult
- Inherits:
-
Object
- Object
- Azure::ARM::Network::Models::AzureAsyncOperationResult
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_network/Models/azure_async_operation_result.rb
Overview
The response body contains the status of the specified asynchronous operation, indicating whether it has succeeded, is inprogress, or has failed. Note that this status is distinct from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous operation failed, the response body includes the HTTP status code for the failed request and error information regarding the failure.
Instance Attribute Summary collapse
- #error ⇒ Error
-
#status ⇒ OperationStatus
values for this property include: ‘InProgress’, ‘Succeeded’, ‘Failed’.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ AzureAsyncOperationResult
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
#error ⇒ Error
27 28 29 |
# File 'lib/azure_mgmt_network/Models/azure_async_operation_result.rb', line 27 def error @error end |
#status ⇒ OperationStatus
values for this property include: ‘InProgress’, ‘Succeeded’, ‘Failed’.
24 25 26 |
# File 'lib/azure_mgmt_network/Models/azure_async_operation_result.rb', line 24 def status @status end |
Class Method Details
.deserialize_object(object) ⇒ AzureAsyncOperationResult
Deserializes given Ruby Hash into Model object.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/azure_mgmt_network/Models/azure_async_operation_result.rb', line 62 def self.deserialize_object(object) return if object.nil? output_object = AzureAsyncOperationResult.new deserialized_property = object['status'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = OperationStatus.constants.any? { |e| OperationStatus.const_get(e).to_s.downcase == deserialized_property.downcase } fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid end output_object.status = deserialized_property deserialized_property = object['error'] unless deserialized_property.nil? deserialized_property = Error.deserialize_object(deserialized_property) end output_object.error = deserialized_property output_object.validate output_object end |
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/azure_mgmt_network/Models/azure_async_operation_result.rb', line 41 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.status output_object['status'] = serialized_property unless serialized_property.nil? serialized_property = object.error unless serialized_property.nil? serialized_property = Error.serialize_object(serialized_property) end output_object['error'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
Validate the object. Throws ValidationError if validation fails.
32 33 34 |
# File 'lib/azure_mgmt_network/Models/azure_async_operation_result.rb', line 32 def validate @error.validate unless @error.nil? end |