oci 2.0.8 → 2.0.9

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/oci.rb +1 -0
  4. data/lib/oci/api_client.rb +22 -4
  5. data/lib/oci/audit/audit_client.rb +7 -7
  6. data/lib/oci/core/blockstorage_client.rb +30 -30
  7. data/lib/oci/core/compute_client.rb +55 -54
  8. data/lib/oci/core/core.rb +2 -0
  9. data/lib/oci/core/models/attach_paravirtualized_volume_details.rb +133 -0
  10. data/lib/oci/core/models/attach_volume_details.rb +2 -1
  11. data/lib/oci/core/models/create_image_details.rb +1 -1
  12. data/lib/oci/core/models/create_public_ip_details.rb +1 -1
  13. data/lib/oci/core/models/create_virtual_circuit_details.rb +1 -1
  14. data/lib/oci/core/models/create_volume_backup_details.rb +1 -1
  15. data/lib/oci/core/models/image.rb +22 -1
  16. data/lib/oci/core/models/image_source_details.rb +1 -1
  17. data/lib/oci/core/models/instance_source_via_image_details.rb +20 -1
  18. data/lib/oci/core/models/paravirtualized_volume_attachment.rb +154 -0
  19. data/lib/oci/core/models/update_virtual_circuit_details.rb +1 -1
  20. data/lib/oci/core/models/volume_attachment.rb +1 -0
  21. data/lib/oci/core/virtual_network_client.rb +154 -154
  22. data/lib/oci/database/database_client.rb +59 -59
  23. data/lib/oci/database/models/create_data_guard_association_details.rb +2 -2
  24. data/lib/oci/database/models/create_database_details.rb +1 -1
  25. data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +1 -1
  26. data/lib/oci/database/models/launch_db_system_details.rb +3 -3
  27. data/lib/oci/database/models/patch_details.rb +1 -1
  28. data/lib/oci/dns/dns_client.rb +44 -44
  29. data/lib/oci/dns/models/create_zone_details.rb +1 -1
  30. data/lib/oci/dns/models/record_operation.rb +1 -1
  31. data/lib/oci/email/email.rb +22 -0
  32. data/lib/oci/email/email_client.rb +417 -0
  33. data/lib/oci/email/models/create_sender_details.rb +147 -0
  34. data/lib/oci/email/models/create_suppression_details.rb +149 -0
  35. data/lib/oci/email/models/sender.rb +219 -0
  36. data/lib/oci/email/models/sender_summary.rb +195 -0
  37. data/lib/oci/email/models/suppression.rb +191 -0
  38. data/lib/oci/email/models/suppression_summary.rb +192 -0
  39. data/lib/oci/email/util.rb +2 -0
  40. data/lib/oci/file_storage/file_storage_client.rb +42 -42
  41. data/lib/oci/identity/identity.rb +4 -0
  42. data/lib/oci/identity/identity_client.rb +250 -94
  43. data/lib/oci/identity/models/compartment.rb +1 -1
  44. data/lib/oci/identity/models/create_compartment_details.rb +1 -1
  45. data/lib/oci/identity/models/create_identity_provider_details.rb +2 -2
  46. data/lib/oci/identity/models/create_smtp_credential_details.rb +122 -0
  47. data/lib/oci/identity/models/smtp_credential.rb +285 -0
  48. data/lib/oci/identity/models/smtp_credential_summary.rb +267 -0
  49. data/lib/oci/identity/models/update_compartment_details.rb +1 -0
  50. data/lib/oci/identity/models/update_identity_provider_details.rb +1 -1
  51. data/lib/oci/identity/models/update_smtp_credential_details.rb +121 -0
  52. data/lib/oci/load_balancer/load_balancer_client.rb +74 -74
  53. data/lib/oci/object_storage/models/create_bucket_details.rb +2 -2
  54. data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +1 -1
  55. data/lib/oci/object_storage/models/update_bucket_details.rb +1 -1
  56. data/lib/oci/object_storage/object_storage_client.rb +73 -73
  57. data/lib/oci/regions.rb +2 -1
  58. data/lib/oci/response.rb +1 -0
  59. data/lib/oci/version.rb +1 -1
  60. metadata +17 -20
@@ -10,6 +10,7 @@ end
10
10
  # Require models
11
11
  require 'oci/core/models/attach_boot_volume_details'
12
12
  require 'oci/core/models/attach_i_scsi_volume_details'
