Class: Azure::ARM::Compute::Models::ComputeLongRunningOperationResult
- Inherits:
-
Object
- Object
- Azure::ARM::Compute::Models::ComputeLongRunningOperationResult
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb
Overview
The Compute service response for long-running operations.
Instance Attribute Summary collapse
-
#end_time ⇒ DateTime
Gets the operation end time.
-
#error ⇒ ApiError
Gets the operation error, if any occurred.
-
#operation_id ⇒ String
Gets the operation identifier.
- #properties ⇒ ComputeLongRunningOperationProperties
-
#start_time ⇒ DateTime
Gets the operation start time.
-
#status ⇒ ComputeOperationStatus
values for this property include: ‘InProgress’, ‘Failed’, ‘Succeeded’, ‘Preempted’.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ ComputeLongRunningOperationResult
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
#end_time ⇒ DateTime
Returns Gets the operation end time.
27 28 29 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 27 def end_time @end_time end |
#error ⇒ ApiError
Returns Gets the operation error, if any occurred.
33 34 35 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 33 def error @error end |
#operation_id ⇒ String
Returns Gets the operation identifier.
16 17 18 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 16 def operation_id @operation_id end |
#properties ⇒ ComputeLongRunningOperationProperties
30 31 32 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 30 def properties @properties end |
#start_time ⇒ DateTime
Returns Gets the operation start time.
24 25 26 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 24 def start_time @start_time end |
#status ⇒ ComputeOperationStatus
values for this property include: ‘InProgress’, ‘Failed’, ‘Succeeded’, ‘Preempted’.
21 22 23 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 21 def status @status end |
Class Method Details
.deserialize_object(object) ⇒ ComputeLongRunningOperationResult
Deserializes given Ruby Hash into Model object.
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 119 120 121 122 123 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 86 def self.deserialize_object(object) return if object.nil? output_object = ComputeLongRunningOperationResult.new deserialized_property = object['operationId'] output_object.operation_id = deserialized_property deserialized_property = object['status'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ComputeOperationStatus.constants.any? { |e| ComputeOperationStatus.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['startTime'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.start_time = deserialized_property deserialized_property = object['endTime'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.end_time = deserialized_property deserialized_property = object['properties'] unless deserialized_property.nil? deserialized_property = ComputeLongRunningOperationProperties.deserialize_object(deserialized_property) end output_object.properties = deserialized_property deserialized_property = object['error'] unless deserialized_property.nil? deserialized_property = ApiError.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.
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 77 78 79 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 48 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.operation_id output_object['operationId'] = serialized_property unless serialized_property.nil? serialized_property = object.status output_object['status'] = serialized_property unless serialized_property.nil? serialized_property = object.start_time serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['startTime'] = serialized_property unless serialized_property.nil? serialized_property = object.end_time serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['endTime'] = serialized_property unless serialized_property.nil? serialized_property = object.properties unless serialized_property.nil? serialized_property = ComputeLongRunningOperationProperties.serialize_object(serialized_property) end output_object['properties'] = serialized_property unless serialized_property.nil? serialized_property = object.error unless serialized_property.nil? serialized_property = ApiError.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.
38 39 40 41 |
# File 'lib/azure_mgmt_compute/models/compute_long_running_operation_result.rb', line 38 def validate @properties.validate unless @properties.nil? @error.validate unless @error.nil? end |