Class: MistApi::GatewayPathPreferencesPath
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::GatewayPathPreferencesPath
- Defined in:
- lib/mist_api/models/gateway_path_preferences_path.rb
Overview
GatewayPathPreferencesPath Model.
Instance Attribute Summary collapse
-
#cost ⇒ Integer
TODO: Write general description for this method.
-
#disabled ⇒ TrueClass | FalseClass
For SSR Only.
-
#gateway_ip ⇒ String
Only if ‘type`==`local`, if a different gateway is desired.
-
#internet_access ⇒ TrueClass | FalseClass
Only if ‘type`==`vpn`, if this vpn path can be used for internet.
-
#name ⇒ String
Required when * ‘type`==`vpn`: the name of the VPN Path to use * `type`==`wan`: the name of the WAN interface to use.
-
#networks ⇒ Array[String]
Required when ‘type`==`local`.
-
#target_ips ⇒ Array[String]
If ‘type`==`local`, if destination IP is to be replaced.
-
#type ⇒ GatewayPathTypeEnum
enum: ‘local`, `tunnel`, `vpn`, `wan`.
-
#wan_name ⇒ String
Optional if ‘type`==`vpn`.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(type = nil, cost = SKIP, disabled = SKIP, gateway_ip = SKIP, internet_access = SKIP, name = SKIP, networks = SKIP, target_ips = SKIP, wan_name = SKIP) ⇒ GatewayPathPreferencesPath
constructor
A new instance of GatewayPathPreferencesPath.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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
#cost ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 14 def cost @cost end |
#disabled ⇒ TrueClass | FalseClass
For SSR Only. ‘true`, if this specific path is undesired
18 19 20 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 18 def disabled @disabled end |
#gateway_ip ⇒ String
Only if ‘type`==`local`, if a different gateway is desired
22 23 24 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 22 def gateway_ip @gateway_ip end |
#internet_access ⇒ TrueClass | FalseClass
Only if ‘type`==`vpn`, if this vpn path can be used for internet
26 27 28 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 26 def internet_access @internet_access end |
#name ⇒ String
Required when
* `type`==`vpn`: the name of the VPN Path to use
* `type`==`wan`: the name of the WAN interface to use
32 33 34 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 32 def name @name end |
#networks ⇒ Array[String]
Required when ‘type`==`local`
36 37 38 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 36 def networks @networks end |
#target_ips ⇒ Array[String]
If ‘type`==`local`, if destination IP is to be replaced
40 41 42 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 40 def target_ips @target_ips end |
#type ⇒ GatewayPathTypeEnum
enum: ‘local`, `tunnel`, `vpn`, `wan`
44 45 46 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 44 def type @type end |
#wan_name ⇒ String
Optional if ‘type`==`vpn`
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
80 81 82 |
# File 'lib/mist_api/models/gateway_path_preferences_path.rb', line 80 def self.nullables [] end |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |