Class: MistApi::NetworkInternetAccessDestinationNatProperty

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

Overview

NetworkInternetAccessDestinationNatProperty 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(internal_ip = SKIP, name = SKIP, port = SKIP, wan_name = SKIP) ⇒ NetworkInternetAccessDestinationNatProperty

Returns a new instance of NetworkInternetAccessDestinationNatProperty.



57
58
59
60
61
62
63
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 57

def initialize(internal_ip = SKIP, name = SKIP, port = SKIP,
               wan_name = SKIP)
  @internal_ip = internal_ip unless internal_ip == SKIP
  @name = name unless name == SKIP
  @port = port unless port == SKIP
  @wan_name = wan_name unless wan_name == SKIP
end

Instance Attribute Details

#internal_ipString

The Destination NAT destination IP Address. Must be an IP (i.e. “192.168.70.30”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


15
16
17
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 15

def internal_ip
  @internal_ip
end

#nameString

The Destination NAT destination IP Address. Must be an IP (i.e. “192.168.70.30”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


20
21
22
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 20

def name
  @name
end

#portString

The Destination NAT destination IP Address. Must be a Port (i.e. “443”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


25
26
27
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 25

def port
  @port
end

#wan_nameString

SRX Only. If not set, we configure the nat policies against all WAN ports for simplicity

Returns:

  • (String)


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

def wan_name
  @wan_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  internal_ip = hash.key?('internal_ip') ? hash['internal_ip'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  port = hash.key?('port') ? hash['port'] : SKIP
  wan_name = hash.key?('wan_name') ? hash['wan_name'] : SKIP

  # Create object from extracted values.
  NetworkInternetAccessDestinationNatProperty.new(internal_ip,
                                                  name,
                                                  port,
                                                  wan_name)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['internal_ip'] = 'internal_ip'
  @_hash['name'] = 'name'
  @_hash['port'] = 'port'
  @_hash['wan_name'] = 'wan_name'
  @_hash
end

.nullablesObject

An array for nullable fields



53
54
55
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 53

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
49
50
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 43

def self.optionals
  %w[
    internal_ip
    name
    port
    wan_name
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



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

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.



100
101
102
103
104
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 100

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} internal_ip: #{@internal_ip.inspect}, name: #{@name.inspect}, port:"\
  " #{@port.inspect}, wan_name: #{@wan_name.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



93
94
95
96
97
# File 'lib/mist_api/models/network_internet_access_destination_nat_property.rb', line 93

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} internal_ip: #{@internal_ip}, name: #{@name}, port: #{@port}, wan_name:"\
  " #{@wan_name}>"
end