SematextCloud 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (345) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/SematextCloud.gemspec +4 -5
  4. data/docs/AlertNotification.md +2 -1
  5. data/docs/AlertNotificationRequest.md +2 -1
  6. data/docs/AlertNotificationsApi.md +30 -28
  7. data/docs/AlertRule.md +2 -1
  8. data/docs/AlertRuleResponse.md +2 -1
  9. data/docs/AlertRuleResponseEntry.md +2 -1
  10. data/docs/AlertRuleScheduleTimeRangeDto.md +2 -1
  11. data/docs/AlertRuleScheduleWeekdayDto.md +2 -1
  12. data/docs/AlertRulesResponse.md +2 -1
  13. data/docs/AlertRulesResponseEntry.md +2 -1
  14. data/docs/AlertsApi.md +55 -53
  15. data/docs/App.md +2 -1
  16. data/docs/AppDescription.md +2 -1
  17. data/docs/AppMetadata.md +2 -1
  18. data/docs/AppResponse.md +2 -1
  19. data/docs/AppResponseEntry.md +2 -1
  20. data/docs/AppTypesResponse.md +2 -1
  21. data/docs/AppTypesResponseEntry.md +2 -1
  22. data/docs/AppsApi.md +85 -80
  23. data/docs/AppsResponse.md +2 -1
  24. data/docs/AppsResponseEntry.md +2 -1
  25. data/docs/AwsSettingsControllerApi.md +10 -8
  26. data/docs/BasicAuthMethodDto.md +2 -1
  27. data/docs/BasicOrganizationDto.md +2 -1
  28. data/docs/BillingApi.md +31 -29
  29. data/docs/BillingInfo.md +2 -1
  30. data/docs/ChargesDetailsResponseDto.md +2 -1
  31. data/docs/CloudWatchSettings.md +2 -1
  32. data/docs/CloudWatchSettingsResponse.md +2 -1
  33. data/docs/CloudWatchSettingsResponseEntry.md +2 -1
  34. data/docs/CreateAppInfo.md +2 -1
  35. data/docs/CreateTokenDto.md +2 -1
  36. data/docs/DailyDto.md +10 -7
  37. data/docs/DayUsageData.md +23 -23
  38. data/docs/Dimension.md +2 -1
  39. data/docs/Error.md +2 -1
  40. data/docs/EventDto.md +2 -1
  41. data/docs/FilterValue.md +2 -1
  42. data/docs/GenericApiResponse.md +2 -1
  43. data/docs/GenericMapBasedApiResponse.md +2 -1
  44. data/docs/Invitation.md +2 -1
  45. data/docs/Invoice.md +2 -1
  46. data/docs/InvoiceResponse.md +2 -1
  47. data/docs/InvoiceResponseEntry.md +2 -1
  48. data/docs/LimitChangeEventDTO.md +2 -1
  49. data/docs/LogsAppApi.md +10 -8
  50. data/docs/LogsUsageApiControllerApi.md +9 -7
  51. data/docs/MailReportResponse.md +2 -1
  52. data/docs/MailReportResponseResponseEntry.md +2 -1
  53. data/docs/MinPeriodFeePeriod.md +17 -14
  54. data/docs/MonitoringAppApi.md +17 -15
  55. data/docs/NotificationIntegration.md +2 -1
  56. data/docs/NotificationsResponse.md +2 -1
  57. data/docs/NotificationsResponseEntry.md +2 -1
  58. data/docs/Plan.md +2 -1
  59. data/docs/PlansResponse.md +2 -1
  60. data/docs/PlansResponseEntry.md +2 -1
  61. data/docs/ReportInfo.md +13 -11
  62. data/docs/ResetPasswordApi.md +10 -8
  63. data/docs/ServiceIntegration.md +2 -1
  64. data/docs/Subscription.md +20 -18
  65. data/docs/SubscriptionDashboardDto.md +2 -1
  66. data/docs/SubscriptionDto.md +17 -15
  67. data/docs/SubscriptionResponse.md +2 -1
  68. data/docs/SubscriptionResponseEntry.md +2 -1
  69. data/docs/SubscriptionsApi.md +102 -99
  70. data/docs/SubscriptionsResponse.md +2 -1
  71. data/docs/SubscriptionsResponseEntry.md +2 -1
  72. data/docs/TagApiControllerApi.md +32 -30
  73. data/docs/TagNamesResponse.md +2 -1
  74. data/docs/TokenDto.md +2 -1
  75. data/docs/TokenResponse.md +2 -1
  76. data/docs/TokenResponseEntry.md +2 -1
  77. data/docs/TokensApiControllerApi.md +62 -60
  78. data/docs/TokensResponse.md +2 -1
  79. data/docs/TokensResponseEntry.md +2 -1
  80. data/docs/UpdateAppInfo.md +2 -1
  81. data/docs/UpdatePlanResponse.md +2 -1
  82. data/docs/UpdatePlanResponseDto.md +2 -1
  83. data/docs/UpdatePlanResponseEntry.md +2 -1
  84. data/docs/UpdateSubscriptionDto.md +2 -1
  85. data/docs/UpdateTokenDto.md +2 -1
  86. data/docs/UsageDto.md +6 -3
  87. data/docs/UsageMultiResponse.md +2 -1
  88. data/docs/UsageMultiResponseEntry.md +2 -1
  89. data/docs/UsageResponse.md +2 -1
  90. data/docs/UsageResponseEntry.md +2 -1
  91. data/docs/UserInfo.md +2 -1
  92. data/docs/UserPermissions.md +2 -1
  93. data/docs/UserRole.md +2 -1
  94. data/lib/SematextCloud/api/alert_notifications_api.rb +42 -37
  95. data/lib/SematextCloud/api/alerts_api.rb +81 -72
  96. data/lib/SematextCloud/api/apps_api.rb +125 -106
  97. data/lib/SematextCloud/api/aws_settings_controller_api.rb +26 -25
  98. data/lib/SematextCloud/api/billing_api.rb +51 -46
  99. data/lib/SematextCloud/api/logs_app_api.rb +21 -20
  100. data/lib/{stcloud → SematextCloud}/api/logs_usage_api_controller_api.rb +2 -2
  101. data/lib/SematextCloud/api/monitoring_app_api.rb +23 -22
  102. data/lib/SematextCloud/api/reset_password_api.rb +21 -20
  103. data/lib/SematextCloud/api/subscriptions_api.rb +203 -172
  104. data/lib/SematextCloud/api/tag_api_controller_api.rb +53 -50
  105. data/lib/SematextCloud/api/tokens_api_controller_api.rb +84 -73
  106. data/lib/SematextCloud/api_client.rb +41 -42
  107. data/lib/SematextCloud/api_error.rb +21 -2
  108. data/lib/SematextCloud/configuration.rb +5 -9
  109. data/lib/{stcloud → SematextCloud}/models/alert_notification.rb +5 -5
  110. data/lib/SematextCloud/models/alert_notification_request.rb +49 -26
  111. data/lib/SematextCloud/models/alert_rule.rb +175 -152
  112. data/lib/{stcloud/models/app_response.rb → SematextCloud/models/alert_rule_response.rb} +6 -6
  113. data/lib/{stcloud → SematextCloud}/models/alert_rule_response_entry.rb +5 -5
  114. data/lib/SematextCloud/models/alert_rule_schedule_time_range_dto.rb +44 -21
  115. data/lib/SematextCloud/models/alert_rule_schedule_weekday_dto.rb +49 -26
  116. data/lib/SematextCloud/models/alert_rules_response.rb +235 -0
  117. data/lib/{stcloud → SematextCloud}/models/alert_rules_response_entry.rb +5 -5
  118. data/lib/SematextCloud/models/app.rb +163 -93
  119. data/lib/SematextCloud/models/app_description.rb +41 -18
  120. data/lib/SematextCloud/models/app_metadata.rb +60 -37
  121. data/lib/{stcloud/models/alert_rule_response.rb → SematextCloud/models/app_response.rb} +6 -6
  122. data/lib/{stcloud → SematextCloud}/models/app_response_entry.rb +5 -5
  123. data/lib/{stcloud → SematextCloud}/models/app_types_response.rb +5 -5
  124. data/lib/{stcloud → SematextCloud}/models/app_types_response_entry.rb +5 -5
  125. data/lib/{stcloud/models/alert_rules_response.rb → SematextCloud/models/apps_response.rb} +6 -6
  126. data/lib/{stcloud → SematextCloud}/models/apps_response_entry.rb +5 -5
  127. data/lib/SematextCloud/models/basic_auth_method_dto.rb +47 -24
  128. data/lib/SematextCloud/models/basic_organization_dto.rb +51 -28
  129. data/lib/SematextCloud/models/billing_info.rb +48 -25
  130. data/lib/{stcloud → SematextCloud}/models/charges_details_response_dto.rb +5 -5
  131. data/lib/SematextCloud/models/cloud_watch_settings.rb +56 -33
  132. data/lib/SematextCloud/models/cloud_watch_settings_response.rb +235 -0
  133. data/lib/{stcloud → SematextCloud}/models/cloud_watch_settings_response_entry.rb +5 -5
  134. data/lib/SematextCloud/models/create_app_info.rb +53 -31
  135. data/lib/SematextCloud/models/create_token_dto.rb +46 -23
  136. data/lib/{stcloud → SematextCloud}/models/daily_dto.rb +36 -18
  137. data/lib/{stcloud → SematextCloud}/models/day_usage_data.rb +5 -5
  138. data/lib/{stcloud → SematextCloud}/models/dimension.rb +5 -5
  139. data/lib/SematextCloud/models/error.rb +43 -20
  140. data/lib/{stcloud → SematextCloud}/models/event_dto.rb +7 -7
  141. data/lib/SematextCloud/models/filter_value.rb +53 -30
  142. data/lib/SematextCloud/models/generic_api_response.rb +46 -24
  143. data/lib/{stcloud → SematextCloud}/models/generic_map_based_api_response.rb +5 -5
  144. data/lib/SematextCloud/models/invitation.rb +74 -52
  145. data/lib/{stcloud → SematextCloud}/models/invoice.rb +5 -5
  146. data/lib/{stcloud/models/notifications_response.rb → SematextCloud/models/invoice_response.rb} +6 -6
  147. data/lib/{stcloud → SematextCloud}/models/invoice_response_entry.rb +5 -5
  148. data/lib/{stcloud → SematextCloud}/models/limit_change_event_dto.rb +5 -5
  149. data/lib/{stcloud → SematextCloud}/models/mail_report_response.rb +5 -5
  150. data/lib/{stcloud/models/subscription_response_entry.rb → SematextCloud/models/mail_report_response_response_entry.rb} +6 -6
  151. data/lib/{stcloud → SematextCloud}/models/min_period_fee_period.rb +24 -6
  152. data/lib/SematextCloud/models/notification_integration.rb +73 -50
  153. data/lib/SematextCloud/models/notifications_response.rb +235 -0
  154. data/lib/{stcloud → SematextCloud}/models/notifications_response_entry.rb +5 -5
  155. data/lib/SematextCloud/models/plan.rb +80 -57
  156. data/lib/{stcloud → SematextCloud}/models/plans_response.rb +5 -5
  157. data/lib/{stcloud → SematextCloud}/models/plans_response_entry.rb +5 -5
  158. data/lib/SematextCloud/models/report_info.rb +69 -37
  159. data/lib/SematextCloud/models/service_integration.rb +71 -48
  160. data/lib/{stcloud → SematextCloud}/models/subscription.rb +15 -6
  161. data/lib/SematextCloud/models/subscription_dashboard_dto.rb +72 -49
  162. data/lib/SematextCloud/models/subscription_dto.rb +85 -53
  163. data/lib/{stcloud/models/cloud_watch_settings_response.rb → SematextCloud/models/subscription_response.rb} +6 -6
  164. data/lib/{stcloud/models/mail_report_response_response_entry.rb → SematextCloud/models/subscription_response_entry.rb} +6 -6
  165. data/lib/{stcloud → SematextCloud}/models/subscriptions_response.rb +5 -5
  166. data/lib/{stcloud → SematextCloud}/models/subscriptions_response_entry.rb +5 -5
  167. data/lib/{stcloud → SematextCloud}/models/tag_names_response.rb +5 -5
  168. data/lib/{stcloud → SematextCloud}/models/token_dto.rb +5 -5
  169. data/lib/{stcloud → SematextCloud}/models/token_response.rb +5 -5
  170. data/lib/{stcloud → SematextCloud}/models/token_response_entry.rb +5 -5
  171. data/lib/{stcloud/models/subscription_response.rb → SematextCloud/models/tokens_response.rb} +6 -6
  172. data/lib/{stcloud → SematextCloud}/models/tokens_response_entry.rb +5 -5
  173. data/lib/SematextCloud/models/update_app_info.rb +64 -41
  174. data/lib/{stcloud → SematextCloud}/models/update_plan_response.rb +5 -5
  175. data/lib/{stcloud → SematextCloud}/models/update_plan_response_dto.rb +5 -5
  176. data/lib/{stcloud → SematextCloud}/models/update_plan_response_entry.rb +5 -5
  177. data/lib/SematextCloud/models/update_subscription_dto.rb +42 -19
  178. data/lib/SematextCloud/models/update_token_dto.rb +44 -21
  179. data/lib/{stcloud → SematextCloud}/models/usage_dto.rb +39 -21
  180. data/lib/{stcloud → SematextCloud}/models/usage_multi_response.rb +5 -5
  181. data/lib/{stcloud → SematextCloud}/models/usage_multi_response_entry.rb +5 -5
  182. data/lib/{stcloud → SematextCloud}/models/usage_response.rb +5 -5
  183. data/lib/{stcloud → SematextCloud}/models/usage_response_entry.rb +5 -5
  184. data/lib/SematextCloud/models/user_info.rb +42 -19
  185. data/lib/SematextCloud/models/user_permissions.rb +48 -25
  186. data/lib/SematextCloud/models/user_role.rb +53 -30
  187. data/lib/SematextCloud/version.rb +2 -3
  188. data/lib/SematextCloud.rb +57 -7
  189. data/spec/api/alert_notifications_api_spec.rb +8 -8
  190. data/spec/api/alerts_api_spec.rb +8 -8
  191. data/spec/api/apps_api_spec.rb +10 -10
  192. data/spec/api/aws_settings_controller_api_spec.rb +4 -4
  193. data/spec/api/billing_api_spec.rb +6 -6
  194. data/spec/api/logs_app_api_spec.rb +4 -4
  195. data/spec/api/logs_usage_api_controller_api_spec.rb +4 -4
  196. data/spec/api/monitoring_app_api_spec.rb +6 -6
  197. data/spec/api/reset_password_api_spec.rb +4 -4
  198. data/spec/api/subscriptions_api_spec.rb +10 -10
  199. data/spec/api/tag_api_controller_api_spec.rb +6 -6
  200. data/spec/api/tokens_api_controller_api_spec.rb +12 -12
  201. data/spec/api_client_spec.rb +30 -30
  202. data/spec/configuration_spec.rb +4 -4
  203. data/spec/models/alert_notification_request_spec.rb +4 -4
  204. data/spec/models/alert_notification_spec.rb +4 -4
  205. data/spec/models/alert_rule_response_entry_spec.rb +4 -4
  206. data/spec/models/alert_rule_response_spec.rb +4 -4
  207. data/spec/models/alert_rule_schedule_time_range_dto_spec.rb +4 -4
  208. data/spec/models/alert_rule_schedule_weekday_dto_spec.rb +4 -4
  209. data/spec/models/alert_rule_spec.rb +4 -4
  210. data/spec/models/alert_rules_response_entry_spec.rb +4 -4
  211. data/spec/models/alert_rules_response_spec.rb +4 -4
  212. data/spec/models/app_description_spec.rb +4 -4
  213. data/spec/models/app_metadata_spec.rb +4 -4
  214. data/spec/models/app_response_entry_spec.rb +4 -4
  215. data/spec/models/app_response_spec.rb +4 -4
  216. data/spec/models/app_spec.rb +4 -4
  217. data/spec/models/app_types_response_entry_spec.rb +4 -4
  218. data/spec/models/app_types_response_spec.rb +4 -4
  219. data/spec/models/apps_response_entry_spec.rb +4 -4
  220. data/spec/models/apps_response_spec.rb +4 -4
  221. data/spec/models/basic_auth_method_dto_spec.rb +4 -4
  222. data/spec/models/basic_organization_dto_spec.rb +4 -4
  223. data/spec/models/billing_info_spec.rb +4 -4
  224. data/spec/models/charges_details_response_dto_spec.rb +4 -4
  225. data/spec/models/cloud_watch_settings_response_entry_spec.rb +4 -4
  226. data/spec/models/cloud_watch_settings_response_spec.rb +4 -4
  227. data/spec/models/cloud_watch_settings_spec.rb +4 -4
  228. data/spec/models/create_app_info_spec.rb +4 -4
  229. data/spec/models/create_token_dto_spec.rb +4 -4
  230. data/spec/models/daily_dto_spec.rb +18 -6
  231. data/spec/models/day_usage_data_spec.rb +4 -4
  232. data/spec/models/dimension_spec.rb +4 -4
  233. data/spec/models/error_spec.rb +4 -4
  234. data/spec/models/event_dto_spec.rb +5 -5
  235. data/spec/models/filter_value_spec.rb +4 -4
  236. data/spec/models/generic_api_response_spec.rb +4 -4
  237. data/spec/models/generic_map_based_api_response_spec.rb +4 -4
  238. data/spec/models/invitation_spec.rb +4 -4
  239. data/spec/models/invoice_response_entry_spec.rb +4 -4
  240. data/spec/models/invoice_response_spec.rb +4 -4
  241. data/spec/models/invoice_spec.rb +4 -4
  242. data/spec/models/limit_change_event_dto_spec.rb +4 -4
  243. data/spec/models/mail_report_response_response_entry_spec.rb +4 -4
  244. data/spec/models/mail_report_response_spec.rb +4 -4
  245. data/spec/models/min_period_fee_period_spec.rb +16 -4
  246. data/spec/models/notification_integration_spec.rb +4 -4
  247. data/spec/models/notifications_response_entry_spec.rb +4 -4
  248. data/spec/models/notifications_response_spec.rb +4 -4
  249. data/spec/models/plan_spec.rb +5 -5
  250. data/spec/models/plans_response_entry_spec.rb +4 -4
  251. data/spec/models/plans_response_spec.rb +4 -4
  252. data/spec/models/report_info_spec.rb +10 -4
  253. data/spec/models/service_integration_spec.rb +4 -4
  254. data/spec/models/subscription_dashboard_dto_spec.rb +4 -4
  255. data/spec/models/subscription_dto_spec.rb +10 -4
  256. data/spec/models/subscription_response_entry_spec.rb +4 -4
  257. data/spec/models/subscription_response_spec.rb +4 -4
  258. data/spec/models/subscription_spec.rb +10 -4
  259. data/spec/models/subscriptions_response_entry_spec.rb +4 -4
  260. data/spec/models/subscriptions_response_spec.rb +4 -4
  261. data/spec/models/tag_names_response_spec.rb +4 -4
  262. data/spec/models/token_dto_spec.rb +4 -4
  263. data/spec/models/token_response_entry_spec.rb +4 -4
  264. data/spec/models/token_response_spec.rb +4 -4
  265. data/spec/models/tokens_response_entry_spec.rb +4 -4
  266. data/spec/models/tokens_response_spec.rb +4 -4
  267. data/spec/models/update_app_info_spec.rb +4 -4
  268. data/spec/models/update_plan_response_dto_spec.rb +4 -4
  269. data/spec/models/update_plan_response_entry_spec.rb +4 -4
  270. data/spec/models/update_plan_response_spec.rb +4 -4
  271. data/spec/models/update_subscription_dto_spec.rb +4 -4
  272. data/spec/models/update_token_dto_spec.rb +4 -4
  273. data/spec/models/usage_dto_spec.rb +22 -10
  274. data/spec/models/usage_multi_response_entry_spec.rb +4 -4
  275. data/spec/models/usage_multi_response_spec.rb +4 -4
  276. data/spec/models/usage_response_entry_spec.rb +4 -4
  277. data/spec/models/usage_response_spec.rb +4 -4
  278. data/spec/models/user_info_spec.rb +4 -4
  279. data/spec/models/user_permissions_spec.rb +4 -4
  280. data/spec/models/user_role_spec.rb +4 -4
  281. data/spec/spec_helper.rb +2 -2
  282. metadata +55 -121
  283. data/docs/DataSeriesFilter.md +0 -8
  284. data/docs/DataSeriesRequest.md +0 -12
  285. data/docs/MetricsApi.md +0 -227
  286. data/docs/SavedQueriesApi.md +0 -220
  287. data/docs/SavedQuery.md +0 -18
  288. data/lib/SematextCloud/api/metrics_api.rb +0 -247
  289. data/lib/SematextCloud/api/saved_queries_api.rb +0 -237
  290. data/lib/SematextCloud/models/data_series_filter.rb +0 -237
  291. data/lib/SematextCloud/models/data_series_request.rb +0 -283
  292. data/lib/SematextCloud/models/saved_query.rb +0 -291
  293. data/lib/stcloud/api/alert_notifications_api.rb +0 -142
  294. data/lib/stcloud/api/alerts_api.rb +0 -292
  295. data/lib/stcloud/api/apps_api.rb +0 -452
  296. data/lib/stcloud/api/aws_settings_controller_api.rb +0 -84
  297. data/lib/stcloud/api/billing_api.rb +0 -202
  298. data/lib/stcloud/api/logs_app_api.rb +0 -76
  299. data/lib/stcloud/api/monitoring_app_api.rb +0 -76
  300. data/lib/stcloud/api/reset_password_api.rb +0 -76
  301. data/lib/stcloud/api/subscriptions_api.rb +0 -610
  302. data/lib/stcloud/api/tag_api_controller_api.rb +0 -250
  303. data/lib/stcloud/api/tokens_api_controller_api.rb +0 -324
  304. data/lib/stcloud/api_client.rb +0 -388
  305. data/lib/stcloud/api_error.rb +0 -57
  306. data/lib/stcloud/configuration.rb +0 -205
  307. data/lib/stcloud/models/alert_notification_request.rb +0 -235
  308. data/lib/stcloud/models/alert_rule.rb +0 -675
  309. data/lib/stcloud/models/alert_rule_schedule_time_range_dto.rb +0 -215
  310. data/lib/stcloud/models/alert_rule_schedule_weekday_dto.rb +0 -244
  311. data/lib/stcloud/models/app.rb +0 -489
  312. data/lib/stcloud/models/app_description.rb +0 -206
  313. data/lib/stcloud/models/app_metadata.rb +0 -291
  314. data/lib/stcloud/models/apps_response.rb +0 -235
  315. data/lib/stcloud/models/basic_auth_method_dto.rb +0 -249
  316. data/lib/stcloud/models/basic_organization_dto.rb +0 -269
  317. data/lib/stcloud/models/billing_info.rb +0 -224
  318. data/lib/stcloud/models/cloud_watch_settings.rb +0 -279
  319. data/lib/stcloud/models/create_app_info.rb +0 -242
  320. data/lib/stcloud/models/create_token_dto.rb +0 -224
  321. data/lib/stcloud/models/error.rb +0 -215
  322. data/lib/stcloud/models/filter_value.rb +0 -253
  323. data/lib/stcloud/models/generic_api_response.rb +0 -236
  324. data/lib/stcloud/models/invitation.rb +0 -348
  325. data/lib/stcloud/models/invoice_response.rb +0 -235
  326. data/lib/stcloud/models/notification_integration.rb +0 -347
  327. data/lib/stcloud/models/plan.rb +0 -360
  328. data/lib/stcloud/models/report_info.rb +0 -270
  329. data/lib/stcloud/models/service_integration.rb +0 -305
  330. data/lib/stcloud/models/subscription_dashboard_dto.rb +0 -342
  331. data/lib/stcloud/models/subscription_dto.rb +0 -351
  332. data/lib/stcloud/models/tokens_response.rb +0 -235
  333. data/lib/stcloud/models/update_app_info.rb +0 -312
  334. data/lib/stcloud/models/update_subscription_dto.rb +0 -206
  335. data/lib/stcloud/models/update_token_dto.rb +0 -215
  336. data/lib/stcloud/models/user_info.rb +0 -206
  337. data/lib/stcloud/models/user_permissions.rb +0 -224
  338. data/lib/stcloud/models/user_role.rb +0 -270
  339. data/lib/stcloud/version.rb +0 -14
  340. data/lib/stcloud.rb +0 -128
  341. data/spec/api/metrics_api_spec.rb +0 -83
  342. data/spec/api/saved_queries_api_spec.rb +0 -80
  343. data/spec/models/data_series_filter_spec.rb +0 -57
  344. data/spec/models/data_series_request_spec.rb +0 -81
  345. data/spec/models/saved_query_spec.rb +0 -113
