Class: Azure::ARM::Network::Models::AzureAsyncOperationResult

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorError

Returns:



27
28
29
# File 'lib/azure_mgmt_network/models/azure_async_operation_result.rb', line 27

def error
  @error
end

#statusNetworkOperationStatus

Possible values include: ‘InProgress’, ‘Succeeded’, ‘Failed’

Returns:



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.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# 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 = NetworkOperationStatus.constants.any? { |e| NetworkOperationStatus.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum NetworkOperationStatus does not contain ' + deserialized_property.downcase + ', but was received from the server.' 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
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.



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

#validateObject

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