Class: MistApi::MxtunnelIpsec

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

Overview

MxtunnelIpsec 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(dns_servers = SKIP, dns_suffix = SKIP, enabled = SKIP, extra_routes = SKIP, split_tunnel = SKIP, use_mxedge = SKIP) ⇒ MxtunnelIpsec

Returns a new instance of MxtunnelIpsec.



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

def initialize(dns_servers = SKIP, dns_suffix = SKIP, enabled = SKIP,
               extra_routes = SKIP, split_tunnel = SKIP, use_mxedge = SKIP)
  @dns_servers = dns_servers unless dns_servers == SKIP
  @dns_suffix = dns_suffix unless dns_suffix == SKIP
  @enabled = enabled unless enabled == SKIP
  @extra_routes = extra_routes unless extra_routes == SKIP
  @split_tunnel = split_tunnel unless split_tunnel == SKIP
  @use_mxedge = use_mxedge unless use_mxedge == SKIP
end

Instance Attribute Details

#dns_serversArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def dns_servers
  @dns_servers
end

#dns_suffixArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def dns_suffix
  @dns_suffix
end

#enabledTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#extra_routesArray[MxtunnelIpsecExtraRoute]

TODO: Write general description for this method

Returns:



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

def extra_routes
  @extra_routes
end

#split_tunnelTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def split_tunnel
  @split_tunnel
end

#use_mxedgeTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def use_mxedge
  @use_mxedge
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/mist_api/models/mxtunnel_ipsec.rb', line 78

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  dns_servers = hash.key?('dns_servers') ? hash['dns_servers'] : SKIP
  dns_suffix = hash.key?('dns_suffix') ? hash['dns_suffix'] : SKIP
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  # Parameter is an array, so we need to iterate through it
  extra_routes = nil
  unless hash['extra_routes'].nil?
    extra_routes = []
    hash['extra_routes'].each do |structure|
      extra_routes << (MxtunnelIpsecExtraRoute.from_hash(structure) if structure)
    end
  end

  extra_routes = SKIP unless hash.key?('extra_routes')
  split_tunnel = hash.key?('split_tunnel') ? hash['split_tunnel'] : SKIP
  use_mxedge = hash.key?('use_mxedge') ? hash['use_mxedge'] : SKIP

  # Create object from extracted values.
  MxtunnelIpsec.new(dns_servers,
                    dns_suffix,
                    enabled,
                    extra_routes,
                    split_tunnel,
                    use_mxedge)
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/mxtunnel_ipsec.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['dns_servers'] = 'dns_servers'
  @_hash['dns_suffix'] = 'dns_suffix'
  @_hash['enabled'] = 'enabled'
  @_hash['extra_routes'] = 'extra_routes'
  @_hash['split_tunnel'] = 'split_tunnel'
  @_hash['use_mxedge'] = 'use_mxedge'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
64
65
# File 'lib/mist_api/models/mxtunnel_ipsec.rb', line 61

def self.nullables
  %w[
    dns_servers
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    dns_servers
    dns_suffix
    enabled
    extra_routes
    split_tunnel
    use_mxedge
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



116
117
118
119
120
121
# File 'lib/mist_api/models/mxtunnel_ipsec.rb', line 116

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} dns_servers: #{@dns_servers.inspect}, dns_suffix: #{@dns_suffix.inspect},"\
  " enabled: #{@enabled.inspect}, extra_routes: #{@extra_routes.inspect}, split_tunnel:"\
  " #{@split_tunnel.inspect}, use_mxedge: #{@use_mxedge.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



108
109
110
111
112
113
# File 'lib/mist_api/models/mxtunnel_ipsec.rb', line 108

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} dns_servers: #{@dns_servers}, dns_suffix: #{@dns_suffix}, enabled:"\
  " #{@enabled}, extra_routes: #{@extra_routes}, split_tunnel: #{@split_tunnel}, use_mxedge:"\
  " #{@use_mxedge}>"
end