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,387 @@
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 Subscription
16
+ attr_accessor :additional_params
17
+
18
+ attr_accessor :addresses
19
+
20
+ attr_accessor :created_by
21
+
22
+ attr_accessor :dashboard_id
23
+
24
+ attr_accessor :dashboard_name
25
+
26
+ attr_accessor :enabled
27
+
28
+ attr_accessor :filters
29
+
30
+ attr_accessor :frequency
31
+
32
+ attr_accessor :id
33
+
34
+ attr_accessor :next_send_date
35
+
36
+ attr_accessor :subject
37
+
38
+ attr_accessor :system_id
39
+
40
+ attr_accessor :system_name
41
+
42
+ attr_accessor :text
43
+
44
+ attr_accessor :time_range
45
+
46
+ attr_accessor :user_permissions
47
+
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
64
+
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'additional_params' => :'additionalParams',
74
+ :'addresses' => :'addresses',
75
+ :'created_by' => :'createdBy',
76
+ :'dashboard_id' => :'dashboardId',
77
+ :'dashboard_name' => :'dashboardName',
78
+ :'enabled' => :'enabled',
79
+ :'filters' => :'filters',
80
+ :'frequency' => :'frequency',
81
+ :'id' => :'id',
82
+ :'next_send_date' => :'nextSendDate',
83
+ :'subject' => :'subject',
84
+ :'system_id' => :'systemId',
85
+ :'system_name' => :'systemName',
86
+ :'text' => :'text',
87
+ :'time_range' => :'timeRange',
88
+ :'user_permissions' => :'userPermissions'
89
+ }
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'additional_params' => :'Object',
96
+ :'addresses' => :'Object',
97
+ :'created_by' => :'Object',
98
+ :'dashboard_id' => :'Object',
99
+ :'dashboard_name' => :'Object',
100
+ :'enabled' => :'Object',
101
+ :'filters' => :'Object',
102
+ :'frequency' => :'Object',
103
+ :'id' => :'Object',
104
+ :'next_send_date' => :'Object',
105
+ :'subject' => :'Object',
106
+ :'system_id' => :'Object',
107
+ :'system_name' => :'Object',
108
+ :'text' => :'Object',
109
+ :'time_range' => :'Object',
110
+ :'user_permissions' => :'Object'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ ])
118
+ end
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ def initialize(attributes = {})
123
+ if (!attributes.is_a?(Hash))
124
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SematextCloud::Subscription` initialize method"
125
+ end
126
+
127
+ # check to see if the attribute exists and convert string to symbol for hash key
128
+ attributes = attributes.each_with_object({}) { |(k, v), h|
129
+ if (!self.class.attribute_map.key?(k.to_sym))
130
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SematextCloud::Subscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
131
+ end
132
+ h[k.to_sym] = v
133
+ }
134
+
135
+ if attributes.key?(:'additional_params')
136
+ self.additional_params = attributes[:'additional_params']
137
+ end
138
+
139
+ if attributes.key?(:'addresses')
140
+ self.addresses = attributes[:'addresses']
141
+ end
142
+
143
+ if attributes.key?(:'created_by')
144
+ self.created_by = attributes[:'created_by']
145
+ end
146
+
147
+ if attributes.key?(:'dashboard_id')
148
+ self.dashboard_id = attributes[:'dashboard_id']
149
+ end
150
+
151
+ if attributes.key?(:'dashboard_name')
152
+ self.dashboard_name = attributes[:'dashboard_name']
153
+ end
154
+
155
+ if attributes.key?(:'enabled')
156
+ self.enabled = attributes[:'enabled']
157
+ end
158
+
159
+ if attributes.key?(:'filters')
160
+ self.filters = attributes[:'filters']
161
+ end
162
+
163
+ if attributes.key?(:'frequency')
164
+ self.frequency = attributes[:'frequency']
165
+ end
166
+
167
+ if attributes.key?(:'id')
168
+ self.id = attributes[:'id']
169
+ end
170
+
171
+ if attributes.key?(:'next_send_date')
172
+ self.next_send_date = attributes[:'next_send_date']
173
+ end
174
+
175
+ if attributes.key?(:'subject')
176
+ self.subject = attributes[:'subject']
177
+ end
178
+
179
+ if attributes.key?(:'system_id')
180
+ self.system_id = attributes[:'system_id']
181
+ end
182
+
183
+ if attributes.key?(:'system_name')
184
+ self.system_name = attributes[:'system_name']
185
+ end
186
+
187
+ if attributes.key?(:'text')
188
+ self.text = attributes[:'text']
189
+ end
190
+
191
+ if attributes.key?(:'time_range')
192
+ self.time_range = attributes[:'time_range']
193
+ end
194
+
195
+ if attributes.key?(:'user_permissions')
196
+ self.user_permissions = attributes[:'user_permissions']
197
+ end
198
+ end
199
+
200
+ # Show invalid properties with the reasons. Usually used together with valid?
201
+ # @return Array for valid properties with the reasons
202
+ def list_invalid_properties
203
+ invalid_properties = Array.new
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ frequency_validator = EnumAttributeValidator.new('Object', ['EVERY_FIVE_MINUTES', 'DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY'])
211
+ return false unless frequency_validator.valid?(@frequency)
212
+ time_range_validator = EnumAttributeValidator.new('Object', ['ONE_DAY', 'ONE_WEEK', 'ONE_MONTH', 'TWO_MONTH', 'SIX_MONTH', 'ONE_YEAR'])
213
+ return false unless time_range_validator.valid?(@time_range)
214
+ true
215
+ end
216
+
217
+ # Custom attribute writer method checking allowed values (enum).
218
+ # @param [Object] frequency Object to be assigned
219
+ def frequency=(frequency)
220
+ validator = EnumAttributeValidator.new('Object', ['EVERY_FIVE_MINUTES', 'DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY'])
221
+ unless validator.valid?(frequency)
222
+ fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}."
223
+ end
224
+ @frequency = frequency
225
+ end
226
+
227
+ # Custom attribute writer method checking allowed values (enum).
228
+ # @param [Object] time_range Object to be assigned
229
+ def time_range=(time_range)
230
+ validator = EnumAttributeValidator.new('Object', ['ONE_DAY', 'ONE_WEEK', 'ONE_MONTH', 'TWO_MONTH', 'SIX_MONTH', 'ONE_YEAR'])
231
+ unless validator.valid?(time_range)
232
+ fail ArgumentError, "invalid value for \"time_range\", must be one of #{validator.allowable_values}."
233
+ end
234
+ @time_range = time_range
235
+ end
236
+
237
+ # Checks equality by comparing each attribute.
238
+ # @param [Object] Object to be compared
239
+ def ==(o)
240
+ return true if self.equal?(o)
241
+ self.class == o.class &&
242
+ additional_params == o.additional_params &&
243
+ addresses == o.addresses &&
244
+ created_by == o.created_by &&
245
+ dashboard_id == o.dashboard_id &&
246
+ dashboard_name == o.dashboard_name &&
247
+ enabled == o.enabled &&
248
+ filters == o.filters &&
249
+ frequency == o.frequency &&
250
+ id == o.id &&
251
+ next_send_date == o.next_send_date &&
252
+ subject == o.subject &&
253
+ system_id == o.system_id &&
254
+ system_name == o.system_name &&
255
+ text == o.text &&
256
+ time_range == o.time_range &&
257
+ user_permissions == o.user_permissions
258
+ end
259
+
260
+ # @see the `==` method
261
+ # @param [Object] Object to be compared
262
+ def eql?(o)
263
+ self == o
264
+ end
265
+
266
+ # Calculates hash code according to all attributes.
267
+ # @return [Integer] Hash code
268
+ def hash
269
+ [additional_params, addresses, created_by, dashboard_id, dashboard_name, enabled, filters, frequency, id, next_send_date, subject, system_id, system_name, text, time_range, user_permissions].hash
270
+ end
271
+
272
+ # Builds the object from hash
273
+ # @param [Hash] attributes Model attributes in the form of hash
274
+ # @return [Object] Returns the model itself
275
+ def self.build_from_hash(attributes)
276
+ new.build_from_hash(attributes)
277
+ end
278
+
279
+ # Builds the object from hash
280
+ # @param [Hash] attributes Model attributes in the form of hash
281
+ # @return [Object] Returns the model itself
282
+ def build_from_hash(attributes)
283
+ return nil unless attributes.is_a?(Hash)
284
+ self.class.openapi_types.each_pair do |key, type|
285
+ if type =~ /\AArray<(.*)>/i
286
+ # check to ensure the input is an array given that the attribute
287
+ # is documented as an array but the input is not
288
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
289
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
290
+ end
291
+ elsif !attributes[self.class.attribute_map[key]].nil?
292
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
293
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
294
+ self.send("#{key}=", nil)
295
+ end
296
+ end
297
+
298
+ self
299
+ end
300
+
301
+ # Deserializes the data based on type
302
+ # @param string type Data type
303
+ # @param string value Value to be deserialized
304
+ # @return [Object] Deserialized data
305
+ def _deserialize(type, value)
306
+ case type.to_sym
307
+ when :DateTime
308
+ DateTime.parse(value)
309
+ when :Date
310
+ Date.parse(value)
311
+ when :String
312
+ value.to_s
313
+ when :Integer
314
+ value.to_i
315
+ when :Float
316
+ value.to_f
317
+ when :Boolean
318
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
319
+ true
320
+ else
321
+ false
322
+ end
323
+ when :Object
324
+ # generic object (usually a Hash), return directly
325
+ value
326
+ when /\AArray<(?<inner_type>.+)>\z/
327
+ inner_type = Regexp.last_match[:inner_type]
328
+ value.map { |v| _deserialize(inner_type, v) }
329
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
330
+ k_type = Regexp.last_match[:k_type]
331
+ v_type = Regexp.last_match[:v_type]
332
+ {}.tap do |hash|
333
+ value.each do |k, v|
334
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
335
+ end
336
+ end
337
+ else # model
338
+ SematextCloud.const_get(type).build_from_hash(value)
339
+ end
340
+ end
341
+
342
+ # Returns the string representation of the object
343
+ # @return [String] String presentation of the object
344
+ def to_s
345
+ to_hash.to_s
346
+ end
347
+
348
+ # to_body is an alias to to_hash (backward compatibility)
349
+ # @return [Hash] Returns the object in the form of hash
350
+ def to_body
351
+ to_hash
352
+ end
353
+
354
+ # Returns the object in the form of hash
355
+ # @return [Hash] Returns the object in the form of hash
356
+ def to_hash
357
+ hash = {}
358
+ self.class.attribute_map.each_pair do |attr, param|
359
+ value = self.send(attr)
360
+ if value.nil?
361
+ is_nullable = self.class.openapi_nullable.include?(attr)
362
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
363
+ end
364
+
365
+ hash[param] = _to_hash(value)
366
+ end
367
+ hash
368
+ end
369
+
370
+ # Outputs non-array value in the form of hash
371
+ # For object, use to_hash. Otherwise, just return the value
372
+ # @param [Object] value Any valid value
373
+ # @return [Hash] Returns the value in the form of hash
374
+ def _to_hash(value)
375
+ if value.is_a?(Array)
376
+ value.compact.map { |v| _to_hash(v) }
377
+ elsif value.is_a?(Hash)
378
+ {}.tap do |hash|
379
+ value.each { |k, v| hash[k] = _to_hash(v) }
380
+ end
381
+ elsif value.respond_to? :to_hash
382
+ value.to_hash
383
+ else
384
+ value
385
+ end
386
+ end end
387
+ end
@@ -6,13 +6,12 @@
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
- module stcloud
14
+ module SematextCloud
16
15
  class SubscriptionDashboardDto
17
16
  attr_accessor :addresses
18
17
 
@@ -76,72 +75,85 @@ module stcloud
76
75
  end
77
76
 
78
77
  # Attribute type mapping.
79
- def self.swagger_types
78
+ def self.openapi_types
80
79
  {
81
- :'addresses' => :'String',
82
- :'dashboard_id' => :'Integer',
83
- :'enable' => :'BOOLEAN',
84
- :'filters' => :'String',
85
- :'frequency' => :'String',
86
- :'id' => :'Integer',
87
- :'report_name' => :'String',
88
- :'send_time' => :'DateTime',
89
- :'subject' => :'String',
90
- :'text' => :'String',
91
- :'time_range' => :'String'
80
+ :'addresses' => :'Object',
81
+ :'dashboard_id' => :'Object',
82
+ :'enable' => :'Object',
83
+ :'filters' => :'Object',
84
+ :'frequency' => :'Object',
85
+ :'id' => :'Object',
86
+ :'report_name' => :'Object',
87
+ :'send_time' => :'Object',
88
+ :'subject' => :'Object',
89
+ :'text' => :'Object',
90
+ :'time_range' => :'Object'
92
91
  }
93
92
  end
94
93
 
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
95
100
  # Initializes the object
96
101
  # @param [Hash] attributes Model attributes in the form of hash
97
102
  def initialize(attributes = {})
98
- return unless attributes.is_a?(Hash)
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SematextCloud::SubscriptionDashboardDto` initialize method"
105
+ end
99
106
 
