oci 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +3 -3
  3. data/README.md +72 -6
  4. data/lib/oci.rb +1 -1
  5. data/lib/oci/api_client.rb +1 -1
  6. data/lib/oci/audit/audit.rb +1 -1
  7. data/lib/oci/audit/audit_client.rb +1 -1
  8. data/lib/oci/audit/models/audit_event.rb +4 -4
  9. data/lib/oci/audit/models/configuration.rb +4 -4
  10. data/lib/oci/audit/models/update_configuration_details.rb +4 -4
  11. data/lib/oci/audit/util.rb +2 -1
  12. data/lib/oci/config.rb +1 -1
  13. data/lib/oci/config_file_loader.rb +1 -1
  14. data/lib/oci/core/blockstorage_client.rb +1 -1
  15. data/lib/oci/core/compute_client.rb +4 -2
  16. data/lib/oci/core/core.rb +2 -1
  17. data/lib/oci/core/models/attach_boot_volume_details.rb +4 -4
  18. data/lib/oci/core/models/attach_i_scsi_volume_details.rb +4 -4
  19. data/lib/oci/core/models/attach_vnic_details.rb +4 -4
  20. data/lib/oci/core/models/attach_volume_details.rb +4 -4
  21. data/lib/oci/core/models/boot_volume.rb +4 -4
  22. data/lib/oci/core/models/boot_volume_attachment.rb +4 -4
  23. data/lib/oci/core/models/bulk_add_virtual_circuit_public_prefixes_details.rb +4 -4
  24. data/lib/oci/core/models/bulk_delete_virtual_circuit_public_prefixes_details.rb +4 -4
  25. data/lib/oci/core/models/capture_console_history_details.rb +36 -5
  26. data/lib/oci/core/models/connect_local_peering_gateways_details.rb +4 -4
  27. data/lib/oci/core/models/console_history.rb +36 -6
  28. data/lib/oci/core/models/cpe.rb +4 -4
  29. data/lib/oci/core/models/create_cpe_details.rb +4 -4
  30. data/lib/oci/core/models/create_cross_connect_details.rb +4 -4
  31. data/lib/oci/core/models/create_cross_connect_group_details.rb +4 -4
  32. data/lib/oci/core/models/create_dhcp_details.rb +36 -5
  33. data/lib/oci/core/models/create_drg_attachment_details.rb +4 -4
  34. data/lib/oci/core/models/create_drg_details.rb +4 -4
  35. data/lib/oci/core/models/create_image_details.rb +69 -8
  36. data/lib/oci/core/models/create_instance_console_connection_details.rb +36 -5
  37. data/lib/oci/core/models/create_internet_gateway_details.rb +4 -4
  38. data/lib/oci/core/models/create_ip_sec_connection_details.rb +4 -4
  39. data/lib/oci/core/models/create_local_peering_gateway_details.rb +4 -4
  40. data/lib/oci/core/models/create_private_ip_details.rb +36 -5
  41. data/lib/oci/core/models/create_route_table_details.rb +36 -5
  42. data/lib/oci/core/models/create_security_list_details.rb +36 -5
  43. data/lib/oci/core/models/create_subnet_details.rb +36 -5
  44. data/lib/oci/core/models/create_vcn_details.rb +39 -8
  45. data/lib/oci/core/models/create_virtual_circuit_details.rb +4 -4
  46. data/lib/oci/core/models/create_virtual_circuit_public_prefix_details.rb +4 -4
  47. data/lib/oci/core/models/create_vnic_details.rb +4 -4
  48. data/lib/oci/core/models/create_volume_backup_details.rb +36 -5
  49. data/lib/oci/core/models/create_volume_details.rb +36 -5
  50. data/lib/oci/core/models/cross_connect.rb +4 -4
  51. data/lib/oci/core/models/cross_connect_group.rb +4 -4
  52. data/lib/oci/core/models/cross_connect_location.rb +4 -4
  53. data/lib/oci/core/models/cross_connect_mapping.rb +4 -4
  54. data/lib/oci/core/models/cross_connect_port_speed_shape.rb +4 -4
  55. data/lib/oci/core/models/cross_connect_status.rb +4 -4
  56. data/lib/oci/core/models/delete_virtual_circuit_public_prefix_details.rb +4 -4
  57. data/lib/oci/core/models/dhcp_dns_option.rb +4 -4
  58. data/lib/oci/core/models/dhcp_option.rb +4 -4
  59. data/lib/oci/core/models/dhcp_options.rb +36 -5
  60. data/lib/oci/core/models/dhcp_search_domain_option.rb +4 -4
  61. data/lib/oci/core/models/drg.rb +4 -4
  62. data/lib/oci/core/models/drg_attachment.rb +4 -4
  63. data/lib/oci/core/models/egress_security_rule.rb +4 -4
  64. data/lib/oci/core/models/export_image_details.rb +4 -4
  65. data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +4 -4
  66. data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +4 -4
  67. data/lib/oci/core/models/fast_connect_provider_service.rb +4 -4
  68. data/lib/oci/core/models/i_scsi_volume_attachment.rb +4 -4
  69. data/lib/oci/core/models/icmp_options.rb +4 -4
  70. data/lib/oci/core/models/image.rb +77 -6
  71. data/lib/oci/core/models/image_source_details.rb +32 -5
  72. data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +8 -5
  73. data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +8 -5
  74. data/lib/oci/core/models/ingress_security_rule.rb +4 -4
  75. data/lib/oci/core/models/instance.rb +77 -5
  76. data/lib/oci/core/models/instance_console_connection.rb +52 -8
  77. data/lib/oci/core/models/instance_credentials.rb +4 -4
  78. data/lib/oci/core/models/instance_source_details.rb +4 -4
  79. data/lib/oci/core/models/instance_source_via_boot_volume_details.rb +4 -4
  80. data/lib/oci/core/models/instance_source_via_image_details.rb +4 -4
  81. data/lib/oci/core/models/internet_gateway.rb +4 -4
  82. data/lib/oci/core/models/ip_sec_connection.rb +4 -4
  83. data/lib/oci/core/models/ip_sec_connection_device_config.rb +4 -4
  84. data/lib/oci/core/models/ip_sec_connection_device_status.rb +4 -4
  85. data/lib/oci/core/models/launch_instance_details.rb +39 -6
  86. data/lib/oci/core/models/launch_options.rb +239 -0
  87. data/lib/oci/core/models/letter_of_authority.rb +4 -4
  88. data/lib/oci/core/models/local_peering_gateway.rb +4 -4
  89. data/lib/oci/core/models/port_range.rb +4 -4
  90. data/lib/oci/core/models/private_ip.rb +36 -5
  91. data/lib/oci/core/models/route_rule.rb +4 -4
  92. data/lib/oci/core/models/route_table.rb +36 -5
  93. data/lib/oci/core/models/security_list.rb +36 -5
  94. data/lib/oci/core/models/shape.rb +4 -4
  95. data/lib/oci/core/models/subnet.rb +36 -5
  96. data/lib/oci/core/models/tcp_options.rb +4 -4
  97. data/lib/oci/core/models/tunnel_config.rb +4 -4
  98. data/lib/oci/core/models/tunnel_status.rb +4 -4
  99. data/lib/oci/core/models/udp_options.rb +4 -4
  100. data/lib/oci/core/models/update_boot_volume_details.rb +4 -4
  101. data/lib/oci/core/models/update_console_history_details.rb +39 -8
  102. data/lib/oci/core/models/update_cpe_details.rb +4 -4
  103. data/lib/oci/core/models/update_cross_connect_details.rb +4 -4
  104. data/lib/oci/core/models/update_cross_connect_group_details.rb +4 -4
  105. data/lib/oci/core/models/update_dhcp_details.rb +36 -5
  106. data/lib/oci/core/models/update_drg_attachment_details.rb +4 -4
  107. data/lib/oci/core/models/update_drg_details.rb +4 -4
  108. data/lib/oci/core/models/update_image_details.rb +39 -8
  109. data/lib/oci/core/models/update_instance_details.rb +39 -8
  110. data/lib/oci/core/models/update_internet_gateway_details.rb +4 -4
  111. data/lib/oci/core/models/update_ip_sec_connection_details.rb +4 -4
  112. data/lib/oci/core/models/update_local_peering_gateway_details.rb +4 -4
  113. data/lib/oci/core/models/update_private_ip_details.rb +36 -5
  114. data/lib/oci/core/models/update_route_table_details.rb +36 -5
  115. data/lib/oci/core/models/update_security_list_details.rb +36 -5
  116. data/lib/oci/core/models/update_subnet_details.rb +39 -8
  117. data/lib/oci/core/models/update_vcn_details.rb +39 -8
  118. data/lib/oci/core/models/update_virtual_circuit_details.rb +4 -4
  119. data/lib/oci/core/models/update_vnic_details.rb +4 -4
  120. data/lib/oci/core/models/update_volume_backup_details.rb +39 -8
  121. data/lib/oci/core/models/update_volume_details.rb +39 -8
  122. data/lib/oci/core/models/vcn.rb +36 -5
  123. data/lib/oci/core/models/virtual_circuit.rb +4 -4
  124. data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +4 -4
  125. data/lib/oci/core/models/virtual_circuit_public_prefix.rb +4 -4
  126. data/lib/oci/core/models/vnic.rb +4 -4
  127. data/lib/oci/core/models/vnic_attachment.rb +4 -4
  128. data/lib/oci/core/models/volume.rb +36 -5
  129. data/lib/oci/core/models/volume_attachment.rb +4 -4
  130. data/lib/oci/core/models/volume_backup.rb +36 -5
  131. data/lib/oci/core/models/volume_source_details.rb +4 -4
  132. data/lib/oci/core/models/volume_source_from_volume_backup_details.rb +4 -4
  133. data/lib/oci/core/models/volume_source_from_volume_details.rb +4 -4
  134. data/lib/oci/core/util.rb +2 -1
  135. data/lib/oci/core/virtual_network_client.rb +1 -1
  136. data/lib/oci/database/database.rb +1 -1
  137. data/lib/oci/database/database_client.rb +1 -1
  138. data/lib/oci/database/models/backup.rb +4 -4
  139. data/lib/oci/database/models/backup_summary.rb +4 -4
  140. data/lib/oci/database/models/create_backup_details.rb +4 -4
  141. data/lib/oci/database/models/create_data_guard_association_details.rb +4 -4
  142. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +4 -4
  143. data/lib/oci/database/models/create_database_details.rb +4 -4
  144. data/lib/oci/database/models/create_database_from_backup_details.rb +4 -4
  145. data/lib/oci/database/models/create_db_home_details.rb +4 -4
  146. data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +4 -4
  147. data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +4 -4
  148. data/lib/oci/database/models/create_db_home_with_db_system_id_from_backup_details.rb +4 -4
  149. data/lib/oci/database/models/data_guard_association.rb +4 -4
  150. data/lib/oci/database/models/data_guard_association_summary.rb +4 -4
  151. data/lib/oci/database/models/database.rb +4 -4
  152. data/lib/oci/database/models/database_summary.rb +4 -4
  153. data/lib/oci/database/models/db_backup_config.rb +4 -4
  154. data/lib/oci/database/models/db_home.rb +4 -4
  155. data/lib/oci/database/models/db_home_summary.rb +4 -4
  156. data/lib/oci/database/models/db_node.rb +4 -4
  157. data/lib/oci/database/models/db_node_summary.rb +4 -4
  158. data/lib/oci/database/models/db_system.rb +4 -4
  159. data/lib/oci/database/models/db_system_shape_summary.rb +4 -4
  160. data/lib/oci/database/models/db_system_summary.rb +4 -4
  161. data/lib/oci/database/models/db_version_summary.rb +4 -4
  162. data/lib/oci/database/models/failover_data_guard_association_details.rb +4 -4
  163. data/lib/oci/database/models/launch_db_system_details.rb +4 -4
  164. data/lib/oci/database/models/patch.rb +4 -4
  165. data/lib/oci/database/models/patch_details.rb +4 -4
  166. data/lib/oci/database/models/patch_history_entry.rb +4 -4
  167. data/lib/oci/database/models/patch_history_entry_summary.rb +4 -4
  168. data/lib/oci/database/models/patch_summary.rb +4 -4
  169. data/lib/oci/database/models/reinstate_data_guard_association_details.rb +4 -4
  170. data/lib/oci/database/models/restore_database_details.rb +4 -4
  171. data/lib/oci/database/models/switchover_data_guard_association_details.rb +4 -4
  172. data/lib/oci/database/models/update_database_details.rb +4 -4
  173. data/lib/oci/database/models/update_db_home_details.rb +4 -4
  174. data/lib/oci/database/models/update_db_system_details.rb +4 -4
  175. data/lib/oci/database/util.rb +2 -1
  176. data/lib/oci/errors.rb +1 -1
  177. data/lib/oci/global_context.rb +1 -1
  178. data/lib/oci/identity/identity.rb +9 -1
  179. data/lib/oci/identity/identity_client.rb +339 -1
  180. data/lib/oci/identity/models/add_user_to_group_details.rb +4 -4
  181. data/lib/oci/identity/models/api_key.rb +4 -4
  182. data/lib/oci/identity/models/availability_domain.rb +4 -4
  183. data/lib/oci/identity/models/compartment.rb +34 -8
  184. data/lib/oci/identity/models/create_api_key_details.rb +4 -4
  185. data/lib/oci/identity/models/create_compartment_details.rb +34 -8
  186. data/lib/oci/identity/models/create_customer_secret_key_details.rb +4 -4
  187. data/lib/oci/identity/models/create_group_details.rb +34 -8
  188. data/lib/oci/identity/models/create_identity_provider_details.rb +34 -8
  189. data/lib/oci/identity/models/create_idp_group_mapping_details.rb +4 -4
  190. data/lib/oci/identity/models/create_policy_details.rb +34 -8
  191. data/lib/oci/identity/models/create_region_subscription_details.rb +4 -4
  192. data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +11 -5
  193. data/lib/oci/identity/models/create_swift_password_details.rb +4 -4
  194. data/lib/oci/identity/models/create_tag_details.rb +158 -0
  195. data/lib/oci/identity/models/create_tag_namespace_details.rb +169 -0
  196. data/lib/oci/identity/models/create_user_details.rb +34 -8
  197. data/lib/oci/identity/models/customer_secret_key.rb +4 -4
  198. data/lib/oci/identity/models/customer_secret_key_summary.rb +4 -4
  199. data/lib/oci/identity/models/group.rb +35 -8
  200. data/lib/oci/identity/models/identity_provider.rb +34 -8
  201. data/lib/oci/identity/models/idp_group_mapping.rb +4 -4
  202. data/lib/oci/identity/models/policy.rb +34 -8
  203. data/lib/oci/identity/models/region.rb +4 -4
  204. data/lib/oci/identity/models/region_subscription.rb +4 -4
  205. data/lib/oci/identity/models/saml2_identity_provider.rb +11 -5
  206. data/lib/oci/identity/models/swift_password.rb +4 -4
  207. data/lib/oci/identity/models/tag.rb +228 -0
  208. data/lib/oci/identity/models/tag_namespace.rb +205 -0
  209. data/lib/oci/identity/models/tag_namespace_summary.rb +205 -0
  210. data/lib/oci/identity/models/tag_summary.rb +205 -0
  211. data/lib/oci/identity/models/tenancy.rb +34 -8
  212. data/lib/oci/identity/models/ui_password.rb +4 -4
  213. data/lib/oci/identity/models/update_compartment_details.rb +34 -8
  214. data/lib/oci/identity/models/update_customer_secret_key_details.rb +4 -4
  215. data/lib/oci/identity/models/update_group_details.rb +34 -8
  216. data/lib/oci/identity/models/update_identity_provider_details.rb +34 -8
  217. data/lib/oci/identity/models/update_idp_group_mapping_details.rb +4 -4
  218. data/lib/oci/identity/models/update_policy_details.rb +34 -8
  219. data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +11 -5
  220. data/lib/oci/identity/models/update_state_details.rb +4 -4
  221. data/lib/oci/identity/models/update_swift_password_details.rb +4 -4
  222. data/lib/oci/identity/models/update_tag_details.rb +157 -0
  223. data/lib/oci/identity/models/update_tag_namespace_details.rb +157 -0
  224. data/lib/oci/identity/models/update_user_details.rb +34 -8
  225. data/lib/oci/identity/models/user.rb +35 -8
  226. data/lib/oci/identity/models/user_group_membership.rb +4 -4
  227. data/lib/oci/identity/util.rb +2 -1
  228. data/lib/oci/internal/internal.rb +1 -1
  229. data/lib/oci/internal/util.rb +2 -2
  230. data/lib/oci/load_balancer/load_balancer.rb +1 -1
  231. data/lib/oci/load_balancer/load_balancer_client.rb +1 -1
  232. data/lib/oci/load_balancer/models/backend.rb +4 -4
  233. data/lib/oci/load_balancer/models/backend_details.rb +4 -4
  234. data/lib/oci/load_balancer/models/backend_health.rb +4 -4
  235. data/lib/oci/load_balancer/models/backend_set.rb +4 -4
  236. data/lib/oci/load_balancer/models/backend_set_details.rb +4 -4
  237. data/lib/oci/load_balancer/models/backend_set_health.rb +4 -4
  238. data/lib/oci/load_balancer/models/certificate.rb +4 -4
  239. data/lib/oci/load_balancer/models/certificate_details.rb +4 -4
  240. data/lib/oci/load_balancer/models/create_backend_details.rb +4 -4
  241. data/lib/oci/load_balancer/models/create_backend_set_details.rb +4 -4
  242. data/lib/oci/load_balancer/models/create_certificate_details.rb +4 -4
  243. data/lib/oci/load_balancer/models/create_listener_details.rb +4 -4
  244. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +4 -4
  245. data/lib/oci/load_balancer/models/health_check_result.rb +4 -4
  246. data/lib/oci/load_balancer/models/health_checker.rb +4 -4
  247. data/lib/oci/load_balancer/models/health_checker_details.rb +4 -4
  248. data/lib/oci/load_balancer/models/ip_address.rb +4 -4
  249. data/lib/oci/load_balancer/models/listener.rb +4 -4
  250. data/lib/oci/load_balancer/models/listener_details.rb +4 -4
  251. data/lib/oci/load_balancer/models/load_balancer.rb +4 -4
  252. data/lib/oci/load_balancer/models/load_balancer_health.rb +4 -4
  253. data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +4 -4
  254. data/lib/oci/load_balancer/models/load_balancer_policy.rb +4 -4
  255. data/lib/oci/load_balancer/models/load_balancer_protocol.rb +4 -4
  256. data/lib/oci/load_balancer/models/load_balancer_shape.rb +4 -4
  257. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +4 -4
  258. data/lib/oci/load_balancer/models/ssl_configuration.rb +4 -4
  259. data/lib/oci/load_balancer/models/ssl_configuration_details.rb +4 -4
  260. data/lib/oci/load_balancer/models/update_backend_details.rb +4 -4
  261. data/lib/oci/load_balancer/models/update_backend_set_details.rb +4 -4
  262. data/lib/oci/load_balancer/models/update_health_checker_details.rb +4 -4
  263. data/lib/oci/load_balancer/models/update_listener_details.rb +4 -4
  264. data/lib/oci/load_balancer/models/update_load_balancer_details.rb +4 -4
  265. data/lib/oci/load_balancer/models/work_request.rb +4 -4
  266. data/lib/oci/load_balancer/models/work_request_error.rb +4 -4
  267. data/lib/oci/load_balancer/util.rb +1 -1
  268. data/lib/oci/object_storage/models/bucket.rb +4 -4
  269. data/lib/oci/object_storage/models/bucket_summary.rb +4 -4
  270. data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +4 -4
  271. data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +4 -4
  272. data/lib/oci/object_storage/models/create_bucket_details.rb +4 -4
  273. data/lib/oci/object_storage/models/create_multipart_upload_details.rb +4 -4
  274. data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +4 -4
  275. data/lib/oci/object_storage/models/list_objects.rb +4 -4
  276. data/lib/oci/object_storage/models/multipart_upload.rb +4 -4
  277. data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +4 -4
  278. data/lib/oci/object_storage/models/namespace_metadata.rb +4 -4
  279. data/lib/oci/object_storage/models/object_summary.rb +4 -4
  280. data/lib/oci/object_storage/models/preauthenticated_request.rb +4 -4
  281. data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +4 -4
  282. data/lib/oci/object_storage/models/rename_object_details.rb +4 -4
  283. data/lib/oci/object_storage/models/restore_objects_details.rb +4 -4
  284. data/lib/oci/object_storage/models/update_bucket_details.rb +4 -4
  285. data/lib/oci/object_storage/models/update_namespace_metadata_details.rb +4 -4
  286. data/lib/oci/object_storage/object_storage.rb +1 -1
  287. data/lib/oci/object_storage/object_storage_client.rb +1 -1
  288. data/lib/oci/object_storage/util.rb +2 -1
  289. data/lib/oci/regions.rb +1 -1
  290. data/lib/oci/response.rb +1 -1
  291. data/lib/oci/response_headers.rb +1 -1
  292. data/lib/oci/signer.rb +1 -1
  293. data/lib/oci/version.rb +2 -2
  294. data/lib/oci/waiter.rb +21 -5
  295. data/lib/oraclebmc.rb +1 -1
  296. metadata +11 -2
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
4
 
