Class: OCI::Core::Models::PhaseTwoConfigDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/core/models/phase_two_config_details.rb

Overview

Phase 2 Configuration Details

Constant Summary collapse

AUTHENTICATION_ALGORITHM_ENUM =
[
  AUTHENTICATION_ALGORITHM_HMAC_SHA2_256_128 = 'HMAC_SHA2_256_128'.freeze,
  AUTHENTICATION_ALGORITHM_HMAC_SHA1_128 = 'HMAC_SHA1_128'.freeze
].freeze
ENCRYPTION_ALGORITHM_ENUM =
[
  ENCRYPTION_ALGORITHM_AES_256_GCM = 'AES_256_GCM'.freeze,
  ENCRYPTION_ALGORITHM_AES_192_GCM = 'AES_192_GCM'.freeze,
  ENCRYPTION_ALGORITHM_AES_128_GCM = 'AES_128_GCM'.freeze,
  ENCRYPTION_ALGORITHM_AES_256_CBC = 'AES_256_CBC'.freeze,
  ENCRYPTION_ALGORITHM_AES_192_CBC = 'AES_192_CBC'.freeze,
  ENCRYPTION_ALGORITHM_AES_128_CBC = 'AES_128_CBC'.freeze
].freeze
PFS_DH_GROUP_ENUM =
[
  PFS_DH_GROUP_GROUP2 = 'GROUP2'.freeze,
  PFS_DH_GROUP_GROUP5 = 'GROUP5'.freeze,
  PFS_DH_GROUP_GROUP14 = 'GROUP14'.freeze,
  PFS_DH_GROUP_GROUP19 = 'GROUP19'.freeze,
  PFS_DH_GROUP_GROUP20 = 'GROUP20'.freeze,
  PFS_DH_GROUP_GROUP24 = 'GROUP24'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PhaseTwoConfigDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/oci/core/models/phase_two_config_details.rb', line 99

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.is_custom_phase_two_config = attributes[:'isCustomPhaseTwoConfig'] unless attributes[:'isCustomPhaseTwoConfig'].nil?

  raise 'You cannot provide both :isCustomPhaseTwoConfig and :is_custom_phase_two_config' if attributes.key?(:'isCustomPhaseTwoConfig') && attributes.key?(:'is_custom_phase_two_config')

  self.is_custom_phase_two_config = attributes[:'is_custom_phase_two_config'] unless attributes[:'is_custom_phase_two_config'].nil?

  self.authentication_algorithm = attributes[:'authenticationAlgorithm'] if attributes[:'authenticationAlgorithm']

  raise 'You cannot provide both :authenticationAlgorithm and :authentication_algorithm' if attributes.key?(:'authenticationAlgorithm') && attributes.key?(:'authentication_algorithm')

  self.authentication_algorithm = attributes[:'authentication_algorithm'] if attributes[:'authentication_algorithm']

  self.encryption_algorithm = attributes[:'encryptionAlgorithm'] if attributes[:'encryptionAlgorithm']

  raise 'You cannot provide both :encryptionAlgorithm and :encryption_algorithm' if attributes.key?(:'encryptionAlgorithm') && attributes.key?(:'encryption_algorithm')

  self.encryption_algorithm = attributes[:'encryption_algorithm'] if attributes[:'encryption_algorithm']

  self.lifetime_in_seconds = attributes[:'lifetimeInSeconds'] if attributes[:'lifetimeInSeconds']

  raise 'You cannot provide both :lifetimeInSeconds and :lifetime_in_seconds' if attributes.key?(:'lifetimeInSeconds') && attributes.key?(:'lifetime_in_seconds')

  self.lifetime_in_seconds = attributes[:'lifetime_in_seconds'] if attributes[:'lifetime_in_seconds']

  self.is_pfs_enabled = attributes[:'isPfsEnabled'] unless attributes[:'isPfsEnabled'].nil?

  raise 'You cannot provide both :isPfsEnabled and :is_pfs_enabled' if attributes.key?(:'isPfsEnabled') && attributes.key?(:'is_pfs_enabled')

  self.is_pfs_enabled = attributes[:'is_pfs_enabled'] unless attributes[:'is_pfs_enabled'].nil?

  self.pfs_dh_group = attributes[:'pfsDhGroup'] if attributes[:'pfsDhGroup']

  raise 'You cannot provide both :pfsDhGroup and :pfs_dh_group' if attributes.key?(:'pfsDhGroup') && attributes.key?(:'pfs_dh_group')

  self.pfs_dh_group = attributes[:'pfs_dh_group'] if attributes[:'pfs_dh_group']
end

Instance Attribute Details

#authentication_algorithmString

Phase two authentication algorithm supported during tunnel negotiation.

Returns:

  • (String)


40
41
42
# File 'lib/oci/core/models/phase_two_config_details.rb', line 40

def authentication_algorithm
  @authentication_algorithm
end

#encryption_algorithmString

Phase two encryption algorithm supported during tunnel negotiation.

Returns:

  • (String)


45
46
47
# File 'lib/oci/core/models/phase_two_config_details.rb', line 45

def encryption_algorithm
  @encryption_algorithm
end

#is_custom_phase_two_configBOOLEAN

Indicates whether custom phase two configuration is enabled.

Returns:

  • (BOOLEAN)


35
36
37
# File 'lib/oci/core/models/phase_two_config_details.rb', line 35

def is_custom_phase_two_config
  @is_custom_phase_two_config
end

#is_pfs_enabledBOOLEAN

Indicates whether perfect forward secrecy (PFS) is enabled.

Returns:

  • (BOOLEAN)


53
54
55
# File 'lib/oci/core/models/phase_two_config_details.rb', line 53

def is_pfs_enabled
  @is_pfs_enabled
end

#lifetime_in_secondsInteger

Lifetime in seconds for IPSec phase two.

Returns:

  • (Integer)


49
50
51
# File 'lib/oci/core/models/phase_two_config_details.rb', line 49

def lifetime_in_seconds
  @lifetime_in_seconds
end

#pfs_dh_groupString

Diffie-Hellman group used for PFS.

Returns:

  • (String)


57
58
59
# File 'lib/oci/core/models/phase_two_config_details.rb', line 57

def pfs_dh_group
  @pfs_dh_group
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/oci/core/models/phase_two_config_details.rb', line 60

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'is_custom_phase_two_config': :'isCustomPhaseTwoConfig',
    'authentication_algorithm': :'authenticationAlgorithm',
    'encryption_algorithm': :'encryptionAlgorithm',
    'lifetime_in_seconds': :'lifetimeInSeconds',
    'is_pfs_enabled': :'isPfsEnabled',
    'pfs_dh_group': :'pfsDhGroup'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/core/models/phase_two_config_details.rb', line 74

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'is_custom_phase_two_config': :'BOOLEAN',
    'authentication_algorithm': :'String',
    'encryption_algorithm': :'String',
    'lifetime_in_seconds': :'Integer',
    'is_pfs_enabled': :'BOOLEAN',
    'pfs_dh_group': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



173
174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/core/models/phase_two_config_details.rb', line 173

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    is_custom_phase_two_config == other.is_custom_phase_two_config &&
    authentication_algorithm == other.authentication_algorithm &&
    encryption_algorithm == other.encryption_algorithm &&
    lifetime_in_seconds == other.lifetime_in_seconds &&
    is_pfs_enabled == other.is_pfs_enabled &&
    pfs_dh_group == other.pfs_dh_group
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/core/models/phase_two_config_details.rb', line 208

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


188
189
190
# File 'lib/oci/core/models/phase_two_config_details.rb', line 188

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



197
198
199
# File 'lib/oci/core/models/phase_two_config_details.rb', line 197

def hash
  [is_custom_phase_two_config, authentication_algorithm, encryption_algorithm, lifetime_in_seconds, is_pfs_enabled, pfs_dh_group].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/core/models/phase_two_config_details.rb', line 241

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



235
236
237
# File 'lib/oci/core/models/phase_two_config_details.rb', line 235

def to_s
  to_hash.to_s
end