Class: MistApi::ApTemplate

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

Overview

ApTemplate 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(ap_matching = nil, created_time = SKIP, for_site = SKIP, id = SKIP, modified_time = SKIP, org_id = SKIP, site_id = SKIP, wifi = SKIP, additional_properties = nil) ⇒ ApTemplate

Returns a new instance of ApTemplate.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/mist_api/models/ap_template.rb', line 76

def initialize(ap_matching = nil, created_time = SKIP, for_site = SKIP,
               id = SKIP, modified_time = SKIP, org_id = SKIP,
               site_id = SKIP, wifi = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @ap_matching = ap_matching
  @created_time = created_time unless created_time == SKIP
  @for_site = for_site unless for_site == SKIP
  @id = id unless id == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @org_id = org_id unless org_id == SKIP
  @site_id = site_id unless site_id == SKIP
  @wifi = wifi unless wifi == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#ap_matchingApTemplateMatching

TODO: Write general description for this method

Returns:



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

def ap_matching
  @ap_matching
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#for_siteTrueClass | FalseClass

When the object has been created, in epoch

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#modified_timeFloat

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

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#org_idUUID | String

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

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#site_idUUID | String

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

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#wifiApTemplateWifi

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

Returns:



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

def wifi
  @wifi
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/mist_api/models/ap_template.rb', line 94

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap_matching = ApTemplateMatching.from_hash(hash['ap_matching']) if hash['ap_matching']
  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
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  wifi = ApTemplateWifi.from_hash(hash['wifi']) if hash['wifi']

  # 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.
  ApTemplate.new(ap_matching,
                 created_time,
                 for_site,
                 id,
                 modified_time,
                 org_id,
                 site_id,
                 wifi,
                 additional_properties)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/mist_api/models/ap_template.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap_matching'] = 'ap_matching'
  @_hash['created_time'] = 'created_time'
  @_hash['for_site'] = 'for_site'
  @_hash['id'] = 'id'
  @_hash['modified_time'] = 'modified_time'
  @_hash['org_id'] = 'org_id'
  @_hash['site_id'] = 'site_id'
  @_hash['wifi'] = 'wifi'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    created_time
    for_site
    id
    modified_time
    org_id
    site_id
    wifi
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



135
136
137
138
139
140
141
142
# File 'lib/mist_api/models/ap_template.rb', line 135

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_matching: #{@ap_matching.inspect}, created_time:"\
  " #{@created_time.inspect}, for_site: #{@for_site.inspect}, id: #{@id.inspect},"\
  " modified_time: #{@modified_time.inspect}, org_id: #{@org_id.inspect}, site_id:"\
  " #{@site_id.inspect}, wifi: #{@wifi.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



127
128
129
130
131
132
# File 'lib/mist_api/models/ap_template.rb', line 127

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_matching: #{@ap_matching}, created_time: #{@created_time}, for_site:"\
  " #{@for_site}, id: #{@id}, modified_time: #{@modified_time}, org_id: #{@org_id}, site_id:"\
  " #{@site_id}, wifi: #{@wifi}, additional_properties: #{@additional_properties}>"
end