oci 2.3.6 → 2.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -10
  3. data/lib/oci.rb +1 -0
  4. data/lib/oci/api_client.rb +2 -2
  5. data/lib/oci/audit/audit_client.rb +11 -9
  6. data/lib/oci/base_signer.rb +13 -13
  7. data/lib/oci/container_engine/container_engine_client.rb +43 -39
  8. data/lib/oci/container_engine/models/node_error.rb +1 -1
  9. data/lib/oci/container_engine/models/work_request_error.rb +1 -1
  10. data/lib/oci/core/blockstorage_client.rb +421 -75
  11. data/lib/oci/core/compute_client.rb +77 -75
  12. data/lib/oci/core/compute_client_composite_operations.rb +40 -0
  13. data/lib/oci/core/core.rb +4 -0
  14. data/lib/oci/core/models/boot_volume.rb +18 -4
  15. data/lib/oci/core/models/boot_volume_kms_key.rb +152 -0
  16. data/lib/oci/core/models/create_boot_volume_details.rb +15 -1
  17. data/lib/oci/core/models/create_image_details.rb +2 -0
  18. data/lib/oci/core/models/create_volume_details.rb +15 -1
  19. data/lib/oci/core/models/fast_connect_provider_service.rb +1 -1
  20. data/lib/oci/core/models/image.rb +2 -0
  21. data/lib/oci/core/models/instance.rb +2 -0
  22. data/lib/oci/core/models/instance_source_via_image_details.rb +18 -4
  23. data/lib/oci/core/models/launch_options.rb +2 -0
  24. data/lib/oci/core/models/update_boot_volume_kms_key_details.rb +154 -0
  25. data/lib/oci/core/models/update_volume_kms_key_details.rb +154 -0
  26. data/lib/oci/core/models/volume.rb +15 -1
  27. data/lib/oci/core/models/volume_kms_key.rb +152 -0
  28. data/lib/oci/core/virtual_network_client.rb +233 -231
  29. data/lib/oci/core/virtual_network_client_composite_operations.rb +80 -0
  30. data/lib/oci/database/database_client.rb +123 -121
  31. data/lib/oci/database/database_client_composite_operations.rb +399 -0
  32. data/lib/oci/database/models/patch.rb +1 -1
  33. data/lib/oci/database/models/patch_summary.rb +1 -1
  34. data/lib/oci/dns/dns_client.rb +38 -36
  35. data/lib/oci/email/email_client.rb +21 -19
  36. data/lib/oci/email/models/sender.rb +1 -1
  37. data/lib/oci/email/models/suppression.rb +1 -1
  38. data/lib/oci/file_storage/file_storage_client.rb +49 -47
  39. data/lib/oci/identity/identity_client.rb +151 -149
  40. data/lib/oci/identity/identity_client_composite_operations.rb +40 -0
  41. data/lib/oci/key_management/key_management.rb +40 -0
  42. data/lib/oci/key_management/kms_crypto_client.rb +258 -0
  43. data/lib/oci/key_management/kms_crypto_client_composite_operations.rb +24 -0
  44. data/lib/oci/key_management/kms_management_client.rb +716 -0
  45. data/lib/oci/key_management/kms_management_client_composite_operations.rb +181 -0
  46. data/lib/oci/key_management/kms_vault_client.rb +533 -0
  47. data/lib/oci/key_management/kms_vault_client_composite_operations.rb +182 -0
  48. data/lib/oci/key_management/models/create_key_details.rb +180 -0
  49. data/lib/oci/key_management/models/create_vault_details.rb +194 -0
  50. data/lib/oci/key_management/models/decrypt_data_details.rb +177 -0
  51. data/lib/oci/key_management/models/decrypted_data.rb +160 -0
  52. data/lib/oci/key_management/models/encrypt_data_details.rb +177 -0
  53. data/lib/oci/key_management/models/encrypted_data.rb +146 -0
  54. data/lib/oci/key_management/models/generate_key_details.rb +195 -0
  55. data/lib/oci/key_management/models/generated_key.rb +177 -0
  56. data/lib/oci/key_management/models/key.rb +318 -0
  57. data/lib/oci/key_management/models/key_shape.rb +178 -0
  58. data/lib/oci/key_management/models/key_summary.rb +287 -0
  59. data/lib/oci/key_management/models/key_version.rb +205 -0
  60. data/lib/oci/key_management/models/key_version_summary.rb +205 -0
  61. data/lib/oci/key_management/models/schedule_vault_deletion_details.rb +153 -0
  62. data/lib/oci/key_management/models/update_key_details.rb +152 -0
  63. data/lib/oci/key_management/models/update_vault_details.rb +152 -0
  64. data/lib/oci/key_management/models/vault.rb +350 -0
  65. data/lib/oci/key_management/models/vault_summary.rb +334 -0
  66. data/lib/oci/key_management/util.rb +2 -0
  67. data/lib/oci/load_balancer/load_balancer_client.rb +89 -87
  68. data/lib/oci/object_storage/models/bucket.rb +18 -4
  69. data/lib/oci/object_storage/models/create_bucket_details.rb +18 -4
  70. data/lib/oci/object_storage/models/multipart_upload.rb +1 -1
  71. data/lib/oci/object_storage/models/preauthenticated_request.rb +1 -1
  72. data/lib/oci/object_storage/models/update_bucket_details.rb +22 -4
  73. data/lib/oci/object_storage/object_storage_client.rb +63 -58
  74. data/lib/oci/resource_search/resource_search_client.rb +11 -9
  75. data/lib/oci/version.rb +1 -1
  76. metadata +32 -2