@@ -68,10 +68,10 @@ module OCI
68
68
  # check to ensure the input is an array given that the the attribute
69
69
  # is documented as an array but the input is not
70
70
  if attributes[self.class.attribute_map[key]].is_a?(Array)
71
- self.public_send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
71
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
72
72
  end
73
73
  elsif !attributes[self.class.attribute_map[key]].nil?
74
- self.public_send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
74
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
75
75
  end # or else data not found in attributes(hash), not an issue as the data can be optional
76
76
  end
77
77
 
@@ -89,7 +89,7 @@ module OCI
89
89
  def to_hash
90
90
  hash = {}
91
91
  self.class.attribute_map.each_pair do |attr, param|
92
- value = public_send(attr)
92
+ value = public_method(attr).call
93
93
  next if value.nil? && !instance_variable_defined?("@#{attr}")
94
94
  hash[param] = _to_hash(value)
95
95
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
4
  require_relative 'instance_source_details'
@@ -59,10 +59,10 @@ module OCI
59
59
  # check to ensure the input is an array given that the the attribute
60
60
  # is documented as an array but the input is not
61
61
  if attributes[self.class.attribute_map[key]].is_a?(Array)
62
- self.public_send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
62
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
63
63
  end
64
64
  elsif !attributes[self.class.attribute_map[key]].nil?
