PageRenderTime 156ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/aws-cpp-sdk-devicefarm/source/model/ArtifactType.cpp

https://gitlab.com/vectorci/aws-sdk-cpp
C++ | 240 lines | 216 code | 10 blank | 14 comment | 76 complexity | 72d1a42c43a27bfcd18ba20e802bf262 MD5 | raw file
  1. /*
  2. * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License").
  5. * You may not use this file except in compliance with the License.
  6. * A copy of the License is located at
  7. *
  8. * http://aws.amazon.com/apache2.0
  9. *
  10. * or in the "license" file accompanying this file. This file is distributed
  11. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. * express or implied. See the License for the specific language governing
  13. * permissions and limitations under the License.
  14. */
  15. #include <aws/devicefarm/model/ArtifactType.h>
  16. #include <aws/core/utils/HashingUtils.h>
  17. #include <aws/core/Globals.h>
  18. #include <aws/core/utils/EnumParseOverflowContainer.h>
  19. using namespace Aws::Utils;
  20. namespace Aws
  21. {
  22. namespace DeviceFarm
  23. {
  24. namespace Model
  25. {
  26. namespace ArtifactTypeMapper
  27. {
  28. static const int UNKNOWN_HASH = HashingUtils::HashString("UNKNOWN");
  29. static const int SCREENSHOT_HASH = HashingUtils::HashString("SCREENSHOT");
  30. static const int DEVICE_LOG_HASH = HashingUtils::HashString("DEVICE_LOG");
  31. static const int MESSAGE_LOG_HASH = HashingUtils::HashString("MESSAGE_LOG");
  32. static const int VIDEO_LOG_HASH = HashingUtils::HashString("VIDEO_LOG");
  33. static const int RESULT_LOG_HASH = HashingUtils::HashString("RESULT_LOG");
  34. static const int SERVICE_LOG_HASH = HashingUtils::HashString("SERVICE_LOG");
  35. static const int WEBKIT_LOG_HASH = HashingUtils::HashString("WEBKIT_LOG");
  36. static const int INSTRUMENTATION_OUTPUT_HASH = HashingUtils::HashString("INSTRUMENTATION_OUTPUT");
  37. static const int EXERCISER_MONKEY_OUTPUT_HASH = HashingUtils::HashString("EXERCISER_MONKEY_OUTPUT");
  38. static const int CALABASH_JSON_OUTPUT_HASH = HashingUtils::HashString("CALABASH_JSON_OUTPUT");
  39. static const int CALABASH_PRETTY_OUTPUT_HASH = HashingUtils::HashString("CALABASH_PRETTY_OUTPUT");
  40. static const int CALABASH_STANDARD_OUTPUT_HASH = HashingUtils::HashString("CALABASH_STANDARD_OUTPUT");
  41. static const int CALABASH_JAVA_XML_OUTPUT_HASH = HashingUtils::HashString("CALABASH_JAVA_XML_OUTPUT");
  42. static const int AUTOMATION_OUTPUT_HASH = HashingUtils::HashString("AUTOMATION_OUTPUT");
  43. static const int APPIUM_SERVER_OUTPUT_HASH = HashingUtils::HashString("APPIUM_SERVER_OUTPUT");
  44. static const int APPIUM_JAVA_OUTPUT_HASH = HashingUtils::HashString("APPIUM_JAVA_OUTPUT");
  45. static const int APPIUM_JAVA_XML_OUTPUT_HASH = HashingUtils::HashString("APPIUM_JAVA_XML_OUTPUT");
  46. static const int APPIUM_PYTHON_OUTPUT_HASH = HashingUtils::HashString("APPIUM_PYTHON_OUTPUT");
  47. static const int APPIUM_PYTHON_XML_OUTPUT_HASH = HashingUtils::HashString("APPIUM_PYTHON_XML_OUTPUT");
  48. static const int EXPLORER_EVENT_LOG_HASH = HashingUtils::HashString("EXPLORER_EVENT_LOG");
  49. static const int EXPLORER_SUMMARY_LOG_HASH = HashingUtils::HashString("EXPLORER_SUMMARY_LOG");
  50. static const int APPLICATION_CRASH_REPORT_HASH = HashingUtils::HashString("APPLICATION_CRASH_REPORT");
  51. static const int XCTEST_LOG_HASH = HashingUtils::HashString("XCTEST_LOG");
  52. static const int VIDEO_HASH = HashingUtils::HashString("VIDEO");
  53. ArtifactType GetArtifactTypeForName(const Aws::String& name)
  54. {
  55. int hashCode = HashingUtils::HashString(name.c_str());
  56. if (hashCode == UNKNOWN_HASH)
  57. {
  58. return ArtifactType::UNKNOWN;
  59. }
  60. else if (hashCode == SCREENSHOT_HASH)
  61. {
  62. return ArtifactType::SCREENSHOT;
  63. }
  64. else if (hashCode == DEVICE_LOG_HASH)
  65. {
  66. return ArtifactType::DEVICE_LOG;
  67. }
  68. else if (hashCode == MESSAGE_LOG_HASH)
  69. {
  70. return ArtifactType::MESSAGE_LOG;
  71. }
  72. else if (hashCode == VIDEO_LOG_HASH)
  73. {
  74. return ArtifactType::VIDEO_LOG;
  75. }
  76. else if (hashCode == RESULT_LOG_HASH)
  77. {
  78. return ArtifactType::RESULT_LOG;
  79. }
  80. else if (hashCode == SERVICE_LOG_HASH)
  81. {
  82. return ArtifactType::SERVICE_LOG;
  83. }
  84. else if (hashCode == WEBKIT_LOG_HASH)
  85. {
  86. return ArtifactType::WEBKIT_LOG;
  87. }
  88. else if (hashCode == INSTRUMENTATION_OUTPUT_HASH)
  89. {
  90. return ArtifactType::INSTRUMENTATION_OUTPUT;
  91. }
  92. else if (hashCode == EXERCISER_MONKEY_OUTPUT_HASH)
  93. {
  94. return ArtifactType::EXERCISER_MONKEY_OUTPUT;
  95. }
  96. else if (hashCode == CALABASH_JSON_OUTPUT_HASH)
  97. {
  98. return ArtifactType::CALABASH_JSON_OUTPUT;
  99. }
  100. else if (hashCode == CALABASH_PRETTY_OUTPUT_HASH)
  101. {
  102. return ArtifactType::CALABASH_PRETTY_OUTPUT;
  103. }
  104. else if (hashCode == CALABASH_STANDARD_OUTPUT_HASH)
  105. {
  106. return ArtifactType::CALABASH_STANDARD_OUTPUT;
  107. }
  108. else if (hashCode == CALABASH_JAVA_XML_OUTPUT_HASH)
  109. {
  110. return ArtifactType::CALABASH_JAVA_XML_OUTPUT;
  111. }
  112. else if (hashCode == AUTOMATION_OUTPUT_HASH)
  113. {
  114. return ArtifactType::AUTOMATION_OUTPUT;
  115. }
  116. else if (hashCode == APPIUM_SERVER_OUTPUT_HASH)
  117. {
  118. return ArtifactType::APPIUM_SERVER_OUTPUT;
  119. }
  120. else if (hashCode == APPIUM_JAVA_OUTPUT_HASH)
  121. {
  122. return ArtifactType::APPIUM_JAVA_OUTPUT;
  123. }
  124. else if (hashCode == APPIUM_JAVA_XML_OUTPUT_HASH)
  125. {
  126. return ArtifactType::APPIUM_JAVA_XML_OUTPUT;
  127. }
  128. else if (hashCode == APPIUM_PYTHON_OUTPUT_HASH)
  129. {
  130. return ArtifactType::APPIUM_PYTHON_OUTPUT;
  131. }
  132. else if (hashCode == APPIUM_PYTHON_XML_OUTPUT_HASH)
  133. {
  134. return ArtifactType::APPIUM_PYTHON_XML_OUTPUT;
  135. }
  136. else if (hashCode == EXPLORER_EVENT_LOG_HASH)
  137. {
  138. return ArtifactType::EXPLORER_EVENT_LOG;
  139. }
  140. else if (hashCode == EXPLORER_SUMMARY_LOG_HASH)
  141. {
  142. return ArtifactType::EXPLORER_SUMMARY_LOG;
  143. }
  144. else if (hashCode == APPLICATION_CRASH_REPORT_HASH)
  145. {
  146. return ArtifactType::APPLICATION_CRASH_REPORT;
  147. }
  148. else if (hashCode == XCTEST_LOG_HASH)
  149. {
  150. return ArtifactType::XCTEST_LOG;
  151. }
  152. else if (hashCode == VIDEO_HASH)
  153. {
  154. return ArtifactType::VIDEO;
  155. }
  156. EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
  157. if(overflowContainer)
  158. {
  159. overflowContainer->StoreOverflow(hashCode, name);
  160. return static_cast<ArtifactType>(hashCode);
  161. }
  162. return ArtifactType::NOT_SET;
  163. }
  164. Aws::String GetNameForArtifactType(ArtifactType enumValue)
  165. {
  166. switch(enumValue)
  167. {
  168. case ArtifactType::UNKNOWN:
  169. return "UNKNOWN";
  170. case ArtifactType::SCREENSHOT:
  171. return "SCREENSHOT";
  172. case ArtifactType::DEVICE_LOG:
  173. return "DEVICE_LOG";
  174. case ArtifactType::MESSAGE_LOG:
  175. return "MESSAGE_LOG";
  176. case ArtifactType::VIDEO_LOG:
  177. return "VIDEO_LOG";
  178. case ArtifactType::RESULT_LOG:
  179. return "RESULT_LOG";
  180. case ArtifactType::SERVICE_LOG:
  181. return "SERVICE_LOG";
  182. case ArtifactType::WEBKIT_LOG:
  183. return "WEBKIT_LOG";
  184. case ArtifactType::INSTRUMENTATION_OUTPUT:
  185. return "INSTRUMENTATION_OUTPUT";
  186. case ArtifactType::EXERCISER_MONKEY_OUTPUT:
  187. return "EXERCISER_MONKEY_OUTPUT";
  188. case ArtifactType::CALABASH_JSON_OUTPUT:
  189. return "CALABASH_JSON_OUTPUT";
  190. case ArtifactType::CALABASH_PRETTY_OUTPUT:
  191. return "CALABASH_PRETTY_OUTPUT";
  192. case ArtifactType::CALABASH_STANDARD_OUTPUT:
  193. return "CALABASH_STANDARD_OUTPUT";
  194. case ArtifactType::CALABASH_JAVA_XML_OUTPUT:
  195. return "CALABASH_JAVA_XML_OUTPUT";
  196. case ArtifactType::AUTOMATION_OUTPUT:
  197. return "AUTOMATION_OUTPUT";
  198. case ArtifactType::APPIUM_SERVER_OUTPUT:
  199. return "APPIUM_SERVER_OUTPUT";
  200. case ArtifactType::APPIUM_JAVA_OUTPUT:
  201. return "APPIUM_JAVA_OUTPUT";
  202. case ArtifactType::APPIUM_JAVA_XML_OUTPUT:
  203. return "APPIUM_JAVA_XML_OUTPUT";
  204. case ArtifactType::APPIUM_PYTHON_OUTPUT:
  205. return "APPIUM_PYTHON_OUTPUT";
  206. case ArtifactType::APPIUM_PYTHON_XML_OUTPUT:
  207. return "APPIUM_PYTHON_XML_OUTPUT";
  208. case ArtifactType::EXPLORER_EVENT_LOG:
  209. return "EXPLORER_EVENT_LOG";
  210. case ArtifactType::EXPLORER_SUMMARY_LOG:
  211. return "EXPLORER_SUMMARY_LOG";
  212. case ArtifactType::APPLICATION_CRASH_REPORT:
  213. return "APPLICATION_CRASH_REPORT";
  214. case ArtifactType::XCTEST_LOG:
  215. return "XCTEST_LOG";
  216. case ArtifactType::VIDEO:
  217. return "VIDEO";
  218. default:
  219. EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
  220. if(overflowContainer)
  221. {
  222. return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
  223. }
  224. return "";
  225. }
  226. }
  227. } // namespace ArtifactTypeMapper
  228. } // namespace Model
  229. } // namespace DeviceFarm
  230. } // namespace Aws