oci 2.0.1 → 2.0.2

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 (248) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/lib/oci.rb +2 -1
  4. data/lib/oci/audit/audit.rb +19 -0
  5. data/lib/oci/audit/audit_client.rb +176 -0
  6. data/lib/oci/audit/models/audit_event.rb +307 -0
  7. data/lib/oci/audit/models/configuration.rb +120 -0
  8. data/lib/oci/audit/models/update_configuration_details.rb +120 -0
  9. data/lib/oci/audit/util.rb +1 -0
  10. data/lib/oci/core/blockstorage_client.rb +69 -1
  11. data/lib/oci/core/compute_client.rb +106 -16
  12. data/lib/oci/core/core.rb +3 -0
  13. data/lib/oci/core/models/attach_i_scsi_volume_details.rb +2 -2
  14. data/lib/oci/core/models/attach_vnic_details.rb +2 -2
  15. data/lib/oci/core/models/attach_volume_details.rb +2 -2
  16. data/lib/oci/core/models/capture_console_history_details.rb +2 -2
  17. data/lib/oci/core/models/console_history.rb +2 -2
  18. data/lib/oci/core/models/cpe.rb +2 -2
  19. data/lib/oci/core/models/create_cpe_details.rb +2 -2
  20. data/lib/oci/core/models/create_cross_connect_details.rb +2 -2
  21. data/lib/oci/core/models/create_cross_connect_group_details.rb +2 -2
  22. data/lib/oci/core/models/create_dhcp_details.rb +2 -2
  23. data/lib/oci/core/models/create_drg_attachment_details.rb +2 -2
  24. data/lib/oci/core/models/create_drg_details.rb +2 -2
  25. data/lib/oci/core/models/create_image_details.rb +2 -2
  26. data/lib/oci/core/models/create_instance_console_connection_details.rb +2 -2
  27. data/lib/oci/core/models/create_internet_gateway_details.rb +2 -2
  28. data/lib/oci/core/models/create_ip_sec_connection_details.rb +2 -2
  29. data/lib/oci/core/models/create_private_ip_details.rb +2 -2
  30. data/lib/oci/core/models/create_route_table_details.rb +2 -2
  31. data/lib/oci/core/models/create_security_list_details.rb +2 -2
  32. data/lib/oci/core/models/create_subnet_details.rb +2 -2
  33. data/lib/oci/core/models/create_vcn_details.rb +2 -2
  34. data/lib/oci/core/models/create_virtual_circuit_details.rb +5 -6
  35. data/lib/oci/core/models/create_vnic_details.rb +2 -2
  36. data/lib/oci/core/models/create_volume_backup_details.rb +2 -2
  37. data/lib/oci/core/models/create_volume_details.rb +20 -4
  38. data/lib/oci/core/models/cross_connect.rb +2 -2
  39. data/lib/oci/core/models/cross_connect_group.rb +2 -2
  40. data/lib/oci/core/models/cross_connect_location.rb +2 -2
  41. data/lib/oci/core/models/cross_connect_mapping.rb +2 -2
  42. data/lib/oci/core/models/cross_connect_port_speed_shape.rb +2 -2
  43. data/lib/oci/core/models/cross_connect_status.rb +2 -2
  44. data/lib/oci/core/models/dhcp_dns_option.rb +2 -2
  45. data/lib/oci/core/models/dhcp_option.rb +2 -2
  46. data/lib/oci/core/models/dhcp_options.rb +2 -2
  47. data/lib/oci/core/models/dhcp_search_domain_option.rb +2 -2
  48. data/lib/oci/core/models/drg.rb +2 -2
  49. data/lib/oci/core/models/drg_attachment.rb +2 -2
  50. data/lib/oci/core/models/egress_security_rule.rb +2 -2
  51. data/lib/oci/core/models/export_image_details.rb +3 -3
  52. data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +5 -5
  53. data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +3 -3
  54. data/lib/oci/core/models/fast_connect_provider_service.rb +2 -2
  55. data/lib/oci/core/models/i_scsi_volume_attachment.rb +2 -2
  56. data/lib/oci/core/models/icmp_options.rb +2 -2
  57. data/lib/oci/core/models/image.rb +2 -2
  58. data/lib/oci/core/models/image_source_details.rb +3 -3
  59. data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +5 -5
  60. data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +3 -3
  61. data/lib/oci/core/models/ingress_security_rule.rb +2 -2
  62. data/lib/oci/core/models/instance.rb +4 -4
  63. data/lib/oci/core/models/instance_console_connection.rb +2 -2
  64. data/lib/oci/core/models/instance_credentials.rb +2 -2
  65. data/lib/oci/core/models/internet_gateway.rb +2 -2
  66. data/lib/oci/core/models/ip_sec_connection.rb +2 -2
  67. data/lib/oci/core/models/ip_sec_connection_device_config.rb +2 -2
  68. data/lib/oci/core/models/ip_sec_connection_device_status.rb +2 -2
  69. data/lib/oci/core/models/launch_instance_details.rb +4 -4
  70. data/lib/oci/core/models/letter_of_authority.rb +2 -2
  71. data/lib/oci/core/models/port_range.rb +2 -2
  72. data/lib/oci/core/models/private_ip.rb +2 -2
  73. data/lib/oci/core/models/route_rule.rb +2 -2
  74. data/lib/oci/core/models/route_table.rb +2 -2
  75. data/lib/oci/core/models/security_list.rb +2 -2
  76. data/lib/oci/core/models/shape.rb +2 -2
  77. data/lib/oci/core/models/subnet.rb +2 -2
  78. data/lib/oci/core/models/tcp_options.rb +2 -2
  79. data/lib/oci/core/models/tunnel_config.rb +2 -2
  80. data/lib/oci/core/models/tunnel_status.rb +2 -2
  81. data/lib/oci/core/models/udp_options.rb +2 -2
  82. data/lib/oci/core/models/update_console_history_details.rb +2 -2
  83. data/lib/oci/core/models/update_cpe_details.rb +2 -2
  84. data/lib/oci/core/models/update_cross_connect_details.rb +2 -2
  85. data/lib/oci/core/models/update_cross_connect_group_details.rb +2 -2
  86. data/lib/oci/core/models/update_dhcp_details.rb +2 -2
  87. data/lib/oci/core/models/update_drg_attachment_details.rb +2 -2
  88. data/lib/oci/core/models/update_drg_details.rb +2 -2
  89. data/lib/oci/core/models/update_image_details.rb +2 -2
  90. data/lib/oci/core/models/update_instance_details.rb +2 -2
  91. data/lib/oci/core/models/update_internet_gateway_details.rb +2 -2
  92. data/lib/oci/core/models/update_ip_sec_connection_details.rb +2 -2
  93. data/lib/oci/core/models/update_private_ip_details.rb +2 -2
  94. data/lib/oci/core/models/update_route_table_details.rb +2 -2
  95. data/lib/oci/core/models/update_security_list_details.rb +2 -2
  96. data/lib/oci/core/models/update_subnet_details.rb +2 -2
  97. data/lib/oci/core/models/update_vcn_details.rb +2 -2
  98. data/lib/oci/core/models/update_virtual_circuit_details.rb +2 -3
  99. data/lib/oci/core/models/update_vnic_details.rb +2 -2
  100. data/lib/oci/core/models/update_volume_backup_details.rb +2 -2
  101. data/lib/oci/core/models/update_volume_details.rb +2 -2
  102. data/lib/oci/core/models/vcn.rb +2 -2
  103. data/lib/oci/core/models/virtual_circuit.rb +5 -5
  104. data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +2 -2
  105. data/lib/oci/core/models/vnic.rb +2 -2
  106. data/lib/oci/core/models/vnic_attachment.rb +2 -2
  107. data/lib/oci/core/models/volume.rb +29 -5
  108. data/lib/oci/core/models/volume_attachment.rb +2 -2
  109. data/lib/oci/core/models/volume_backup.rb +2 -2
  110. data/lib/oci/core/models/volume_source_details.rb +131 -0
  111. data/lib/oci/core/models/volume_source_from_volume_backup_details.rb +128 -0
  112. data/lib/oci/core/models/volume_source_from_volume_details.rb +128 -0
  113. data/lib/oci/core/virtual_network_client.rb +312 -10
  114. data/lib/oci/database/database.rb +7 -0
  115. data/lib/oci/database/database_client.rb +228 -4
  116. data/lib/oci/database/models/backup.rb +253 -0
  117. data/lib/oci/database/models/backup_summary.rb +253 -0
  118. data/lib/oci/database/models/create_backup_details.rb +131 -0
  119. data/lib/oci/database/models/create_data_guard_association_details.rb +2 -2
  120. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +2 -2
  121. data/lib/oci/database/models/create_database_details.rb +13 -3
  122. data/lib/oci/database/models/create_db_home_details.rb +2 -2
  123. data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +2 -2
  124. data/lib/oci/database/models/data_guard_association.rb +2 -2
  125. data/lib/oci/database/models/data_guard_association_summary.rb +374 -0
  126. data/lib/oci/database/models/database.rb +15 -3
  127. data/lib/oci/database/models/database_summary.rb +15 -3
  128. data/lib/oci/database/models/db_backup_config.rb +120 -0
  129. data/lib/oci/database/models/db_home.rb +2 -2
  130. data/lib/oci/database/models/db_home_summary.rb +2 -2
  131. data/lib/oci/database/models/db_node.rb +2 -2
  132. data/lib/oci/database/models/db_node_summary.rb +2 -2
  133. data/lib/oci/database/models/db_system.rb +9 -9
  134. data/lib/oci/database/models/db_system_shape_summary.rb +2 -2
  135. data/lib/oci/database/models/db_system_summary.rb +9 -9
  136. data/lib/oci/database/models/db_version_summary.rb +2 -2
  137. data/lib/oci/database/models/failover_data_guard_association_details.rb +2 -2
  138. data/lib/oci/database/models/launch_db_system_details.rb +2 -2
  139. data/lib/oci/database/models/patch.rb +4 -2
  140. data/lib/oci/database/models/patch_details.rb +4 -3
  141. data/lib/oci/database/models/patch_history_entry.rb +3 -2
  142. data/lib/oci/database/models/patch_history_entry_summary.rb +3 -2
  143. data/lib/oci/database/models/patch_summary.rb +4 -2
  144. data/lib/oci/database/models/reinstate_data_guard_association_details.rb +2 -2
  145. data/lib/oci/database/models/restore_database_details.rb +145 -0
  146. data/lib/oci/database/models/switchover_data_guard_association_details.rb +2 -2
  147. data/lib/oci/database/models/update_database_details.rb +119 -0
  148. data/lib/oci/database/models/update_db_home_details.rb +2 -2
  149. data/lib/oci/database/models/update_db_system_details.rb +9 -9
  150. data/lib/oci/identity/identity_client.rb +6 -5
  151. data/lib/oci/identity/models/add_user_to_group_details.rb +2 -2
  152. data/lib/oci/identity/models/api_key.rb +2 -2
  153. data/lib/oci/identity/models/availability_domain.rb +2 -2
  154. data/lib/oci/identity/models/compartment.rb +3 -3
  155. data/lib/oci/identity/models/create_api_key_details.rb +2 -2
  156. data/lib/oci/identity/models/create_compartment_details.rb +2 -2
  157. data/lib/oci/identity/models/create_customer_secret_key_details.rb +2 -2
  158. data/lib/oci/identity/models/create_group_details.rb +2 -2
  159. data/lib/oci/identity/models/create_identity_provider_details.rb +2 -2
  160. data/lib/oci/identity/models/create_idp_group_mapping_details.rb +2 -2
  161. data/lib/oci/identity/models/create_policy_details.rb +2 -2
  162. data/lib/oci/identity/models/create_region_subscription_details.rb +2 -2
  163. data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +2 -2
  164. data/lib/oci/identity/models/create_swift_password_details.rb +2 -2
  165. data/lib/oci/identity/models/create_user_details.rb +2 -2
  166. data/lib/oci/identity/models/customer_secret_key.rb +2 -2
  167. data/lib/oci/identity/models/customer_secret_key_summary.rb +2 -2
  168. data/lib/oci/identity/models/group.rb +2 -2
  169. data/lib/oci/identity/models/identity_provider.rb +4 -4
  170. data/lib/oci/identity/models/idp_group_mapping.rb +2 -2
  171. data/lib/oci/identity/models/policy.rb +2 -2
  172. data/lib/oci/identity/models/region.rb +4 -4
  173. data/lib/oci/identity/models/region_subscription.rb +4 -4
  174. data/lib/oci/identity/models/saml2_identity_provider.rb +2 -2
  175. data/lib/oci/identity/models/swift_password.rb +2 -2
  176. data/lib/oci/identity/models/tenancy.rb +2 -2
  177. data/lib/oci/identity/models/ui_password.rb +2 -2
  178. data/lib/oci/identity/models/update_compartment_details.rb +2 -2
  179. data/lib/oci/identity/models/update_customer_secret_key_details.rb +2 -2
  180. data/lib/oci/identity/models/update_group_details.rb +2 -2
  181. data/lib/oci/identity/models/update_identity_provider_details.rb +2 -2
  182. data/lib/oci/identity/models/update_idp_group_mapping_details.rb +2 -2
  183. data/lib/oci/identity/models/update_policy_details.rb +2 -2
  184. data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +2 -2
  185. data/lib/oci/identity/models/update_state_details.rb +2 -2
  186. data/lib/oci/identity/models/update_swift_password_details.rb +2 -2
  187. data/lib/oci/identity/models/update_user_details.rb +2 -2
  188. data/lib/oci/identity/models/user.rb +2 -2
  189. data/lib/oci/identity/models/user_group_membership.rb +2 -2
  190. data/lib/oci/load_balancer/load_balancer_client.rb +1 -1
  191. data/lib/oci/load_balancer/models/backend.rb +2 -2
  192. data/lib/oci/load_balancer/models/backend_details.rb +2 -2
  193. data/lib/oci/load_balancer/models/backend_health.rb +2 -2
  194. data/lib/oci/load_balancer/models/backend_set.rb +2 -2
  195. data/lib/oci/load_balancer/models/backend_set_details.rb +2 -2
  196. data/lib/oci/load_balancer/models/backend_set_health.rb +2 -2
  197. data/lib/oci/load_balancer/models/certificate.rb +2 -2
  198. data/lib/oci/load_balancer/models/certificate_details.rb +2 -2
  199. data/lib/oci/load_balancer/models/create_backend_details.rb +2 -2
  200. data/lib/oci/load_balancer/models/create_backend_set_details.rb +2 -2
  201. data/lib/oci/load_balancer/models/create_certificate_details.rb +2 -2
  202. data/lib/oci/load_balancer/models/create_listener_details.rb +2 -2
  203. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +2 -2
  204. data/lib/oci/load_balancer/models/health_check_result.rb +2 -2
  205. data/lib/oci/load_balancer/models/health_checker.rb +2 -2
  206. data/lib/oci/load_balancer/models/health_checker_details.rb +2 -2
  207. data/lib/oci/load_balancer/models/ip_address.rb +2 -2
  208. data/lib/oci/load_balancer/models/listener.rb +2 -2
  209. data/lib/oci/load_balancer/models/listener_details.rb +2 -2
  210. data/lib/oci/load_balancer/models/load_balancer.rb +2 -2
  211. data/lib/oci/load_balancer/models/load_balancer_health.rb +2 -2
  212. data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +2 -2
  213. data/lib/oci/load_balancer/models/load_balancer_policy.rb +2 -2
  214. data/lib/oci/load_balancer/models/load_balancer_protocol.rb +2 -2
  215. data/lib/oci/load_balancer/models/load_balancer_shape.rb +2 -2
  216. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +2 -2
  217. data/lib/oci/load_balancer/models/ssl_configuration.rb +2 -2
  218. data/lib/oci/load_balancer/models/ssl_configuration_details.rb +2 -2
  219. data/lib/oci/load_balancer/models/update_backend_details.rb +2 -2
  220. data/lib/oci/load_balancer/models/update_backend_set_details.rb +2 -2
  221. data/lib/oci/load_balancer/models/update_health_checker_details.rb +2 -2
  222. data/lib/oci/load_balancer/models/update_listener_details.rb +2 -2
  223. data/lib/oci/load_balancer/models/update_load_balancer_details.rb +2 -2
  224. data/lib/oci/load_balancer/models/work_request.rb +2 -2
  225. data/lib/oci/load_balancer/models/work_request_error.rb +2 -2
  226. data/lib/oci/object_storage/models/bucket.rb +44 -12
  227. data/lib/oci/object_storage/models/bucket_summary.rb +6 -4
  228. data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +2 -2
  229. data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +2 -2
  230. data/lib/oci/object_storage/models/create_bucket_details.rb +41 -11
  231. data/lib/oci/object_storage/models/create_multipart_upload_details.rb +9 -7
  232. data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +6 -7
  233. data/lib/oci/object_storage/models/list_objects.rb +4 -3
  234. data/lib/oci/object_storage/models/multipart_upload.rb +3 -3
  235. data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +6 -6
  236. data/lib/oci/object_storage/models/namespace_metadata.rb +142 -0
  237. data/lib/oci/object_storage/models/object_summary.rb +6 -4
  238. data/lib/oci/object_storage/models/preauthenticated_request.rb +13 -11
  239. data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +8 -10
  240. data/lib/oci/object_storage/models/rename_object_details.rb +164 -0
  241. data/lib/oci/object_storage/models/restore_objects_details.rb +120 -0
  242. data/lib/oci/object_storage/models/update_bucket_details.rb +20 -8
  243. data/lib/oci/object_storage/models/update_namespace_metadata_details.rb +131 -0
  244. data/lib/oci/object_storage/object_storage.rb +4 -0
  245. data/lib/oci/object_storage/object_storage_client.rb +206 -94
  246. data/lib/oci/regions.rb +2 -1
  247. data/lib/oci/version.rb +1 -1
  248. metadata +22 -2