13
+ require 'oci/core/models/attach_paravirtualized_volume_details'
13
14
  require 'oci/core/models/attach_vnic_details'
14
15
  require 'oci/core/models/attach_volume_details'
15
16
  require 'oci/core/models/boot_volume'
@@ -84,6 +85,7 @@ require 'oci/core/models/launch_instance_details'
84
85
  require 'oci/core/models/launch_options'
85
86
  require 'oci/core/models/letter_of_authority'
86
87
  require 'oci/core/models/local_peering_gateway'
88
+ require 'oci/core/models/paravirtualized_volume_attachment'
87
89
  require 'oci/core/models/port_range'
88
90
  require 'oci/core/models/private_ip'
89
91
  require 'oci/core/models/public_ip'
@@ -0,0 +1,133 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require_relative 'attach_volume_details'
5
+
6
+ module OCI
7
+ class Core::Models::AttachParavirtualizedVolumeDetails < Core::Models::AttachVolumeDetails
8
+
9
+ # Initializes the object
10
+ # @param [Hash] attributes Model attributes in the form of hash
11
+ # @option attributes [String] :display_name The value to assign to the {OCI::Core::Models::AttachVolumeDetails#display_name #display_name} proprety
12
+ # @option attributes [String] :instance_id The value to assign to the {OCI::Core::Models::AttachVolumeDetails#instance_id #instance_id} proprety
13
+ # @option attributes [BOOLEAN] :is_read_only The value to assign to the {OCI::Core::Models::AttachVolumeDetails#is_read_only #is_read_only} proprety
14
+ # @option attributes [String] :volume_id The value to assign to the {OCI::Core::Models::AttachVolumeDetails#volume_id #volume_id} proprety
15
+ def initialize(attributes = {})
16
+ return unless attributes.is_a?(Hash)
17
+
18
+ attributes['type'] = 'paravirtualized'
19
+
20
+ super(attributes)
21
+
22
+ # convert string to symbol for hash key
23
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
24
+
25
+ end
26
+
27
+ # Checks equality by comparing each attribute.
28
+ # @param [Object] other_object to be compared
29
+ def ==(other_object)
30
+ return true if self.equal?(other_object)
31
+ self.class == other_object.class &&
32
+ display_name == other_object.display_name &&
33
+ instance_id == other_object.instance_id &&
34
+ is_read_only == other_object.is_read_only &&
35
+ type == other_object.type &&
36
+ volume_id == other_object.volume_id
37
+ end
38
+
39
+ # @see the `==` method
40
+ # @param [Object] other_object to be compared
41
+ def eql?(other_object)
42
+ self == other_object
43
+ end
44
+
45
+ # Calculates hash code according to all attributes.
46
+ # @return [Fixnum] Hash code
47
+ def hash
48
+ [display_name, instance_id, is_read_only, type, volume_id].hash
49
+ end
50
+
51
+ # Builds the object from hash
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ # @return [Object] Returns the model itself
54
+ def build_from_hash(attributes)
55
+ return nil unless attributes.is_a?(Hash)
56
+ self.class.swagger_types.each_pair do |key, type|
57
+ if type =~ /^Array<(.*)>/i
58
+ # check to ensure the input is an array given that the the attribute
59
+ # is documented as an array but the input is not
60
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
61
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
62
+ end
63
+ elsif !attributes[self.class.attribute_map[key]].nil?
64
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
65
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
66
+ end
67
+
68
+ self
69
+ end
70
+
71
+ # Returns the string representation of the object
72
+ # @return [String] String presentation of the object
73
+ def to_s
74
+ to_hash.to_s
75
+ end
76
+
77
+ # Returns the object in the form of hash
78
+ # @return [Hash] Returns the object in the form of hash
79
+ def to_hash
80
+ hash = {}
81
+ self.class.attribute_map.each_pair do |attr, param|
82
+ value = public_method(attr).call
83
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
84
+ hash[param] = _to_hash(value)
85
+ end
86
+ hash
87
+ end
88
+
89
+ private
90
+
91
+ # Outputs non-array value in the form of hash
92
+ # For object, use to_hash. Otherwise, just return the value
93
+ # @param [Object] value Any valid value
94
+ # @return [Hash] Returns the value in the form of hash
95
+ def _to_hash(value)
96
+ if value.is_a?(Array)
97
+ value.compact.map{ |v| _to_hash(v) }
98
+ elsif value.is_a?(Hash)
99
+ {}.tap do |hash|
100
+ value.each { |k, v| hash[k] = _to_hash(v) }
101
+ end
102
+ elsif value.respond_to? :to_hash
103
+ value.to_hash
104
+ else
105
+ value
106
+ end
107
+ end
108
+
109
+
110
+
111
+ # Attribute mapping from ruby-style variable name to JSON key.
112
+ def self.attribute_map
113
+ {
114
+ :'display_name' => :'displayName',
115
+ :'instance_id' => :'instanceId',
116
+ :'is_read_only' => :'isReadOnly',
117
+ :'type' => :'type',
118
+ :'volume_id' => :'volumeId'
119
+ }
120
+ end
121
+
122
+ # Attribute type mapping.
123
+ def self.swagger_types
124
+ {
125
+ :'display_name' => :'String',
126
+ :'instance_id' => :'String',
127
+ :'is_read_only' => :'BOOLEAN',
128
+ :'type' => :'String',
129
+ :'volume_id' => :'String'
130
+ }
131
+ end
132
+ end
133
+ end
@@ -18,7 +18,7 @@ module OCI
18
18
  # @return [BOOLEAN]
