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
@@ -6,8 +6,7 @@
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'
@@ -27,26 +26,39 @@ module SematextCloud
27
26
  end
28
27
 
29
28
  # Attribute type mapping.
30
- def self.swagger_types
29
+ def self.openapi_types
31
30
  {
32
- :'code' => :'String',
33
- :'message' => :'String'
31
+ :'code' => :'Object',
32
+ :'message' => :'Object'
34
33
  }
35
34
  end
36
35
 
36
+ # List of attributes with nullable: true
37
+ def self.openapi_nullable
38
+ Set.new([
39
+ ])
40
+ end
41
+
37
42
  # Initializes the object
38
43
  # @param [Hash] attributes Model attributes in the form of hash
39
44
  def initialize(attributes = {})
40
- return unless attributes.is_a?(Hash)
45
+ if (!attributes.is_a?(Hash))
46
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SematextCloud::Error` initialize method"
47
+ end
41
48
 
42
- # convert string to symbol for hash key
43
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
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::Error`. 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
+ }
44
56
 
45
- if attributes.has_key?(:'code')
57
+ if attributes.key?(:'code')
46
58
  self.code = attributes[:'code']
47
59
  end
48
60
 
49
- if attributes.has_key?(:'message')
61
+ if attributes.key?(:'message')
50
62
  self.message = attributes[:'message']
51
63
  end
52
64
  end
@@ -80,26 +92,35 @@ module SematextCloud
80
92
  end
81
93
 
82
94
  # Calculates hash code according to all attributes.
83
- # @return [Fixnum] Hash code
95
+ # @return [Integer] Hash code
84
96
  def hash
85
97
  [code, message].hash
86
98
  end
87
99
 
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def self.build_from_hash(attributes)
104
+ new.build_from_hash(attributes)
105
+ end
106
+
88
107
  # Builds the object from hash
89
108
  # @param [Hash] attributes Model attributes in the form of hash
90
109
  # @return [Object] Returns the model itself
91
110
  def build_from_hash(attributes)
92
111
  return nil unless attributes.is_a?(Hash)
93
- self.class.swagger_types.each_pair do |key, type|
112
+ self.class.openapi_types.each_pair do |key, type|
94
113
  if type =~ /\AArray<(.*)>/i
95
- # check to ensure the input is an array given that the the attribute
114
+ # check to ensure the input is an array given that the attribute
96
115
  # is documented as an array but the input is not
97
116
  if attributes[self.class.attribute_map[key]].is_a?(Array)
98
117
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
118
  end
100
119
  elsif !attributes[self.class.attribute_map[key]].nil?
101
120
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
- end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ end
103
124
  end
104
125
 
105
126
  self
@@ -121,7 +142,7 @@ module SematextCloud
121
142
  value.to_i
122
143
  when :Float
123
144
  value.to_f
124
- when :BOOLEAN
145
+ when :Boolean
125
146
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
147
  true
127
148
  else
@@ -142,8 +163,7 @@ module SematextCloud
142
163
  end
143
164
  end
144
165
  else # model
145
- temp_model = SematextCloud.const_get(type).new
146
- temp_model.build_from_hash(value)
166
+ SematextCloud.const_get(type).build_from_hash(value)
147
167
  end
148
168
  end
149
169
 
@@ -165,7 +185,11 @@ module SematextCloud
165
185
  hash = {}
166
186
  self.class.attribute_map.each_pair do |attr, param|
167
187
  value = self.send(attr)
168
- next if value.nil?
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
169
193
  hash[param] = _to_hash(value)
170
194
  end
171
195
  hash
@@ -187,6 +211,5 @@ module SematextCloud
187
211
  else
188
212
  value
189
213
  end
190
- end
191
- end
214
+ end end
192
215
  end
@@ -6,32 +6,18 @@
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 DataSeriesRequest
17
- attr_accessor :default_interval
18
-
19
- # End time of interval. Can be expressed as timestamp in milliseconds or UTC date in yyyy-MM-dd HH:mm:ss format
20
- attr_accessor :_end
21
-
22
- # Map of allowed filter values and aggregation strategy. List of available filter values can be fetched using metric filters endpoint and default aggregation strategy depends on metric
23
- attr_accessor :filters
24
-
25
- # Data points interval granularity between two data points.Default value is \"AUTO\" - calculated based on selected time span. Not required while getting filters.
26
- attr_accessor :granularity
15
+ class EventDto
16
+ attr_accessor :from
27
17
 
28
- attr_accessor :interval
18
+ attr_accessor :to
29
19
 