65
- self.public_send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
65
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
66
66
  end # or else data not found in attributes(hash), not an issue as the data can be optional
67
67
  end
68
68
 
@@ -80,7 +80,7 @@ module OCI
80
80
  def to_hash
81
81
  hash = {}
82
82
  self.class.attribute_map.each_pair do |attr, param|
83
- value = public_send(attr)
83
+ value = public_method(attr).call
84
84
  next if value.nil? && !instance_variable_defined?("@#{attr}")
85
85
  hash[param] = _to_hash(value)
86
86
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
4
  require_relative 'instance_source_details'
@@ -59,10 +59,10 @@ module OCI
59
59
  # check to ensure the input is an array given that the the attribute
60
60
  # is documented as an array but the input is not
61
61
  if attributes[self.class.attribute_map[key]].is_a?(Array)
62
- self.public_send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
62
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
63
63
  end
64
64
  elsif !attributes[self.class.attribute_map[key]].nil?
65
- self.public_send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
65
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
66
66
  end # or else data not found in attributes(hash), not an issue as the data can be optional
67
67
  end
68
68
 
@@ -80,7 +80,7 @@ module OCI
80
80
  def to_hash
81
81
  hash = {}
82
82
  self.class.attribute_map.each_pair do |attr, param|
83
- value = public_send(attr)
83
+ value = public_method(attr).call
84
84
  next if value.nil? && !instance_variable_defined?("@#{attr}")
