Class: MistApi::SuppressedAlarmApplies

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/suppressed_alarm_applies.rb

Overview

If ‘scope`==`site`. Object defines the scope (within the org e.g. whole org, and/or some site_groups, and/or some sites) for which the alarm service has to be suppressed for some `duration`

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(org_id = SKIP, site_ids = SKIP, sitegroup_ids = SKIP) ⇒ SuppressedAlarmApplies

Returns a new instance of SuppressedAlarmApplies.



52
53
54
55
56
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 52

def initialize(org_id = SKIP, site_ids = SKIP, sitegroup_ids = SKIP)
  @org_id = org_id unless org_id == SKIP
  @site_ids = site_ids unless site_ids == SKIP
  @sitegroup_ids = sitegroup_ids unless sitegroup_ids == SKIP
end

Instance Attribute Details

#org_idUUID | String

UUID of the current org (if provided, the alarms will be suppressed at org level)

Returns:

  • (UUID | String)


17
18
19
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 17

def org_id
  @org_id
end

#site_idsArray[UUID | String]

List of UUID of the sites within the org (if provided, the alarms will be suppressed for all the mentioned sites under the org)

Returns:

  • (Array[UUID | String])


22
23
24
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 22

def site_ids
  @site_ids
end

#sitegroup_idsArray[UUID | String]

List of UUID of the site groups within the org (if provided, the alarms will be suppressed for all the sites under those site groups)

Returns:

  • (Array[UUID | String])


27
28
29
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 27

def sitegroup_ids
  @sitegroup_ids
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  site_ids = hash.key?('site_ids') ? hash['site_ids'] : SKIP
  sitegroup_ids = hash.key?('sitegroup_ids') ? hash['sitegroup_ids'] : SKIP

  # Create object from extracted values.
  SuppressedAlarmApplies.new(org_id,
                             site_ids,
                             sitegroup_ids)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['org_id'] = 'org_id'
  @_hash['site_ids'] = 'site_ids'
  @_hash['sitegroup_ids'] = 'sitegroup_ids'
  @_hash
end

.nullablesObject

An array for nullable fields



48
49
50
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 48

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 39

def self.optionals
  %w[
    org_id
    site_ids
    sitegroup_ids
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



81
82
83
84
85
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 81

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} org_id: #{@org_id.inspect}, site_ids: #{@site_ids.inspect}, sitegroup_ids:"\
  " #{@sitegroup_ids.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



74
75
76
77
78
# File 'lib/mist_api/models/suppressed_alarm_applies.rb', line 74

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} org_id: #{@org_id}, site_ids: #{@site_ids}, sitegroup_ids:"\
  " #{@sitegroup_ids}>"
end