Class: MistApi::SynthetictestConfigVlan

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

Overview

SynthetictestConfigVlan 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(custom_test_urls = SKIP, disabled = false, probes = SKIP, vlan_ids = SKIP) ⇒ SynthetictestConfigVlan

Returns a new instance of SynthetictestConfigVlan.



53
54
55
56
57
58
59
# File 'lib/mist_api/models/synthetictest_config_vlan.rb', line 53

def initialize(custom_test_urls = SKIP, disabled = false, probes = SKIP,
               vlan_ids = SKIP)
  @custom_test_urls = custom_test_urls unless custom_test_urls == SKIP
  @disabled = disabled unless disabled == SKIP
  @probes = probes unless probes == SKIP
  @vlan_ids = vlan_ids unless vlan_ids == SKIP
end

Instance Attribute Details

#custom_test_urlsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def custom_test_urls
  @custom_test_urls
end

#disabledTrueClass | FalseClass

For some vlans where we don’t want this to run

Returns:

  • (TrueClass | FalseClass)


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

def disabled
  @disabled
end

#probesArray[String]

app name comes from ‘custom_probes` above or /const/synthetic_test_probes

Returns:

  • (Array[String])


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

def probes
  @probes
end

#vlan_idsArray[Object]

app name comes from ‘custom_probes` above or /const/synthetic_test_probes

Returns:

  • (Array[Object])


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

def vlan_ids
  @vlan_ids
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  custom_test_urls =
    hash.key?('custom_test_urls') ? hash['custom_test_urls'] : SKIP
  disabled = hash['disabled'] ||= false
  probes = hash.key?('probes') ? hash['probes'] : SKIP
  vlan_ids = hash.key?('vlan_ids') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:VlanIdWithVariable), hash['vlan_ids']
  ) : SKIP

  # Create object from extracted values.
  SynthetictestConfigVlan.new(custom_test_urls,
                              disabled,
                              probes,
                              vlan_ids)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/mist_api/models/synthetictest_config_vlan.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['custom_test_urls'] = 'custom_test_urls'
  @_hash['disabled'] = 'disabled'
  @_hash['probes'] = 'probes'
  @_hash['vlan_ids'] = 'vlan_ids'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/mist_api/models/synthetictest_config_vlan.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    custom_test_urls
    disabled
    probes
    vlan_ids
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



83
84
85
86
87
88
89
# File 'lib/mist_api/models/synthetictest_config_vlan.rb', line 83

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} custom_test_urls: #{@custom_test_urls.inspect}, disabled:"\
  " #{@disabled.inspect}, probes: #{@probes.inspect}, vlan_ids: #{@vlan_ids.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



92
93
94
95
96
# File 'lib/mist_api/models/synthetictest_config_vlan.rb', line 92

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} custom_test_urls: #{@custom_test_urls}, disabled: #{@disabled}, probes:"\
  " #{@probes}, vlan_ids: #{@vlan_ids}>"
end