@@ -20,7 +20,7 @@ module OCI
20
20
  # @return [String]
21
21
  attr_accessor :upload_id
22
22
 
23
- # The date and time when the upload was created.
23
+ # The date and time the upload was created, as described in [RFC 2616](https://tools.ietf.org/rfc/rfc2616), section 14.29.
24
24
  # @return [DateTime]
25
25
  attr_accessor :time_created
26
26
 
@@ -110,8 +110,8 @@ module OCI
110
110
  def to_hash
111
111
  hash = {}
112
112
  self.class.attribute_map.each_pair do |attr, param|
113
- value = self.send(attr)
114
- next if value.nil?
113
+ value = send(attr)
114
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
115
115
  hash[param] = _to_hash(value)
116
116
  end
117
117
  hash
@@ -4,19 +4,19 @@ require 'date'
4
4
 
5
5
  module OCI
6
6
  class ObjectStorage::Models::MultipartUploadPartSummary
7
- # the current entity tag for the part.
7
+ # The current entity tag for the part.
8
8
  # @return [String]
9
9
  attr_accessor :etag
10
10
 
11
- # the MD5 hash of the bytes of the part.
11
+ # The MD5 hash of the bytes of the part.
12
12
  # @return [String]
13
13
  attr_accessor :md5
14
14
 
