Class: MistApi::UtilsSendBleBeacon

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

Overview

UtilsSendBleBeacon Model.

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(beacon_frame = SKIP, beacon_freq = SKIP, duration = SKIP, macs = SKIP, map_ids = SKIP, additional_properties = nil) ⇒ UtilsSendBleBeacon

Returns a new instance of UtilsSendBleBeacon.



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

def initialize(beacon_frame = SKIP, beacon_freq = SKIP, duration = SKIP,
               macs = SKIP, map_ids = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @beacon_frame = beacon_frame unless beacon_frame == SKIP
  @beacon_freq = beacon_freq unless beacon_freq == SKIP
  @duration = duration unless duration == SKIP
  @macs = macs unless macs == SKIP
  @map_ids = map_ids unless map_ids == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#beacon_frameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 14

def beacon_frame
  @beacon_frame
end

#beacon_freqInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 18

def beacon_freq
  @beacon_freq
end

#durationInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def duration
  @duration
end

#macsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


26
27
28
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 26

def macs
  @macs
end

#map_idsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


30
31
32
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 30

def map_ids
  @map_ids
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  beacon_frame = hash.key?('beacon_frame') ? hash['beacon_frame'] : SKIP
  beacon_freq = hash.key?('beacon_freq') ? hash['beacon_freq'] : SKIP
  duration = hash.key?('duration') ? hash['duration'] : SKIP
  macs = hash.key?('macs') ? hash['macs'] : SKIP
  map_ids = hash.key?('map_ids') ? hash['map_ids'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  UtilsSendBleBeacon.new(beacon_frame,
                         beacon_freq,
                         duration,
                         macs,
                         map_ids,
                         additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['beacon_frame'] = 'beacon_frame'
  @_hash['beacon_freq'] = 'beacon_freq'
  @_hash['duration'] = 'duration'
  @_hash['macs'] = 'macs'
  @_hash['map_ids'] = 'map_ids'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 44

def self.optionals
  %w[
    beacon_frame
    beacon_freq
    duration
    macs
    map_ids
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



108
109
110
111
112
113
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 108

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} beacon_frame: #{@beacon_frame.inspect}, beacon_freq:"\
  " #{@beacon_freq.inspect}, duration: #{@duration.inspect}, macs: #{@macs.inspect}, map_ids:"\
  " #{@map_ids.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



100
101
102
103
104
105
# File 'lib/mist_api/models/utils_send_ble_beacon.rb', line 100

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} beacon_frame: #{@beacon_frame}, beacon_freq: #{@beacon_freq}, duration:"\
  " #{@duration}, macs: #{@macs}, map_ids: #{@map_ids}, additional_properties:"\
  " #{@additional_properties}>"
end