class MsRestAzure::AsyncOperationStatus

Defines values for AsyncOperationStatus enum.

Constants

ACCEPTED
ALL_STATUSES
CANCELED_STATUS
DEFAULT_DELAY
FAILED_STATUS
FAILED_STATUSES
IN_PROGRESS_STATUS
RUNNING
SUCCESS_STATUS
TERMINAL_STATUSES

Attributes

error[RW]

@return [MsRestAzure::CloudErrorData] error information about async operation.

retry_after[RW]

@return [Integer] delay in seconds which should be used for polling for result of async operation.

status[RW]

@return [Stirng] status of polling.

Public Class Methods

deserialize_object(object) click to toggle source

Deserializes given hash into AsyncOperationStatus object. @param object [Hash] object to deserialize.

@return [AsyncOperationStatus] deserialized object.

# File lib/ms_rest_azure/async_operation_status.rb, line 63
def self.deserialize_object(object)
  return if object.nil?
  output_object = AsyncOperationStatus.new

  output_object.status = object['status']

  output_object.error = CloudErrorData.deserialize_object(object['error'])

  output_object.retry_after = Integer(object['retryAfter']) unless object['retryAfter'].nil?

  output_object
end
is_failed_status(status) click to toggle source

Checks if given status is failed one. @param status [String] status to verify

@return [Boolean] True if given status is failed one, false otherwise.

# File lib/ms_rest_azure/async_operation_status.rb, line 45
def self.is_failed_status(status)
  FAILED_STATUSES.any? { |st| st.casecmp(status) == 0 }
end
is_successful_status(status) click to toggle source

Checks if given status is successful one. @param status [String] status to verify

@return [Boolean] True if given status is successful one, false otherwise.

# File lib/ms_rest_azure/async_operation_status.rb, line 54
def self.is_successful_status(status)
  return (status.casecmp(SUCCESS_STATUS) == 0)
end
is_terminal_status(status) click to toggle source

Checks if given status is terminal one. @param status [String] status to verify

@return [Boolean] True if given status is terminal one, false otherwise.

# File lib/ms_rest_azure/async_operation_status.rb, line 36
def self.is_terminal_status(status)
  TERMINAL_STATUSES.any? { |st| st.casecmp(status) == 0 }
end