15
- # the size of the part in bytes.
15
+ # The size of the part in bytes.
16
16
  # @return [Integer]
17
17
  attr_accessor :size
18
18
 
19
- # the part number for this part.
19
+ # The part number for this part.
20
20
  # @return [Integer]
21
21
  attr_accessor :part_number
22
22
 
@@ -101,8 +101,8 @@ module OCI
101
101
  def to_hash
102
102
  hash = {}
103
103
  self.class.attribute_map.each_pair do |attr, param|
104
- value = self.send(attr)
105
- next if value.nil?
104
+ value = send(attr)
105
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
106
106
  hash[param] = _to_hash(value)
107
107
  end
108
108
  hash
@@ -0,0 +1,142 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class ObjectStorage::Models::NamespaceMetadata
7
+ # The namespace to which the metadata belongs.
8
+ # @return [String]
9
+ attr_accessor :namespace
10
+
11
+ # The default compartment ID for an S3 client.
12
+ # @return [String]
13
+ attr_accessor :default_s3_compartment_id
14
+
15
+ # The default compartment ID for a Swift client.
16
+ # @return [String]
17
+ attr_accessor :default_swift_compartment_id
18
+
19
+
20
+ # Initializes the object
21
+ # @param [Hash] attributes Model attributes in the form of hash
22
+ def initialize(attributes = {})
23
+ return unless attributes.is_a?(Hash)
24
+
25
+ # convert string to symbol for hash key
26
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
27
+
28
+ if attributes[:'namespace']
29
+ self.namespace = attributes[:'namespace']
30
+ end
31
+
32
+ if attributes[:'defaultS3CompartmentId']
33
+ self.default_s3_compartment_id = attributes[:'defaultS3CompartmentId']
34
+ end
35
+
36
+ if attributes[:'defaultSwiftCompartmentId']
37
+ self.default_swift_compartment_id = attributes[:'defaultSwiftCompartmentId']
38
+ end
39
+
40
+ end
41
+
42
+ # Checks equality by comparing each attribute.
43
+ # @param [Object] other_object to be compared
44
+ def ==(other_object)
45
+ return true if self.equal?(other_object)
46
+ self.class == other_object.class &&
47
+ namespace == other_object.namespace &&
48
+ default_s3_compartment_id == other_object.default_s3_compartment_id &&
49
+ default_swift_compartment_id == other_object.default_swift_compartment_id
50
+ end
51
+
52
+ # @see the `==` method
53
+ # @param [Object] other_object to be compared
54
+ def eql?(other_object)
55
+ self == other_object
56
+ end
57
+
58
+ # Calculates hash code according to all attributes.
59
+ # @return [Fixnum] Hash code
60
+ def hash
61
+ [namespace, default_s3_compartment_id, default_swift_compartment_id].hash
62
+ end
63
+
64
+ # Builds the object from hash
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ # @return [Object] Returns the model itself
67
+ def build_from_hash(attributes)
68
+ return nil unless attributes.is_a?(Hash)
69
+ self.class.swagger_types.each_pair do |key, type|
70
+ if type =~ /^Array<(.*)>/i
71
+ # check to ensure the input is an array given that the the attribute
72
+ # is documented as an array but the input is not
73
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
74
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
75
+ end
76
+ elsif !attributes[self.class.attribute_map[key]].nil?
77
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
78
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
79
+ end
80
+
81
+ self
82
+ end
83
+
84
+ # Returns the string representation of the object
85
+ # @return [String] String presentation of the object
86
+ def to_s
87
+ to_hash.to_s
88
+ end
89
+
90
+ # Returns the object in the form of hash
91
+ # @return [Hash] Returns the object in the form of hash
92
+ def to_hash
93
+ hash = {}
94
+ self.class.attribute_map.each_pair do |attr, param|
95
+ value = send(attr)
96
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
97
+ hash[param] = _to_hash(value)
98
+ end
99
+ hash
100
+ end
101
+
102
+ private
103
+
104
+ # Outputs non-array value in the form of hash
105
+ # For object, use to_hash. Otherwise, just return the value
106
+ # @param [Object] value Any valid value
107
+ # @return [Hash] Returns the value in the form of hash
108
+ def _to_hash(value)
109
+ if value.is_a?(Array)
110
+ value.compact.map{ |v| _to_hash(v) }
111
+ elsif value.is_a?(Hash)
112
+ {}.tap do |hash|
113
+ value.each { |k, v| hash[k] = _to_hash(v) }
114
+ end
115
+ elsif value.respond_to? :to_hash
116
+ value.to_hash
117
+ else
118
+ value
119
+ end
120
+ end
121
+
122
+
123
+
124
+ # Attribute mapping from ruby-style variable name to JSON key.
125
+ def self.attribute_map
126
+ {
127
+ :'namespace' => :'namespace',
128
+ :'default_s3_compartment_id' => :'defaultS3CompartmentId',
129
+ :'default_swift_compartment_id' => :'defaultSwiftCompartmentId'
130
+ }
131
+ end
132
+
133
+ # Attribute type mapping.
134
+ def self.swagger_types
135
+ {
136
+ :'namespace' => :'String',
137
+ :'default_s3_compartment_id' => :'String',
138
+ :'default_swift_compartment_id' => :'String'
139
+ }
140
+ end
141
+ end
142
+ end
@@ -4,7 +4,9 @@ require 'date'
4
4
 