19
19
  attr_accessor :is_read_only
20
20
 
21
- # **[Required]** The type of volume. The only supported value is \"iscsi\".
21
+ # **[Required]** The type of volume. The only supported value are \"iscsi\" and \"paravirtualized\".
22
22
  # @return [String]
23
23
  attr_accessor :type
24
24
 
@@ -33,6 +33,7 @@ module OCI
33
33
  type = object_hash[:'type']
34
34
 
35
35
  return 'OCI::Core::Models::AttachIScsiVolumeDetails' if type == 'iscsi'
36
+ return 'OCI::Core::Models::AttachParavirtualizedVolumeDetails' if type == 'paravirtualized'
36
37
 
37
38
  # TODO: Log a warning when the subtype is not found.
38
39
  return 'OCI::Core::Models::AttachVolumeDetails'
@@ -149,7 +149,7 @@ module OCI
149
149
  # @param [Object] launch_mode Object to be assigned
150
150
  def launch_mode=(launch_mode)
151
151
  if launch_mode && !LAUNCH_MODE_ENUM.include?(launch_mode)
152
- fail "Invalid value for 'launch_mode': this must be one of the values in LAUNCH_MODE_ENUM."
152
+ raise "Invalid value for 'launch_mode': this must be one of the values in LAUNCH_MODE_ENUM."
153
153
  else
154
154
  @launch_mode = launch_mode
155
155
  end
@@ -92,7 +92,7 @@ module OCI
92
92
  # @param [Object] lifetime Object to be assigned
93
93
  def lifetime=(lifetime)
94
94
  if lifetime && !LIFETIME_ENUM.include?(lifetime)
95
- fail "Invalid value for 'lifetime': this must be one of the values in LIFETIME_ENUM."
95
+ raise "Invalid value for 'lifetime': this must be one of the values in LIFETIME_ENUM."
96
96
  else
97
97
  @lifetime = lifetime
98
98
  end
@@ -222,7 +222,7 @@ module OCI
222
222
  # @param [Object] type Object to be assigned
223
223
  def type=(type)
224
224
  if type && !TYPE_ENUM.include?(type)
225
- fail "Invalid value for 'type': this must be one of the values in TYPE_ENUM."
225
+ raise "Invalid value for 'type': this must be one of the values in TYPE_ENUM."
226
226
  else
227
227
  @type = type
228
228
  end
@@ -103,7 +103,7 @@ module OCI
103
103
  # @param [Object] type Object to be assigned
104
104
  def type=(type)
105
105
  if type && !TYPE_ENUM.include?(type)
106
- fail "Invalid value for 'type': this must be one of the values in TYPE_ENUM."
106
+ raise "Invalid value for 'type': this must be one of the values in TYPE_ENUM."
107
107
  else
108
108
  @type = type
109
109
  end
@@ -101,6 +101,13 @@ module OCI
101
101
  # @return [String]
102
102
  attr_accessor :operating_system_version
103
103
 
104
+ # Image size (1 MB = 1048576 bytes)
105
+ #
106
+ # Example: `47694`
107
+ #
108
+ # @return [Integer]
109
+ attr_accessor :size_in_mbs
110
+
104
111
  # **[Required]** The date and time the image was created, in the format defined by RFC3339.
105
112
  #
106
113
  # Example: `2016-08-25T21:10:29.600Z`
