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

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

Overview

Configuration details for IPSec phase two configuration parameters.

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):



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
141
142
# File 'lib/oci/core/models/phase_two_config_details.rb', line 101

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

The authentication algorithm proposed during phase two tunnel negotiation.

Returns:

  • (String)


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

def authentication_algorithm
  @authentication_algorithm
end

#encryption_algorithmString

The encryption algorithm proposed during phase two tunnel negotiation.

Returns:

  • (String)


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

def encryption_algorithm
  @encryption_algorithm
end

#is_custom_phase_two_configBOOLEAN

Indicates whether custom configuration is enabled for phase two options.

Returns:

  • (BOOLEAN)


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

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)


55
56
57
# File 'lib/oci/core/models/phase_two_config_details.rb', line 55

def is_pfs_enabled
  @is_pfs_enabled
end

#lifetime_in_secondsInteger

Lifetime in seconds for the IPSec session key set in phase two. The default is 3600 which is equivalent to 1 hour.

Returns:

  • (Integer)


51
52
53
# File 'lib/oci/core/models/phase_two_config_details.rb', line 51

def lifetime_in_seconds
  @lifetime_in_seconds
end

#pfs_dh_groupString

The Diffie-Hellman group used for PFS, if PFS is enabled.

Returns:

  • (String)


59
60
61
# File 'lib/oci/core/models/phase_two_config_details.rb', line 59

def pfs_dh_group
  @pfs_dh_group
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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


190
191
192
# File 'lib/oci/core/models/phase_two_config_details.rb', line 190

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



199
200
201
# File 'lib/oci/core/models/phase_two_config_details.rb', line 199

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



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

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



237
238
239
# File 'lib/oci/core/models/phase_two_config_details.rb', line 237

def to_s
  to_hash.to_s
end