5
5
  module OCI
6
6
  class ObjectStorage::Models::ObjectSummary
7
- # The name of the object.
7
+ # The name of the object. Avoid entering confidential information.
8
+ # Example: test/object1.log
9
+ #
8
10
  # @return [String]
9
11
  attr_accessor :name
10
12
 
@@ -16,7 +18,7 @@ module OCI
16
18
  # @return [String]
17
19
  attr_accessor :md5
18
20
 
19
- # Date and time of object creation.
21
+ # The date and time the object was created, as described in [RFC 2616](https://tools.ietf.org/rfc/rfc2616), section 14.29.
20
22
  # @return [DateTime]
21
23
  attr_accessor :time_created
22
24
 
@@ -101,8 +103,8 @@ module OCI
101
103
  def to_hash
102
104
  hash = {}
103
105
  self.class.attribute_map.each_pair do |attr, param|
104
- value = self.send(attr)
105
- next if value.nil?
106
+ value = send(attr)
107
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
106
108
  hash[param] = _to_hash(value)
107
109
  end
108
110
  hash
@@ -11,34 +11,36 @@ module OCI
11
11
  ACCESS_TYPE_ANY_OBJECT_WRITE = 'AnyObjectWrite',
12
12
  ACCESS_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
13
13
 
14
- # the unique identifier to use when directly addressing the pre-authenticated request
14
+ # The unique identifier to use when directly addressing the pre-authenticated request.
15
15
  # @return [String]
