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