85
85
  hash[param] = _to_hash(value)
86
86
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
4
 
@@ -131,10 +131,10 @@ module OCI
131
131
  # check to ensure the input is an array given that the the attribute
132
132
  # is documented as an array but the input is not
133
133
  if attributes[self.class.attribute_map[key]].is_a?(Array)
134
- self.public_send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
134
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
135
135
  end
136
136
  elsif !attributes[self.class.attribute_map[key]].nil?
137
- self.public_send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
137
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
138
138
  end # or else data not found in attributes(hash), not an issue as the data can be optional
139
139
  end
140
140
 
@@ -152,7 +152,7 @@ module OCI
152
152
  def to_hash
153
153
  hash = {}
154
154
  self.class.attribute_map.each_pair do |attr, param|
155
- value = public_send(attr)
155
+ value = public_method(attr).call
156
156
  next if value.nil? && !instance_variable_defined?("@#{attr}")
157
157
  hash[param] = _to_hash(value)
158
158
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
4
 
@@ -142,10 +142,10 @@ module OCI
142
142
  # check to ensure the input is an array given that the the attribute
143
143
  # is documented as an array but the input is not
144
144
  if attributes[self.class.attribute_map[key]].is_a?(Array)
145
- self.public_send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
145
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
146
146
  end
147
147
  elsif !attributes[self.class.attribute_map[key]].nil?
