Class: MistApi::RfDiag

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

Overview

RF Diag

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, type = nil, duration = 180, mac = SKIP, sdkclient_id = SKIP, additional_properties = nil) ⇒ RfDiag

Returns a new instance of RfDiag.



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

def initialize(name = nil, type = nil, duration = 180, mac = SKIP,
               sdkclient_id = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @duration = duration unless duration == SKIP
  @mac = mac unless mac == SKIP
  @name = name
  @sdkclient_id = sdkclient_id unless sdkclient_id == SKIP
  @type = type
  @additional_properties = additional_properties
end

Instance Attribute Details

#durationInteger

recording length in seconds, max is 180. Default value is also 180.

Returns:

  • (Integer)


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

def duration
  @duration
end

#macString

If ‘type`==`client` or `asset`, mac of the device

Returns:

  • (String)


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

def mac
  @mac
end

#nameString

Name of the recording, the name of the sdk client would be a good default choice

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/rf_diag.rb', line 23

def name
  @name
end

#sdkclient_idUUID | String

If ‘type`==`sdkclient`, sdkclient_id of this recording

Returns:

  • (UUID | String)


27
28
29
# File 'lib/mist_api/models/rf_diag.rb', line 27

def sdkclient_id
  @sdkclient_id
end

#typeRfClientTypeEnum

enum: ‘asset`, `client`, `sdkclient`

Returns:



31
32
33
# File 'lib/mist_api/models/rf_diag.rb', line 31

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



72
73
74
75
76
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/rf_diag.rb', line 72

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  duration = hash['duration'] ||= 180
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  sdkclient_id = hash.key?('sdkclient_id') ? hash['sdkclient_id'] : 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.
  RfDiag.new(name,
             type,
             duration,
             mac,
             sdkclient_id,
             additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
42
# File 'lib/mist_api/models/rf_diag.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['duration'] = 'duration'
  @_hash['mac'] = 'mac'
  @_hash['name'] = 'name'
  @_hash['sdkclient_id'] = 'sdkclient_id'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
# File 'lib/mist_api/models/rf_diag.rb', line 45

def self.optionals
  %w[
    duration
    mac
    sdkclient_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} duration: #{@duration.inspect}, mac: #{@mac.inspect}, name:"\
  " #{@name.inspect}, sdkclient_id: #{@sdkclient_id.inspect}, type: #{@type.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



99
100
101
102
103
# File 'lib/mist_api/models/rf_diag.rb', line 99

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} duration: #{@duration}, mac: #{@mac}, name: #{@name}, sdkclient_id:"\
  " #{@sdkclient_id}, type: #{@type}, additional_properties: #{@additional_properties}>"
end