@@ -1,347 +0,0 @@
1
- =begin
2
- #Sematext Cloud API
3
-
4
- #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5
-
6
- OpenAPI spec version: v3
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.25
10
- =end
11
-
12
- require 'date'
13
-
14
- module stcloud
15
- class NotificationIntegration
16
- attr_accessor :applicability
17
-
18
- attr_accessor :create_date
19
-
20
- attr_accessor :created_by_owner
21
-
22
- attr_accessor :creator_id
23
-
24
- attr_accessor :id
25
-
26
- attr_accessor :integration_type
27
-
28
- attr_accessor :name
29
-
30
- attr_accessor :params
31
-
32
- attr_accessor :state
33
-
34
- attr_accessor :user_id
35
-
36
- class EnumAttributeValidator
37
- attr_reader :datatype
38
- attr_reader :allowable_values
39
-
40
- def initialize(datatype, allowable_values)
41
- @allowable_values = allowable_values.map do |value|
42
- case datatype.to_s
43
- when /Integer/i
44
- value.to_i
45
- when /Float/i
46
- value.to_f
47
- else
48
- value
49
- end
50
- end
51
- end
52
-
53
- def valid?(value)
54
- !value || allowable_values.include?(value)
55
- end
56
- end
57
-
58
- # Attribute mapping from ruby-style variable name to JSON key.
59
- def self.attribute_map
60
- {
61
- :'applicability' => :'applicability',
62
- :'create_date' => :'createDate',
63
- :'created_by_owner' => :'createdByOwner',
64
- :'creator_id' => :'creatorId',
65
- :'id' => :'id',
66
- :'integration_type' => :'integrationType',
67
- :'name' => :'name',
68
- :'params' => :'params',
69
- :'state' => :'state',
70
- :'user_id' => :'userId'
71
- }
72
- end
73
-
74
- # Attribute type mapping.
75
- def self.openapi_types
76
- {
77
- :'applicability' => :'Object',
78
- :'create_date' => :'Object',
79
- :'created_by_owner' => :'Object',
80
- :'creator_id' => :'Object',
81
- :'id' => :'Object',
82
- :'integration_type' => :'Object',
83
- :'name' => :'Object',
84
- :'params' => :'Object',
85
- :'state' => :'Object',
86
- :'user_id' => :'Object'
87
- }
88
- end
89
-
90
- # List of attributes with nullable: true
91
- def self.openapi_nullable
92
- Set.new([
93
- ])
94
- end
95
-
96
- # Initializes the object
97
- # @param [Hash] attributes Model attributes in the form of hash
98
- def initialize(attributes = {})
99
- if (!attributes.is_a?(Hash))
100
- fail ArgumentError, "The input argument (attributes) must be a hash in `stcloud::NotificationIntegration` initialize method"
101
- end
102
-
103
- # check to see if the attribute exists and convert string to symbol for hash key
104
- attributes = attributes.each_with_object({}) { |(k, v), h|
105
- if (!self.class.attribute_map.key?(k.to_sym))
106
- fail ArgumentError, "`#{k}` is not a valid attribute in `stcloud::NotificationIntegration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
- end
108
- h[k.to_sym] = v
109
- }
110
-
111
- if attributes.key?(:'applicability')
112
- self.applicability = attributes[:'applicability']
113
- end
114
-
115
- if attributes.key?(:'create_date')
116
- self.create_date = attributes[:'create_date']
117
- end
118
-
119
- if attributes.key?(:'created_by_owner')
120
- self.created_by_owner = attributes[:'created_by_owner']
121
- end
122
-
123
- if attributes.key?(:'creator_id')
124
- self.creator_id = attributes[:'creator_id']
125
- end
126
-
127
- if attributes.key?(:'id')
128
- self.id = attributes[:'id']
129
- end
130
-
131
- if attributes.key?(:'integration_type')
132
- self.integration_type = attributes[:'integration_type']
133
- end
134
-
135
- if attributes.key?(:'name')
136
- self.name = attributes[:'name']
137
- end
138
-
139
- if attributes.key?(:'params')
140
- if (value = attributes[:'params']).is_a?(Hash)
141
- self.params = value
142
- end
143
- end
144
-
145
- if attributes.key?(:'state')
146
- self.state = attributes[:'state']
147
- end
148
-
149
- if attributes.key?(:'user_id')
150
- self.user_id = attributes[:'user_id']
151
- end
152
- end
153
-
154
- # Show invalid properties with the reasons. Usually used together with valid?
155
- # @return Array for valid properties with the reasons
156
- def list_invalid_properties
157
- invalid_properties = Array.new
158
- invalid_properties
159
- end
160
-
161
- # Check to see if the all the properties in the model are valid
162
- # @return true if the model is valid
163
- def valid?
164
- applicability_validator = EnumAttributeValidator.new('Object', ['NONE', 'USE_ALWAYS'])
165
- return false unless applicability_validator.valid?(@applicability)
166
- integration_type_validator = EnumAttributeValidator.new('Object', ['PAGER_DUTY', 'NAGIOS', 'WEB_HOOKS', 'WEB_HOOKS_TEMPLATE', 'HIP_CHAT', 'EMAIL_LIST', 'TEMPORARY_EMAIL_LIST'])
167
- return false unless integration_type_validator.valid?(@integration_type)
168
- state_validator = EnumAttributeValidator.new('Object', ['ACTIVE', 'DISABLED', 'DELETED'])
169
- return false unless state_validator.valid?(@state)
170
- true
171
- end
172
-
173
- # Custom attribute writer method checking allowed values (enum).
174
- # @param [Object] applicability Object to be assigned
175
- def applicability=(applicability)
176
- validator = EnumAttributeValidator.new('Object', ['NONE', 'USE_ALWAYS'])
177
- unless validator.valid?(applicability)
178
- fail ArgumentError, "invalid value for \"applicability\", must be one of #{validator.allowable_values}."
179
- end
180
- @applicability = applicability
181
- end
182
-
183
- # Custom attribute writer method checking allowed values (enum).
184
- # @param [Object] integration_type Object to be assigned
185
- def integration_type=(integration_type)
186
- validator = EnumAttributeValidator.new('Object', ['PAGER_DUTY', 'NAGIOS', 'WEB_HOOKS', 'WEB_HOOKS_TEMPLATE', 'HIP_CHAT', 'EMAIL_LIST', 'TEMPORARY_EMAIL_LIST'])
187
- unless validator.valid?(integration_type)
188
- fail ArgumentError, "invalid value for \"integration_type\", must be one of #{validator.allowable_values}."
189
- end
190
- @integration_type = integration_type
191
- end
192
-
193
- # Custom attribute writer method checking allowed values (enum).
194
- # @param [Object] state Object to be assigned
195
- def state=(state)
196
- validator = EnumAttributeValidator.new('Object', ['ACTIVE', 'DISABLED', 'DELETED'])
197
- unless validator.valid?(state)
198
- fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
199
- end
200
- @state = state
201
- end
202
-
203
- # Checks equality by comparing each attribute.
204
- # @param [Object] Object to be compared
205
- def ==(o)
206
- return true if self.equal?(o)
207
- self.class == o.class &&
208
- applicability == o.applicability &&
209
- create_date == o.create_date &&
210
- created_by_owner == o.created_by_owner &&
211
- creator_id == o.creator_id &&
212
- id == o.id &&
213
- integration_type == o.integration_type &&
214
- name == o.name &&
215
- params == o.params &&
216
- state == o.state &&
217
- user_id == o.user_id
218
- end
219
-
220
- # @see the `==` method
221
- # @param [Object] Object to be compared
222
- def eql?(o)
223
- self == o
224
- end
225
-
226
- # Calculates hash code according to all attributes.
227
- # @return [Integer] Hash code
228
- def hash
229
- [applicability, create_date, created_by_owner, creator_id, id, integration_type, name, params, state, user_id].hash
230
- end
231
-
232
- # Builds the object from hash
233
- # @param [Hash] attributes Model attributes in the form of hash
234
- # @return [Object] Returns the model itself
235
- def self.build_from_hash(attributes)
236
- new.build_from_hash(attributes)
237
- end
238
-
239
- # Builds the object from hash
240
- # @param [Hash] attributes Model attributes in the form of hash
241
- # @return [Object] Returns the model itself
242
- def build_from_hash(attributes)
243
- return nil unless attributes.is_a?(Hash)
244
- self.class.openapi_types.each_pair do |key, type|
245
- if type =~ /\AArray<(.*)>/i
246
- # check to ensure the input is an array given that the attribute
247
- # is documented as an array but the input is not
248
- if attributes[self.class.attribute_map[key]].is_a?(Array)
249
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
250
- end
251
- elsif !attributes[self.class.attribute_map[key]].nil?
252
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
253
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
254
- self.send("#{key}=", nil)
255
- end
256
- end
257
-
258
- self
259
- end
260
-
261
- # Deserializes the data based on type
262
- # @param string type Data type
263
- # @param string value Value to be deserialized
264
- # @return [Object] Deserialized data
265
- def _deserialize(type, value)
266
- case type.to_sym
267
- when :DateTime
268
- DateTime.parse(value)
269
- when :Date
270
- Date.parse(value)
271
- when :String
272
- value.to_s
273
- when :Integer
274
- value.to_i
275
- when :Float
276
- value.to_f
277
- when :Boolean
278
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
279
- true
280
- else
281
- false
282
- end
283
- when :Object
284
- # generic object (usually a Hash), return directly
285
- value
286
- when /\AArray<(?<inner_type>.+)>\z/
287
- inner_type = Regexp.last_match[:inner_type]
288
- value.map { |v| _deserialize(inner_type, v) }
289
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
290
- k_type = Regexp.last_match[:k_type]
291
- v_type = Regexp.last_match[:v_type]
292
- {}.tap do |hash|
293
- value.each do |k, v|
294
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
295
- end
296
- end
297
- else # model
298
- stcloud.const_get(type).build_from_hash(value)
299
- end
300
- end
301
-
302
- # Returns the string representation of the object
303
- # @return [String] String presentation of the object
304
- def to_s
305
- to_hash.to_s
306
- end
307
-
308
- # to_body is an alias to to_hash (backward compatibility)
309
- # @return [Hash] Returns the object in the form of hash
310
- def to_body
311
- to_hash
312
- end
313
-
314
- # Returns the object in the form of hash
315
- # @return [Hash] Returns the object in the form of hash
316
- def to_hash
317
- hash = {}
318
- self.class.attribute_map.each_pair do |attr, param|
319
- value = self.send(attr)
320
- if value.nil?
321
- is_nullable = self.class.openapi_nullable.include?(attr)
322
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
323
- end
324
-
325
- hash[param] = _to_hash(value)
326
- end
327
- hash
328
- end
329
-
330
- # Outputs non-array value in the form of hash
331
- # For object, use to_hash. Otherwise, just return the value
332
- # @param [Object] value Any valid value
333
- # @return [Hash] Returns the value in the form of hash
334
- def _to_hash(value)
335
- if value.is_a?(Array)
336
- value.compact.map { |v| _to_hash(v) }
337
- elsif value.is_a?(Hash)
338
- {}.tap do |hash|
339
- value.each { |k, v| hash[k] = _to_hash(v) }
340
- end
341
- elsif value.respond_to? :to_hash
342
- value.to_hash
343
- else
344
- value
345
- end
346
- end end
347
- end
@@ -1,360 +0,0 @@
1
- =begin
2
- #Sematext Cloud API
3
-
4
- #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5
-
6
- OpenAPI spec version: v3
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.25
10
- =end
11
-
12
- require 'date'
13
-
14
- module stcloud
15
- class Plan
16
- attr_accessor :app_type
17
-
18
- attr_accessor :custom
19
-
20
- attr_accessor :data_retention_hours
21
-
22
- attr_accessor :default_trial_plan
23
-
24
- attr_accessor :free
25
-
26
- attr_accessor :free_trial_days
27
-
28
- attr_accessor :id
29
-
30
- attr_accessor :max_alerts
31
-
32
- attr_accessor :max_daily_events
33
-
34
- attr_accessor :name
35
-
36
- attr_accessor :plan_scheme
37
-
38
- attr_accessor :sematext_service
39
-
40
- attr_accessor :trial_plan
41
-
42
- class EnumAttributeValidator
43
- attr_reader :datatype
44
- attr_reader :allowable_values
45
-
46
- def initialize(datatype, allowable_values)
47
- @allowable_values = allowable_values.map do |value|
48
- case datatype.to_s
49
- when /Integer/i
50
- value.to_i
51
- when /Float/i
52
- value.to_f
53
- else
54
- value
55
- end
56
- end
57
- end
58
-
59
- def valid?(value)
60
- !value || allowable_values.include?(value)
61
- end
62
- end
63
-
64
- # Attribute mapping from ruby-style variable name to JSON key.
65
- def self.attribute_map
66
- {
67
- :'app_type' => :'appType',
68
- :'custom' => :'custom',
69
- :'data_retention_hours' => :'dataRetentionHours',
70
- :'default_trial_plan' => :'defaultTrialPlan',
71
- :'free' => :'free',
72
- :'free_trial_days' => :'freeTrialDays',
73
- :'id' => :'id',
74
- :'max_alerts' => :'maxAlerts',
75
- :'max_daily_events' => :'maxDailyEvents',
76
- :'name' => :'name',
77
- :'plan_scheme' => :'planScheme',
78
- :'sematext_service' => :'sematextService',
79
- :'trial_plan' => :'trialPlan'
80
- }
81
- end
82
-
83
- # Attribute type mapping.
84
- def self.openapi_types
85
- {
86
- :'app_type' => :'Object',
87
- :'custom' => :'Object',
88
- :'data_retention_hours' => :'Object',
89
- :'default_trial_plan' => :'Object',
90
- :'free' => :'Object',
91
- :'free_trial_days' => :'Object',
92
- :'id' => :'Object',
93
- :'max_alerts' => :'Object',
94
- :'max_daily_events' => :'Object',
95
- :'name' => :'Object',
96
- :'plan_scheme' => :'Object',
97
- :'sematext_service' => :'Object',
98
- :'trial_plan' => :'Object'
99
- }
100
- end
101
-
102
- # List of attributes with nullable: true
103
- def self.openapi_nullable
104
- Set.new([
105
- ])
106
- end
107
-
108
- # Initializes the object
109
- # @param [Hash] attributes Model attributes in the form of hash
110
- def initialize(attributes = {})
111
- if (!attributes.is_a?(Hash))
112
- fail ArgumentError, "The input argument (attributes) must be a hash in `stcloud::Plan` initialize method"
113
- end
114
-
115
- # check to see if the attribute exists and convert string to symbol for hash key
116
- attributes = attributes.each_with_object({}) { |(k, v), h|
117
- if (!self.class.attribute_map.key?(k.to_sym))
118
- fail ArgumentError, "`#{k}` is not a valid attribute in `stcloud::Plan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
119
- end
120
- h[k.to_sym] = v
121
- }
122
-
123
- if attributes.key?(:'app_type')
124
- self.app_type = attributes[:'app_type']
125
- end
126
-
127
- if attributes.key?(:'custom')
128
- self.custom = attributes[:'custom']
129
- end
130
-
131
- if attributes.key?(:'data_retention_hours')
132
- self.data_retention_hours = attributes[:'data_retention_hours']
133
- end
134
-
135
- if attributes.key?(:'default_trial_plan')
136
- self.default_trial_plan = attributes[:'default_trial_plan']
137
- end
138
-
139
- if attributes.key?(:'free')
140
- self.free = attributes[:'free']
141
- end
142
-
143
- if attributes.key?(:'free_trial_days')
144
- self.free_trial_days = attributes[:'free_trial_days']
145
- end
146
-
147
- if attributes.key?(:'id')
148
- self.id = attributes[:'id']
149
- end
150
-
151
- if attributes.key?(:'max_alerts')
152
- self.max_alerts = attributes[:'max_alerts']
153
- end
154
-
155
- if attributes.key?(:'max_daily_events')
156
- self.max_daily_events = attributes[:'max_daily_events']
157
- end
158
-
159
- if attributes.key?(:'name')
160
- self.name = attributes[:'name']
161
- end
162
-
163
- if attributes.key?(:'plan_scheme')
164
- self.plan_scheme = attributes[:'plan_scheme']
165
- end
166
-
167
- if attributes.key?(:'sematext_service')
168
- self.sematext_service = attributes[:'sematext_service']
169
- end
170
-
171
- if attributes.key?(:'trial_plan')
172
- self.trial_plan = attributes[:'trial_plan']
173
- end
174
- end
175
-
176
- # Show invalid properties with the reasons. Usually used together with valid?
177
- # @return Array for valid properties with the reasons
178
- def list_invalid_properties
179
- invalid_properties = Array.new
180
- invalid_properties
181
- end
182
-
183
- # Check to see if the all the properties in the model are valid
184
- # @return true if the model is valid
185
- def valid?
186
- plan_scheme_validator = EnumAttributeValidator.new('Object', ['SPM_1_0', 'SPM_2_0', 'SEARCHENE_1_0', 'LOGSENE_1_0', 'LOGSENE_2_0', 'RUM_1_0', 'RUM_1_1', 'RUM_EA', 'SYNTHETICS_EA', 'SYNTHETICS_1_0'])
187
- return false unless plan_scheme_validator.valid?(@plan_scheme)
188
- sematext_service_validator = EnumAttributeValidator.new('Object', ['LOGSENE', 'SPM', 'RUM', 'SYNTHETICS'])
189
- return false unless sematext_service_validator.valid?(@sematext_service)
190
- true
191
- end
192
-
193
- # Custom attribute writer method checking allowed values (enum).
194
- # @param [Object] plan_scheme Object to be assigned
195
- def plan_scheme=(plan_scheme)
196
- validator = EnumAttributeValidator.new('Object', ['SPM_1_0', 'SPM_2_0', 'SEARCHENE_1_0', 'LOGSENE_1_0', 'LOGSENE_2_0', 'RUM_1_0', 'RUM_1_1', 'RUM_EA', 'SYNTHETICS_EA', 'SYNTHETICS_1_0'])
197
- unless validator.valid?(plan_scheme)
198
- fail ArgumentError, "invalid value for \"plan_scheme\", must be one of #{validator.allowable_values}."
199
- end
200
- @plan_scheme = plan_scheme
201
- end
202
-
203
- # Custom attribute writer method checking allowed values (enum).
204
- # @param [Object] sematext_service Object to be assigned
205
- def sematext_service=(sematext_service)
206
- validator = EnumAttributeValidator.new('Object', ['LOGSENE', 'SPM', 'RUM', 'SYNTHETICS'])
207
- unless validator.valid?(sematext_service)
208
- fail ArgumentError, "invalid value for \"sematext_service\", must be one of #{validator.allowable_values}."
209
- end
210
- @sematext_service = sematext_service
211
- end
212
-
213
- # Checks equality by comparing each attribute.
214
- # @param [Object] Object to be compared
215
- def ==(o)
216
- return true if self.equal?(o)
217
- self.class == o.class &&
218
- app_type == o.app_type &&
219
- custom == o.custom &&
220
- data_retention_hours == o.data_retention_hours &&
221
- default_trial_plan == o.default_trial_plan &&
222
- free == o.free &&
223
- free_trial_days == o.free_trial_days &&
224
- id == o.id &&
225
- max_alerts == o.max_alerts &&
226
- max_daily_events == o.max_daily_events &&
227
- name == o.name &&
228
- plan_scheme == o.plan_scheme &&
229
- sematext_service == o.sematext_service &&
230
- trial_plan == o.trial_plan
231
- end
232
-
233
- # @see the `==` method
234
- # @param [Object] Object to be compared
235
- def eql?(o)
236
- self == o
237
- end
238
-
239
- # Calculates hash code according to all attributes.
240
- # @return [Integer] Hash code
241
- def hash
242
- [app_type, custom, data_retention_hours, default_trial_plan, free, free_trial_days, id, max_alerts, max_daily_events, name, plan_scheme, sematext_service, trial_plan].hash
243
- end
244
-
245
- # Builds the object from hash
246
- # @param [Hash] attributes Model attributes in the form of hash
247
- # @return [Object] Returns the model itself
248
- def self.build_from_hash(attributes)
249
- new.build_from_hash(attributes)
250
- end
251
-
252
- # Builds the object from hash
253
- # @param [Hash] attributes Model attributes in the form of hash
254
- # @return [Object] Returns the model itself
255
- def build_from_hash(attributes)
256
- return nil unless attributes.is_a?(Hash)
257
- self.class.openapi_types.each_pair do |key, type|
258
- if type =~ /\AArray<(.*)>/i
259
- # check to ensure the input is an array given that the attribute
260
- # is documented as an array but the input is not
261
- if attributes[self.class.attribute_map[key]].is_a?(Array)
262
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
263
- end
264
- elsif !attributes[self.class.attribute_map[key]].nil?
265
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
266
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
267
- self.send("#{key}=", nil)
268
- end
269
- end
270
-
271
- self
272
- end
273
-
274
- # Deserializes the data based on type
275
- # @param string type Data type
276
- # @param string value Value to be deserialized
277
- # @return [Object] Deserialized data
278
- def _deserialize(type, value)
279
- case type.to_sym
280
- when :DateTime
281
- DateTime.parse(value)
282
- when :Date
283
- Date.parse(value)
284
- when :String
285
- value.to_s
286
- when :Integer
287
- value.to_i
288
- when :Float
289
- value.to_f
290
- when :Boolean
291
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
292
- true
293
- else
294
- false
295
- end
296
- when :Object
297
- # generic object (usually a Hash), return directly
298
- value
299
- when /\AArray<(?<inner_type>.+)>\z/
300
- inner_type = Regexp.last_match[:inner_type]
301
- value.map { |v| _deserialize(inner_type, v) }
302
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
303
- k_type = Regexp.last_match[:k_type]
304
- v_type = Regexp.last_match[:v_type]
305
- {}.tap do |hash|
306
- value.each do |k, v|
307
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
308
- end
309
- end
310
- else # model
311
- stcloud.const_get(type).build_from_hash(value)
312
- end
313
- end
314
-
315
- # Returns the string representation of the object
316
- # @return [String] String presentation of the object
317
- def to_s
318
- to_hash.to_s
319
- end
320
-
321
- # to_body is an alias to to_hash (backward compatibility)
322
- # @return [Hash] Returns the object in the form of hash
323
- def to_body
324
- to_hash
325
- end
326
-
327
- # Returns the object in the form of hash
328
- # @return [Hash] Returns the object in the form of hash
329
- def to_hash
330
- hash = {}
331
- self.class.attribute_map.each_pair do |attr, param|
332
- value = self.send(attr)
333
- if value.nil?
334
- is_nullable = self.class.openapi_nullable.include?(attr)
335
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
336
- end
337
-
338
- hash[param] = _to_hash(value)
339
- end
340
- hash
341
- end
342
-
343
- # Outputs non-array value in the form of hash
344
- # For object, use to_hash. Otherwise, just return the value
345
- # @param [Object] value Any valid value
346
- # @return [Hash] Returns the value in the form of hash
347
- def _to_hash(value)
348
- if value.is_a?(Array)
349
- value.compact.map { |v| _to_hash(v) }
350
- elsif value.is_a?(Hash)
351
- {}.tap do |hash|
352
- value.each { |k, v| hash[k] = _to_hash(v) }
353
- end
354
- elsif value.respond_to? :to_hash
355
- value.to_hash
356
- else
357
- value
358
- end
359
- end end
360
- end