30
- # Metric name or metric group prefix
31
- attr_accessor :metric
32
-
33
- # Start time of interval. Can be expressed as timestamp in milliseconds or UTC date in yyyy-MM-dd HH:mm:ss format
34
- attr_accessor :start
20
+ attr_accessor :type
35
21
 
36
22
  class EnumAttributeValidator
37
23
  attr_reader :datatype
@@ -58,65 +44,52 @@ module SematextCloud
58
44
  # Attribute mapping from ruby-style variable name to JSON key.
59
45
  def self.attribute_map
60
46
  {
61
- :'default_interval' => :'defaultInterval',
62
- :'_end' => :'end',
63
- :'filters' => :'filters',
64
- :'granularity' => :'granularity',
65
- :'interval' => :'interval',
66
- :'metric' => :'metric',
67
- :'start' => :'start'
47
+ :'from' => :'from',
48
+ :'to' => :'to',
49
+ :'type' => :'type'
68
50
  }
69
51
  end
70
52
 
71
53
  # Attribute type mapping.
72
- def self.swagger_types
54
+ def self.openapi_types
73
55
  {
74
- :'default_interval' => :'Integer',
75
- :'_end' => :'String',
76
- :'filters' => :'Hash<String, DataSeriesFilter>',
77
- :'granularity' => :'String',
78
- :'interval' => :'String',
79
- :'metric' => :'String',
80
- :'start' => :'String'
56
+ :'from' => :'Object',
57
+ :'to' => :'Object',
58
+ :'type' => :'Object'
81
59
  }
82
60
  end
83
61
 
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ ])
66
+ end
67
+
84
68
  # Initializes the object
85
69
  # @param [Hash] attributes Model attributes in the form of hash
86
70
  def initialize(attributes = {})
