Class: MistApi::ApIot

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

Overview

IoT AP settings

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(a1 = SKIP, a2 = SKIP, a3 = SKIP, a4 = SKIP, di1 = SKIP, di2 = SKIP, mdo = SKIP) ⇒ ApIot

Returns a new instance of ApIot.



71
72
73
74
75
76
77
78
79
80
# File 'lib/mist_api/models/ap_iot.rb', line 71

def initialize(a1 = SKIP, a2 = SKIP, a3 = SKIP, a4 = SKIP, di1 = SKIP,
               di2 = SKIP, mdo = SKIP)
  @a1 = a1 unless a1 == SKIP
  @a2 = a2 unless a2 == SKIP
  @a3 = a3 unless a3 == SKIP
  @a4 = a4 unless a4 == SKIP
  @di1 = di1 unless di1 == SKIP
  @di2 = di2 unless di2 == SKIP
  @mdo = mdo unless mdo == SKIP
end

Instance Attribute Details

#a1ApIotOutput

IoT output AP settings

Returns:



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

def a1
  @a1
end

#a2ApIotOutput

IoT output AP settings

Returns:



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

def a2
  @a2
end

#a3ApIotOutput

IoT output AP settings

Returns:



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

def a3
  @a3
end

#a4ApIotOutput

IoT output AP settings

Returns:



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

def a4
  @a4
end

#di1ApIotInput

IoT Input AP settings

Returns:



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

def di1
  @di1
end

#di2ApIotInput

IoT Input AP settings

Returns:



34
35
36
# File 'lib/mist_api/models/ap_iot.rb', line 34

def di2
  @di2
end

#mdoApIotOutput

IoT output AP settings

Returns:



38
39
40
# File 'lib/mist_api/models/ap_iot.rb', line 38

def mdo
  @mdo
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/mist_api/models/ap_iot.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  a1 = ApIotOutput.from_hash(hash['A1']) if hash['A1']
  a2 = ApIotOutput.from_hash(hash['A2']) if hash['A2']
  a3 = ApIotOutput.from_hash(hash['A3']) if hash['A3']
  a4 = ApIotOutput.from_hash(hash['A4']) if hash['A4']
  di1 = ApIotInput.from_hash(hash['DI1']) if hash['DI1']
  di2 = ApIotInput.from_hash(hash['DI2']) if hash['DI2']
  mdo = ApIotOutput.from_hash(hash['DO']) if hash['DO']

  # Create object from extracted values.
  ApIot.new(a1,
            a2,
            a3,
            a4,
            di1,
            di2,
            mdo)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/mist_api/models/ap_iot.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['a1'] = 'A1'
  @_hash['a2'] = 'A2'
  @_hash['a3'] = 'A3'
  @_hash['a4'] = 'A4'
  @_hash['di1'] = 'DI1'
  @_hash['di2'] = 'DI2'
  @_hash['mdo'] = 'DO'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/mist_api/models/ap_iot.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/mist_api/models/ap_iot.rb', line 54

def self.optionals
  %w[
    a1
    a2
    a3
    a4
    di1
    di2
    mdo
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



113
114
115
116
117
# File 'lib/mist_api/models/ap_iot.rb', line 113

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} a1: #{@a1.inspect}, a2: #{@a2.inspect}, a3: #{@a3.inspect}, a4:"\
  " #{@a4.inspect}, di1: #{@di1.inspect}, di2: #{@di2.inspect}, mdo: #{@mdo.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



106
107
108
109
110
# File 'lib/mist_api/models/ap_iot.rb', line 106

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} a1: #{@a1}, a2: #{@a2}, a3: #{@a3}, a4: #{@a4}, di1: #{@di1}, di2: #{@di2},"\
  " mdo: #{@mdo}>"
end