100
- # convert string to symbol for hash key
101
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!self.class.attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SematextCloud::SubscriptionDashboardDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
102
114
 
103
- if attributes.has_key?(:'addresses')
115
+ if attributes.key?(:'addresses')
104
116
  self.addresses = attributes[:'addresses']
105
117
  end
106
118
 
107
- if attributes.has_key?(:'dashboardId')
108
- self.dashboard_id = attributes[:'dashboardId']
119
+ if attributes.key?(:'dashboard_id')
120
+ self.dashboard_id = attributes[:'dashboard_id']
109
121
  end
110
122
 
111
- if attributes.has_key?(:'enable')
123
+ if attributes.key?(:'enable')
112
124
  self.enable = attributes[:'enable']
113
125
  end
114
126
 
115
- if attributes.has_key?(:'filters')
127
+ if attributes.key?(:'filters')
116
128
  self.filters = attributes[:'filters']
117
129
  end
118
130
 
119
- if attributes.has_key?(:'frequency')
131
+ if attributes.key?(:'frequency')
120
132
  self.frequency = attributes[:'frequency']
121
133
  end
122
134
 
123
- if attributes.has_key?(:'id')
135
+ if attributes.key?(:'id')
124
136
  self.id = attributes[:'id']
125
137
  end
126
138
 
