PageRenderTime 49ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/SMLibrary/OperationResult.cs

https://github.com/mwasham/wasvcmgmntapi
C# | 43 lines | 29 code | 9 blank | 5 comment | 0 complexity | f336c5a62b68b94a1404c5f245bb5c93 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace SMLibrary
  8. {
  9. public enum OperationStatus
  10. {
  11. InProgress,
  12. Failed,
  13. Succeeded,
  14. TimedOut
  15. }
  16. public struct OperationResult
  17. {
  18. public String RequestID { get; set; }
  19. // The status: InProgress, Failed, Succeeded, or TimedOut.
  20. public OperationStatus Status { get; set; }
  21. // The http status code of the requestId operation, if any.
  22. public HttpStatusCode StatusCode { get; set; }
  23. // The approximate running time for PollGetOperationStatus.
  24. public TimeSpan RunningTime { get; set; }
  25. // The error code for the failed operation.
  26. public String Code { get; set; }
  27. // The message for the failed operation.
  28. public String Message { get; set; }
  29. public override String ToString()
  30. {
  31. return String.Format("Requested ID: {0}\n Status: {0}\n Message: {1}\n Elapsed Seconds: {2}", RequestID, Status.ToString(), Message, RunningTime.Seconds);
  32. }
  33. }
  34. }