16
16
  attr_accessor :id
17
17
 
18
- # the user supplied name of the pre-authenticated request.
18
+ # The user-provided name of the pre-authenticated request.
19
19
  # @return [String]
20
20
  attr_accessor :name
21
21
 
22
- # the uri to embed in the url when using the pre-authenticated request.
22
+ # The URI to embed in the URL when using the pre-authenticated request.
23
23
  # @return [String]
24
24
  attr_accessor :access_uri
25
25
 
26
- # Name of object that is being granted access to by the pre-authenticated request. This can be null and that would mean that the pre-authenticated request is granting access to the entire bucket
26
+ # The name of the object that is being granted access to by the pre-authenticated request. This can be null and
27
+ # if so, the pre-authenticated request grants access to the entire bucket. Avoid entering confidential information.
28
+ # Example: test/object1.log
29
+ #
27
30
  # @return [String]
28
31
  attr_accessor :object_name
29
32
 
30
- # the operation that can be performed on this resource e.g PUT or GET.
33
+ # The operation that can be performed on this resource.
31
34
  # @return [String]
32
35
  attr_accessor :access_type
33
36
 
34
- # the expiration date after which the pre authenticated request will no longer be valid as per spec
35
- # [RFC 3339](https://tools.ietf.org/rfc/rfc3339)
37
+ # The expiration date for the pre-authenticated request as per [RFC 3339](https://tools.ietf.org/rfc/rfc3339). After this date the pre-authenticated request will no longer be valid.
36
38
  #