127
- if attributes.has_key?(:'reportName')
128
- self.report_name = attributes[:'reportName']
139
+ if attributes.key?(:'report_name')
140
+ self.report_name = attributes[:'report_name']
129
141
  end
130
142
 
131
- if attributes.has_key?(:'sendTime')
132
- self.send_time = attributes[:'sendTime']
143
+ if attributes.key?(:'send_time')
144
+ self.send_time = attributes[:'send_time']
133
145
  end
134
146
 
135
- if attributes.has_key?(:'subject')
147
+ if attributes.key?(:'subject')
136
148
  self.subject = attributes[:'subject']
137
149
  end
138
150
 
139
- if attributes.has_key?(:'text')
151
+ if attributes.key?(:'text')
140
152
  self.text = attributes[:'text']
141
153
  end
142
154
 
143
- if attributes.has_key?(:'timeRange')
144
- self.time_range = attributes[:'timeRange']
155
+ if attributes.key?(:'time_range')
156
+ self.time_range = attributes[:'time_range']
145
157
  end
146
158
  end
147
159
 
@@ -155,9 +167,9 @@ module stcloud
155
167
  # Check to see if the all the properties in the model are valid
156
168
  # @return true if the model is valid
157
169
  def valid?
158
- frequency_validator = EnumAttributeValidator.new('String', ['EVERY_FIVE_MINUTES', 'DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY'])
170
+ frequency_validator = EnumAttributeValidator.new('Object', ['EVERY_FIVE_MINUTES', 'DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY'])
159
171
  return false unless frequency_validator.valid?(@frequency)
