SematextCloud 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/LICENSE +13 -0
- data/README.md +149 -0
- data/Rakefile +8 -0
- data/SematextCloud.gemspec +45 -0
- data/docs/AlertNotificationRequest.md +9 -0
- data/docs/AlertNotificationsApi.md +118 -0
- data/docs/AlertRule.md +53 -0
- data/docs/AlertRuleScheduleTimeRangeDto.md +7 -0
- data/docs/AlertRuleScheduleWeekdayDto.md +10 -0
- data/docs/AlertsApi.md +270 -0
- data/docs/App.md +32 -0
- data/docs/AppDescription.md +6 -0
- data/docs/AppMetadata.md +10 -0
- data/docs/AppsApi.md +369 -0
- data/docs/AwsSettingsControllerApi.md +63 -0
- data/docs/BasicAuthMethodDto.md +7 -0
- data/docs/BasicOrganizationDto.md +9 -0
- data/docs/BillingApi.md +176 -0
- data/docs/BillingInfo.md +8 -0
- data/docs/CloudWatchSettings.md +9 -0
- data/docs/CreateAppInfo.md +10 -0
- data/docs/DataSeriesFilter.md +8 -0
- data/docs/DataSeriesRequest.md +12 -0
- data/docs/Error.md +7 -0
- data/docs/FilterValue.md +11 -0
- data/docs/GenericApiResponse.md +9 -0
- data/docs/Invitation.md +15 -0
- data/docs/LogsAppApi.md +58 -0
- data/docs/MetricsApi.md +227 -0
- data/docs/MonitoringAppApi.md +58 -0
- data/docs/NotificationIntegration.md +15 -0
- data/docs/Plan.md +18 -0
- data/docs/ReportInfo.md +13 -0
- data/docs/ResetPasswordApi.md +58 -0
- data/docs/SavedQueriesApi.md +220 -0
- data/docs/SavedQuery.md +18 -0
- data/docs/ServiceIntegration.md +17 -0
- data/docs/SubscriptionsApi.md +114 -0
- data/docs/TagApiControllerApi.md +212 -0
- data/docs/UpdateAppInfo.md +14 -0
- data/docs/UserInfo.md +6 -0
- data/docs/UserPermissions.md +8 -0
- data/docs/UserRole.md +8 -0
- data/lib/SematextCloud.rb +78 -0
- data/lib/SematextCloud/api/alert_notifications_api.rb +137 -0
- data/lib/SematextCloud/api/alerts_api.rb +283 -0
- data/lib/SematextCloud/api/apps_api.rb +381 -0
- data/lib/SematextCloud/api/aws_settings_controller_api.rb +83 -0
- data/lib/SematextCloud/api/billing_api.rb +197 -0
- data/lib/SematextCloud/api/logs_app_api.rb +75 -0
- data/lib/SematextCloud/api/metrics_api.rb +247 -0
- data/lib/SematextCloud/api/monitoring_app_api.rb +75 -0
- data/lib/SematextCloud/api/reset_password_api.rb +75 -0
- data/lib/SematextCloud/api/saved_queries_api.rb +237 -0
- data/lib/SematextCloud/api/subscriptions_api.rb +133 -0
- data/lib/SematextCloud/api/tag_api_controller_api.rb +247 -0
- data/lib/SematextCloud/api_client.rb +389 -0
- data/lib/SematextCloud/api_error.rb +38 -0
- data/lib/SematextCloud/configuration.rb +209 -0
- data/lib/SematextCloud/models/alert_notification_request.rb +212 -0
- data/lib/SematextCloud/models/alert_rule.rb +652 -0
- data/lib/SematextCloud/models/alert_rule_schedule_time_range_dto.rb +192 -0
- data/lib/SematextCloud/models/alert_rule_schedule_weekday_dto.rb +221 -0
- data/lib/SematextCloud/models/app.rb +419 -0
- data/lib/SematextCloud/models/app_description.rb +183 -0
- data/lib/SematextCloud/models/app_metadata.rb +268 -0
- data/lib/SematextCloud/models/basic_auth_method_dto.rb +226 -0
- data/lib/SematextCloud/models/basic_organization_dto.rb +246 -0
- data/lib/SematextCloud/models/billing_info.rb +201 -0
- data/lib/SematextCloud/models/cloud_watch_settings.rb +256 -0
- data/lib/SematextCloud/models/create_app_info.rb +220 -0
- data/lib/SematextCloud/models/data_series_filter.rb +237 -0
- data/lib/SematextCloud/models/data_series_request.rb +283 -0
- data/lib/SematextCloud/models/error.rb +192 -0
- data/lib/SematextCloud/models/filter_value.rb +230 -0
- data/lib/SematextCloud/models/generic_api_response.rb +214 -0
- data/lib/SematextCloud/models/invitation.rb +326 -0
- data/lib/SematextCloud/models/notification_integration.rb +324 -0
- data/lib/SematextCloud/models/plan.rb +337 -0
- data/lib/SematextCloud/models/report_info.rb +247 -0
- data/lib/SematextCloud/models/saved_query.rb +291 -0
- data/lib/SematextCloud/models/service_integration.rb +282 -0
- data/lib/SematextCloud/models/update_app_info.rb +289 -0
- data/lib/SematextCloud/models/user_info.rb +183 -0
- data/lib/SematextCloud/models/user_permissions.rb +201 -0
- data/lib/SematextCloud/models/user_role.rb +247 -0
- data/lib/SematextCloud/version.rb +15 -0
- data/spec/api/alert_notifications_api_spec.rb +60 -0
- data/spec/api/alerts_api_spec.rb +90 -0
- data/spec/api/apps_api_spec.rb +113 -0
- data/spec/api/aws_settings_controller_api_spec.rb +48 -0
- data/spec/api/billing_api_spec.rb +72 -0
- data/spec/api/logs_app_api_spec.rb +46 -0
- data/spec/api/metrics_api_spec.rb +83 -0
- data/spec/api/monitoring_app_api_spec.rb +46 -0
- data/spec/api/reset_password_api_spec.rb +46 -0
- data/spec/api/saved_queries_api_spec.rb +80 -0
- data/spec/api/subscriptions_api_spec.rb +58 -0
- data/spec/api/tag_api_controller_api_spec.rb +88 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/alert_notification_request_spec.rb +59 -0
- data/spec/models/alert_rule_schedule_time_range_dto_spec.rb +47 -0
- data/spec/models/alert_rule_schedule_weekday_dto_spec.rb +65 -0
- data/spec/models/alert_rule_spec.rb +327 -0
- data/spec/models/app_description_spec.rb +41 -0
- data/spec/models/app_metadata_spec.rb +77 -0
- data/spec/models/app_spec.rb +197 -0
- data/spec/models/basic_auth_method_dto_spec.rb +51 -0
- data/spec/models/basic_organization_dto_spec.rb +63 -0
- data/spec/models/billing_info_spec.rb +53 -0
- data/spec/models/cloud_watch_settings_spec.rb +67 -0
- data/spec/models/create_app_info_spec.rb +65 -0
- data/spec/models/data_series_filter_spec.rb +57 -0
- data/spec/models/data_series_request_spec.rb +81 -0
- data/spec/models/error_spec.rb +47 -0
- data/spec/models/filter_value_spec.rb +71 -0
- data/spec/models/generic_api_response_spec.rb +59 -0
- data/spec/models/invitation_spec.rb +107 -0
- data/spec/models/notification_integration_spec.rb +107 -0
- data/spec/models/plan_spec.rb +121 -0
- data/spec/models/report_info_spec.rb +83 -0
- data/spec/models/saved_query_spec.rb +113 -0
- data/spec/models/service_integration_spec.rb +107 -0
- data/spec/models/update_app_info_spec.rb +93 -0
- data/spec/models/user_info_spec.rb +41 -0
- data/spec/models/user_permissions_spec.rb +53 -0
- data/spec/models/user_role_spec.rb +61 -0
- data/spec/spec_helper.rb +111 -0
- metadata +395 -0
@@ -0,0 +1,652 @@
|
|
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: 2.4.12
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module SematextCloud
|
16
|
+
class AlertRule
|
17
|
+
attr_accessor :account_email
|
18
|
+
|
19
|
+
attr_accessor :allowed_app_types
|
20
|
+
|
21
|
+
attr_accessor :analyzing_time
|
22
|
+
|
23
|
+
attr_accessor :app_display_state
|
24
|
+
|
25
|
+
attr_accessor :app_id
|
26
|
+
|
27
|
+
attr_accessor :app_name
|
28
|
+
|
29
|
+
attr_accessor :app_state
|
30
|
+
|
31
|
+
attr_accessor :app_token
|
32
|
+
|
33
|
+
attr_accessor :app_type
|
34
|
+
|
35
|
+
attr_accessor :back_to_normal_needed
|
36
|
+
|
37
|
+
attr_accessor :chart_key
|
38
|
+
|
39
|
+
attr_accessor :color
|
40
|
+
|
41
|
+
attr_accessor :creator_email
|
42
|
+
|
43
|
+
attr_accessor :default_agg_type
|
44
|
+
|
45
|
+
attr_accessor :description
|
46
|
+
|
47
|
+
attr_accessor :disallowed_app_types
|
48
|
+
|
49
|
+
attr_accessor :enabled
|
50
|
+
|
51
|
+
attr_accessor :estimate_operation
|
52
|
+
|
53
|
+
attr_accessor :estimate_value
|
54
|
+
|
55
|
+
attr_accessor :filter_values
|
56
|
+
|
57
|
+
attr_accessor :filter_values_obj
|
58
|
+
|
59
|
+
attr_accessor :ignore_regular_events_enabled
|
60
|
+
|
61
|
+
attr_accessor :integrations
|
62
|
+
|
63
|
+
attr_accessor :last_data_received_date
|
64
|
+
|
65
|
+
attr_accessor :last_sent
|
66
|
+
|
67
|
+
attr_accessor :last_triggered
|
68
|
+
|
69
|
+
attr_accessor :metadata
|
70
|
+
|
71
|
+
attr_accessor :metric_key
|
72
|
+
|
73
|
+
attr_accessor :metric_label
|
74
|
+
|
75
|
+
attr_accessor :min_delay_between_notifications_in_minutes
|
76
|
+
|
77
|
+
attr_accessor :name
|
78
|
+
|
79
|
+
attr_accessor :notification_emails
|
80
|
+
|
81
|
+
attr_accessor :notification_integrations
|
82
|
+
|
83
|
+
attr_accessor :notifications_enabled
|
84
|
+
|
85
|
+
attr_accessor :query
|
86
|
+
|
87
|
+
attr_accessor :report_name
|
88
|
+
|
89
|
+
attr_accessor :rule_key
|
90
|
+
|
91
|
+
attr_accessor :rule_type
|
92
|
+
|
93
|
+
attr_accessor :runbook
|
94
|
+
|
95
|
+
attr_accessor :saved_query_id
|
96
|
+
|
97
|
+
attr_accessor :schedule
|
98
|
+
|
99
|
+
attr_accessor :sematext_service
|
100
|
+
|
101
|
+
attr_accessor :send_to_email
|
102
|
+
|
103
|
+
attr_accessor :timezone
|
104
|
+
|
105
|
+
attr_accessor :use_only_alert_rule_integrations
|
106
|
+
|
107
|
+
attr_accessor :user_permissions
|
108
|
+
|
109
|
+
attr_accessor :value_column_name
|
110
|
+
|
111
|
+
attr_accessor :value_name
|
112
|
+
|
113
|
+
class EnumAttributeValidator
|
114
|
+
attr_reader :datatype
|
115
|
+
attr_reader :allowable_values
|
116
|
+
|
117
|
+
def initialize(datatype, allowable_values)
|
118
|
+
@allowable_values = allowable_values.map do |value|
|
119
|
+
case datatype.to_s
|
120
|
+
when /Integer/i
|
121
|
+
value.to_i
|
122
|
+
when /Float/i
|
123
|
+
value.to_f
|
124
|
+
else
|
125
|
+
value
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def valid?(value)
|
131
|
+
!value || allowable_values.include?(value)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
136
|
+
def self.attribute_map
|
137
|
+
{
|
138
|
+
:'account_email' => :'accountEmail',
|
139
|
+
:'allowed_app_types' => :'allowedAppTypes',
|
140
|
+
:'analyzing_time' => :'analyzingTime',
|
141
|
+
:'app_display_state' => :'appDisplayState',
|
142
|
+
:'app_id' => :'appId',
|
143
|
+
:'app_name' => :'appName',
|
144
|
+
:'app_state' => :'appState',
|
145
|
+
:'app_token' => :'appToken',
|
146
|
+
:'app_type' => :'appType',
|
147
|
+
:'back_to_normal_needed' => :'backToNormalNeeded',
|
148
|
+
:'chart_key' => :'chartKey',
|
149
|
+
:'color' => :'color',
|
150
|
+
:'creator_email' => :'creatorEmail',
|
151
|
+
:'default_agg_type' => :'defaultAggType',
|
152
|
+
:'description' => :'description',
|
153
|
+
:'disallowed_app_types' => :'disallowedAppTypes',
|
154
|
+
:'enabled' => :'enabled',
|
155
|
+
:'estimate_operation' => :'estimateOperation',
|
156
|
+
:'estimate_value' => :'estimateValue',
|
157
|
+
:'filter_values' => :'filterValues',
|
158
|
+
:'filter_values_obj' => :'filterValuesObj',
|
159
|
+
:'ignore_regular_events_enabled' => :'ignoreRegularEventsEnabled',
|
160
|
+
:'integrations' => :'integrations',
|
161
|
+
:'last_data_received_date' => :'lastDataReceivedDate',
|
162
|
+
:'last_sent' => :'lastSent',
|
163
|
+
:'last_triggered' => :'lastTriggered',
|
164
|
+
:'metadata' => :'metadata',
|
165
|
+
:'metric_key' => :'metricKey',
|
166
|
+
:'metric_label' => :'metricLabel',
|
167
|
+
:'min_delay_between_notifications_in_minutes' => :'minDelayBetweenNotificationsInMinutes',
|
168
|
+
:'name' => :'name',
|
169
|
+
:'notification_emails' => :'notificationEmails',
|
170
|
+
:'notification_integrations' => :'notificationIntegrations',
|
171
|
+
:'notifications_enabled' => :'notificationsEnabled',
|
172
|
+
:'query' => :'query',
|
173
|
+
:'report_name' => :'reportName',
|
174
|
+
:'rule_key' => :'ruleKey',
|
175
|
+
:'rule_type' => :'ruleType',
|
176
|
+
:'runbook' => :'runbook',
|
177
|
+
:'saved_query_id' => :'savedQueryId',
|
178
|
+
:'schedule' => :'schedule',
|
179
|
+
:'sematext_service' => :'sematextService',
|
180
|
+
:'send_to_email' => :'sendToEmail',
|
181
|
+
:'timezone' => :'timezone',
|
182
|
+
:'use_only_alert_rule_integrations' => :'useOnlyAlertRuleIntegrations',
|
183
|
+
:'user_permissions' => :'userPermissions',
|
184
|
+
:'value_column_name' => :'valueColumnName',
|
185
|
+
:'value_name' => :'valueName'
|
186
|
+
}
|
187
|
+
end
|
188
|
+
|
189
|
+
# Attribute type mapping.
|
190
|
+
def self.swagger_types
|
191
|
+
{
|
192
|
+
:'account_email' => :'String',
|
193
|
+
:'allowed_app_types' => :'Array<Integer>',
|
194
|
+
:'analyzing_time' => :'String',
|
195
|
+
:'app_display_state' => :'String',
|
196
|
+
:'app_id' => :'Integer',
|
197
|
+
:'app_name' => :'String',
|
198
|
+
:'app_state' => :'String',
|
199
|
+
:'app_token' => :'String',
|
200
|
+
:'app_type' => :'String',
|
201
|
+
:'back_to_normal_needed' => :'BOOLEAN',
|
202
|
+
:'chart_key' => :'String',
|
203
|
+
:'color' => :'String',
|
204
|
+
:'creator_email' => :'String',
|
205
|
+
:'default_agg_type' => :'String',
|
206
|
+
:'description' => :'String',
|
207
|
+
:'disallowed_app_types' => :'Array<Integer>',
|
208
|
+
:'enabled' => :'BOOLEAN',
|
209
|
+
:'estimate_operation' => :'String',
|
210
|
+
:'estimate_value' => :'Float',
|
211
|
+
:'filter_values' => :'String',
|
212
|
+
:'filter_values_obj' => :'Array<FilterValue>',
|
213
|
+
:'ignore_regular_events_enabled' => :'BOOLEAN',
|
214
|
+
:'integrations' => :'String',
|
215
|
+
:'last_data_received_date' => :'Integer',
|
216
|
+
:'last_sent' => :'Integer',
|
217
|
+
:'last_triggered' => :'Integer',
|
218
|
+
:'metadata' => :'Object',
|
219
|
+
:'metric_key' => :'String',
|
220
|
+
:'metric_label' => :'String',
|
221
|
+
:'min_delay_between_notifications_in_minutes' => :'String',
|
222
|
+
:'name' => :'String',
|
223
|
+
:'notification_emails' => :'Array<String>',
|
224
|
+
:'notification_integrations' => :'Array<NotificationIntegration>',
|
225
|
+
:'notifications_enabled' => :'BOOLEAN',
|
226
|
+
:'query' => :'String',
|
227
|
+
:'report_name' => :'String',
|
228
|
+
:'rule_key' => :'Integer',
|
229
|
+
:'rule_type' => :'String',
|
230
|
+
:'runbook' => :'String',
|
231
|
+
:'saved_query_id' => :'Integer',
|
232
|
+
:'schedule' => :'Array<AlertRuleScheduleWeekdayDto>',
|
233
|
+
:'sematext_service' => :'String',
|
234
|
+
:'send_to_email' => :'String',
|
235
|
+
:'timezone' => :'String',
|
236
|
+
:'use_only_alert_rule_integrations' => :'BOOLEAN',
|
237
|
+
:'user_permissions' => :'UserPermissions',
|
238
|
+
:'value_column_name' => :'String',
|
239
|
+
:'value_name' => :'String'
|
240
|
+
}
|
241
|
+
end
|
242
|
+
|
243
|
+
# Initializes the object
|
244
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
245
|
+
def initialize(attributes = {})
|
246
|
+
return unless attributes.is_a?(Hash)
|
247
|
+
|
248
|
+
# convert string to symbol for hash key
|
249
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
250
|
+
|
251
|
+
if attributes.has_key?(:'accountEmail')
|
252
|
+
self.account_email = attributes[:'accountEmail']
|
253
|
+
end
|
254
|
+
|
255
|
+
if attributes.has_key?(:'allowedAppTypes')
|
256
|
+
if (value = attributes[:'allowedAppTypes']).is_a?(Array)
|
257
|
+
self.allowed_app_types = value
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
if attributes.has_key?(:'analyzingTime')
|
262
|
+
self.analyzing_time = attributes[:'analyzingTime']
|
263
|
+
end
|
264
|
+
|
265
|
+
if attributes.has_key?(:'appDisplayState')
|
266
|
+
self.app_display_state = attributes[:'appDisplayState']
|
267
|
+
end
|
268
|
+
|
269
|
+
if attributes.has_key?(:'appId')
|
270
|
+
self.app_id = attributes[:'appId']
|
271
|
+
end
|
272
|
+
|
273
|
+
if attributes.has_key?(:'appName')
|
274
|
+
self.app_name = attributes[:'appName']
|
275
|
+
end
|
276
|
+
|
277
|
+
if attributes.has_key?(:'appState')
|
278
|
+
self.app_state = attributes[:'appState']
|
279
|
+
end
|
280
|
+
|
281
|
+
if attributes.has_key?(:'appToken')
|
282
|
+
self.app_token = attributes[:'appToken']
|
283
|
+
end
|
284
|
+
|
285
|
+
if attributes.has_key?(:'appType')
|
286
|
+
self.app_type = attributes[:'appType']
|
287
|
+
end
|
288
|
+
|
289
|
+
if attributes.has_key?(:'backToNormalNeeded')
|
290
|
+
self.back_to_normal_needed = attributes[:'backToNormalNeeded']
|
291
|
+
end
|
292
|
+
|
293
|
+
if attributes.has_key?(:'chartKey')
|
294
|
+
self.chart_key = attributes[:'chartKey']
|
295
|
+
end
|
296
|
+
|
297
|
+
if attributes.has_key?(:'color')
|
298
|
+
self.color = attributes[:'color']
|
299
|
+
end
|
300
|
+
|
301
|
+
if attributes.has_key?(:'creatorEmail')
|
302
|
+
self.creator_email = attributes[:'creatorEmail']
|
303
|
+
end
|
304
|
+
|
305
|
+
if attributes.has_key?(:'defaultAggType')
|
306
|
+
self.default_agg_type = attributes[:'defaultAggType']
|
307
|
+
end
|
308
|
+
|
309
|
+
if attributes.has_key?(:'description')
|
310
|
+
self.description = attributes[:'description']
|
311
|
+
end
|
312
|
+
|
313
|
+
if attributes.has_key?(:'disallowedAppTypes')
|
314
|
+
if (value = attributes[:'disallowedAppTypes']).is_a?(Array)
|
315
|
+
self.disallowed_app_types = value
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
if attributes.has_key?(:'enabled')
|
320
|
+
self.enabled = attributes[:'enabled']
|
321
|
+
end
|
322
|
+
|
323
|
+
if attributes.has_key?(:'estimateOperation')
|
324
|
+
self.estimate_operation = attributes[:'estimateOperation']
|
325
|
+
end
|
326
|
+
|
327
|
+
if attributes.has_key?(:'estimateValue')
|
328
|
+
self.estimate_value = attributes[:'estimateValue']
|
329
|
+
end
|
330
|
+
|
331
|
+
if attributes.has_key?(:'filterValues')
|
332
|
+
self.filter_values = attributes[:'filterValues']
|
333
|
+
end
|
334
|
+
|
335
|
+
if attributes.has_key?(:'filterValuesObj')
|
336
|
+
if (value = attributes[:'filterValuesObj']).is_a?(Array)
|
337
|
+
self.filter_values_obj = value
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
if attributes.has_key?(:'ignoreRegularEventsEnabled')
|
342
|
+
self.ignore_regular_events_enabled = attributes[:'ignoreRegularEventsEnabled']
|
343
|
+
end
|
344
|
+
|
345
|
+
if attributes.has_key?(:'integrations')
|
346
|
+
self.integrations = attributes[:'integrations']
|
347
|
+
end
|
348
|
+
|
349
|
+
if attributes.has_key?(:'lastDataReceivedDate')
|
350
|
+
self.last_data_received_date = attributes[:'lastDataReceivedDate']
|
351
|
+
end
|
352
|
+
|
353
|
+
if attributes.has_key?(:'lastSent')
|
354
|
+
self.last_sent = attributes[:'lastSent']
|
355
|
+
end
|
356
|
+
|
357
|
+
if attributes.has_key?(:'lastTriggered')
|
358
|
+
self.last_triggered = attributes[:'lastTriggered']
|
359
|
+
end
|
360
|
+
|
361
|
+
if attributes.has_key?(:'metadata')
|
362
|
+
self.metadata = attributes[:'metadata']
|
363
|
+
end
|
364
|
+
|
365
|
+
if attributes.has_key?(:'metricKey')
|
366
|
+
self.metric_key = attributes[:'metricKey']
|
367
|
+
end
|
368
|
+
|
369
|
+
if attributes.has_key?(:'metricLabel')
|
370
|
+
self.metric_label = attributes[:'metricLabel']
|
371
|
+
end
|
372
|
+
|
373
|
+
if attributes.has_key?(:'minDelayBetweenNotificationsInMinutes')
|
374
|
+
self.min_delay_between_notifications_in_minutes = attributes[:'minDelayBetweenNotificationsInMinutes']
|
375
|
+
end
|
376
|
+
|
377
|
+
if attributes.has_key?(:'name')
|
378
|
+
self.name = attributes[:'name']
|
379
|
+
end
|
380
|
+
|
381
|
+
if attributes.has_key?(:'notificationEmails')
|
382
|
+
if (value = attributes[:'notificationEmails']).is_a?(Array)
|
383
|
+
self.notification_emails = value
|
384
|
+
end
|
385
|
+
end
|
386
|
+
|
387
|
+
if attributes.has_key?(:'notificationIntegrations')
|
388
|
+
if (value = attributes[:'notificationIntegrations']).is_a?(Array)
|
389
|
+
self.notification_integrations = value
|
390
|
+
end
|
391
|
+
end
|
392
|
+
|
393
|
+
if attributes.has_key?(:'notificationsEnabled')
|
394
|
+
self.notifications_enabled = attributes[:'notificationsEnabled']
|
395
|
+
end
|
396
|
+
|
397
|
+
if attributes.has_key?(:'query')
|
398
|
+
self.query = attributes[:'query']
|
399
|
+
end
|
400
|
+
|
401
|
+
if attributes.has_key?(:'reportName')
|
402
|
+
self.report_name = attributes[:'reportName']
|
403
|
+
end
|
404
|
+
|
405
|
+
if attributes.has_key?(:'ruleKey')
|
406
|
+
self.rule_key = attributes[:'ruleKey']
|
407
|
+
end
|
408
|
+
|
409
|
+
if attributes.has_key?(:'ruleType')
|
410
|
+
self.rule_type = attributes[:'ruleType']
|
411
|
+
end
|
412
|
+
|
413
|
+
if attributes.has_key?(:'runbook')
|
414
|
+
self.runbook = attributes[:'runbook']
|
415
|
+
end
|
416
|
+
|
417
|
+
if attributes.has_key?(:'savedQueryId')
|
418
|
+
self.saved_query_id = attributes[:'savedQueryId']
|
419
|
+
end
|
420
|
+
|
421
|
+
if attributes.has_key?(:'schedule')
|
422
|
+
if (value = attributes[:'schedule']).is_a?(Array)
|
423
|
+
self.schedule = value
|
424
|
+
end
|
425
|
+
end
|
426
|
+
|
427
|
+
if attributes.has_key?(:'sematextService')
|
428
|
+
self.sematext_service = attributes[:'sematextService']
|
429
|
+
end
|
430
|
+
|
431
|
+
if attributes.has_key?(:'sendToEmail')
|
432
|
+
self.send_to_email = attributes[:'sendToEmail']
|
433
|
+
end
|
434
|
+
|
435
|
+
if attributes.has_key?(:'timezone')
|
436
|
+
self.timezone = attributes[:'timezone']
|
437
|
+
end
|
438
|
+
|
439
|
+
if attributes.has_key?(:'useOnlyAlertRuleIntegrations')
|
440
|
+
self.use_only_alert_rule_integrations = attributes[:'useOnlyAlertRuleIntegrations']
|
441
|
+
end
|
442
|
+
|
443
|
+
if attributes.has_key?(:'userPermissions')
|
444
|
+
self.user_permissions = attributes[:'userPermissions']
|
445
|
+
end
|
446
|
+
|
447
|
+
if attributes.has_key?(:'valueColumnName')
|
448
|
+
self.value_column_name = attributes[:'valueColumnName']
|
449
|
+
end
|
450
|
+
|
451
|
+
if attributes.has_key?(:'valueName')
|
452
|
+
self.value_name = attributes[:'valueName']
|
453
|
+
end
|
454
|
+
end
|
455
|
+
|
456
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
457
|
+
# @return Array for valid properties with the reasons
|
458
|
+
def list_invalid_properties
|
459
|
+
invalid_properties = Array.new
|
460
|
+
invalid_properties
|
461
|
+
end
|
462
|
+
|
463
|
+
# Check to see if the all the properties in the model are valid
|
464
|
+
# @return true if the model is valid
|
465
|
+
def valid?
|
466
|
+
estimate_operation_validator = EnumAttributeValidator.new('String', ['LESS', 'MORE', 'EQUAL', 'UN_EQUAL', 'LESS_OR_EQUAL', 'MORE_OR_EQUAL'])
|
467
|
+
return false unless estimate_operation_validator.valid?(@estimate_operation)
|
468
|
+
true
|
469
|
+
end
|
470
|
+
|
471
|
+
# Custom attribute writer method checking allowed values (enum).
|
472
|
+
# @param [Object] estimate_operation Object to be assigned
|
473
|
+
def estimate_operation=(estimate_operation)
|
474
|
+
validator = EnumAttributeValidator.new('String', ['LESS', 'MORE', 'EQUAL', 'UN_EQUAL', 'LESS_OR_EQUAL', 'MORE_OR_EQUAL'])
|
475
|
+
unless validator.valid?(estimate_operation)
|
476
|
+
fail ArgumentError, 'invalid value for "estimate_operation", must be one of #{validator.allowable_values}.'
|
477
|
+
end
|
478
|
+
@estimate_operation = estimate_operation
|
479
|
+
end
|
480
|
+
|
481
|
+
# Checks equality by comparing each attribute.
|
482
|
+
# @param [Object] Object to be compared
|
483
|
+
def ==(o)
|
484
|
+
return true if self.equal?(o)
|
485
|
+
self.class == o.class &&
|
486
|
+
account_email == o.account_email &&
|
487
|
+
allowed_app_types == o.allowed_app_types &&
|
488
|
+
analyzing_time == o.analyzing_time &&
|
489
|
+
app_display_state == o.app_display_state &&
|
490
|
+
app_id == o.app_id &&
|
491
|
+
app_name == o.app_name &&
|
492
|
+
app_state == o.app_state &&
|
493
|
+
app_token == o.app_token &&
|
494
|
+
app_type == o.app_type &&
|
495
|
+
back_to_normal_needed == o.back_to_normal_needed &&
|
496
|
+
chart_key == o.chart_key &&
|
497
|
+
color == o.color &&
|
498
|
+
creator_email == o.creator_email &&
|
499
|
+
default_agg_type == o.default_agg_type &&
|
500
|
+
description == o.description &&
|
501
|
+
disallowed_app_types == o.disallowed_app_types &&
|
502
|
+
enabled == o.enabled &&
|
503
|
+
estimate_operation == o.estimate_operation &&
|
504
|
+
estimate_value == o.estimate_value &&
|
505
|
+
filter_values == o.filter_values &&
|
506
|
+
filter_values_obj == o.filter_values_obj &&
|
507
|
+
ignore_regular_events_enabled == o.ignore_regular_events_enabled &&
|
508
|
+
integrations == o.integrations &&
|
509
|
+
last_data_received_date == o.last_data_received_date &&
|
510
|
+
last_sent == o.last_sent &&
|
511
|
+
last_triggered == o.last_triggered &&
|
512
|
+
metadata == o.metadata &&
|
513
|
+
metric_key == o.metric_key &&
|
514
|
+
metric_label == o.metric_label &&
|
515
|
+
min_delay_between_notifications_in_minutes == o.min_delay_between_notifications_in_minutes &&
|
516
|
+
name == o.name &&
|
517
|
+
notification_emails == o.notification_emails &&
|
518
|
+
notification_integrations == o.notification_integrations &&
|
519
|
+
notifications_enabled == o.notifications_enabled &&
|
520
|
+
query == o.query &&
|
521
|
+
report_name == o.report_name &&
|
522
|
+
rule_key == o.rule_key &&
|
523
|
+
rule_type == o.rule_type &&
|
524
|
+
runbook == o.runbook &&
|
525
|
+
saved_query_id == o.saved_query_id &&
|
526
|
+
schedule == o.schedule &&
|
527
|
+
sematext_service == o.sematext_service &&
|
528
|
+
send_to_email == o.send_to_email &&
|
529
|
+
timezone == o.timezone &&
|
530
|
+
use_only_alert_rule_integrations == o.use_only_alert_rule_integrations &&
|
531
|
+
user_permissions == o.user_permissions &&
|
532
|
+
value_column_name == o.value_column_name &&
|
533
|
+
value_name == o.value_name
|
534
|
+
end
|
535
|
+
|
536
|
+
# @see the `==` method
|
537
|
+
# @param [Object] Object to be compared
|
538
|
+
def eql?(o)
|
539
|
+
self == o
|
540
|
+
end
|
541
|
+
|
542
|
+
# Calculates hash code according to all attributes.
|
543
|
+
# @return [Fixnum] Hash code
|
544
|
+
def hash
|
545
|
+
[account_email, allowed_app_types, analyzing_time, app_display_state, app_id, app_name, app_state, app_token, app_type, back_to_normal_needed, chart_key, color, creator_email, default_agg_type, description, disallowed_app_types, enabled, estimate_operation, estimate_value, filter_values, filter_values_obj, ignore_regular_events_enabled, integrations, last_data_received_date, last_sent, last_triggered, metadata, metric_key, metric_label, min_delay_between_notifications_in_minutes, name, notification_emails, notification_integrations, notifications_enabled, query, report_name, rule_key, rule_type, runbook, saved_query_id, schedule, sematext_service, send_to_email, timezone, use_only_alert_rule_integrations, user_permissions, value_column_name, value_name].hash
|
546
|
+
end
|
547
|
+
|
548
|
+
# Builds the object from hash
|
549
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
550
|
+
# @return [Object] Returns the model itself
|
551
|
+
def build_from_hash(attributes)
|
552
|
+
return nil unless attributes.is_a?(Hash)
|
553
|
+
self.class.swagger_types.each_pair do |key, type|
|
554
|
+
if type =~ /\AArray<(.*)>/i
|
555
|
+
# check to ensure the input is an array given that the the attribute
|
556
|
+
# is documented as an array but the input is not
|
557
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
558
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
559
|
+
end
|
560
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
561
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
562
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
563
|
+
end
|
564
|
+
|
565
|
+
self
|
566
|
+
end
|
567
|
+
|
568
|
+
# Deserializes the data based on type
|
569
|
+
# @param string type Data type
|
570
|
+
# @param string value Value to be deserialized
|
571
|
+
# @return [Object] Deserialized data
|
572
|
+
def _deserialize(type, value)
|
573
|
+
case type.to_sym
|
574
|
+
when :DateTime
|
575
|
+
DateTime.parse(value)
|
576
|
+
when :Date
|
577
|
+
Date.parse(value)
|
578
|
+
when :String
|
579
|
+
value.to_s
|
580
|
+
when :Integer
|
581
|
+
value.to_i
|
582
|
+
when :Float
|
583
|
+
value.to_f
|
584
|
+
when :BOOLEAN
|
585
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
586
|
+
true
|
587
|
+
else
|
588
|
+
false
|
589
|
+
end
|
590
|
+
when :Object
|
591
|
+
# generic object (usually a Hash), return directly
|
592
|
+
value
|
593
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
594
|
+
inner_type = Regexp.last_match[:inner_type]
|
595
|
+
value.map { |v| _deserialize(inner_type, v) }
|
596
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
597
|
+
k_type = Regexp.last_match[:k_type]
|
598
|
+
v_type = Regexp.last_match[:v_type]
|
599
|
+
{}.tap do |hash|
|
600
|
+
value.each do |k, v|
|
601
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
602
|
+
end
|
603
|
+
end
|
604
|
+
else # model
|
605
|
+
temp_model = SematextCloud.const_get(type).new
|
606
|
+
temp_model.build_from_hash(value)
|
607
|
+
end
|
608
|
+
end
|
609
|
+
|
610
|
+
# Returns the string representation of the object
|
611
|
+
# @return [String] String presentation of the object
|
612
|
+
def to_s
|
613
|
+
to_hash.to_s
|
614
|
+
end
|
615
|
+
|
616
|
+
# to_body is an alias to to_hash (backward compatibility)
|
617
|
+
# @return [Hash] Returns the object in the form of hash
|
618
|
+
def to_body
|
619
|
+
to_hash
|
620
|
+
end
|
621
|
+
|
622
|
+
# Returns the object in the form of hash
|
623
|
+
# @return [Hash] Returns the object in the form of hash
|
624
|
+
def to_hash
|
625
|
+
hash = {}
|
626
|
+
self.class.attribute_map.each_pair do |attr, param|
|
627
|
+
value = self.send(attr)
|
628
|
+
next if value.nil?
|
629
|
+
hash[param] = _to_hash(value)
|
630
|
+
end
|
631
|
+
hash
|
632
|
+
end
|
633
|
+
|
634
|
+
# Outputs non-array value in the form of hash
|
635
|
+
# For object, use to_hash. Otherwise, just return the value
|
636
|
+
# @param [Object] value Any valid value
|
637
|
+
# @return [Hash] Returns the value in the form of hash
|
638
|
+
def _to_hash(value)
|
639
|
+
if value.is_a?(Array)
|
640
|
+
value.compact.map { |v| _to_hash(v) }
|
641
|
+
elsif value.is_a?(Hash)
|
642
|
+
{}.tap do |hash|
|
643
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
644
|
+
end
|
645
|
+
elsif value.respond_to? :to_hash
|
646
|
+
value.to_hash
|
647
|
+
else
|
648
|
+
value
|
649
|
+
end
|
650
|
+
end
|
651
|
+
end
|
652
|
+
end
|