Class: MistApi::RfTemplate

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

Overview

RF Template

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(name = nil, ant_gain_24 = SKIP, ant_gain_5 = SKIP, ant_gain_6 = SKIP, band_24 = SKIP, band_24_usage = SKIP, band_5 = SKIP, band_5_on_24_radio = SKIP, band_6 = SKIP, country_code = SKIP, created_time = SKIP, for_site = SKIP, id = SKIP, model_specific = SKIP, modified_time = SKIP, org_id = SKIP, scanning_enabled = SKIP, additional_properties = nil) ⇒ RfTemplate

Returns a new instance of RfTemplate.



132
133
134
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
# File 'lib/mist_api/models/rf_template.rb', line 132

def initialize(name = nil, ant_gain_24 = SKIP, ant_gain_5 = SKIP,
               ant_gain_6 = SKIP, band_24 = SKIP, band_24_usage = SKIP,
               band_5 = SKIP, band_5_on_24_radio = SKIP, band_6 = SKIP,
               country_code = SKIP, created_time = SKIP, for_site = SKIP,
               id = SKIP, model_specific = SKIP, modified_time = SKIP,
               org_id = SKIP, scanning_enabled = SKIP,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @ant_gain_24 = ant_gain_24 unless ant_gain_24 == SKIP
  @ant_gain_5 = ant_gain_5 unless ant_gain_5 == SKIP
  @ant_gain_6 = ant_gain_6 unless ant_gain_6 == SKIP
  @band_24 = band_24 unless band_24 == SKIP
  @band_24_usage = band_24_usage unless band_24_usage == SKIP
  @band_5 = band_5 unless band_5 == SKIP
  @band_5_on_24_radio = band_5_on_24_radio unless band_5_on_24_radio == SKIP
  @band_6 = band_6 unless band_6 == SKIP
  @country_code = country_code unless country_code == SKIP
  @created_time = created_time unless created_time == SKIP
  @for_site = for_site unless for_site == SKIP
  @id = id unless id == SKIP
  @model_specific = model_specific unless model_specific == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name
  @org_id = org_id unless org_id == SKIP
  @scanning_enabled = scanning_enabled unless scanning_enabled == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#ant_gain_24Integer

TODO: Write general description for this method

Returns:

  • (Integer)


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

def ant_gain_24
  @ant_gain_24
end

#ant_gain_5Integer

TODO: Write general description for this method

Returns:

  • (Integer)


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

def ant_gain_5
  @ant_gain_5
end

#ant_gain_6Integer

TODO: Write general description for this method

Returns:

  • (Integer)


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

def ant_gain_6
  @ant_gain_6
end

#band_24RftemplateRadioBand24

Radio Band AP settings

Returns:

  • (RftemplateRadioBand24)


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

def band_24
  @band_24
end

#band_24_usageRadioBand24UsageEnum

enum: ‘24`, `5`, `6`, `auto`



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

def band_24_usage
  @band_24_usage
end

#band_5RftemplateRadioBand5

Radio Band AP settings

Returns:

  • (RftemplateRadioBand5)


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

def band_5
  @band_5
end

#band_5_on_24_radioRftemplateRadioBand5

Radio Band AP settings

Returns:

  • (RftemplateRadioBand5)


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

def band_5_on_24_radio
  @band_5_on_24_radio
end

#band_6RftemplateRadioBand6

Radio Band AP settings

Returns:

  • (RftemplateRadioBand6)


42
43
44
# File 'lib/mist_api/models/rf_template.rb', line 42

def band_6
  @band_6
end

#country_codeString

Optional, country code to use. If specified, this gets applied to all sites using the RF Template

Returns:

  • (String)


47
48
49
# File 'lib/mist_api/models/rf_template.rb', line 47

def country_code
  @country_code
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


51
52
53
# File 'lib/mist_api/models/rf_template.rb', line 51

def created_time
  @created_time
end

#for_siteTrueClass | FalseClass

When the object has been created, in epoch

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


59
60
61
# File 'lib/mist_api/models/rf_template.rb', line 59

def id
  @id
end

#model_specificHash[String, RfTemplateModelSpecificProperty]

overwrites for a specific model. If a band is specified, it will shadow the default. Property key is the model name (e.g. “AP63”)

Returns:



64
65
66
# File 'lib/mist_api/models/rf_template.rb', line 64

def model_specific
  @model_specific
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


68
69
70
# File 'lib/mist_api/models/rf_template.rb', line 68

def modified_time
  @modified_time
end

#nameString

The name of the RF template

Returns:

  • (String)


72
73
74
# File 'lib/mist_api/models/rf_template.rb', line 72

def name
  @name
end

#org_idUUID | String

The name of the RF template

Returns:

  • (UUID | String)


76
77
78
# File 'lib/mist_api/models/rf_template.rb', line 76

def org_id
  @org_id
end

#scanning_enabledTrueClass | FalseClass

Whether scanning radio is enabled

Returns:

  • (TrueClass | FalseClass)


80
81
82
# File 'lib/mist_api/models/rf_template.rb', line 80

def scanning_enabled
  @scanning_enabled
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
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
# File 'lib/mist_api/models/rf_template.rb', line 163

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  ant_gain_24 = hash.key?('ant_gain_24') ? hash['ant_gain_24'] : SKIP
  ant_gain_5 = hash.key?('ant_gain_5') ? hash['ant_gain_5'] : SKIP
  ant_gain_6 = hash.key?('ant_gain_6') ? hash['ant_gain_6'] : SKIP
  band_24 = RftemplateRadioBand24.from_hash(hash['band_24']) if hash['band_24']
  band_24_usage = hash.key?('band_24_usage') ? hash['band_24_usage'] : SKIP
  band_5 = RftemplateRadioBand5.from_hash(hash['band_5']) if hash['band_5']
  band_5_on_24_radio = RftemplateRadioBand5.from_hash(hash['band_5_on_24_radio']) if
    hash['band_5_on_24_radio']
  band_6 = RftemplateRadioBand6.from_hash(hash['band_6']) if hash['band_6']
  country_code = hash.key?('country_code') ? hash['country_code'] : SKIP
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  model_specific = RfTemplateModelSpecificProperty.from_hash(hash['model_specific']) if
    hash['model_specific']

  model_specific = SKIP unless hash.key?('model_specific')
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  scanning_enabled =
    hash.key?('scanning_enabled') ? hash['scanning_enabled'] : 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.
  RfTemplate.new(name,
                 ant_gain_24,
                 ant_gain_5,
                 ant_gain_6,
                 band_24,
                 band_24_usage,
                 band_5,
                 band_5_on_24_radio,
                 band_6,
                 country_code,
                 created_time,
                 for_site,
                 id,
                 model_specific,
                 modified_time,
                 org_id,
                 scanning_enabled,
                 additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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/rf_template.rb', line 83

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ant_gain_24'] = 'ant_gain_24'
  @_hash['ant_gain_5'] = 'ant_gain_5'
  @_hash['ant_gain_6'] = 'ant_gain_6'
  @_hash['band_24'] = 'band_24'
  @_hash['band_24_usage'] = 'band_24_usage'
  @_hash['band_5'] = 'band_5'
  @_hash['band_5_on_24_radio'] = 'band_5_on_24_radio'
  @_hash['band_6'] = 'band_6'
  @_hash['country_code'] = 'country_code'
  @_hash['created_time'] = 'created_time'
  @_hash['for_site'] = 'for_site'
  @_hash['id'] = 'id'
  @_hash['model_specific'] = 'model_specific'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['scanning_enabled'] = 'scanning_enabled'
  @_hash
end

.nullablesObject

An array for nullable fields



128
129
130
# File 'lib/mist_api/models/rf_template.rb', line 128

def self.nullables
  []
end

.optionalsObject

An array for optional fields



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/mist_api/models/rf_template.rb', line 106

def self.optionals
  %w[
    ant_gain_24
    ant_gain_5
    ant_gain_6
    band_24
    band_24_usage
    band_5
    band_5_on_24_radio
    band_6
    country_code
    created_time
    for_site
    id
    model_specific
    modified_time
    org_id
    scanning_enabled
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/mist_api/models/rf_template.rb', line 231

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ant_gain_24: #{@ant_gain_24.inspect}, ant_gain_5: #{@ant_gain_5.inspect},"\
  " ant_gain_6: #{@ant_gain_6.inspect}, band_24: #{@band_24.inspect}, band_24_usage:"\
  " #{@band_24_usage.inspect}, band_5: #{@band_5.inspect}, band_5_on_24_radio:"\
  " #{@band_5_on_24_radio.inspect}, band_6: #{@band_6.inspect}, country_code:"\
  " #{@country_code.inspect}, created_time: #{@created_time.inspect}, for_site:"\
  " #{@for_site.inspect}, id: #{@id.inspect}, model_specific: #{@model_specific.inspect},"\
  " modified_time: #{@modified_time.inspect}, name: #{@name.inspect}, org_id:"\
  " #{@org_id.inspect}, scanning_enabled: #{@scanning_enabled.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



219
220
221
222
223
224
225
226
227
228
# File 'lib/mist_api/models/rf_template.rb', line 219

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ant_gain_24: #{@ant_gain_24}, ant_gain_5: #{@ant_gain_5}, ant_gain_6:"\
  " #{@ant_gain_6}, band_24: #{@band_24}, band_24_usage: #{@band_24_usage}, band_5:"\
  " #{@band_5}, band_5_on_24_radio: #{@band_5_on_24_radio}, band_6: #{@band_6}, country_code:"\
  " #{@country_code}, created_time: #{@created_time}, for_site: #{@for_site}, id: #{@id},"\
  " model_specific: #{@model_specific}, modified_time: #{@modified_time}, name: #{@name},"\
  " org_id: #{@org_id}, scanning_enabled: #{@scanning_enabled}, additional_properties:"\
  " #{@additional_properties}>"
end