Class: stcloud::AlertRule

Inherits:
Object
  • Object
show all
Defined in:
lib/stcloud/models/alert_rule.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AlertRule

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'lib/stcloud/models/alert_rule.rb', line 250

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `stcloud::AlertRule` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `stcloud::AlertRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'account_email')
    self. = attributes[:'account_email']
  end

  if attributes.key?(:'allowed_app_types')
    if (value = attributes[:'allowed_app_types']).is_a?(Array)
      self.allowed_app_types = value
    end
  end

  if attributes.key?(:'analyzing_time')
    self.analyzing_time = attributes[:'analyzing_time']
  end

  if attributes.key?(:'app_display_state')
    self.app_display_state = attributes[:'app_display_state']
  end

  if attributes.key?(:'app_id')
    self.app_id = attributes[:'app_id']
  end

  if attributes.key?(:'app_name')
    self.app_name = attributes[:'app_name']
  end

  if attributes.key?(:'app_state')
    self.app_state = attributes[:'app_state']
  end

  if attributes.key?(:'app_token')
    self.app_token = attributes[:'app_token']
  end

  if attributes.key?(:'app_type')
    self.app_type = attributes[:'app_type']
  end

  if attributes.key?(:'back_to_normal_needed')
    self.back_to_normal_needed = attributes[:'back_to_normal_needed']
  end

  if attributes.key?(:'chart_key')
    self.chart_key = attributes[:'chart_key']
  end

  if attributes.key?(:'color')
    self.color = attributes[:'color']
  end

  if attributes.key?(:'creator_email')
    self.creator_email = attributes[:'creator_email']
  end

  if attributes.key?(:'default_agg_type')
    self.default_agg_type = attributes[:'default_agg_type']
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'disallowed_app_types')
    if (value = attributes[:'disallowed_app_types']).is_a?(Array)
      self.disallowed_app_types = value
    end
  end

  if attributes.key?(:'enabled')
    self.enabled = attributes[:'enabled']
  end

  if attributes.key?(:'estimate_operation')
    self.estimate_operation = attributes[:'estimate_operation']
  end

  if attributes.key?(:'estimate_value')
    self.estimate_value = attributes[:'estimate_value']
  end

  if attributes.key?(:'filter_values')
    self.filter_values = attributes[:'filter_values']
  end

  if attributes.key?(:'filter_values_obj')
    if (value = attributes[:'filter_values_obj']).is_a?(Array)
      self.filter_values_obj = value
    end
  end

  if attributes.key?(:'ignore_regular_events_enabled')
    self.ignore_regular_events_enabled = attributes[:'ignore_regular_events_enabled']
  end

  if attributes.key?(:'integrations')
    self.integrations = attributes[:'integrations']
  end

  if attributes.key?(:'last_data_received_date')
    self.last_data_received_date = attributes[:'last_data_received_date']
  end

  if attributes.key?(:'last_sent')
    self.last_sent = attributes[:'last_sent']
  end

  if attributes.key?(:'last_triggered')
    self.last_triggered = attributes[:'last_triggered']
  end

  if attributes.key?(:'metadata')
    self. = attributes[:'metadata']
  end

  if attributes.key?(:'metric_key')
    self.metric_key = attributes[:'metric_key']
  end

  if attributes.key?(:'metric_label')
    self.metric_label = attributes[:'metric_label']
  end

  if attributes.key?(:'min_delay_between_notifications_in_minutes')
    self.min_delay_between_notifications_in_minutes = attributes[:'min_delay_between_notifications_in_minutes']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'notification_emails')
    if (value = attributes[:'notification_emails']).is_a?(Array)
      self.notification_emails = value
    end
  end

  if attributes.key?(:'notification_integrations')
    if (value = attributes[:'notification_integrations']).is_a?(Array)
      self.notification_integrations = value
    end
  end

  if attributes.key?(:'notifications_enabled')
    self.notifications_enabled = attributes[:'notifications_enabled']
  end

  if attributes.key?(:'query')
    self.query = attributes[:'query']
  end

  if attributes.key?(:'report_name')
    self.report_name = attributes[:'report_name']
  end

  if attributes.key?(:'rule_key')
    self.rule_key = attributes[:'rule_key']
  end

  if attributes.key?(:'rule_type')
    self.rule_type = attributes[:'rule_type']
  end

  if attributes.key?(:'runbook')
    self.runbook = attributes[:'runbook']
  end

  if attributes.key?(:'saved_query_id')
    self.saved_query_id = attributes[:'saved_query_id']
  end

  if attributes.key?(:'schedule')
    if (value = attributes[:'schedule']).is_a?(Array)
      self.schedule = value
    end
  end

  if attributes.key?(:'sematext_service')
    self.sematext_service = attributes[:'sematext_service']
  end

  if attributes.key?(:'send_to_email')
    self.send_to_email = attributes[:'send_to_email']
  end

  if attributes.key?(:'timezone')
    self.timezone = attributes[:'timezone']
  end

  if attributes.key?(:'use_only_alert_rule_integrations')
    self.use_only_alert_rule_integrations = attributes[:'use_only_alert_rule_integrations']
  end

  if attributes.key?(:'user_permissions')
    self.user_permissions = attributes[:'user_permissions']
  end

  if attributes.key?(:'value_column_name')
    self.value_column_name = attributes[:'value_column_name']
  end

  if attributes.key?(:'value_name')
    self.value_name = attributes[:'value_name']
  end
end

Instance Attribute Details

#account_emailObject

Returns the value of attribute account_email.



16
17
18
# File 'lib/stcloud/models/alert_rule.rb', line 16

def 
  @account_email
end

#allowed_app_typesObject

Returns the value of attribute allowed_app_types.



18
19
20
# File 'lib/stcloud/models/alert_rule.rb', line 18

def allowed_app_types
  @allowed_app_types
end

#analyzing_timeObject

Returns the value of attribute analyzing_time.



20
21
22
# File 'lib/stcloud/models/alert_rule.rb', line 20

def analyzing_time
  @analyzing_time
end

#app_display_stateObject

Returns the value of attribute app_display_state.



22
23
24
# File 'lib/stcloud/models/alert_rule.rb', line 22

def app_display_state
  @app_display_state
end

#app_idObject

Returns the value of attribute app_id.



24
25
26
# File 'lib/stcloud/models/alert_rule.rb', line 24

def app_id
  @app_id
end

#app_nameObject

Returns the value of attribute app_name.



26
27
28
# File 'lib/stcloud/models/alert_rule.rb', line 26

def app_name
  @app_name
end

#app_stateObject

Returns the value of attribute app_state.



28
29
30
# File 'lib/stcloud/models/alert_rule.rb', line 28

def app_state
  @app_state
end

#app_tokenObject

Returns the value of attribute app_token.



30
31
32
# File 'lib/stcloud/models/alert_rule.rb', line 30

def app_token
  @app_token
end

#app_typeObject

Returns the value of attribute app_type.



32
33
34
# File 'lib/stcloud/models/alert_rule.rb', line 32

def app_type
  @app_type
end

#back_to_normal_neededObject

Returns the value of attribute back_to_normal_needed.



34
35
36
# File 'lib/stcloud/models/alert_rule.rb', line 34

def back_to_normal_needed
  @back_to_normal_needed
end

#chart_keyObject

Returns the value of attribute chart_key.



36
37
38
# File 'lib/stcloud/models/alert_rule.rb', line 36

def chart_key
  @chart_key
end

#colorObject

Returns the value of attribute color.



38
39
40
# File 'lib/stcloud/models/alert_rule.rb', line 38

def color
  @color
end

#creator_emailObject

Returns the value of attribute creator_email.



40
41
42
# File 'lib/stcloud/models/alert_rule.rb', line 40

def creator_email
  @creator_email
end

#default_agg_typeObject

Returns the value of attribute default_agg_type.



42
43
44
# File 'lib/stcloud/models/alert_rule.rb', line 42

def default_agg_type
  @default_agg_type
end

#descriptionObject

Returns the value of attribute description.



44
45
46
# File 'lib/stcloud/models/alert_rule.rb', line 44

def description
  @description
end

#disallowed_app_typesObject

Returns the value of attribute disallowed_app_types.



46
47
48
# File 'lib/stcloud/models/alert_rule.rb', line 46

def disallowed_app_types
  @disallowed_app_types
end

#enabledObject

Returns the value of attribute enabled.



48
49
50
# File 'lib/stcloud/models/alert_rule.rb', line 48

def enabled
  @enabled
end

#estimate_operationObject

Returns the value of attribute estimate_operation.



50
51
52
# File 'lib/stcloud/models/alert_rule.rb', line 50

def estimate_operation
  @estimate_operation
end

#estimate_valueObject

Returns the value of attribute estimate_value.



52
53
54
# File 'lib/stcloud/models/alert_rule.rb', line 52

def estimate_value
  @estimate_value
end

#filter_valuesObject

Returns the value of attribute filter_values.



54
55
56
# File 'lib/stcloud/models/alert_rule.rb', line 54

def filter_values
  @filter_values
end

#filter_values_objObject

Returns the value of attribute filter_values_obj.



56
57
58
# File 'lib/stcloud/models/alert_rule.rb', line 56

def filter_values_obj
  @filter_values_obj
end

#ignore_regular_events_enabledObject

Returns the value of attribute ignore_regular_events_enabled.



58
59
60
# File 'lib/stcloud/models/alert_rule.rb', line 58

def ignore_regular_events_enabled
  @ignore_regular_events_enabled
end

#integrationsObject

Returns the value of attribute integrations.



60
61
62
# File 'lib/stcloud/models/alert_rule.rb', line 60

def integrations
  @integrations
end

#last_data_received_dateObject

Returns the value of attribute last_data_received_date.



62
63
64
# File 'lib/stcloud/models/alert_rule.rb', line 62

def last_data_received_date
  @last_data_received_date
end

#last_sentObject

Returns the value of attribute last_sent.



64
65
66
# File 'lib/stcloud/models/alert_rule.rb', line 64

def last_sent
  @last_sent
end

#last_triggeredObject

Returns the value of attribute last_triggered.



66
67
68
# File 'lib/stcloud/models/alert_rule.rb', line 66

def last_triggered
  @last_triggered
end

#metadataObject

Returns the value of attribute metadata.



68
69
70
# File 'lib/stcloud/models/alert_rule.rb', line 68

def 
  @metadata
end

#metric_keyObject

Returns the value of attribute metric_key.



70
71
72
# File 'lib/stcloud/models/alert_rule.rb', line 70

def metric_key
  @metric_key
end

#metric_labelObject

Returns the value of attribute metric_label.



72
73
74
# File 'lib/stcloud/models/alert_rule.rb', line 72

def metric_label
  @metric_label
end

#min_delay_between_notifications_in_minutesObject

Returns the value of attribute min_delay_between_notifications_in_minutes.



74
75
76
# File 'lib/stcloud/models/alert_rule.rb', line 74

def min_delay_between_notifications_in_minutes
  @min_delay_between_notifications_in_minutes
end

#nameObject

Returns the value of attribute name.



76
77
78
# File 'lib/stcloud/models/alert_rule.rb', line 76

def name
  @name
end

#notification_emailsObject

Returns the value of attribute notification_emails.



78
79
80
# File 'lib/stcloud/models/alert_rule.rb', line 78

def notification_emails
  @notification_emails
end

#notification_integrationsObject

Returns the value of attribute notification_integrations.



80
81
82
# File 'lib/stcloud/models/alert_rule.rb', line 80

def notification_integrations
  @notification_integrations
end

#notifications_enabledObject

Returns the value of attribute notifications_enabled.



82
83
84
# File 'lib/stcloud/models/alert_rule.rb', line 82

def notifications_enabled
  @notifications_enabled
end

#queryObject

Returns the value of attribute query.



84
85
86
# File 'lib/stcloud/models/alert_rule.rb', line 84

def query
  @query
end

#report_nameObject

Returns the value of attribute report_name.



86
87
88
# File 'lib/stcloud/models/alert_rule.rb', line 86

def report_name
  @report_name
end

#rule_keyObject

Returns the value of attribute rule_key.



88
89
90
# File 'lib/stcloud/models/alert_rule.rb', line 88

def rule_key
  @rule_key
end

#rule_typeObject

Returns the value of attribute rule_type.



90
91
92
# File 'lib/stcloud/models/alert_rule.rb', line 90

def rule_type
  @rule_type
end

#runbookObject

Returns the value of attribute runbook.



92
93
94
# File 'lib/stcloud/models/alert_rule.rb', line 92

def runbook
  @runbook
end

#saved_query_idObject

Returns the value of attribute saved_query_id.



94
95
96
# File 'lib/stcloud/models/alert_rule.rb', line 94

def saved_query_id
  @saved_query_id
end

#scheduleObject

Returns the value of attribute schedule.



96
97
98
# File 'lib/stcloud/models/alert_rule.rb', line 96

def schedule
  @schedule
end

#sematext_serviceObject

Returns the value of attribute sematext_service.



98
99
100
# File 'lib/stcloud/models/alert_rule.rb', line 98

def sematext_service
  @sematext_service
end

#send_to_emailObject

Returns the value of attribute send_to_email.



100
101
102
# File 'lib/stcloud/models/alert_rule.rb', line 100

def send_to_email
  @send_to_email
end

#timezoneObject

Returns the value of attribute timezone.



102
103
104
# File 'lib/stcloud/models/alert_rule.rb', line 102

def timezone
  @timezone
end

#use_only_alert_rule_integrationsObject

Returns the value of attribute use_only_alert_rule_integrations.



104
105
106
# File 'lib/stcloud/models/alert_rule.rb', line 104

def use_only_alert_rule_integrations
  @use_only_alert_rule_integrations
end

#user_permissionsObject

Returns the value of attribute user_permissions.



106
107
108
# File 'lib/stcloud/models/alert_rule.rb', line 106

def user_permissions
  @user_permissions
end

#value_column_nameObject

Returns the value of attribute value_column_name.



108
109
110
# File 'lib/stcloud/models/alert_rule.rb', line 108

def value_column_name
  @value_column_name
end

#value_nameObject

Returns the value of attribute value_name.



110
111
112
# File 'lib/stcloud/models/alert_rule.rb', line 110

def value_name
  @value_name
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/stcloud/models/alert_rule.rb', line 135

def self.attribute_map
  {
    :'account_email' => :'accountEmail',
    :'allowed_app_types' => :'allowedAppTypes',
    :'analyzing_time' => :'analyzingTime',
    :'app_display_state' => :'appDisplayState',
    :'app_id' => :'appId',
    :'app_name' => :'appName',
    :'app_state' => :'appState',
    :'app_token' => :'appToken',
    :'app_type' => :'appType',
    :'back_to_normal_needed' => :'backToNormalNeeded',
    :'chart_key' => :'chartKey',
    :'color' => :'color',
    :'creator_email' => :'creatorEmail',
    :'default_agg_type' => :'defaultAggType',
    :'description' => :'description',
    :'disallowed_app_types' => :'disallowedAppTypes',
    :'enabled' => :'enabled',
    :'estimate_operation' => :'estimateOperation',
    :'estimate_value' => :'estimateValue',
    :'filter_values' => :'filterValues',
    :'filter_values_obj' => :'filterValuesObj',
    :'ignore_regular_events_enabled' => :'ignoreRegularEventsEnabled',
    :'integrations' => :'integrations',
    :'last_data_received_date' => :'lastDataReceivedDate',
    :'last_sent' => :'lastSent',
    :'last_triggered' => :'lastTriggered',
    :'metadata' => :'metadata',
    :'metric_key' => :'metricKey',
    :'metric_label' => :'metricLabel',
    :'min_delay_between_notifications_in_minutes' => :'minDelayBetweenNotificationsInMinutes',
    :'name' => :'name',
    :'notification_emails' => :'notificationEmails',
    :'notification_integrations' => :'notificationIntegrations',
    :'notifications_enabled' => :'notificationsEnabled',
    :'query' => :'query',
    :'report_name' => :'reportName',
    :'rule_key' => :'ruleKey',
    :'rule_type' => :'ruleType',
    :'runbook' => :'runbook',
    :'saved_query_id' => :'savedQueryId',
    :'schedule' => :'schedule',
    :'sematext_service' => :'sematextService',
    :'send_to_email' => :'sendToEmail',
    :'timezone' => :'timezone',
    :'use_only_alert_rule_integrations' => :'useOnlyAlertRuleIntegrations',
    :'user_permissions' => :'userPermissions',
    :'value_column_name' => :'valueColumnName',
    :'value_name' => :'valueName'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



563
564
565
# File 'lib/stcloud/models/alert_rule.rb', line 563

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



243
244
245
246
# File 'lib/stcloud/models/alert_rule.rb', line 243

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/stcloud/models/alert_rule.rb', line 189

def self.openapi_types
  {
    :'account_email' => :'Object',
    :'allowed_app_types' => :'Object',
    :'analyzing_time' => :'Object',
    :'app_display_state' => :'Object',
    :'app_id' => :'Object',
    :'app_name' => :'Object',
    :'app_state' => :'Object',
    :'app_token' => :'Object',
    :'app_type' => :'Object',
    :'back_to_normal_needed' => :'Object',
    :'chart_key' => :'Object',
    :'color' => :'Object',
    :'creator_email' => :'Object',
    :'default_agg_type' => :'Object',
    :'description' => :'Object',
    :'disallowed_app_types' => :'Object',
    :'enabled' => :'Object',
    :'estimate_operation' => :'Object',
    :'estimate_value' => :'Object',
    :'filter_values' => :'Object',
    :'filter_values_obj' => :'Object',
    :'ignore_regular_events_enabled' => :'Object',
    :'integrations' => :'Object',
    :'last_data_received_date' => :'Object',
    :'last_sent' => :'Object',
    :'last_triggered' => :'Object',
    :'metadata' => :'Object',
    :'metric_key' => :'Object',
    :'metric_label' => :'Object',
    :'min_delay_between_notifications_in_minutes' => :'Object',
    :'name' => :'Object',
    :'notification_emails' => :'Object',
    :'notification_integrations' => :'Object',
    :'notifications_enabled' => :'Object',
    :'query' => :'Object',
    :'report_name' => :'Object',
    :'rule_key' => :'Object',
    :'rule_type' => :'Object',
    :'runbook' => :'Object',
    :'saved_query_id' => :'Object',
    :'schedule' => :'Object',
    :'sematext_service' => :'Object',
    :'send_to_email' => :'Object',
    :'timezone' => :'Object',
    :'use_only_alert_rule_integrations' => :'Object',
    :'user_permissions' => :'Object',
    :'value_column_name' => :'Object',
    :'value_name' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/stcloud/models/alert_rule.rb', line 495

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
      allowed_app_types == o.allowed_app_types &&
      analyzing_time == o.analyzing_time &&
      app_display_state == o.app_display_state &&
      app_id == o.app_id &&
      app_name == o.app_name &&
      app_state == o.app_state &&
      app_token == o.app_token &&
      app_type == o.app_type &&
      back_to_normal_needed == o.back_to_normal_needed &&
      chart_key == o.chart_key &&
      color == o.color &&
      creator_email == o.creator_email &&
      default_agg_type == o.default_agg_type &&
      description == o.description &&
      disallowed_app_types == o.disallowed_app_types &&
      enabled == o.enabled &&
      estimate_operation == o.estimate_operation &&
      estimate_value == o.estimate_value &&
      filter_values == o.filter_values &&
      filter_values_obj == o.filter_values_obj &&
      ignore_regular_events_enabled == o.ignore_regular_events_enabled &&
      integrations == o.integrations &&
      last_data_received_date == o.last_data_received_date &&
      last_sent == o.last_sent &&
      last_triggered == o.last_triggered &&
       == o. &&
      metric_key == o.metric_key &&
      metric_label == o.metric_label &&
      min_delay_between_notifications_in_minutes == o.min_delay_between_notifications_in_minutes &&
      name == o.name &&
      notification_emails == o.notification_emails &&
      notification_integrations == o.notification_integrations &&
      notifications_enabled == o.notifications_enabled &&
      query == o.query &&
      report_name == o.report_name &&
      rule_key == o.rule_key &&
      rule_type == o.rule_type &&
      runbook == o.runbook &&
      saved_query_id == o.saved_query_id &&
      schedule == o.schedule &&
      sematext_service == o.sematext_service &&
      send_to_email == o.send_to_email &&
      timezone == o.timezone &&
      use_only_alert_rule_integrations == o.use_only_alert_rule_integrations &&
      user_permissions == o.user_permissions &&
      value_column_name == o.value_column_name &&
      value_name == o.value_name
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'lib/stcloud/models/alert_rule.rb', line 593

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    stcloud.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/stcloud/models/alert_rule.rb', line 662

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/stcloud/models/alert_rule.rb', line 570

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


550
551
552
# File 'lib/stcloud/models/alert_rule.rb', line 550

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



556
557
558
# File 'lib/stcloud/models/alert_rule.rb', line 556

def hash
  [, 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, , 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
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



470
471
472
473
# File 'lib/stcloud/models/alert_rule.rb', line 470

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



638
639
640
# File 'lib/stcloud/models/alert_rule.rb', line 638

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/stcloud/models/alert_rule.rb', line 644

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



632
633
634
# File 'lib/stcloud/models/alert_rule.rb', line 632

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



477
478
479
480
481
# File 'lib/stcloud/models/alert_rule.rb', line 477

def valid?
  estimate_operation_validator = EnumAttributeValidator.new('Object', ['LESS', 'MORE', 'EQUAL', 'UN_EQUAL', 'LESS_OR_EQUAL', 'MORE_OR_EQUAL'])
  return false unless estimate_operation_validator.valid?(@estimate_operation)
  true
end