37
39
  # @return [DateTime]
38
40
  attr_accessor :time_expires
39
41
 
40
- # the date when the pre-authenticated request was created as per spec
41
- # [RFC 3339](https://tools.ietf.org/rfc/rfc3339)
42
+ # The date when the pre-authenticated request was created as per specification
43
+ # [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
42
44
  #
43
45
  # @return [DateTime]
44
46
  attr_accessor :time_created
@@ -149,8 +151,8 @@ module OCI
149
151
  def to_hash
150
152
  hash = {}
151
153
  self.class.attribute_map.each_pair do |attr, param|
152
- value = self.send(attr)
153
- next if value.nil?
154
+ value = send(attr)
155
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
154
156
  hash[param] = _to_hash(value)
155
157
  end
156
158
  hash
@@ -11,30 +11,28 @@ module OCI
11
11
  ACCESS_TYPE_ANY_OBJECT_WRITE = 'AnyObjectWrite',
12
12
  ACCESS_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
13
13
 
14
- # the unique identifier to use when directly addressing the pre-authenticated request
14
+ # The unique identifier to use when directly addressing the pre-authenticated request.
15
15
  # @return [String]
16
16
  attr_accessor :id
17
17
 
18
- # the user supplied name of the pre-authenticated request
18
+ # The user-provided name of the pre-authenticated request.
19
19
  # @return [String]
