Class: MistApi::ResponsePcapSearchItem

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

Overview

ResponsePcapSearchItem 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(timestamp = nil, type = nil, url = nil, ap_macs = SKIP, aps = SKIP, duration = SKIP, format = SKIP, id = SKIP, last_seen = SKIP, max_num_packets = SKIP, mxedges = SKIP, org_id = SKIP, pcap_aps = SKIP, pcap_url = SKIP, site_id = SKIP, termination_reason = SKIP) ⇒ ResponsePcapSearchItem

Returns a new instance of ResponsePcapSearchItem.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 122

def initialize(timestamp = nil, type = nil, url = nil, ap_macs = SKIP,
               aps = SKIP, duration = SKIP, format = SKIP, id = SKIP,
               last_seen = SKIP, max_num_packets = SKIP, mxedges = SKIP,
               org_id = SKIP, pcap_aps = SKIP, pcap_url = SKIP,
               site_id = SKIP, termination_reason = SKIP)
  @ap_macs = ap_macs unless ap_macs == SKIP
  @aps = aps unless aps == SKIP
  @duration = duration unless duration == SKIP
  @format = format unless format == SKIP
  @id = id unless id == SKIP
  @last_seen = last_seen unless last_seen == SKIP
  @max_num_packets = max_num_packets unless max_num_packets == SKIP
  @mxedges = mxedges unless mxedges == SKIP
  @org_id = org_id unless org_id == SKIP
  @pcap_aps = pcap_aps unless pcap_aps == SKIP
  @pcap_url = pcap_url unless pcap_url == SKIP
  @site_id = site_id unless site_id == SKIP
  @termination_reason = termination_reason unless termination_reason == SKIP
  @timestamp = timestamp
  @type = type
  @url = url
end

Instance Attribute Details

#ap_macsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def ap_macs
  @ap_macs
end

#apsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def aps
  @aps
end

#durationFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def duration
  @duration
end

#formatString

TODO: Write general description for this method

Returns:

  • (String)


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

def format
  @format
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#last_seenFloat

Last seen timestamp of the capture

Returns:

  • (Float)


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

def last_seen
  @last_seen
end

#max_num_packetsFloat

Last seen timestamp of the capture

Returns:

  • (Float)


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

def max_num_packets
  @max_num_packets
end

#mxedgesArray[String]

List of Mist Edge IDs included in the capture

Returns:

  • (Array[String])


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

def mxedges
  @mxedges
end

#org_idUUID | String

List of Mist Edge IDs included in the capture

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#pcap_apsHash[String, ResponsePcapSearchItemPcapApsItem]

List of Mist Edge IDs included in the capture

Returns:



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

def pcap_aps
  @pcap_aps
end

#pcap_urlString

List of Mist Edge IDs included in the capture

Returns:

  • (String)


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

def pcap_url
  @pcap_url
end

#site_idUUID | String

List of Mist Edge IDs included in the capture

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#termination_reasonString

List of Mist Edge IDs included in the capture

Returns:

  • (String)


62
63
64
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 62

def termination_reason
  @termination_reason
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


66
67
68
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 66

def timestamp
  @timestamp
end

#typeString

Epoch (seconds)

Returns:

  • (String)


70
71
72
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 70

def type
  @type
end

#urlString

Epoch (seconds)

Returns:

  • (String)


74
75
76
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 74

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 146

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  url = hash.key?('url') ? hash['url'] : nil
  ap_macs = hash.key?('ap_macs') ? hash['ap_macs'] : SKIP
  aps = hash.key?('aps') ? hash['aps'] : SKIP
  duration = hash.key?('duration') ? hash['duration'] : SKIP
  format = hash.key?('format') ? hash['format'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP
  max_num_packets =
    hash.key?('max_num_packets') ? hash['max_num_packets'] : SKIP
  mxedges = hash.key?('mxedges') ? hash['mxedges'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  pcap_aps = ResponsePcapSearchItemPcapApsItem.from_hash(hash['pcap_aps']) if hash['pcap_aps']

  pcap_aps = SKIP unless hash.key?('pcap_aps')
  pcap_url = hash.key?('pcap_url') ? hash['pcap_url'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  termination_reason =
    hash.key?('termination_reason') ? hash['termination_reason'] : SKIP

  # Create object from extracted values.
  ResponsePcapSearchItem.new(timestamp,
                             type,
                             url,
                             ap_macs,
                             aps,
                             duration,
                             format,
                             id,
                             last_seen,
                             max_num_packets,
                             mxedges,
                             org_id,
                             pcap_aps,
                             pcap_url,
                             site_id,
                             termination_reason)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap_macs'] = 'ap_macs'
  @_hash['aps'] = 'aps'
  @_hash['duration'] = 'duration'
  @_hash['format'] = 'format'
  @_hash['id'] = 'id'
  @_hash['last_seen'] = 'last_seen'
  @_hash['max_num_packets'] = 'max_num_packets'
  @_hash['mxedges'] = 'mxedges'
  @_hash['org_id'] = 'org_id'
  @_hash['pcap_aps'] = 'pcap_aps'
  @_hash['pcap_url'] = 'pcap_url'
  @_hash['site_id'] = 'site_id'
  @_hash['termination_reason'] = 'termination_reason'
  @_hash['timestamp'] = 'timestamp'
  @_hash['type'] = 'type'
  @_hash['url'] = 'url'
  @_hash
end

.nullablesObject

An array for nullable fields



118
119
120
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 118

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    ap_macs
    aps
    duration
    format
    id
    last_seen
    max_num_packets
    mxedges
    org_id
    pcap_aps
    pcap_url
    site_id
    termination_reason
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



201
202
203
204
205
206
207
208
209
210
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 201

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_macs: #{@ap_macs.inspect}, aps: #{@aps.inspect}, duration:"\
  " #{@duration.inspect}, format: #{@format.inspect}, id: #{@id.inspect}, last_seen:"\
  " #{@last_seen.inspect}, max_num_packets: #{@max_num_packets.inspect}, mxedges:"\
  " #{@mxedges.inspect}, org_id: #{@org_id.inspect}, pcap_aps: #{@pcap_aps.inspect}, pcap_url:"\
  " #{@pcap_url.inspect}, site_id: #{@site_id.inspect}, termination_reason:"\
  " #{@termination_reason.inspect}, timestamp: #{@timestamp.inspect}, type: #{@type.inspect},"\
  " url: #{@url.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



191
192
193
194
195
196
197
198
# File 'lib/mist_api/models/response_pcap_search_item.rb', line 191

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_macs: #{@ap_macs}, aps: #{@aps}, duration: #{@duration}, format:"\
  " #{@format}, id: #{@id}, last_seen: #{@last_seen}, max_num_packets: #{@max_num_packets},"\
  " mxedges: #{@mxedges}, org_id: #{@org_id}, pcap_aps: #{@pcap_aps}, pcap_url: #{@pcap_url},"\
  " site_id: #{@site_id}, termination_reason: #{@termination_reason}, timestamp:"\
  " #{@timestamp}, type: #{@type}, url: #{@url}>"
end