87
- return unless attributes.is_a?(Hash)
88
-
89
- # convert string to symbol for hash key
90
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
91
-
92
- if attributes.has_key?(:'defaultInterval')
93
- self.default_interval = attributes[:'defaultInterval']
94
- end
95
-
96
- if attributes.has_key?(:'end')
97
- self._end = attributes[:'end']
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SematextCloud::EventDto` initialize method"
98
73
  end
99
74
 
100
- if attributes.has_key?(:'filters')
101
- if (value = attributes[:'filters']).is_a?(Hash)
102
- self.filters = value
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SematextCloud::EventDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
79
  end
104
- end
105
-
106
- if attributes.has_key?(:'granularity')
107
- self.granularity = attributes[:'granularity']
108
- end
80
+ h[k.to_sym] = v
81
+ }
109
82
 
110
- if attributes.has_key?(:'interval')
111
- self.interval = attributes[:'interval']
83
+ if attributes.key?(:'from')
84
+ self.from = attributes[:'from']
112
85
  end
113
86
 
114
- if attributes.has_key?(:'metric')
115
- self.metric = attributes[:'metric']
87
+ if attributes.key?(:'to')
88
+ self.to = attributes[:'to']
116
89
  end
117
90
 
118
- if attributes.has_key?(:'start')
119
- self.start = attributes[:'start']
91
+ if attributes.key?(:'type')
92
+ self.type = attributes[:'type']
120
93
  end
121
94
  end
122
95
 
@@ -124,30 +97,25 @@ module SematextCloud
124
97
  # @return Array for valid properties with the reasons
125
98
  def list_invalid_properties
126
99
  invalid_properties = Array.new
127
- if @metric.nil?
128
- invalid_properties.push('invalid value for "metric", metric cannot be nil.')
129
- end
130
-
131
100
  invalid_properties
132
101
  end
133
102
 
134
103
  # Check to see if the all the properties in the model are valid
135
104
  # @return true if the model is valid
136
105
  def valid?
137
- granularity_validator = EnumAttributeValidator.new('String', ['AUTO', 'ONE_MINUTE', 'FIVE_MINUTES', 'HOUR', 'DAY', 'WEEK', 'MONTH'])
138
- return false unless granularity_validator.valid?(@granularity)
139
- return false if @metric.nil?
106
+ type_validator = EnumAttributeValidator.new('Object', ['CREATED', 'DISABLED', 'DELETED', 'REACTIVATED', 'PLAN_UPDATE', 'PAYMENT_METHOD_UPDATE', 'SEND_EMAIL_CHANGE', 'AUTOMATIC_PLAN_UPGRADE_CHANGE', 'MAX_LIMIT_CHANGE', 'SAMPLING_CHANGE', 'OWNERSHIP_CHANGE', 'PIPELINE_CHANGE'])
107
+ return false unless type_validator.valid?(@type)
140
108
  true
141
109
  end
142
110
 
143
111
  # Custom attribute writer method checking allowed values (enum).
144
- # @param [Object] granularity Object to be assigned
145
- def granularity=(granularity)
146
- validator = EnumAttributeValidator.new('String', ['AUTO', 'ONE_MINUTE', 'FIVE_MINUTES', 'HOUR', 'DAY', 'WEEK', 'MONTH'])
147
- unless validator.valid?(granularity)
148
- fail ArgumentError, 'invalid value for "granularity", must be one of #{validator.allowable_values}.'
112
+ # @param [Object] type Object to be assigned
113
+ def type=(type)
114
+ validator = EnumAttributeValidator.new('Object', ['CREATED', 'DISABLED', 'DELETED', 'REACTIVATED', 'PLAN_UPDATE', 'PAYMENT_METHOD_UPDATE', 'SEND_EMAIL_CHANGE', 'AUTOMATIC_PLAN_UPGRADE_CHANGE', 'MAX_LIMIT_CHANGE', 'SAMPLING_CHANGE', 'OWNERSHIP_CHANGE', 'PIPELINE_CHANGE'])
115
+ unless validator.valid?(type)
116
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
149
117
  end
150
- @granularity = granularity
118
+ @type = type
151
119
  end
152
120
 
153
121
  # Checks equality by comparing each attribute.
@@ -155,13 +123,9 @@ module SematextCloud
155
123
  def ==(o)
156
124
  return true if self.equal?(o)
157
125
  self.class == o.class &&
158
- default_interval == o.default_interval &&
159
- _end == o._end &&
160
- filters == o.filters &&
161
- granularity == o.granularity &&
162
- interval == o.interval &&
163
- metric == o.metric &&
164
- start == o.start
126
+ from == o.from &&
127
+ to == o.to &&
128
+ type == o.type
165
129
  end
166
130
 
167
131
  # @see the `==` method
@@ -171,9 +135,16 @@ module SematextCloud
171
135
  end
172
136
 
173
137
  # Calculates hash code according to all attributes.
174
- # @return [Fixnum] Hash code
138
+ # @return [Integer] Hash code
175
139
  def hash
176
- [default_interval, _end, filters, granularity, interval, metric, start].hash
140
+ [from, to, type].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ new.build_from_hash(attributes)
177
148
  end
178
149
 
179
150
  # Builds the object from hash
@@ -181,16 +152,18 @@ module SematextCloud
181
152
  # @return [Object] Returns the model itself
182
153
  def build_from_hash(attributes)
183
154
  return nil unless attributes.is_a?(Hash)
184
- self.class.swagger_types.each_pair do |key, type|
155
+ self.class.openapi_types.each_pair do |key, type|
185
156
  if type =~ /\AArray<(.*)>/i
186
- # check to ensure the input is an array given that the the attribute
157
+ # check to ensure the input is an array given that the attribute
187
158
  # is documented as an array but the input is not
188
159
  if attributes[self.class.attribute_map[key]].is_a?(Array)
189
160
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
190
161
  end
191
162
  elsif !attributes[self.class.attribute_map[key]].nil?
192
163
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
193
- end # or else data not found in attributes(hash), not an issue as the data can be optional
164
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
165
+ self.send("#{key}=", nil)
166
+ end
194
167
  end
195
168
 
196
169
  self
@@ -212,7 +185,7 @@ module SematextCloud
212
185
  value.to_i
213
186
  when :Float
214
187
  value.to_f
215
- when :BOOLEAN
188
+ when :Boolean
216
189
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
217
190
  true
218
191
  else
@@ -233,8 +206,7 @@ module SematextCloud
233
206
  end
234
207
  end
235
208
  else # model
236
- temp_model = SematextCloud.const_get(type).new
237
- temp_model.build_from_hash(value)
209
+ SematextCloud.const_get(type).build_from_hash(value)
238
210
  end
239
211
  end
240
212
 
@@ -256,7 +228,11 @@ module SematextCloud
256
228
  hash = {}
257
229
  self.class.attribute_map.each_pair do |attr, param|
258
230
  value = self.send(attr)
259
- next if value.nil?
231
+ if value.nil?
232
+ is_nullable = self.class.openapi_nullable.include?(attr)
233
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
234
+ end
235
+
260
236
  hash[param] = _to_hash(value)
261
237
  end
262
238
  hash
@@ -278,6 +254,5 @@ module SematextCloud
278
254
  else
279
255
  value
280
256
  end
281
- end
282
- end
257
+ end end
283
258
  end
@@ -6,8 +6,7 @@
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'
@@ -39,46 +38,59 @@ module SematextCloud
39
38
  end
40
39
 
41
40
  # Attribute type mapping.
42
- def self.swagger_types
41
+ def self.openapi_types
43
42
  {
44
- :'agg_type' => :'String',
45
- :'filter_name' => :'String',
46
- :'key' => :'String',
47
- :'label' => :'String',
48
- :'name' => :'String',
49
- :'values' => :'Array<String>'
43
+ :'agg_type' => :'Object',
44
+ :'filter_name' => :'Object',
45
+ :'key' => :'Object',
46
+ :'label' => :'Object',
47
+ :'name' => :'Object',
48
+ :'values' => :'Object'
50
49
  }
51
50
  end
52
51
 
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
53
58
  # Initializes the object
54
59
  # @param [Hash] attributes Model attributes in the form of hash
55
60
  def initialize(attributes = {})
56
- return unless attributes.is_a?(Hash)
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SematextCloud::FilterValue` initialize method"
63
+ end
57
64
 