20
20
  attr_accessor :name
21
21
 
22
- # Name of object that is being granted access to by the pre-authenticated request. This can be null and that would mean that the pre-authenticated request is granting access to the entire bucket
22
+ # The name of object that is being granted access to by the pre-authenticated request. This can be null and if it is, the pre-authenticated request grants access to the entire bucket.
23
23
  # @return [String]
24
24
  attr_accessor :object_name
25
25
 
26
- # the operation that can be performed on this resource e.g PUT or GET.
26
+ # The operation that can be performed on this resource.
27
27
  # @return [String]
28
28
  attr_accessor :access_type
29
29
 
30
- # the expiration date after which the pre authenticated request will no longer be valid as per spec
31
- # [RFC 3339](https://tools.ietf.org/rfc/rfc3339)
30
+ # The expiration date for the pre-authenticated request as per [RFC 3339](https://tools.ietf.org/rfc/rfc3339). After this date the pre-authenticated request will no longer be valid.
32
31
  #
33
32
  # @return [DateTime]
34
33
  attr_accessor :time_expires
35
34
 
36
- # the date when the pre-authenticated request was created as per spec
37
- # [RFC 3339](https://tools.ietf.org/rfc/rfc3339)
35
+ # The date when the pre-authenticated request was created as per [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
38
36
  #
39
37
  # @return [DateTime]
40
38
  attr_accessor :time_created
@@ -140,8 +138,8 @@ module OCI
140
138
  def to_hash
141
139
  hash = {}
142
140
  self.class.attribute_map.each_pair do |attr, param|
143
- value = self.send(attr)
144
- next if value.nil?
141
+ value = send(attr)
142
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
145
143
  hash[param] = _to_hash(value)
146
144
  end
147
145
  hash