160
- time_range_validator = EnumAttributeValidator.new('String', ['ONE_DAY', 'ONE_WEEK', 'ONE_MONTH', 'TWO_MONTH', 'SIX_MONTH', 'ONE_YEAR'])
172
+ time_range_validator = EnumAttributeValidator.new('Object', ['ONE_DAY', 'ONE_WEEK', 'ONE_MONTH', 'TWO_MONTH', 'SIX_MONTH', 'ONE_YEAR'])
161
173
  return false unless time_range_validator.valid?(@time_range)
162
174
  true
163
175
  end
@@ -165,9 +177,9 @@ module stcloud
165
177
  # Custom attribute writer method checking allowed values (enum).
166
178
  # @param [Object] frequency Object to be assigned
167
179
  def frequency=(frequency)
168
- validator = EnumAttributeValidator.new('String', ['EVERY_FIVE_MINUTES', 'DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY'])
180
+ validator = EnumAttributeValidator.new('Object', ['EVERY_FIVE_MINUTES', 'DAILY', 'WEEKLY', 'MONTHLY', 'QUARTERLY'])
169
181
  unless validator.valid?(frequency)
170
- fail ArgumentError, 'invalid value for "frequency", must be one of #{validator.allowable_values}.'
182
+ fail ArgumentError, "invalid value for \"frequency\", must be one of #{validator.allowable_values}."
171
183
  end
