Class: MistApi::SynthetictestConfig

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

Overview

SynthetictestConfig 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(aggressiveness = SynthetictestConfigAggressivenessEnum::AUTO, custom_probes = SKIP, disabled = false, lan_networks = SKIP, vlans = SKIP, wan_speedtest = SKIP) ⇒ SynthetictestConfig

Returns a new instance of SynthetictestConfig.



65
66
67
68
69
70
71
72
73
74
# File 'lib/mist_api/models/synthetictest_config.rb', line 65

def initialize(aggressiveness = SynthetictestConfigAggressivenessEnum::AUTO,
               custom_probes = SKIP, disabled = false, lan_networks = SKIP,
               vlans = SKIP, wan_speedtest = SKIP)
  @aggressiveness = aggressiveness unless aggressiveness == SKIP
  @custom_probes = custom_probes unless custom_probes == SKIP
  @disabled = disabled unless disabled == SKIP
  @lan_networks = lan_networks unless lan_networks == SKIP
  @vlans = vlans unless vlans == SKIP
  @wan_speedtest = wan_speedtest unless wan_speedtest == SKIP
end

Instance Attribute Details

#aggressivenessSynthetictestConfigAggressivenessEnum

enum: ‘auto`, `high`, `low`



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

def aggressiveness
  @aggressiveness
end

#custom_probesHash[String, SynthetictestConfigCustomProbe]

Custom probes to be used for synthetic tests

Returns:



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

def custom_probes
  @custom_probes
end

#disabledTrueClass | FalseClass

Custom probes to be used for synthetic tests

Returns:

  • (TrueClass | FalseClass)


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

def disabled
  @disabled
end

#lan_networksArray[SynthetictestConfigLanNetwork]

List of networks to be used for synthetic tests

Returns:



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

def lan_networks
  @lan_networks
end

#vlansArray[SynthetictestConfigVlan]

List of networks to be used for synthetic tests

Returns:



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

def vlans
  @vlans
end

#wan_speedtestSynthetictestConfigWanSpeedtest

List of networks to be used for synthetic tests



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

def wan_speedtest
  @wan_speedtest
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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
# File 'lib/mist_api/models/synthetictest_config.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  aggressiveness =
    hash['aggressiveness'] ||= SynthetictestConfigAggressivenessEnum::AUTO
  custom_probes = SynthetictestConfigCustomProbe.from_hash(hash['custom_probes']) if
    hash['custom_probes']

  custom_probes = SKIP unless hash.key?('custom_probes')
  disabled = hash['disabled'] ||= false
  # Parameter is an array, so we need to iterate through it
  lan_networks = nil
  unless hash['lan_networks'].nil?
    lan_networks = []
    hash['lan_networks'].each do |structure|
      lan_networks << (SynthetictestConfigLanNetwork.from_hash(structure) if structure)
    end
  end

  lan_networks = SKIP unless hash.key?('lan_networks')
  # Parameter is an array, so we need to iterate through it
  vlans = nil
  unless hash['vlans'].nil?
    vlans = []
    hash['vlans'].each do |structure|
      vlans << (SynthetictestConfigVlan.from_hash(structure) if structure)
    end
  end

  vlans = SKIP unless hash.key?('vlans')
  wan_speedtest = SynthetictestConfigWanSpeedtest.from_hash(hash['wan_speedtest']) if
    hash['wan_speedtest']

  # Create object from extracted values.
  SynthetictestConfig.new(aggressiveness,
                          custom_probes,
                          disabled,
                          lan_networks,
                          vlans,
                          wan_speedtest)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/synthetictest_config.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['aggressiveness'] = 'aggressiveness'
  @_hash['custom_probes'] = 'custom_probes'
  @_hash['disabled'] = 'disabled'
  @_hash['lan_networks'] = 'lan_networks'
  @_hash['vlans'] = 'vlans'
  @_hash['wan_speedtest'] = 'wan_speedtest'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/mist_api/models/synthetictest_config.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/mist_api/models/synthetictest_config.rb', line 49

def self.optionals
  %w[
    aggressiveness
    custom_probes
    disabled
    lan_networks
    vlans
    wan_speedtest
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



129
130
131
132
133
134
135
# File 'lib/mist_api/models/synthetictest_config.rb', line 129

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} aggressiveness: #{@aggressiveness.inspect}, custom_probes:"\
  " #{@custom_probes.inspect}, disabled: #{@disabled.inspect}, lan_networks:"\
  " #{@lan_networks.inspect}, vlans: #{@vlans.inspect}, wan_speedtest:"\
  " #{@wan_speedtest.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



121
122
123
124
125
126
# File 'lib/mist_api/models/synthetictest_config.rb', line 121

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} aggressiveness: #{@aggressiveness}, custom_probes: #{@custom_probes},"\
  " disabled: #{@disabled}, lan_networks: #{@lan_networks}, vlans: #{@vlans}, wan_speedtest:"\
  " #{@wan_speedtest}>"
end