58
- # convert string to symbol for hash key
59
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SematextCloud::FilterValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
60
72
 
61
- if attributes.has_key?(:'aggType')
62
- self.agg_type = attributes[:'aggType']
73
+ if attributes.key?(:'agg_type')
74
+ self.agg_type = attributes[:'agg_type']
63
75
  end
64
76
 
65
- if attributes.has_key?(:'filterName')
66
- self.filter_name = attributes[:'filterName']
77
+ if attributes.key?(:'filter_name')
78
+ self.filter_name = attributes[:'filter_name']
67
79
  end
68
80
 
69
- if attributes.has_key?(:'key')
81
+ if attributes.key?(:'key')
70
82
  self.key = attributes[:'key']
71
83
  end
72
84
 
73
- if attributes.has_key?(:'label')
85
+ if attributes.key?(:'label')
74
86
  self.label = attributes[:'label']
75
87
  end
76
88
 
77
- if attributes.has_key?(:'name')
89
+ if attributes.key?(:'name')
78
90
  self.name = attributes[:'name']
79
91
  end
80
92
 
81
- if attributes.has_key?(:'values')
93
+ if attributes.key?(:'values')
82
94
  if (value = attributes[:'values']).is_a?(Array)
83
95
  self.values = value
84
96
  end
@@ -118,26 +130,35 @@ module SematextCloud
118
130
  end
119
131
 
120
132
  # Calculates hash code according to all attributes.
121
- # @return [Fixnum] Hash code
133
+ # @return [Integer] Hash code
122
134
  def hash
123
135
  [agg_type, filter_name, key, label, name, values].hash
124
136
  end
125
137
 
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def self.build_from_hash(attributes)
142
+ new.build_from_hash(attributes)
143
+ end
144
+
126
145
  # Builds the object from hash
127
146
  # @param [Hash] attributes Model attributes in the form of hash
128
147
  # @return [Object] Returns the model itself
129
148
  def build_from_hash(attributes)
130
149
  return nil unless attributes.is_a?(Hash)
131
- self.class.swagger_types.each_pair do |key, type|
150
+ self.class.openapi_types.each_pair do |key, type|
132
151
  if type =~ /\AArray<(.*)>/i
133
- # check to ensure the input is an array given that the the attribute
152
+ # check to ensure the input is an array given that the attribute
134
153
  # is documented as an array but the input is not
135
154
  if attributes[self.class.attribute_map[key]].is_a?(Array)
136
155
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
156
  end
138
157
  elsif !attributes[self.class.attribute_map[key]].nil?
139
158
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
- end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
160
+ self.send("#{key}=", nil)
161
+ end
141
162
  end
142
163
 
143
164
  self
@@ -159,7 +180,7 @@ module SematextCloud
159
180
  value.to_i
160
181
  when :Float
161
182
  value.to_f
162
- when :BOOLEAN
183
+ when :Boolean
163
184
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
185
  true
165
186
  else
@@ -180,8 +201,7 @@ module SematextCloud
180
201
  end
181
202
  end
182
203
  else # model
183
- temp_model = SematextCloud.const_get(type).new
184
- temp_model.build_from_hash(value)
204
+ SematextCloud.const_get(type).build_from_hash(value)
185
205
  end
186
206
  end
187
207
 
@@ -203,7 +223,11 @@ module SematextCloud
203
223
  hash = {}
204
224
  self.class.attribute_map.each_pair do |attr, param|
205
225
  value = self.send(attr)
206
- next if value.nil?
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
207
231
  hash[param] = _to_hash(value)
208
232
  end
209
233
  hash
@@ -225,6 +249,5 @@ module SematextCloud
225
249
  else
226
250
  value
227
251
  end
228
- end
229
- end
252
+ end end
230
253
  end