148
- self.public_send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
148
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
149
149
  end # or else data not found in attributes(hash), not an issue as the data can be optional
150
150
  end
151
151
 
@@ -163,7 +163,7 @@ module OCI
163
163
  def to_hash
164
164
  hash = {}
165
165
  self.class.attribute_map.each_pair do |attr, param|
166
- value = public_send(attr)
166
+ value = public_method(attr).call
167
167
  next if value.nil? && !instance_variable_defined?("@#{attr}")
168
168
  hash[param] = _to_hash(value)
169
169
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
4
 
@@ -80,10 +80,10 @@ module OCI
80
80
  # check to ensure the input is an array given that the the attribute
81
81
  # is documented as an array but the input is not
82
82
  if attributes[self.class.attribute_map[key]].is_a?(Array)
83
- self.public_send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
83
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
84
84
  end
85
85
  elsif !attributes[self.class.attribute_map[key]].nil?
86
- self.public_send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
86
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
87
87
  end # or else data not found in attributes(hash), not an issue as the data can be optional
88
88
  end
89
89
 
@@ -101,7 +101,7 @@ module OCI
101
101
  def to_hash
102
102
  hash = {}
103
103
  self.class.attribute_map.each_pair do |attr, param|
104
- value = public_send(attr)
104
+ value = public_method(attr).call
105
105
  next if value.nil? && !instance_variable_defined?("@#{attr}")