@@ -123,6 +130,7 @@ module OCI
123
130
  # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
124
131
  # @option attributes [String] :operating_system The value to assign to the {#operating_system} property
125
132
  # @option attributes [String] :operating_system_version The value to assign to the {#operating_system_version} property
133
+ # @option attributes [Integer] :size_in_mbs The value to assign to the {#size_in_mbs} property
126
134
  # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
127
135
  def initialize(attributes = {})
128
136
  return unless attributes.is_a?(Hash)
@@ -244,6 +252,16 @@ module OCI
244
252
  self.operating_system_version = attributes[:'operating_system_version']
245
253
  end
246
254
 
255
+ if attributes[:'sizeInMBs']
256
+ self.size_in_mbs = attributes[:'sizeInMBs']
257
+ end
258
+
259
+ raise 'You cannot provide both :sizeInMBs and :size_in_mbs' if attributes.key?(:'sizeInMBs') && attributes.key?(:'size_in_mbs')
260
+
261
+ if attributes[:'size_in_mbs']
262
+ self.size_in_mbs = attributes[:'size_in_mbs']
263
+ end
264
+
247
265
  if attributes[:'timeCreated']
248
266
  self.time_created = attributes[:'timeCreated']
249
267
  end
@@ -293,6 +311,7 @@ module OCI
293
311
  lifecycle_state == other_object.lifecycle_state &&
294
312
  operating_system == other_object.operating_system &&
295
313
  operating_system_version == other_object.operating_system_version &&
314
+ size_in_mbs == other_object.size_in_mbs &&
296
315
  time_created == other_object.time_created
297
316
  end
298
317
 
@@ -305,7 +324,7 @@ module OCI
305
324
  # Calculates hash code according to all attributes.
306
325
  # @return [Fixnum] Hash code
307
326
  def hash
308
- [base_image_id, compartment_id, create_image_allowed, defined_tags, display_name, freeform_tags, id, launch_mode, launch_options, lifecycle_state, operating_system, operating_system_version, time_created].hash
327
+ [base_image_id, compartment_id, create_image_allowed, defined_tags, display_name, freeform_tags, id, launch_mode, launch_options, lifecycle_state, operating_system, operating_system_version, size_in_mbs, time_created].hash
309
328
  end
310
329
 
311
330
  # Builds the object from hash
@@ -383,6 +402,7 @@ module OCI
383
402
  :'lifecycle_state' => :'lifecycleState',
384
403
  :'operating_system' => :'operatingSystem',
385
404
  :'operating_system_version' => :'operatingSystemVersion',
405
+ :'size_in_mbs' => :'sizeInMBs',
386
406
  :'time_created' => :'timeCreated'
387
407
  }
388
408
  end
@@ -402,6 +422,7 @@ module OCI
402
422
  :'lifecycle_state' => :'String',
403
423
  :'operating_system' => :'String',
404
424
  :'operating_system_version' => :'String',
425
+ :'size_in_mbs' => :'Integer',
405
426
  :'time_created' => :'DateTime'
406
427
  }
407
428
  end
@@ -70,7 +70,7 @@ module OCI
70
70
  # @param [Object] source_image_type Object to be assigned
71
71
  def source_image_type=(source_image_type)
72
72
  if source_image_type && !SOURCE_IMAGE_TYPE_ENUM.include?(source_image_type)
73
- fail "Invalid value for 'source_image_type': this must be one of the values in SOURCE_IMAGE_TYPE_ENUM."
73
+ raise "Invalid value for 'source_image_type': this must be one of the values in SOURCE_IMAGE_TYPE_ENUM."
74
74
  else
75
75
  @source_image_type = source_image_type
76
76
  end
@@ -5,6 +5,11 @@ require_relative 'instance_source_details'
5
5
 
6
6
  module OCI
7
7
  class Core::Models::InstanceSourceViaImageDetails < Core::Models::InstanceSourceDetails
8
+ # The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 16384 GB (16TB).
9
+ #
10
+ # @return [Integer]
11
+ attr_accessor :boot_volume_size_in_gbs
12
+
8
13
  # **[Required]** The OCID of the image used to boot the instance.
9
14
  # @return [String]
10
15
  attr_accessor :image_id
@@ -12,6 +17,7 @@ module OCI
12
17
 
13
18
  # Initializes the object
14
19
  # @param [Hash] attributes Model attributes in the form of hash