@@ -0,0 +1,164 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class ObjectStorage::Models::RenameObjectDetails
7
+ # The name of the source object to be renamed.
8
+ # @return [String]
9
+ attr_accessor :source_name
10
+
11
+ # The new name of the source object.
12
+ # @return [String]
13
+ attr_accessor :new_name
14
+
15
+ # The if-match entity tag of the source object.
16
+ # @return [String]
17
+ attr_accessor :src_obj_if_match_e_tag
18
+
19
+ # The if-match entity tag of the new object.
20
+ # @return [String]
21
+ attr_accessor :new_obj_if_match_e_tag
22
+
23
+ # The if-none-match entity tag of the new object.
24
+ # @return [String]
25
+ attr_accessor :new_obj_if_none_match_e_tag
26
+
27
+
28
+ # Initializes the object
29
+ # @param [Hash] attributes Model attributes in the form of hash
30
+ def initialize(attributes = {})
31
+ return unless attributes.is_a?(Hash)
32
+
33
+ # convert string to symbol for hash key
34
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
35
+
36
+ if attributes[:'sourceName']
37
+ self.source_name = attributes[:'sourceName']
38
+ end
39
+
40
+ if attributes[:'newName']
41
+ self.new_name = attributes[:'newName']
42
+ end
43
+
44
+ if attributes[:'srcObjIfMatchETag']
45
+ self.src_obj_if_match_e_tag = attributes[:'srcObjIfMatchETag']
46
+ end
47
+
48
+ if attributes[:'newObjIfMatchETag']
49
+ self.new_obj_if_match_e_tag = attributes[:'newObjIfMatchETag']
50
+ end
51
+
52
+ if attributes[:'newObjIfNoneMatchETag']
53
+ self.new_obj_if_none_match_e_tag = attributes[:'newObjIfNoneMatchETag']
54
+ end
55
+
56
+ end
57
+
58
+ # Checks equality by comparing each attribute.
59
+ # @param [Object] other_object to be compared
60
+ def ==(other_object)
61
+ return true if self.equal?(other_object)
62
+ self.class == other_object.class &&
63
+ source_name == other_object.source_name &&
64
+ new_name == other_object.new_name &&
65
+ src_obj_if_match_e_tag == other_object.src_obj_if_match_e_tag &&
66
+ new_obj_if_match_e_tag == other_object.new_obj_if_match_e_tag &&
67
+ new_obj_if_none_match_e_tag == other_object.new_obj_if_none_match_e_tag
68
+ end
69
+
70
+ # @see the `==` method
71
+ # @param [Object] other_object to be compared
72
+ def eql?(other_object)
73
+ self == other_object
74
+ end
75
+
76
+ # Calculates hash code according to all attributes.
77
+ # @return [Fixnum] Hash code
78
+ def hash
79
+ [source_name, new_name, src_obj_if_match_e_tag, new_obj_if_match_e_tag, new_obj_if_none_match_e_tag].hash
80
+ end
81
+
82
+ # Builds the object from hash
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ # @return [Object] Returns the model itself
85
+ def build_from_hash(attributes)
86
+ return nil unless attributes.is_a?(Hash)
87
+ self.class.swagger_types.each_pair do |key, type|
88
+ if type =~ /^Array<(.*)>/i
89
+ # check to ensure the input is an array given that the the attribute
90
+ # is documented as an array but the input is not
91
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
92
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
93
+ end
94
+ elsif !attributes[self.class.attribute_map[key]].nil?
95
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
96
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
97
+ end
98
+
99
+ self
100
+ end
101
+
102
+ # Returns the string representation of the object
103
+ # @return [String] String presentation of the object
104
+ def to_s
105
+ to_hash.to_s
106
+ end
107
+
108
+ # Returns the object in the form of hash
109
+ # @return [Hash] Returns the object in the form of hash
110
+ def to_hash
111
+ hash = {}
112
+ self.class.attribute_map.each_pair do |attr, param|
113
+ value = send(attr)
114
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
115
+ hash[param] = _to_hash(value)
116
+ end
117
+ hash
118
+ end
119
+
120
+ private
121
+
122
+ # Outputs non-array value in the form of hash
123
+ # For object, use to_hash. Otherwise, just return the value
124
+ # @param [Object] value Any valid value
125
+ # @return [Hash] Returns the value in the form of hash
126
+ def _to_hash(value)
127
+ if value.is_a?(Array)
128
+ value.compact.map{ |v| _to_hash(v) }
129
+ elsif value.is_a?(Hash)
130
+ {}.tap do |hash|
131
+ value.each { |k, v| hash[k] = _to_hash(v) }
132
+ end
133
+ elsif value.respond_to? :to_hash
134
+ value.to_hash
135
+ else
136
+ value
137
+ end
138
+ end
139
+
140
+
141
+
142
+ # Attribute mapping from ruby-style variable name to JSON key.
143
+ def self.attribute_map
144
+ {
145
+ :'source_name' => :'sourceName',
146
+ :'new_name' => :'newName',
147
+ :'src_obj_if_match_e_tag' => :'srcObjIfMatchETag',
148
+ :'new_obj_if_match_e_tag' => :'newObjIfMatchETag',
149
+ :'new_obj_if_none_match_e_tag' => :'newObjIfNoneMatchETag'
150
+ }
151
+ end
152
+
153
+ # Attribute type mapping.
154
+ def self.swagger_types
155
+ {
156
+ :'source_name' => :'String',
157
+ :'new_name' => :'String',
158
+ :'src_obj_if_match_e_tag' => :'String',
159
+ :'new_obj_if_match_e_tag' => :'String',
160
+ :'new_obj_if_none_match_e_tag' => :'String'
161
+ }
162
+ end
163
+ end
164
+ end