@@ -0,0 +1,318 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # Key model.
9
+ class KeyManagement::Models::Key # rubocop:disable Metrics/LineLength
10
+ LIFECYCLE_STATE_ENUM = [
11
+ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
12
+ LIFECYCLE_STATE_ENABLING = 'ENABLING'.freeze,
13
+ LIFECYCLE_STATE_ENABLED = 'ENABLED'.freeze,
14
+ LIFECYCLE_STATE_DISABLING = 'DISABLING'.freeze,
15
+ LIFECYCLE_STATE_DISABLED = 'DISABLED'.freeze,
16
+ LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
17
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
18
+ LIFECYCLE_STATE_PENDING_DELETION = 'PENDING_DELETION'.freeze,
19
+ LIFECYCLE_STATE_SCHEDULING_DELETION = 'SCHEDULING_DELETION'.freeze,
20
+ LIFECYCLE_STATE_CANCELLING_DELETION = 'CANCELLING_DELETION'.freeze,
21
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
22
+ ].freeze
23
+
24
+ # **[Required]** The OCID of the compartment that contains this key.
25
+ # @return [String]
26
+ attr_accessor :compartment_id
27
+
28
+ # **[Required]** The OCID of the KeyVersion resource used in cryptographic operations. During key rotation, service may be in transitional state
29
+ # where this or a newer KeyVersion are used intermittently, and currentKeyVersion field is updated once service is guaranteed to
30
+ # use new KeyVersion for all consequent encrypt operations.
31
+ #
32
+ # @return [String]
33
+ attr_accessor :current_key_version
34
+
35
+ # Usage of predefined tag keys. These predefined keys are scoped to namespaces.
36
+ # Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
37
+ #
38
+ # @return [Hash<String, Hash<String, Object>>]
39
+ attr_accessor :defined_tags
40
+
41
+ # **[Required]** A user-friendly name for the key. It does not have to be unique, and it is changeable.
42
+ # Avoid entering confidential information.
43
+ #
44
+ # @return [String]
45
+ attr_accessor :display_name
46
+
47
+ # Simple key-value pair that is applied without any predefined name, type, or scope.
48
+ # Exists for cross-compatibility only.
49
+ # Example: `{\"bar-key\": \"value\"}`
50
+ #
51
+ # @return [Hash<String, String>]
52
+ attr_accessor :freeform_tags
53
+
54
+ # **[Required]** The OCID of the key.
55
+ # @return [String]
56
+ attr_accessor :id
57
+
58
+ # This attribute is required.
59
+ # @return [OCI::KeyManagement::Models::KeyShape]
60
+ attr_accessor :key_shape
61
+
62
+ # **[Required]** The key's current state.
63
+ #
64
+ # Example: `ENABLED`
65
+ #
66
+ # @return [String]
67
+ attr_reader :lifecycle_state
68
+
69
+ # **[Required]** The date and time the key was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format.
70
+ #
71
+ # Example: `2018-04-03T21:10:29.600Z`
72
+ #
73
+ # @return [DateTime]
74
+ attr_accessor :time_created
75
+
76
+ # **[Required]** The OCID of the vault that contains this key.
77
+ # @return [String]
78
+ attr_accessor :vault_id
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ # rubocop:disable Style/SymbolLiteral
84
+ 'compartment_id': :'compartmentId',
85
+ 'current_key_version': :'currentKeyVersion',
86
+ 'defined_tags': :'definedTags',
87
+ 'display_name': :'displayName',
88
+ 'freeform_tags': :'freeformTags',
89
+ 'id': :'id',
90
+ 'key_shape': :'keyShape',
91
+ 'lifecycle_state': :'lifecycleState',
92
+ 'time_created': :'timeCreated',
93
+ 'vault_id': :'vaultId'
94
+ # rubocop:enable Style/SymbolLiteral
95
+ }
96
+ end
97
+
98
+ # Attribute type mapping.
99
+ def self.swagger_types
100
+ {
101
+ # rubocop:disable Style/SymbolLiteral
102
+ 'compartment_id': :'String',
103
+ 'current_key_version': :'String',
104
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
105
+ 'display_name': :'String',
106
+ 'freeform_tags': :'Hash<String, String>',
107
+ 'id': :'String',
108
+ 'key_shape': :'OCI::KeyManagement::Models::KeyShape',
109
+ 'lifecycle_state': :'String',
110
+ 'time_created': :'DateTime',
111
+ 'vault_id': :'String'
112
+ # rubocop:enable Style/SymbolLiteral
113
+ }
114
+ end
115
+
116
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
117
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
118
+
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
123
+ # @option attributes [String] :current_key_version The value to assign to the {#current_key_version} property
124
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
125
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
126
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
127
+ # @option attributes [String] :id The value to assign to the {#id} property
128
+ # @option attributes [OCI::KeyManagement::Models::KeyShape] :key_shape The value to assign to the {#key_shape} property
129
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
130
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
131
+ # @option attributes [String] :vault_id The value to assign to the {#vault_id} property
132
+ def initialize(attributes = {})
133
+ return unless attributes.is_a?(Hash)
134
+
135
+ # convert string to symbol for hash key
136
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
137
+
138
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
139
+
140
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
141
+
142
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
143
+
144
+ self.current_key_version = attributes[:'currentKeyVersion'] if attributes[:'currentKeyVersion']
145
+
146
+ raise 'You cannot provide both :currentKeyVersion and :current_key_version' if attributes.key?(:'currentKeyVersion') && attributes.key?(:'current_key_version')
147
+
148
+ self.current_key_version = attributes[:'current_key_version'] if attributes[:'current_key_version']
149
+
150
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
151
+
152
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
153
+
154
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
155
+
156
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
157
+
158
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
159
+
160
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
161
+
162
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
163
+
164
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
165
+
166
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
167
+
168
+ self.id = attributes[:'id'] if attributes[:'id']
169
+
170
+ self.key_shape = attributes[:'keyShape'] if attributes[:'keyShape']
171
+
172
+ raise 'You cannot provide both :keyShape and :key_shape' if attributes.key?(:'keyShape') && attributes.key?(:'key_shape')
173
+
174
+ self.key_shape = attributes[:'key_shape'] if attributes[:'key_shape']
175
+
176
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
177
+
178
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
179
+
180
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
181
+
182
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
183
+
184
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
185
+
186
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
187
+
188
+ self.vault_id = attributes[:'vaultId'] if attributes[:'vaultId']
189
+
190
+ raise 'You cannot provide both :vaultId and :vault_id' if attributes.key?(:'vaultId') && attributes.key?(:'vault_id')
191
+
192
+ self.vault_id = attributes[:'vault_id'] if attributes[:'vault_id']
193
+ end
194
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
195
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
196
+
197
+ # Custom attribute writer method checking allowed values (enum).
198
+ # @param [Object] lifecycle_state Object to be assigned
199
+ def lifecycle_state=(lifecycle_state)
200
+ # rubocop:disable Style/ConditionalAssignment
201
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
202
+ # rubocop: disable Metrics/LineLength
203
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
204
+ # rubocop: enable Metrics/LineLength
205
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
206
+ else
207
+ @lifecycle_state = lifecycle_state
208
+ end
209
+ # rubocop:enable Style/ConditionalAssignment
210
+ end
211
+
212
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
213
+
214
+
215
+ # Checks equality by comparing each attribute.
216
+ # @param [Object] other the other object to be compared
217
+ def ==(other)
218
+ return true if equal?(other)
219
+ self.class == other.class &&
220
+ compartment_id == other.compartment_id &&
221
+ current_key_version == other.current_key_version &&
222
+ defined_tags == other.defined_tags &&
223
+ display_name == other.display_name &&
224
+ freeform_tags == other.freeform_tags &&
225
+ id == other.id &&
226
+ key_shape == other.key_shape &&
227
+ lifecycle_state == other.lifecycle_state &&
228
+ time_created == other.time_created &&
229
+ vault_id == other.vault_id
230
+ end
231
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
232
+
233
+ # @see the `==` method
234
+ # @param [Object] other the other object to be compared
235
+ def eql?(other)
236
+ self == other
237
+ end
238
+
239
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
240
+
241
+
242
+ # Calculates hash code according to all attributes.
243
+ # @return [Fixnum] Hash code
244
+ def hash
245
+ [compartment_id, current_key_version, defined_tags, display_name, freeform_tags, id, key_shape, lifecycle_state, time_created, vault_id].hash
246
+ end
247
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
248
+
249
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
250
+
251
+
252
+ # Builds the object from hash
253
+ # @param [Hash] attributes Model attributes in the form of hash
254
+ # @return [Object] Returns the model itself
255
+ def build_from_hash(attributes)
256
+ return nil unless attributes.is_a?(Hash)
257
+ self.class.swagger_types.each_pair do |key, type|
258
+ if type =~ /^Array<(.*)>/i
259
+ # check to ensure the input is an array given that the the attribute
260
+ # is documented as an array but the input is not
261
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
262
+ public_method("#{key}=").call(
263
+ attributes[self.class.attribute_map[key]]
264
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
265
+ )
266
+ end
267
+ elsif !attributes[self.class.attribute_map[key]].nil?
268
+ public_method("#{key}=").call(
269
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
270
+ )
271
+ end
272
+ # or else data not found in attributes(hash), not an issue as the data can be optional
273
+ end
274
+
275
+ self
276
+ end
277
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
278
+
279
+ # Returns the string representation of the object
280
+ # @return [String] String presentation of the object
281
+ def to_s
282
+ to_hash.to_s
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = public_method(attr).call
291
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ private
298
+
299
+ # Outputs non-array value in the form of hash
300
+ # For object, use to_hash. Otherwise, just return the value
301
+ # @param [Object] value Any valid value
302
+ # @return [Hash] Returns the value in the form of hash
303
+ def _to_hash(value)
304
+ if value.is_a?(Array)
305
+ value.compact.map { |v| _to_hash(v) }
306
+ elsif value.is_a?(Hash)
307
+ {}.tap do |hash|
308
+ value.each { |k, v| hash[k] = _to_hash(v) }
309
+ end
310
+ elsif value.respond_to? :to_hash
311
+ value.to_hash
312
+ else
313
+ value
314
+ end
315
+ end
316
+ end
317
+ end
318
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,178 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # The cryptographic properties of a key.
9
+ class KeyManagement::Models::KeyShape # rubocop:disable Metrics/LineLength
10
+ ALGORITHM_ENUM = [
11
+ ALGORITHM_AES = 'AES'.freeze,
12
+ ALGORITHM_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
13
+ ].freeze
14
+
15
+ # **[Required]** The algorithm used by a key's KeyVersions to encrypt or decrypt.
16
+ # @return [String]
17
+ attr_reader :algorithm
18
+
19
+ # **[Required]** The length of the key, expressed as an integer. Values of 16, 24, or 32 are supported.
20
+ #
21
+ # @return [Integer]
22
+ attr_accessor :length
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ # rubocop:disable Style/SymbolLiteral
28
+ 'algorithm': :'algorithm',
29
+ 'length': :'length'
30
+ # rubocop:enable Style/SymbolLiteral
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ # rubocop:disable Style/SymbolLiteral
38
+ 'algorithm': :'String',
39
+ 'length': :'Integer'
40
+ # rubocop:enable Style/SymbolLiteral
41
+ }
42
+ end
43
+
44
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
45
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
46
+
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ # @option attributes [String] :algorithm The value to assign to the {#algorithm} property
51
+ # @option attributes [Integer] :length The value to assign to the {#length} property
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ self.algorithm = attributes[:'algorithm'] if attributes[:'algorithm']
59
+
60
+ self.length = attributes[:'length'] if attributes[:'length']
61
+ end
62
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
63
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
64
+
65
+ # Custom attribute writer method checking allowed values (enum).
66
+ # @param [Object] algorithm Object to be assigned
67
+ def algorithm=(algorithm)
68
+ # rubocop:disable Style/ConditionalAssignment
69
+ if algorithm && !ALGORITHM_ENUM.include?(algorithm)
70
+ # rubocop: disable Metrics/LineLength
71
+ OCI.logger.debug("Unknown value for 'algorithm' [" + algorithm + "]. Mapping to 'ALGORITHM_UNKNOWN_ENUM_VALUE'") if OCI.logger
72
+ # rubocop: enable Metrics/LineLength
73
+ @algorithm = ALGORITHM_UNKNOWN_ENUM_VALUE
74
+ else
75
+ @algorithm = algorithm
76
+ end
77
+ # rubocop:enable Style/ConditionalAssignment
78
+ end
79
+
80
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
81
+
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] other the other object to be compared
85
+ def ==(other)
86
+ return true if equal?(other)
87
+ self.class == other.class &&
88
+ algorithm == other.algorithm &&
89
+ length == other.length
90
+ end
91
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
92
+
93
+ # @see the `==` method
94
+ # @param [Object] other the other object to be compared
95
+ def eql?(other)
96
+ self == other
97
+ end
98
+
99
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
100
+
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Fixnum] Hash code
104
+ def hash
105
+ [algorithm, length].hash
106
+ end
107
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
108
+
109
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
110
+
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.swagger_types.each_pair do |key, type|
118
+ if type =~ /^Array<(.*)>/i
119
+ # check to ensure the input is an array given that the the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ public_method("#{key}=").call(
123
+ attributes[self.class.attribute_map[key]]
124
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
125
+ )
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ public_method("#{key}=").call(
129
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
130
+ )
131
+ end
132
+ # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
138
+
139
+ # Returns the string representation of the object
140
+ # @return [String] String presentation of the object
141
+ def to_s
142
+ to_hash.to_s
143
+ end
144
+
145
+ # Returns the object in the form of hash
146
+ # @return [Hash] Returns the object in the form of hash
147
+ def to_hash
148
+ hash = {}
149
+ self.class.attribute_map.each_pair do |attr, param|
150
+ value = public_method(attr).call
151
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
152
+ hash[param] = _to_hash(value)
153
+ end
154
+ hash
155
+ end
156
+
157
+ private
158
+
159
+ # Outputs non-array value in the form of hash
160
+ # For object, use to_hash. Otherwise, just return the value
161
+ # @param [Object] value Any valid value
162
+ # @return [Hash] Returns the value in the form of hash
163
+ def _to_hash(value)
164
+ if value.is_a?(Array)
165
+ value.compact.map { |v| _to_hash(v) }
166
+ elsif value.is_a?(Hash)
167
+ {}.tap do |hash|
168
+ value.each { |k, v| hash[k] = _to_hash(v) }
169
+ end
170
+ elsif value.respond_to? :to_hash
171
+ value.to_hash
172
+ else
173
+ value
174
+ end
175
+ end
176
+ end
177
+ end
178
+ # rubocop:enable Lint/UnneededCopDisableDirective