20
+ # @option attributes [Integer] :boot_volume_size_in_gbs The value to assign to the {#boot_volume_size_in_gbs} property
15
21
  # @option attributes [String] :image_id The value to assign to the {#image_id} property
16
22
  def initialize(attributes = {})
17
23
  return unless attributes.is_a?(Hash)
@@ -23,6 +29,16 @@ module OCI
23
29
  # convert string to symbol for hash key
24
30
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
25
31
 
32
+ if attributes[:'bootVolumeSizeInGBs']
33
+ self.boot_volume_size_in_gbs = attributes[:'bootVolumeSizeInGBs']
34
+ end
35
+
36
+ raise 'You cannot provide both :bootVolumeSizeInGBs and :boot_volume_size_in_gbs' if attributes.key?(:'bootVolumeSizeInGBs') && attributes.key?(:'boot_volume_size_in_gbs')
37
+
38
+ if attributes[:'boot_volume_size_in_gbs']
39
+ self.boot_volume_size_in_gbs = attributes[:'boot_volume_size_in_gbs']
40
+ end
41
+
26
42
  if attributes[:'imageId']
27
43
  self.image_id = attributes[:'imageId']
28
44
  end
@@ -41,6 +57,7 @@ module OCI
41
57
  return true if self.equal?(other_object)
42
58
  self.class == other_object.class &&
43
59
  source_type == other_object.source_type &&
60
+ boot_volume_size_in_gbs == other_object.boot_volume_size_in_gbs &&
44
61
  image_id == other_object.image_id
45
62
  end
46
63
 
@@ -53,7 +70,7 @@ module OCI
53
70
  # Calculates hash code according to all attributes.
54
71
  # @return [Fixnum] Hash code
55
72
  def hash
56
- [source_type, image_id].hash
73
+ [source_type, boot_volume_size_in_gbs, image_id].hash
57
74
  end
58
75
 
59
76
  # Builds the object from hash
@@ -120,6 +137,7 @@ module OCI
120
137
  def self.attribute_map
121
138
  {
122
139
  :'source_type' => :'sourceType',
140
+ :'boot_volume_size_in_gbs' => :'bootVolumeSizeInGBs',
123
141
  :'image_id' => :'imageId'
124
142
  }
125
143
  end
@@ -128,6 +146,7 @@ module OCI
128
146
  def self.swagger_types
129
147
  {
130
148
  :'source_type' => :'String',
149
+ :'boot_volume_size_in_gbs' => :'Integer',
131
150
  :'image_id' => :'String'
132
151
  }
133
152
  end