106
106
  hash[param] = _to_hash(value)
107
107
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
4
 
@@ -83,10 +83,10 @@ module OCI
83
83
  # check to ensure the input is an array given that the the attribute
84
84
  # is documented as an array but the input is not
85
85
  if attributes[self.class.attribute_map[key]].is_a?(Array)
86
- self.public_send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
86
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
87
87
  end
88
88
  elsif !attributes[self.class.attribute_map[key]].nil?
89
- self.public_send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
89
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
90
90
  end # or else data not found in attributes(hash), not an issue as the data can be optional
91
91
  end
92
92
 
@@ -104,7 +104,7 @@ module OCI
104
104
  def to_hash
105
105
  hash = {}
106
106
  self.class.attribute_map.each_pair do |attr, param|
107
- value = public_send(attr)
107
+ value = public_method(attr).call
108
108
  next if value.nil? && !instance_variable_defined?("@#{attr}")
109
109
  hash[param] = _to_hash(value)
110
110
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
4
 
@@ -21,6 +21,14 @@ module OCI
21
21
  # @return [OCI::Core::Models::CreateVnicDetails]
22
22
  attr_accessor :create_vnic_details
23
23
 
24
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
25
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
26
+ #
27
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
28
+ #
29
+ # @return [Hash<String, Hash<String, Object>>]
30
+ attr_accessor :defined_tags
31
+
24
32
  # A user-friendly name. Does not have to be unique, and it's changeable.
25
33
  # Avoid entering confidential information.
26
34
  #
@@ -38,7 +46,16 @@ module OCI
38
46
  # @return [Hash<String, Object>]
39
47
  attr_accessor :extended_metadata
40
48
 
41
- # Deprecated. Instead Use `hostnameLabel` in
49
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
50
+ # predefined name, type, or namespace. For more information, see
51
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
52
+ #
53
+ # Example: `{\"Department\": \"Finance\"}`
54
+ #
55
+ # @return [Hash<String, String>]
56
+ attr_accessor :freeform_tags
57
+
58
+ # Deprecated. Instead use `hostnameLabel` in
42
59
  # {CreateVnicDetails}.
43
60
  # If you provide both, the values must match.
44
61
  #
@@ -150,6 +167,8 @@ module OCI
150
167
  attr_accessor :shape
151
168
 
152
169
  # Details for creating an instance.
170
+ # Use this parameter to specify whether a boot volume or an image should be used to launch a new instance.
171
+ #
153
172
  # @return [OCI::Core::Models::InstanceSourceDetails]
154
173
  attr_accessor :source_details
155
174
 
@@ -181,6 +200,10 @@ module OCI
181
200
  self.create_vnic_details = attributes[:'createVnicDetails']
182
201
  end
183
202
 
203
+ if attributes[:'definedTags']
204
+ self.defined_tags = attributes[:'definedTags']
205
+ end
206
+
184
207
  if attributes[:'displayName']
185
208
  self.display_name = attributes[:'displayName']
186
209
  end
@@ -189,6 +212,10 @@ module OCI
189
212
  self.extended_metadata = attributes[:'extendedMetadata']
190
213
  end
191
214
 
215
+ if attributes[:'freeformTags']
216
+ self.freeform_tags = attributes[:'freeformTags']
217
+ end
218
+
192
219
  if attributes[:'hostnameLabel']
193
220
  self.hostname_label = attributes[:'hostnameLabel']
194
221
  end
@@ -227,8 +254,10 @@ module OCI
227
254
  availability_domain == other_object.availability_domain &&
228
255
  compartment_id == other_object.compartment_id &&
