SematextCloud 0.1.5 → 0.4.0

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