@@ -0,0 +1,154 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require_relative 'volume_attachment'
5
+
6
+ module OCI
7
+ # A paravirtualized volume attachment.
8
+ class Core::Models::ParavirtualizedVolumeAttachment < Core::Models::VolumeAttachment
9
+
10
+ # Initializes the object
11
+ # @param [Hash] attributes Model attributes in the form of hash
12
+ # @option attributes [String] :availability_domain The value to assign to the {OCI::Core::Models::VolumeAttachment#availability_domain #availability_domain} proprety
13
+ # @option attributes [String] :compartment_id The value to assign to the {OCI::Core::Models::VolumeAttachment#compartment_id #compartment_id} proprety
14
+ # @option attributes [String] :display_name The value to assign to the {OCI::Core::Models::VolumeAttachment#display_name #display_name} proprety
15
+ # @option attributes [String] :id The value to assign to the {OCI::Core::Models::VolumeAttachment#id #id} proprety
16
+ # @option attributes [String] :instance_id The value to assign to the {OCI::Core::Models::VolumeAttachment#instance_id #instance_id} proprety
17
+ # @option attributes [BOOLEAN] :is_read_only The value to assign to the {OCI::Core::Models::VolumeAttachment#is_read_only #is_read_only} proprety
18
+ # @option attributes [String] :lifecycle_state The value to assign to the {OCI::Core::Models::VolumeAttachment#lifecycle_state #lifecycle_state} proprety
19
+ # @option attributes [DateTime] :time_created The value to assign to the {OCI::Core::Models::VolumeAttachment#time_created #time_created} proprety
20
+ # @option attributes [String] :volume_id The value to assign to the {OCI::Core::Models::VolumeAttachment#volume_id #volume_id} proprety
21
+ def initialize(attributes = {})
22
+ return unless attributes.is_a?(Hash)
23
+
24
+ attributes['attachmentType'] = 'paravirtualized'
25
+
26
+ super(attributes)
27
+
28
+ # convert string to symbol for hash key
29
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
30
+
31
+ end
32
+
33
+ # Checks equality by comparing each attribute.
34
+ # @param [Object] other_object to be compared
35
+ def ==(other_object)
36
+ return true if self.equal?(other_object)
37
+ self.class == other_object.class &&
38
+ attachment_type == other_object.attachment_type &&
39
+ availability_domain == other_object.availability_domain &&
40
+ compartment_id == other_object.compartment_id &&
41
+ display_name == other_object.display_name &&
42
+ id == other_object.id &&
43
+ instance_id == other_object.instance_id &&
44
+ is_read_only == other_object.is_read_only &&
45
+ lifecycle_state == other_object.lifecycle_state &&
46
+ time_created == other_object.time_created &&
47
+ volume_id == other_object.volume_id
48
+ end
49
+
50
+ # @see the `==` method
51
+ # @param [Object] other_object to be compared
52
+ def eql?(other_object)
53
+ self == other_object
54
+ end
55
+
56
+ # Calculates hash code according to all attributes.
57
+ # @return [Fixnum] Hash code
58
+ def hash
59
+ [attachment_type, availability_domain, compartment_id, display_name, id, instance_id, is_read_only, lifecycle_state, time_created, volume_id].hash
60
+ end
61
+
62
+ # Builds the object from hash
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ # @return [Object] Returns the model itself
65
+ def build_from_hash(attributes)
66
+ return nil unless attributes.is_a?(Hash)
67
+ self.class.swagger_types.each_pair do |key, type|
68
+ if type =~ /^Array<(.*)>/i
69
+ # check to ensure the input is an array given that the the attribute
70
+ # is documented as an array but the input is not
71
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
72
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
73
+ end
74
+ elsif !attributes[self.class.attribute_map[key]].nil?
75
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
76
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
77
+ end
78
+
79
+ self
80
+ end
81
+
82
+ # Returns the string representation of the object
83
+ # @return [String] String presentation of the object
84
+ def to_s
85
+ to_hash.to_s
86
+ end
87
+
88
+ # Returns the object in the form of hash
89
+ # @return [Hash] Returns the object in the form of hash
90
+ def to_hash
91
+ hash = {}
92
+ self.class.attribute_map.each_pair do |attr, param|
93
+ value = public_method(attr).call
94
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
95
+ hash[param] = _to_hash(value)
96
+ end
97
+ hash
98
+ end
99
+
100
+ private
101
+
102
+ # Outputs non-array value in the form of hash
103
+ # For object, use to_hash. Otherwise, just return the value
104
+ # @param [Object] value Any valid value
105
+ # @return [Hash] Returns the value in the form of hash
106
+ def _to_hash(value)
107
+ if value.is_a?(Array)
108
+ value.compact.map{ |v| _to_hash(v) }
109
+ elsif value.is_a?(Hash)
110
+ {}.tap do |hash|
111
+ value.each { |k, v| hash[k] = _to_hash(v) }
112
+ end
113
+ elsif value.respond_to? :to_hash
114
+ value.to_hash
115
+ else
116
+ value
117
+ end
118
+ end
119
+
120
+
121
+
122
+ # Attribute mapping from ruby-style variable name to JSON key.
123
+ def self.attribute_map
124
+ {
125
+ :'attachment_type' => :'attachmentType',
126
+ :'availability_domain' => :'availabilityDomain',
127
+ :'compartment_id' => :'compartmentId',
128
+ :'display_name' => :'displayName',
129
+ :'id' => :'id',
130
+ :'instance_id' => :'instanceId',
131
+ :'is_read_only' => :'isReadOnly',
132
+ :'lifecycle_state' => :'lifecycleState',
133
+ :'time_created' => :'timeCreated',
134
+ :'volume_id' => :'volumeId'
135
+ }
136
+ end
137
+
138
+ # Attribute type mapping.
139
+ def self.swagger_types
140
+ {
141
+ :'attachment_type' => :'String',
142
+ :'availability_domain' => :'String',
143
+ :'compartment_id' => :'String',
144
+ :'display_name' => :'String',
145
+ :'id' => :'String',
146
+ :'instance_id' => :'String',
147
+ :'is_read_only' => :'BOOLEAN',
148
+ :'lifecycle_state' => :'String',
149
+ :'time_created' => :'DateTime',
150
+ :'volume_id' => :'String'
151
+ }
152
+ end
153
+ end
154
+ end