172
184
  @frequency = frequency
173
185
  end
@@ -175,9 +187,9 @@ module stcloud
175
187
  # Custom attribute writer method checking allowed values (enum).
176
188
  # @param [Object] time_range Object to be assigned
177
189
  def time_range=(time_range)
178
- validator = EnumAttributeValidator.new('String', ['ONE_DAY', 'ONE_WEEK', 'ONE_MONTH', 'TWO_MONTH', 'SIX_MONTH', 'ONE_YEAR'])
190
+ validator = EnumAttributeValidator.new('Object', ['ONE_DAY', 'ONE_WEEK', 'ONE_MONTH', 'TWO_MONTH', 'SIX_MONTH', 'ONE_YEAR'])
179
191
  unless validator.valid?(time_range)
180
- fail ArgumentError, 'invalid value for "time_range", must be one of #{validator.allowable_values}.'
192
+ fail ArgumentError, "invalid value for \"time_range\", must be one of #{validator.allowable_values}."
181
193
  end
182
194
  @time_range = time_range
183
195
  end
@@ -207,26 +219,35 @@ module stcloud
207
219
  end
208
220
 
209
221
  # Calculates hash code according to all attributes.
210
- # @return [Fixnum] Hash code
222
+ # @return [Integer] Hash code
211
223
  def hash
212
224
  [addresses, dashboard_id, enable, filters, frequency, id, report_name, send_time, subject, text, time_range].hash
213
225
  end
214
226
 
227
+ # Builds the object from hash
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ # @return [Object] Returns the model itself
230
+ def self.build_from_hash(attributes)
231
+ new.build_from_hash(attributes)
232
+ end
233
+
215
234
  # Builds the object from hash
216
235
  # @param [Hash] attributes Model attributes in the form of hash
217
236
  # @return [Object] Returns the model itself
218
237
  def build_from_hash(attributes)
219
238
  return nil unless attributes.is_a?(Hash)
220
- self.class.swagger_types.each_pair do |key, type|
239
+ self.class.openapi_types.each_pair do |key, type|
221
240
  if type =~ /\AArray<(.*)>/i
222
- # check to ensure the input is an array given that the the attribute
241
+ # check to ensure the input is an array given that the attribute
223
242
  # is documented as an array but the input is not
224
243
  if attributes[self.class.attribute_map[key]].is_a?(Array)
225
244
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
226
245
  end
227
246
  elsif !attributes[self.class.attribute_map[key]].nil?
228
247
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
229
- end # or else data not found in attributes(hash), not an issue as the data can be optional
248
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
249
+ self.send("#{key}=", nil)
250
+ end
230
251
  end
231
252
 
232
253
  self
@@ -248,7 +269,7 @@ module stcloud
248
269
  value.to_i
249
270
  when :Float
250
271
  value.to_f
251
- when :BOOLEAN
272
+ when :Boolean
252
273
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
274
  true
254
275
  else
@@ -269,8 +290,7 @@ module stcloud
269
290
  end
270
291
  end
271
292
  else # model
272
- temp_model = stcloud.const_get(type).new
273
- temp_model.build_from_hash(value)
293
+ SematextCloud.const_get(type).build_from_hash(value)
274
294
  end
275
295
  end
276
296
 
@@ -292,7 +312,11 @@ module stcloud
292
312
  hash = {}
293
313
  self.class.attribute_map.each_pair do |attr, param|
294
314
  value = self.send(attr)
295
- next if value.nil?
315
+ if value.nil?
316
+ is_nullable = self.class.openapi_nullable.include?(attr)
317
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
318
+ end
319
+
296
320
  hash[param] = _to_hash(value)
297
321
  end
298
322
  hash
@@ -314,6 +338,5 @@ module stcloud
314
338
  else
315
339
  value
316
340
  end
317
- end
318
- end
341
+ end end
319
342
  end