oci 2.3.6 → 2.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,177 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # DecryptDataDetails model.
8
+ class KeyManagement::Models::DecryptDataDetails # rubocop:disable Metrics/LineLength
9
+ # Information that can be used to provide an encryption context for the
10
+ # encrypted data. The length of the string representation of the associatedData
11
+ # must be fewer than 4096 characters.
12
+ #
13
+ # @return [Hash<String, String>]
14
+ attr_accessor :associated_data
15
+
16
+ # **[Required]** The encrypted data to decrypt.
17
+ # @return [String]
18
+ attr_accessor :ciphertext
19
+
20
+ # **[Required]** The OCID of the key used to encrypt the ciphertext.
21
+ # @return [String]
22
+ attr_accessor :key_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ # rubocop:disable Style/SymbolLiteral
28
+ 'associated_data': :'associatedData',
29
+ 'ciphertext': :'ciphertext',
30
+ 'key_id': :'keyId'
31
+ # rubocop:enable Style/SymbolLiteral
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ # rubocop:disable Style/SymbolLiteral
39
+ 'associated_data': :'Hash<String, String>',
40
+ 'ciphertext': :'String',
41
+ 'key_id': :'String'
42
+ # rubocop:enable Style/SymbolLiteral
43
+ }
44
+ end
45
+
46
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
47
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
48
+
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ # @option attributes [Hash<String, String>] :associated_data The value to assign to the {#associated_data} property
53
+ # @option attributes [String] :ciphertext The value to assign to the {#ciphertext} property
54
+ # @option attributes [String] :key_id The value to assign to the {#key_id} property
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
+
61
+ self.associated_data = attributes[:'associatedData'] if attributes[:'associatedData']
62
+
63
+ raise 'You cannot provide both :associatedData and :associated_data' if attributes.key?(:'associatedData') && attributes.key?(:'associated_data')
64
+
65
+ self.associated_data = attributes[:'associated_data'] if attributes[:'associated_data']
66
+
67
+ self.ciphertext = attributes[:'ciphertext'] if attributes[:'ciphertext']
68
+
69
+ self.key_id = attributes[:'keyId'] if attributes[:'keyId']
70
+
71
+ raise 'You cannot provide both :keyId and :key_id' if attributes.key?(:'keyId') && attributes.key?(:'key_id')
72
+
73
+ self.key_id = attributes[:'key_id'] if attributes[:'key_id']
74
+ end
75
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
76
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
77
+
78
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
79
+
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] other the other object to be compared
83
+ def ==(other)
84
+ return true if equal?(other)
85
+ self.class == other.class &&
86
+ associated_data == other.associated_data &&
87
+ ciphertext == other.ciphertext &&
88
+ key_id == other.key_id
89
+ end
90
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
91
+
92
+ # @see the `==` method
93
+ # @param [Object] other the other object to be compared
94
+ def eql?(other)
95
+ self == other
96
+ end
97
+
98
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
99
+
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Fixnum] Hash code
103
+ def hash
104
+ [associated_data, ciphertext, key_id].hash
105
+ end
106
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
107
+
108
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
109
+
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /^Array<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ public_method("#{key}=").call(
122
+ attributes[self.class.attribute_map[key]]
123
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
124
+ )
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ public_method("#{key}=").call(
128
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
129
+ )
130
+ end
131
+ # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
137
+
138
+ # Returns the string representation of the object
139
+ # @return [String] String presentation of the object
140
+ def to_s
141
+ to_hash.to_s
142
+ end
143
+
144
+ # Returns the object in the form of hash
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_hash
147
+ hash = {}
148
+ self.class.attribute_map.each_pair do |attr, param|
149
+ value = public_method(attr).call
150
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ private
157
+
158
+ # Outputs non-array value in the form of hash
159
+ # For object, use to_hash. Otherwise, just return the value
160
+ # @param [Object] value Any valid value
161
+ # @return [Hash] Returns the value in the form of hash
162
+ def _to_hash(value)
163
+ if value.is_a?(Array)
164
+ value.compact.map { |v| _to_hash(v) }
165
+ elsif value.is_a?(Hash)
166
+ {}.tap do |hash|
167
+ value.each { |k, v| hash[k] = _to_hash(v) }
168
+ end
169
+ elsif value.respond_to? :to_hash
170
+ value.to_hash
171
+ else
172
+ value
173
+ end
174
+ end
175
+ end
176
+ end
177
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,160 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # DecryptedData model.
8
+ class KeyManagement::Models::DecryptedData # rubocop:disable Metrics/LineLength
9
+ # **[Required]** The decrypted data, in the form of a base64-encoded value.
10
+ # @return [String]
11
+ attr_accessor :plaintext
12
+
13
+ # **[Required]** Checksum of the decrypted data.
14
+ # @return [String]
15
+ attr_accessor :plaintext_checksum
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ # rubocop:disable Style/SymbolLiteral
21
+ 'plaintext': :'plaintext',
22
+ 'plaintext_checksum': :'plaintextChecksum'
23
+ # rubocop:enable Style/SymbolLiteral
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ # rubocop:disable Style/SymbolLiteral
31
+ 'plaintext': :'String',
32
+ 'plaintext_checksum': :'String'
33
+ # rubocop:enable Style/SymbolLiteral
34
+ }
35
+ end
36
+
37
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
38
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
39
+
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ # @option attributes [String] :plaintext The value to assign to the {#plaintext} property
44
+ # @option attributes [String] :plaintext_checksum The value to assign to the {#plaintext_checksum} property
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ self.plaintext = attributes[:'plaintext'] if attributes[:'plaintext']
52
+
53
+ self.plaintext_checksum = attributes[:'plaintextChecksum'] if attributes[:'plaintextChecksum']
54
+
55
+ raise 'You cannot provide both :plaintextChecksum and :plaintext_checksum' if attributes.key?(:'plaintextChecksum') && attributes.key?(:'plaintext_checksum')
56
+
57
+ self.plaintext_checksum = attributes[:'plaintext_checksum'] if attributes[:'plaintext_checksum']
58
+ end
59
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
60
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
61
+
62
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
63
+
64
+
65
+ # Checks equality by comparing each attribute.
66
+ # @param [Object] other the other object to be compared
67
+ def ==(other)
68
+ return true if equal?(other)
69
+ self.class == other.class &&
70
+ plaintext == other.plaintext &&
71
+ plaintext_checksum == other.plaintext_checksum
72
+ end
73
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
74
+
75
+ # @see the `==` method
76
+ # @param [Object] other the other object to be compared
77
+ def eql?(other)
78
+ self == other
79
+ end
80
+
81
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
82
+
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [plaintext, plaintext_checksum].hash
88
+ end
89
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
90
+
91
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
92
+
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def build_from_hash(attributes)
98
+ return nil unless attributes.is_a?(Hash)
99
+ self.class.swagger_types.each_pair do |key, type|
100
+ if type =~ /^Array<(.*)>/i
101
+ # check to ensure the input is an array given that the the attribute
102
+ # is documented as an array but the input is not
103
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
104
+ public_method("#{key}=").call(
105
+ attributes[self.class.attribute_map[key]]
106
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
107
+ )
108
+ end
109
+ elsif !attributes[self.class.attribute_map[key]].nil?
110
+ public_method("#{key}=").call(
111
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
112
+ )
113
+ end
114
+ # or else data not found in attributes(hash), not an issue as the data can be optional
115
+ end
116
+
117
+ self
118
+ end
119
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
120
+
121
+ # Returns the string representation of the object
122
+ # @return [String] String presentation of the object
123
+ def to_s
124
+ to_hash.to_s
125
+ end
126
+
127
+ # Returns the object in the form of hash
128
+ # @return [Hash] Returns the object in the form of hash
129
+ def to_hash
130
+ hash = {}
131
+ self.class.attribute_map.each_pair do |attr, param|
132
+ value = public_method(attr).call
133
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
134
+ hash[param] = _to_hash(value)
135
+ end
136
+ hash
137
+ end
138
+
139
+ private
140
+
141
+ # Outputs non-array value in the form of hash
142
+ # For object, use to_hash. Otherwise, just return the value
143
+ # @param [Object] value Any valid value
144
+ # @return [Hash] Returns the value in the form of hash
145
+ def _to_hash(value)
146
+ if value.is_a?(Array)
147
+ value.compact.map { |v| _to_hash(v) }
148
+ elsif value.is_a?(Hash)
149
+ {}.tap do |hash|
150
+ value.each { |k, v| hash[k] = _to_hash(v) }
151
+ end
152
+ elsif value.respond_to? :to_hash
153
+ value.to_hash
154
+ else
155
+ value
156
+ end
157
+ end
158
+ end
159
+ end
160
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,177 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # EncryptDataDetails model.
8
+ class KeyManagement::Models::EncryptDataDetails # rubocop:disable Metrics/LineLength
9
+ # Information that can be used to provide an encryption context for the
10
+ # encrypted data. The length of the string representation of the associatedData
11
+ # must be fewer than 4096 characters.
12
+ #
13
+ # @return [Hash<String, String>]
14
+ attr_accessor :associated_data
15
+
16
+ # **[Required]** The OCID of the key to encrypt with.
17
+ # @return [String]
18
+ attr_accessor :key_id
19
+
20
+ # **[Required]** The plaintext data to encrypt.
21
+ # @return [String]
22
+ attr_accessor :plaintext
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ # rubocop:disable Style/SymbolLiteral
28
+ 'associated_data': :'associatedData',
29
+ 'key_id': :'keyId',
30
+ 'plaintext': :'plaintext'
31
+ # rubocop:enable Style/SymbolLiteral
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ # rubocop:disable Style/SymbolLiteral
39
+ 'associated_data': :'Hash<String, String>',
40
+ 'key_id': :'String',
41
+ 'plaintext': :'String'
42
+ # rubocop:enable Style/SymbolLiteral
43
+ }
44
+ end
45
+
46
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
47
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
48
+
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ # @option attributes [Hash<String, String>] :associated_data The value to assign to the {#associated_data} property
53
+ # @option attributes [String] :key_id The value to assign to the {#key_id} property
54
+ # @option attributes [String] :plaintext The value to assign to the {#plaintext} property
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
+
61
+ self.associated_data = attributes[:'associatedData'] if attributes[:'associatedData']
62
+
63
+ raise 'You cannot provide both :associatedData and :associated_data' if attributes.key?(:'associatedData') && attributes.key?(:'associated_data')
64
+
65
+ self.associated_data = attributes[:'associated_data'] if attributes[:'associated_data']
66
+
67
+ self.key_id = attributes[:'keyId'] if attributes[:'keyId']
68
+
69
+ raise 'You cannot provide both :keyId and :key_id' if attributes.key?(:'keyId') && attributes.key?(:'key_id')
70
+
71
+ self.key_id = attributes[:'key_id'] if attributes[:'key_id']
72
+
73
+ self.plaintext = attributes[:'plaintext'] if attributes[:'plaintext']
74
+ end
75
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
76
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
77
+
78
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
79
+
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] other the other object to be compared
83
+ def ==(other)
84
+ return true if equal?(other)
85
+ self.class == other.class &&
86
+ associated_data == other.associated_data &&
87
+ key_id == other.key_id &&
88
+ plaintext == other.plaintext
89
+ end
90
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
91
+
92
+ # @see the `==` method
93
+ # @param [Object] other the other object to be compared
94
+ def eql?(other)
95
+ self == other
96
+ end
97
+
98
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
99
+
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Fixnum] Hash code
103
+ def hash
104
+ [associated_data, key_id, plaintext].hash
105
+ end
106
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
107
+
108
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
109
+
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /^Array<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ public_method("#{key}=").call(
122
+ attributes[self.class.attribute_map[key]]
123
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
124
+ )
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ public_method("#{key}=").call(
128
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
129
+ )
130
+ end
131
+ # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
137
+
138
+ # Returns the string representation of the object
139
+ # @return [String] String presentation of the object
140
+ def to_s
141
+ to_hash.to_s
142
+ end
143
+
144
+ # Returns the object in the form of hash
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_hash
147
+ hash = {}
148
+ self.class.attribute_map.each_pair do |attr, param|
149
+ value = public_method(attr).call
150
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ private
157
+
158
+ # Outputs non-array value in the form of hash
159
+ # For object, use to_hash. Otherwise, just return the value
160
+ # @param [Object] value Any valid value
161
+ # @return [Hash] Returns the value in the form of hash
162
+ def _to_hash(value)
163
+ if value.is_a?(Array)
164
+ value.compact.map { |v| _to_hash(v) }
165
+ elsif value.is_a?(Hash)
166
+ {}.tap do |hash|
167
+ value.each { |k, v| hash[k] = _to_hash(v) }
168
+ end
169
+ elsif value.respond_to? :to_hash
170
+ value.to_hash
171
+ else
172
+ value
173
+ end
174
+ end
175
+ end
176
+ end
177
+ # rubocop:enable Lint/UnneededCopDisableDirective