Class: MistApi::GatewayPathPreferencesPath

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

Overview

GatewayPathPreferencesPath 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(type = nil, cost = SKIP, disabled = SKIP, gateway_ip = SKIP, internet_access = SKIP, name = SKIP, networks = SKIP, target_ips = SKIP, wan_name = SKIP) ⇒ GatewayPathPreferencesPath

Returns a new instance of GatewayPathPreferencesPath.



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 84

def initialize(type = nil, cost = SKIP, disabled = SKIP, gateway_ip = SKIP,
               internet_access = SKIP, name = SKIP, networks = SKIP,
               target_ips = SKIP, wan_name = SKIP)
  @cost = cost unless cost == SKIP
  @disabled = disabled unless disabled == SKIP
  @gateway_ip = gateway_ip unless gateway_ip == SKIP
  @internet_access = internet_access unless internet_access == SKIP
  @name = name unless name == SKIP
  @networks = networks unless networks == SKIP
  @target_ips = target_ips unless target_ips == SKIP
  @type = type
  @wan_name = wan_name unless wan_name == SKIP
end

Instance Attribute Details

#costInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def cost
  @cost
end

#disabledTrueClass | FalseClass

For SSR Only. ‘true`, if this specific path is undesired

Returns:

  • (TrueClass | FalseClass)


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

def disabled
  @disabled
end

#gateway_ipString

Only if ‘type`==`local`, if a different gateway is desired

Returns:

  • (String)


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

def gateway_ip
  @gateway_ip
end

#internet_accessTrueClass | FalseClass

Only if ‘type`==`vpn`, if this vpn path can be used for internet

Returns:

  • (TrueClass | FalseClass)


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

def internet_access
  @internet_access
end

#nameString

Required when

* `type`==`vpn`: the name of the VPN Path to use 
* `type`==`wan`: the name of the WAN interface to use

Returns:

  • (String)


32
33
34
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 32

def name
  @name
end

#networksArray[String]

Required when ‘type`==`local`

Returns:

  • (Array[String])


36
37
38
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 36

def networks
  @networks
end

#target_ipsArray[String]

If ‘type`==`local`, if destination IP is to be replaced

Returns:

  • (Array[String])


40
41
42
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 40

def target_ips
  @target_ips
end

#typeGatewayPathTypeEnum

enum: ‘local`, `tunnel`, `vpn`, `wan`

Returns:



44
45
46
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 44

def type
  @type
end

#wan_nameString

Optional if ‘type`==`vpn`

Returns:

  • (String)


48
49
50
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 48

def wan_name
  @wan_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  type = hash.key?('type') ? hash['type'] : nil
  cost = hash.key?('cost') ? hash['cost'] : SKIP
  disabled = hash.key?('disabled') ? hash['disabled'] : SKIP
  gateway_ip = hash.key?('gateway_ip') ? hash['gateway_ip'] : SKIP
  internet_access =
    hash.key?('internet_access') ? hash['internet_access'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  networks = hash.key?('networks') ? hash['networks'] : SKIP
  target_ips = hash.key?('target_ips') ? hash['target_ips'] : SKIP
  wan_name = hash.key?('wan_name') ? hash['wan_name'] : SKIP

  # Create object from extracted values.
  GatewayPathPreferencesPath.new(type,
                                 cost,
                                 disabled,
                                 gateway_ip,
                                 internet_access,
                                 name,
                                 networks,
                                 target_ips,
                                 wan_name)
end

.namesObject

A mapping from model property names to API property names.



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 51

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cost'] = 'cost'
  @_hash['disabled'] = 'disabled'
  @_hash['gateway_ip'] = 'gateway_ip'
  @_hash['internet_access'] = 'internet_access'
  @_hash['name'] = 'name'
  @_hash['networks'] = 'networks'
  @_hash['target_ips'] = 'target_ips'
  @_hash['type'] = 'type'
  @_hash['wan_name'] = 'wan_name'
  @_hash
end

.nullablesObject

An array for nullable fields



80
81
82
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 80

def self.nullables
  []
end

.optionalsObject

An array for optional fields



66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 66

def self.optionals
  %w[
    cost
    disabled
    gateway_ip
    internet_access
    name
    networks
    target_ips
    wan_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



135
136
137
138
139
140
141
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 135

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cost: #{@cost.inspect}, disabled: #{@disabled.inspect}, gateway_ip:"\
  " #{@gateway_ip.inspect}, internet_access: #{@internet_access.inspect}, name:"\
  " #{@name.inspect}, networks: #{@networks.inspect}, target_ips: #{@target_ips.inspect},"\
  " type: #{@type.inspect}, wan_name: #{@wan_name.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



127
128
129
130
131
132
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 127

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cost: #{@cost}, disabled: #{@disabled}, gateway_ip: #{@gateway_ip},"\
  " internet_access: #{@internet_access}, name: #{@name}, networks: #{@networks}, target_ips:"\
  " #{@target_ips}, type: #{@type}, wan_name: #{@wan_name}>"
end