Class: MistApi::TunnelConfigIpsecProposal

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

Overview

TunnelConfigIpsecProposal 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(auth_algo = SKIP, dh_group = TunnelConfigDhGroupEnum::ENUM_14, enc_algo = TunnelConfigEncAlgoEnum::AES256) ⇒ TunnelConfigIpsecProposal

Returns a new instance of TunnelConfigIpsecProposal.



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

def initialize(auth_algo = SKIP,
               dh_group = TunnelConfigDhGroupEnum::ENUM_14,
               enc_algo = TunnelConfigEncAlgoEnum::AES256)
  @auth_algo = auth_algo unless auth_algo == SKIP
  @dh_group = dh_group unless dh_group == SKIP
  @enc_algo = enc_algo unless enc_algo == SKIP
end

Instance Attribute Details

#auth_algoTunnelConfigAuthAlgoEnum

enum: ‘md5`, `sha1`, `sha2`



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

def auth_algo
  @auth_algo
end

#dh_groupTunnelConfigDhGroupEnum

Only if ‘provider`==`custom-ipsec`. enum:

* 1
* 2 (1024-bit)
* 5
* 14 (default, 2048-bit)
* 15 (3072-bit)
* 16 (4096-bit)
* 19 (256-bit ECP)
* 20 (384-bit ECP)
* 21 (521-bit ECP)
* 24 (2048-bit ECP)


28
29
30
# File 'lib/mist_api/models/tunnel_config_ipsec_proposal.rb', line 28

def dh_group
  @dh_group
end

#enc_algoTunnelConfigEncAlgoEnum

enum: ‘3des`, `aes128`, `aes256`, `aes_gcm128`, `aes_gcm256`



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

def enc_algo
  @enc_algo
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  auth_algo = hash.key?('auth_algo') ? hash['auth_algo'] : SKIP
  dh_group = hash['dh_group'] ||= TunnelConfigDhGroupEnum::ENUM_14
  enc_algo = hash['enc_algo'] ||= TunnelConfigEncAlgoEnum::AES256

  # Create object from extracted values.
  TunnelConfigIpsecProposal.new(auth_algo,
                                dh_group,
                                enc_algo)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
# File 'lib/mist_api/models/tunnel_config_ipsec_proposal.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['auth_algo'] = 'auth_algo'
  @_hash['dh_group'] = 'dh_group'
  @_hash['enc_algo'] = 'enc_algo'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    enc_algo
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    auth_algo
    dh_group
    enc_algo
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



89
90
91
92
93
# File 'lib/mist_api/models/tunnel_config_ipsec_proposal.rb', line 89

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

#to_sObject

Provides a human-readable string representation of the object.



83
84
85
86
# File 'lib/mist_api/models/tunnel_config_ipsec_proposal.rb', line 83

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} auth_algo: #{@auth_algo}, dh_group: #{@dh_group}, enc_algo: #{@enc_algo}>"
end