229
256
  create_vnic_details == other_object.create_vnic_details &&
257
+ defined_tags == other_object.defined_tags &&
230
258
  display_name == other_object.display_name &&
231
259
  extended_metadata == other_object.extended_metadata &&
260
+ freeform_tags == other_object.freeform_tags &&
232
261
  hostname_label == other_object.hostname_label &&
233
262
  image_id == other_object.image_id &&
234
263
  ipxe_script == other_object.ipxe_script &&
@@ -247,7 +276,7 @@ module OCI
247
276
  # Calculates hash code according to all attributes.
248
277
  # @return [Fixnum] Hash code
249
278
  def hash
250
- [availability_domain, compartment_id, create_vnic_details, display_name, extended_metadata, hostname_label, image_id, ipxe_script, metadata, shape, source_details, subnet_id].hash
279
+ [availability_domain, compartment_id, create_vnic_details, defined_tags, display_name, extended_metadata, freeform_tags, hostname_label, image_id, ipxe_script, metadata, shape, source_details, subnet_id].hash
251
280
  end
252
281
 
253
282
  # Builds the object from hash
@@ -260,10 +289,10 @@ module OCI
260
289
  # check to ensure the input is an array given that the the attribute
261
290
  # is documented as an array but the input is not
262
291
  if attributes[self.class.attribute_map[key]].is_a?(Array)
263
- self.public_send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
292
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
264
293
  end
265
294
  elsif !attributes[self.class.attribute_map[key]].nil?
266
- self.public_send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
295
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
267
296
  end # or else data not found in attributes(hash), not an issue as the data can be optional
268
297
  end
269
298
 
@@ -281,7 +310,7 @@ module OCI
281
310
  def to_hash
282
311
  hash = {}
283
312
  self.class.attribute_map.each_pair do |attr, param|
284
- value = public_send(attr)
313
+ value = public_method(attr).call
285
314
  next if value.nil? && !instance_variable_defined?("@#{attr}")
286
315
  hash[param] = _to_hash(value)
287
316
  end
@@ -316,8 +345,10 @@ module OCI
316
345
  :'availability_domain' => :'availabilityDomain',
317
346
  :'compartment_id' => :'compartmentId',
318
347
  :'create_vnic_details' => :'createVnicDetails',
348
+ :'defined_tags' => :'definedTags',
319
349
  :'display_name' => :'displayName',
320
350
  :'extended_metadata' => :'extendedMetadata',
351
+ :'freeform_tags' => :'freeformTags',
321
352
  :'hostname_label' => :'hostnameLabel',
322
353
  :'image_id' => :'imageId',
323
354
  :'ipxe_script' => :'ipxeScript',
@@ -334,8 +365,10 @@ module OCI
334
365
  :'availability_domain' => :'String',
335
366
  :'compartment_id' => :'String',
336
367
  :'create_vnic_details' => :'OCI::Core::Models::CreateVnicDetails',
368
+ :'defined_tags' => :'Hash<String, Hash<String, Object>>',
337
369
  :'display_name' => :'String',
338
370
  :'extended_metadata' => :'Hash<String, Object>',
371
+ :'freeform_tags' => :'Hash<String, String>',
339
372
  :'hostname_label' => :'String',
340
373
  :'image_id' => :'String',
341
374
  :'ipxe_script' => :'String',
