Class: MistApi::ServicePathEvent

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

Overview

ServicePathEvent 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(mac = SKIP, model = SKIP, org_id = SKIP, policy = SKIP, port_id = SKIP, site_id = SKIP, text = SKIP, timestamp = SKIP, type = SKIP, version = SKIP, vpn_name = SKIP, vpn_path = SKIP) ⇒ ServicePathEvent

Returns a new instance of ServicePathEvent.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/mist_api/models/service_path_event.rb', line 101

def initialize(mac = SKIP, model = SKIP, org_id = SKIP, policy = SKIP,
               port_id = SKIP, site_id = SKIP, text = SKIP,
               timestamp = SKIP, type = SKIP, version = SKIP,
               vpn_name = SKIP, vpn_path = SKIP)
  @mac = mac unless mac == SKIP
  @model = model unless model == SKIP
  @org_id = org_id unless org_id == SKIP
  @policy = policy unless policy == SKIP
  @port_id = port_id unless port_id == SKIP
  @site_id = site_id unless site_id == SKIP
  @text = text unless text == SKIP
  @timestamp = timestamp unless timestamp == SKIP
  @type = type unless type == SKIP
  @version = version unless version == SKIP
  @vpn_name = vpn_name unless vpn_name == SKIP
  @vpn_path = vpn_path unless vpn_path == SKIP
end

Instance Attribute Details

#macString

TODO: Write general description for this method

Returns:

  • (String)


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

def mac
  @mac
end

#modelString

TODO: Write general description for this method

Returns:

  • (String)


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

def model
  @model
end

#org_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#policyString

TODO: Write general description for this method

Returns:

  • (String)


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

def policy
  @policy
end

#port_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def port_id
  @port_id
end

#site_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#textString

TODO: Write general description for this method

Returns:

  • (String)


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

def text
  @text
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

#typeString

Epoch (seconds)

Returns:

  • (String)


46
47
48
# File 'lib/mist_api/models/service_path_event.rb', line 46

def type
  @type
end

#versionString

Epoch (seconds)

Returns:

  • (String)


50
51
52
# File 'lib/mist_api/models/service_path_event.rb', line 50

def version
  @version
end

#vpn_nameString

Epoch (seconds)

Returns:

  • (String)


54
55
56
# File 'lib/mist_api/models/service_path_event.rb', line 54

def vpn_name
  @vpn_name
end

#vpn_pathString

Epoch (seconds)

Returns:

  • (String)


58
59
60
# File 'lib/mist_api/models/service_path_event.rb', line 58

def vpn_path
  @vpn_path
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/mist_api/models/service_path_event.rb', line 120

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  model = hash.key?('model') ? hash['model'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  policy = hash.key?('policy') ? hash['policy'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  text = hash.key?('text') ? hash['text'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  vpn_name = hash.key?('vpn_name') ? hash['vpn_name'] : SKIP
  vpn_path = hash.key?('vpn_path') ? hash['vpn_path'] : SKIP

  # Create object from extracted values.
  ServicePathEvent.new(mac,
                       model,
                       org_id,
                       policy,
                       port_id,
                       site_id,
                       text,
                       timestamp,
                       type,
                       version,
                       vpn_name,
                       vpn_path)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mist_api/models/service_path_event.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mac'] = 'mac'
  @_hash['model'] = 'model'
  @_hash['org_id'] = 'org_id'
  @_hash['policy'] = 'policy'
  @_hash['port_id'] = 'port_id'
  @_hash['site_id'] = 'site_id'
  @_hash['text'] = 'text'
  @_hash['timestamp'] = 'timestamp'
  @_hash['type'] = 'type'
  @_hash['version'] = 'version'
  @_hash['vpn_name'] = 'vpn_name'
  @_hash['vpn_path'] = 'vpn_path'
  @_hash
end

.nullablesObject

An array for nullable fields



97
98
99
# File 'lib/mist_api/models/service_path_event.rb', line 97

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/mist_api/models/service_path_event.rb', line 79

def self.optionals
  %w[
    mac
    model
    org_id
    policy
    port_id
    site_id
    text
    timestamp
    type
    version
    vpn_name
    vpn_path
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



161
162
163
164
165
166
167
# File 'lib/mist_api/models/service_path_event.rb', line 161

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mac: #{@mac.inspect}, model: #{@model.inspect}, org_id: #{@org_id.inspect},"\
  " policy: #{@policy.inspect}, port_id: #{@port_id.inspect}, site_id: #{@site_id.inspect},"\
  " text: #{@text.inspect}, timestamp: #{@timestamp.inspect}, type: #{@type.inspect}, version:"\
  " #{@version.inspect}, vpn_name: #{@vpn_name.inspect}, vpn_path: #{@vpn_path.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



153
154
155
156
157
158
# File 'lib/mist_api/models/service_path_event.rb', line 153

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mac: #{@mac}, model: #{@model}, org_id: #{@org_id}, policy: #{@policy},"\
  " port_id: #{@port_id}, site_id: #{@site_id}, text: #{@text}, timestamp: #{@timestamp},"\
  " type: #{@type}, version: #{@version}, vpn_name: #{@vpn_name}, vpn_path: #{@vpn_path}>"
end