public static OperationState?GetStateForClient(this OperationInternalState state) { switch (state) { case OperationInternalState.Started: return(OperationState.Started); case OperationInternalState.CompletedSucessfully: return(OperationState.CompletedSucessfully); case OperationInternalState.CancelationPending: return(OperationState.CancelationPending); case OperationInternalState.Canceled: return(OperationState.Canceled); default: return(null); } }
public SingleProcessDeploymentOperationStatus( Guid operationId, string readableOperationId, OperationInternalState state = OperationInternalState.Started, DateTime?operationStartTime = null, int progress = 0, object result = null, TimeSpan?operationRunTimeout = null, TimeSpan?finalStatusRetrievalPendingTimeout = null, TimeSpan?storageAfterFinalStatusRetrievedByClientTimeout = null) { _operationId = OperationId; _readableOperationId = readableOperationId; State = state; OperationStartTime = operationStartTime ?? DateTime.Now; Progress = progress; Result = result; OperationRunTimeout = operationRunTimeout ?? NoTimeout; FinalStatusRetrievalPendingTimeout = finalStatusRetrievalPendingTimeout ?? NoTimeout; StorageAfterFinalStatusRetrievedByClientTimeout = storageAfterFinalStatusRetrievedByClientTimeout ?? NoTimeout; }
public static bool IsFinished(this OperationInternalState state) { return(state == OperationInternalState.CompletedSucessfully || state == OperationInternalState.Failed || state == OperationInternalState.Canceled); }