@@ -0,0 +1,239 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Core::Models::LaunchOptions
7
+
8
+ BOOT_VOLUME_TYPE_ENUM = [BOOT_VOLUME_TYPE_ISCSI = 'ISCSI',
9
+ BOOT_VOLUME_TYPE_SCSI = 'SCSI',
10
+ BOOT_VOLUME_TYPE_IDE = 'IDE',
11
+ BOOT_VOLUME_TYPE_VFIO = 'VFIO',
12
+ BOOT_VOLUME_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
13
+
14
+
15
+ FIRMWARE_ENUM = [FIRMWARE_BIOS = 'BIOS',
16
+ FIRMWARE_UEFI_64 = 'UEFI_64',
17
+ FIRMWARE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
18
+
19
+
20
+ NETWORK_TYPE_ENUM = [NETWORK_TYPE_E1000 = 'E1000',
21
+ NETWORK_TYPE_VFIO = 'VFIO',
22
+ NETWORK_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
23
+
24
+
25
+ REMOTE_DATA_VOLUME_TYPE_ENUM = [REMOTE_DATA_VOLUME_TYPE_ISCSI = 'ISCSI',
26
+ REMOTE_DATA_VOLUME_TYPE_SCSI = 'SCSI',
27
+ REMOTE_DATA_VOLUME_TYPE_IDE = 'IDE',
28
+ REMOTE_DATA_VOLUME_TYPE_VFIO = 'VFIO',
29
+ REMOTE_DATA_VOLUME_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
30
+
31
+ # Emulation type for volume.
32
+ # * `ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block
33
+ # Storage volumes on Oracle provided images.
34
+ # * `SCSI` - Emulated SCSI disk.
35
+ # * `IDE` - Emulated IDE disk.
36
+ # * `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data
37
+ # volumes on Oracle provided images.
38
+ #
39
+ # @return [String]
40
+ attr_accessor :boot_volume_type
41
+
42
+ # Firmware used to boot VM. Select the option that matches your operating system.
43
+ # * `BIOS` - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating
44
+ # systems that boot using MBR style bootloaders.
45
+ # * `UEFI_64` - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the
46
+ # default for Oracle provided images.
47
+ #
48
+ # @return [String]
49
+ attr_accessor :firmware
50
+
51
+ # Emulation type for NIC.
52
+ # * `E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver.
53
+ # * `VFIO` - Direct attached Virtual Function network controller. Default for Oracle provided images.
54
+ #
55
+ # @return [String]
56
+ attr_accessor :network_type
57
+
58
+ # Emulation type for volume.
59
+ # * `ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block
60
+ # Storage volumes on Oracle provided images.
61
+ # * `SCSI` - Emulated SCSI disk.
62
+ # * `IDE` - Emulated IDE disk.
63
+ # * `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data
64
+ # volumes on Oracle provided images.
65
+ #
66
+ # @return [String]
67
+ attr_accessor :remote_data_volume_type
68
+
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ return unless attributes.is_a?(Hash)
74
+
75
+ # convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
77
+
78
+ if attributes[:'bootVolumeType']
79
+ self.boot_volume_type = attributes[:'bootVolumeType']
80
+ end
81
+
82
+ if attributes[:'firmware']
83
+ self.firmware = attributes[:'firmware']
84
+ end
85
+
86
+ if attributes[:'networkType']
87
+ self.network_type = attributes[:'networkType']
88
+ end
89
+
90
+ if attributes[:'remoteDataVolumeType']
91
+ self.remote_data_volume_type = attributes[:'remoteDataVolumeType']
92
+ end
93
+
94
+ end
95
+
96
+ # Custom attribute writer method checking allowed values (enum).
97
+ # @param [Object] boot_volume_type Object to be assigned
98
+ def boot_volume_type=(boot_volume_type)
99
+ if boot_volume_type && !BOOT_VOLUME_TYPE_ENUM.include?(boot_volume_type)
100
+ @boot_volume_type = BOOT_VOLUME_TYPE_UNKNOWN_ENUM_VALUE
101
+ else
102
+ @boot_volume_type = boot_volume_type
103
+ end
104
+ end
105
+
106
+ # Custom attribute writer method checking allowed values (enum).
107
+ # @param [Object] firmware Object to be assigned
108
+ def firmware=(firmware)
109
+ if firmware && !FIRMWARE_ENUM.include?(firmware)
110
+ @firmware = FIRMWARE_UNKNOWN_ENUM_VALUE
111
+ else
112
+ @firmware = firmware
113
+ end
114
+ end
115
+
116
+ # Custom attribute writer method checking allowed values (enum).
117
+ # @param [Object] network_type Object to be assigned
118
+ def network_type=(network_type)
119
+ if network_type && !NETWORK_TYPE_ENUM.include?(network_type)
120
+ @network_type = NETWORK_TYPE_UNKNOWN_ENUM_VALUE
121
+ else
122
+ @network_type = network_type
123
+ end
124
+ end
125
+
126
+ # Custom attribute writer method checking allowed values (enum).
127
+ # @param [Object] remote_data_volume_type Object to be assigned
128
+ def remote_data_volume_type=(remote_data_volume_type)
129
+ if remote_data_volume_type && !REMOTE_DATA_VOLUME_TYPE_ENUM.include?(remote_data_volume_type)
130
+ @remote_data_volume_type = REMOTE_DATA_VOLUME_TYPE_UNKNOWN_ENUM_VALUE
131
+ else
132
+ @remote_data_volume_type = remote_data_volume_type
133
+ end
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] other_object to be compared
138
+ def ==(other_object)
139
+ return true if self.equal?(other_object)
140
+ self.class == other_object.class &&
141
+ boot_volume_type == other_object.boot_volume_type &&
142
+ firmware == other_object.firmware &&
143
+ network_type == other_object.network_type &&
144
+ remote_data_volume_type == other_object.remote_data_volume_type
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] other_object to be compared
149
+ def eql?(other_object)
150
+ self == other_object
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Fixnum] Hash code
155
+ def hash
156
+ [boot_volume_type, firmware, network_type, remote_data_volume_type].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ self.class.swagger_types.each_pair do |key, type|
165
+ if type =~ /^Array<(.*)>/i
166
+ # check to ensure the input is an array given that the the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
173
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = public_method(attr).call
191
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ private
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map{ |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+
218
+
219
+ # Attribute mapping from ruby-style variable name to JSON key.
220
+ def self.attribute_map
221
+ {
222
+ :'boot_volume_type' => :'bootVolumeType',
223
+ :'firmware' => :'firmware',
224
+ :'network_type' => :'networkType',
225
+ :'remote_data_volume_type' => :'remoteDataVolumeType'
226
+ }
227
+ end
228
+
229
+ # Attribute type mapping.
230
+ def self.swagger_types
231
+ {
232
+ :'boot_volume_type' => :'String',
233
+ :'firmware' => :'String',
234
+ :'network_type' => :'String',
235
+ :'remote_data_volume_type' => :'String'
236
+ }
237
+ end
238
+ end
239
+ end