Class: OCI::Core::Models::TunnelPhaseTwoDetails

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

Overview

IPsec tunnel detail information specific to phase two.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TunnelPhaseTwoDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 125

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.lifetime = attributes[:'lifetime'] if attributes[:'lifetime']

  self.remaining_lifetime = attributes[:'remainingLifetime'] if attributes[:'remainingLifetime']

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

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

  self.custom_authentication_algorithm = attributes[:'customAuthenticationAlgorithm'] if attributes[:'customAuthenticationAlgorithm']

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

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

  self.negotiated_authentication_algorithm = attributes[:'negotiatedAuthenticationAlgorithm'] if attributes[:'negotiatedAuthenticationAlgorithm']

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

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

  self.custom_encryption_algorithm = attributes[:'customEncryptionAlgorithm'] if attributes[:'customEncryptionAlgorithm']

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

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

  self.negotiated_encryption_algorithm = attributes[:'negotiatedEncryptionAlgorithm'] if attributes[:'negotiatedEncryptionAlgorithm']

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

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

  self.dh_group = attributes[:'dhGroup'] if attributes[:'dhGroup']

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

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

  self.negotiated_dh_group = attributes[:'negotiatedDhGroup'] if attributes[:'negotiatedDhGroup']

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

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

  self.is_esp_established = attributes[:'isEspEstablished'] unless attributes[:'isEspEstablished'].nil?

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

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

  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.remaining_lifetime_last_retrieved = attributes[:'remainingLifetimeLastRetrieved'] if attributes[:'remainingLifetimeLastRetrieved']

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

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

Instance Attribute Details

#custom_authentication_algorithmString

Phase two authentication algorithm proposed during tunnel negotiation.

Returns:

  • (String)


28
29
30
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 28

def custom_authentication_algorithm
  @custom_authentication_algorithm
end

#custom_encryption_algorithmString

The proposed custom phase two encryption algorithm.

Returns:

  • (String)


37
38
39
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 37

def custom_encryption_algorithm
  @custom_encryption_algorithm
end

#dh_groupString

The proposed Diffie-Hellman group.

Returns:

  • (String)


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

def dh_group
  @dh_group
end

#is_custom_phase_two_configBOOLEAN

Indicates whether custom phase two configuration is enabled. If this option is not enabled, default settings are proposed.

Returns:

  • (BOOLEAN)


15
16
17
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 15

def is_custom_phase_two_config
  @is_custom_phase_two_config
end

#is_esp_establishedBOOLEAN

Indicates that ESP phase two is established.

Returns:

  • (BOOLEAN)


54
55
56
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 54

def is_esp_established
  @is_esp_established
end

#is_pfs_enabledBOOLEAN

Indicates that PFS (perfect forward secrecy) is enabled.

Returns:

  • (BOOLEAN)


58
59
60
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 58

def is_pfs_enabled
  @is_pfs_enabled
end

#lifetimeInteger

The total configured lifetime of the IKE security association.

Returns:

  • (Integer)


19
20
21
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 19

def lifetime
  @lifetime
end

#negotiated_authentication_algorithmString

The negotiated phase two authentication algorithm.

Returns:

  • (String)


32
33
34
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 32

def negotiated_authentication_algorithm
  @negotiated_authentication_algorithm
end

#negotiated_dh_groupString

The negotiated Diffie-Hellman group.

Returns:

  • (String)


50
51
52
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 50

def negotiated_dh_group
  @negotiated_dh_group
end

#negotiated_encryption_algorithmString

The negotiated encryption algorithm.

Returns:

  • (String)


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

def negotiated_encryption_algorithm
  @negotiated_encryption_algorithm
end

#remaining_lifetimeInteger

The remaining lifetime before the key is refreshed.

Returns:

  • (Integer)


23
24
25
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 23

def remaining_lifetime
  @remaining_lifetime
end

#remaining_lifetime_last_retrievedDateTime

The date and time the remaining lifetime was last retrieved, in the format defined by RFC3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


65
66
67
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 65

def remaining_lifetime_last_retrieved
  @remaining_lifetime_last_retrieved
end

Class Method Details

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 68

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'is_custom_phase_two_config': :'isCustomPhaseTwoConfig',
    'lifetime': :'lifetime',
    'remaining_lifetime': :'remainingLifetime',
    'custom_authentication_algorithm': :'customAuthenticationAlgorithm',
    'negotiated_authentication_algorithm': :'negotiatedAuthenticationAlgorithm',
    'custom_encryption_algorithm': :'customEncryptionAlgorithm',
    'negotiated_encryption_algorithm': :'negotiatedEncryptionAlgorithm',
    'dh_group': :'dhGroup',
    'negotiated_dh_group': :'negotiatedDhGroup',
    'is_esp_established': :'isEspEstablished',
    'is_pfs_enabled': :'isPfsEnabled',
    'remaining_lifetime_last_retrieved': :'remainingLifetimeLastRetrieved'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 88

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'is_custom_phase_two_config': :'BOOLEAN',
    'lifetime': :'Integer',
    'remaining_lifetime': :'Integer',
    'custom_authentication_algorithm': :'String',
    'negotiated_authentication_algorithm': :'String',
    'custom_encryption_algorithm': :'String',
    'negotiated_encryption_algorithm': :'String',
    'dh_group': :'String',
    'negotiated_dh_group': :'String',
    'is_esp_established': :'BOOLEAN',
    'is_pfs_enabled': :'BOOLEAN',
    'remaining_lifetime_last_retrieved': :'DateTime'
    # 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



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 207

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

  self.class == other.class &&
    is_custom_phase_two_config == other.is_custom_phase_two_config &&
    lifetime == other.lifetime &&
    remaining_lifetime == other.remaining_lifetime &&
    custom_authentication_algorithm == other.custom_authentication_algorithm &&
    negotiated_authentication_algorithm == other.negotiated_authentication_algorithm &&
    custom_encryption_algorithm == other.custom_encryption_algorithm &&
    negotiated_encryption_algorithm == other.negotiated_encryption_algorithm &&
    dh_group == other.dh_group &&
    negotiated_dh_group == other.negotiated_dh_group &&
    is_esp_established == other.is_esp_established &&
    is_pfs_enabled == other.is_pfs_enabled &&
    remaining_lifetime_last_retrieved == other.remaining_lifetime_last_retrieved
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



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 248

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


228
229
230
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 228

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

def hash
  [is_custom_phase_two_config, lifetime, remaining_lifetime, custom_authentication_algorithm, negotiated_authentication_algorithm, custom_encryption_algorithm, negotiated_encryption_algorithm, dh_group, negotiated_dh_group, is_esp_established, is_pfs_enabled, remaining_lifetime_last_retrieved].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



281
282
283
284
285
286
287
288
289
290
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 281

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



275
276
277
# File 'lib/oci/core/models/tunnel_phase_two_details.rb', line 275

def to_s
  to_hash.to_s
end