ApiEnvironment.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. namespace Edgegap
  2. {
  3. public enum ApiEnvironment
  4. {
  5. Staging,
  6. Console,
  7. }
  8. public static class ApiEnvironmentsExtensions
  9. {
  10. public static string GetApiUrl(this ApiEnvironment apiEnvironment)
  11. {
  12. string apiUrl;
  13. switch (apiEnvironment)
  14. {
  15. case ApiEnvironment.Staging:
  16. apiUrl = "https://staging-api.edgegap.com";
  17. break;
  18. case ApiEnvironment.Console:
  19. apiUrl = "https://api.edgegap.com";
  20. break;
  21. default:
  22. apiUrl = null;
  23. break;
  24. }
  25. return apiUrl;
  26. }
  27. public static string GetDashboardUrl(this ApiEnvironment apiEnvironment)
  28. {
  29. string apiUrl;
  30. switch (apiEnvironment)
  31. {
  32. case ApiEnvironment.Staging:
  33. apiUrl = "https://staging-console.edgegap.com";
  34. break;
  35. case ApiEnvironment.Console:
  36. apiUrl = "https://console.edgegap.com";
  37. break;
  38. default:
  39. apiUrl = null;
  40. break;
  41. }
  42. return apiUrl;
  43. }
  44. public static string GetDocumentationUrl(this ApiEnvironment apiEnvironment)
  45. {
  46. string apiUrl;
  47. switch (apiEnvironment)
  48. {
  49. case ApiEnvironment.Staging:
  50. apiUrl = "https://staging-docs.edgegap.com/docs";
  51. break;
  52. case ApiEnvironment.Console:
  53. apiUrl = "https://docs.edgegap.com/docs";
  54. break;
  55. default:
  56. apiUrl = null;
  57. break;
  58. }
  59. return apiUrl;
  60. }
  61. }
  62. }