oci 2.5.10 → 2.5.11

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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -1
  3. data/lib/oci.rb +3 -0
  4. data/lib/oci/budget/budget.rb +1 -0
  5. data/lib/oci/budget/budget_client.rb +21 -1
  6. data/lib/oci/budget/models/budget.rb +52 -2
  7. data/lib/oci/budget/models/budget_summary.rb +52 -2
  8. data/lib/oci/budget/models/create_budget_details.rb +55 -2
  9. data/lib/oci/budget/models/target_type.rb +10 -0
  10. data/lib/oci/core/blockstorage_client.rb +18 -6
  11. data/lib/oci/core/compute_client.rb +75 -0
  12. data/lib/oci/core/compute_management_client.rb +4 -1
  13. data/lib/oci/core/core.rb +12 -0
  14. data/lib/oci/core/models/add_security_rule_details.rb +2 -2
  15. data/lib/oci/core/models/boot_volume_backup.rb +19 -1
  16. data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +2 -2
  17. data/lib/oci/core/models/change_boot_volume_compartment_details.rb +2 -2
  18. data/lib/oci/core/models/change_cpe_compartment_details.rb +155 -0
  19. data/lib/oci/core/models/change_cross_connect_compartment_details.rb +155 -0
  20. data/lib/oci/core/models/change_cross_connect_group_compartment_details.rb +155 -0
  21. data/lib/oci/core/models/change_instance_compartment_details.rb +154 -0
  22. data/lib/oci/core/models/change_ip_sec_connection_compartment_details.rb +155 -0
  23. data/lib/oci/core/models/change_remote_peering_connection_compartment_details.rb +155 -0
  24. data/lib/oci/core/models/change_virtual_circuit_compartment_details.rb +155 -0
  25. data/lib/oci/core/models/change_volume_backup_compartment_details.rb +2 -2
  26. data/lib/oci/core/models/change_volume_compartment_details.rb +2 -2
  27. data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +2 -2
  28. data/lib/oci/core/models/change_volume_group_compartment_details.rb +2 -2
  29. data/lib/oci/core/models/copy_volume_backup_details.rb +27 -4
  30. data/lib/oci/core/models/create_cross_connect_details.rb +37 -1
  31. data/lib/oci/core/models/create_cross_connect_group_details.rb +40 -4
  32. data/lib/oci/core/models/create_instance_configuration_base.rb +250 -0
  33. data/lib/oci/core/models/create_instance_configuration_details.rb +15 -57
  34. data/lib/oci/core/models/create_instance_configuration_from_instance_details.rb +179 -0
  35. data/lib/oci/core/models/create_ipv6_details.rb +249 -0
  36. data/lib/oci/core/models/create_remote_peering_connection_details.rb +40 -4
  37. data/lib/oci/core/models/create_service_gateway_details.rb +23 -1
  38. data/lib/oci/core/models/create_subnet_details.rb +24 -1
  39. data/lib/oci/core/models/create_vcn_details.rb +56 -4
  40. data/lib/oci/core/models/create_virtual_circuit_details.rb +38 -2
  41. data/lib/oci/core/models/cross_connect.rb +37 -1
  42. data/lib/oci/core/models/cross_connect_group.rb +37 -1
  43. data/lib/oci/core/models/cross_connect_mapping.rb +50 -1
  44. data/lib/oci/core/models/egress_security_rule.rb +10 -7
  45. data/lib/oci/core/models/ingress_security_rule.rb +10 -7
  46. data/lib/oci/core/models/instance.rb +1 -0
  47. data/lib/oci/core/models/ipv6.rb +375 -0
  48. data/lib/oci/core/models/private_ip.rb +1 -0
  49. data/lib/oci/core/models/remote_peering_connection.rb +37 -1
  50. data/lib/oci/core/models/route_rule.rb +4 -1
  51. data/lib/oci/core/models/security_rule.rb +2 -2
  52. data/lib/oci/core/models/service_gateway.rb +18 -1
  53. data/lib/oci/core/models/subnet.rb +56 -1
  54. data/lib/oci/core/models/update_cross_connect_details.rb +37 -1
  55. data/lib/oci/core/models/update_cross_connect_group_details.rb +40 -4
  56. data/lib/oci/core/models/update_ipv6_details.rb +229 -0
  57. data/lib/oci/core/models/update_remote_peering_connection_details.rb +40 -4
  58. data/lib/oci/core/models/update_security_rule_details.rb +2 -2
  59. data/lib/oci/core/models/update_service_gateway_details.rb +18 -1
  60. data/lib/oci/core/models/update_virtual_circuit_details.rb +37 -1
  61. data/lib/oci/core/models/vcn.rb +42 -1
  62. data/lib/oci/core/models/virtual_circuit.rb +37 -1
  63. data/lib/oci/core/models/volume_backup.rb +19 -1
  64. data/lib/oci/core/virtual_network_client.rb +744 -10
  65. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  66. data/lib/oci/database/database.rb +3 -0
  67. data/lib/oci/database/database_client.rb +320 -36
  68. data/lib/oci/database/models/autonomous_data_warehouse.rb +1 -0
  69. data/lib/oci/database/models/autonomous_data_warehouse_console_token_details.rb +164 -0
  70. data/lib/oci/database/models/autonomous_data_warehouse_summary.rb +1 -0
  71. data/lib/oci/database/models/autonomous_database.rb +5 -3
  72. data/lib/oci/database/models/autonomous_database_connection_urls.rb +1 -1
  73. data/lib/oci/database/models/autonomous_database_console_token_details.rb +163 -0
  74. data/lib/oci/database/models/autonomous_database_summary.rb +5 -3
  75. data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +1 -3
  76. data/lib/oci/database/models/change_compartment_details.rb +155 -0
  77. data/lib/oci/database/models/create_autonomous_database_base.rb +5 -4
  78. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +2 -5
  79. data/lib/oci/database/models/create_database_details.rb +1 -1
  80. data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +2 -1
  81. data/lib/oci/database/models/create_db_home_with_db_system_id_from_backup_details.rb +2 -1
  82. data/lib/oci/database/models/db_system.rb +2 -5
  83. data/lib/oci/database/models/db_system_summary.rb +2 -5
  84. data/lib/oci/database/models/launch_db_system_base.rb +3 -5
  85. data/lib/oci/database/models/maintenance_window.rb +2 -1
  86. data/lib/oci/database/models/update_autonomous_database_details.rb +5 -3
  87. data/lib/oci/database/models/update_db_system_details.rb +2 -5
  88. data/lib/oci/dns/dns.rb +2 -0
  89. data/lib/oci/dns/dns_client.rb +138 -1
  90. data/lib/oci/dns/models/change_steering_policy_compartment_details.rb +155 -0
  91. data/lib/oci/dns/models/change_zone_compartment_details.rb +155 -0
  92. data/lib/oci/events/events.rb +34 -0
  93. data/lib/oci/events/events_client.rb +537 -0
  94. data/lib/oci/events/events_client_composite_operations.rb +145 -0
  95. data/lib/oci/events/models/action.rb +275 -0
  96. data/lib/oci/events/models/action_details.rb +222 -0
  97. data/lib/oci/events/models/action_details_list.rb +150 -0
  98. data/lib/oci/events/models/action_list.rb +151 -0
  99. data/lib/oci/events/models/change_rule_compartment_details.rb +156 -0
  100. data/lib/oci/events/models/create_faa_s_action_details.rb +170 -0
  101. data/lib/oci/events/models/create_notification_service_action_details.rb +170 -0
  102. data/lib/oci/events/models/create_rule_details.rb +284 -0
  103. data/lib/oci/events/models/create_streaming_service_action_details.rb +170 -0
  104. data/lib/oci/events/models/faa_s_action.rb +178 -0
  105. data/lib/oci/events/models/notification_service_action.rb +179 -0
  106. data/lib/oci/events/models/rule.rb +372 -0
  107. data/lib/oci/events/models/rule_summary.rb +321 -0
  108. data/lib/oci/events/models/streaming_service_action.rb +178 -0
  109. data/lib/oci/events/models/update_rule_details.rb +266 -0
  110. data/lib/oci/events/util.rb +2 -0
  111. data/lib/oci/functions/functions.rb +29 -0
  112. data/lib/oci/functions/functions_invoke_client.rb +237 -0
  113. data/lib/oci/functions/functions_invoke_client_composite_operations.rb +24 -0
  114. data/lib/oci/functions/functions_management_client.rb +851 -0
  115. data/lib/oci/functions/functions_management_client_composite_operations.rb +266 -0
  116. data/lib/oci/functions/models/application.rb +322 -0
  117. data/lib/oci/functions/models/application_summary.rb +281 -0
  118. data/lib/oci/functions/models/change_application_compartment_details.rb +156 -0
  119. data/lib/oci/functions/models/create_application_details.rb +236 -0
  120. data/lib/oci/functions/models/create_function_details.rb +280 -0
  121. data/lib/oci/functions/models/function.rb +397 -0
  122. data/lib/oci/functions/models/function_summary.rb +381 -0
  123. data/lib/oci/functions/models/update_application_details.rb +191 -0
  124. data/lib/oci/functions/models/update_function_details.rb +250 -0
  125. data/lib/oci/functions/util.rb +2 -0
  126. data/lib/oci/healthchecks/health_checks_client.rb +147 -1
  127. data/lib/oci/healthchecks/healthchecks.rb +2 -0
  128. data/lib/oci/healthchecks/models/change_http_monitor_compartment_details.rb +155 -0
  129. data/lib/oci/healthchecks/models/change_ping_monitor_compartment_details.rb +155 -0
  130. data/lib/oci/healthchecks/models/create_http_monitor_details.rb +2 -1
  131. data/lib/oci/healthchecks/models/create_on_demand_http_probe_details.rb +2 -1
  132. data/lib/oci/healthchecks/models/create_on_demand_ping_probe_details.rb +2 -1
  133. data/lib/oci/healthchecks/models/create_ping_monitor_details.rb +2 -1
  134. data/lib/oci/healthchecks/models/http_monitor.rb +2 -0
  135. data/lib/oci/healthchecks/models/http_probe.rb +2 -0
  136. data/lib/oci/healthchecks/models/ping_monitor.rb +2 -0
  137. data/lib/oci/healthchecks/models/ping_probe.rb +2 -0
  138. data/lib/oci/healthchecks/models/update_http_monitor_details.rb +2 -0
  139. data/lib/oci/healthchecks/models/update_ping_monitor_details.rb +2 -0
  140. data/lib/oci/identity/identity.rb +1 -0
  141. data/lib/oci/identity/identity_client.rb +70 -0
  142. data/lib/oci/identity/identity_client_composite_operations.rb +50 -0
  143. data/lib/oci/identity/models/move_compartment_details.rb +155 -0
  144. data/lib/oci/key_management/key_management.rb +2 -0
  145. data/lib/oci/key_management/kms_management_client.rb +73 -0
  146. data/lib/oci/key_management/kms_vault_client.rb +73 -0
  147. data/lib/oci/key_management/models/change_key_compartment_details.rb +153 -0
  148. data/lib/oci/key_management/models/change_vault_compartment_details.rb +153 -0
  149. data/lib/oci/key_management/models/key.rb +1 -0
  150. data/lib/oci/key_management/models/key_summary.rb +1 -0
  151. data/lib/oci/key_management/models/vault.rb +1 -0
  152. data/lib/oci/key_management/models/vault_summary.rb +1 -0
  153. data/lib/oci/limits/limits.rb +23 -0
  154. data/lib/oci/limits/models/create_quota_details.rb +220 -0
  155. data/lib/oci/limits/models/quota.rb +287 -0
  156. data/lib/oci/limits/models/quota_summary.rb +273 -0
  157. data/lib/oci/limits/models/update_quota_details.rb +194 -0
  158. data/lib/oci/limits/quotas_client.rb +439 -0
  159. data/lib/oci/limits/quotas_client_composite_operations.rb +143 -0
  160. data/lib/oci/limits/util.rb +2 -0
  161. data/lib/oci/load_balancer/load_balancer.rb +9 -0
  162. data/lib/oci/load_balancer/load_balancer_client.rb +139 -0
  163. data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
  164. data/lib/oci/load_balancer/models/allow_rule.rb +181 -0
  165. data/lib/oci/load_balancer/models/backend_set.rb +21 -4
  166. data/lib/oci/load_balancer/models/backend_set_details.rb +21 -4
  167. data/lib/oci/load_balancer/models/change_load_balancer_compartment_details.rb +156 -0
  168. data/lib/oci/load_balancer/models/control_access_using_http_methods_rule.rb +205 -0
  169. data/lib/oci/load_balancer/models/create_backend_set_details.rb +21 -4
  170. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +37 -1
  171. data/lib/oci/load_balancer/models/lb_cookie_session_persistence_configuration_details.rb +334 -0
  172. data/lib/oci/load_balancer/models/listener_rule_summary.rb +166 -0
  173. data/lib/oci/load_balancer/models/rule.rb +4 -0
  174. data/lib/oci/load_balancer/models/rule_condition.rb +192 -0
  175. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +6 -0
  176. data/lib/oci/load_balancer/models/source_ip_address_condition.rb +167 -0
  177. data/lib/oci/load_balancer/models/source_vcn_id_condition.rb +169 -0
  178. data/lib/oci/load_balancer/models/source_vcn_ip_address_condition.rb +171 -0
  179. data/lib/oci/load_balancer/models/update_backend_set_details.rb +21 -4
  180. data/lib/oci/monitoring/models/alarm.rb +4 -3
  181. data/lib/oci/monitoring/models/alarm_summary.rb +4 -3
  182. data/lib/oci/monitoring/models/change_alarm_compartment_details.rb +155 -0
  183. data/lib/oci/monitoring/models/create_alarm_details.rb +4 -3
  184. data/lib/oci/monitoring/models/datapoint.rb +1 -1
  185. data/lib/oci/monitoring/models/list_metrics_details.rb +4 -4
  186. data/lib/oci/monitoring/models/metric_data.rb +14 -0
  187. data/lib/oci/monitoring/models/metric_data_details.rb +6 -4
  188. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +3 -0
  189. data/lib/oci/monitoring/models/update_alarm_details.rb +4 -3
  190. data/lib/oci/monitoring/monitoring.rb +1 -0
  191. data/lib/oci/monitoring/monitoring_client.rb +140 -5
  192. data/lib/oci/ons/models/backoff_retry_policy.rb +2 -2
  193. data/lib/oci/ons/models/change_compartment_details.rb +156 -0
  194. data/lib/oci/ons/models/confirmation_result.rb +5 -6
  195. data/lib/oci/ons/models/create_topic_details.rb +1 -1
  196. data/lib/oci/ons/models/notification_topic.rb +2 -2
  197. data/lib/oci/ons/models/notification_topic_summary.rb +2 -2
  198. data/lib/oci/ons/models/subscription.rb +47 -4
  199. data/lib/oci/ons/models/subscription_summary.rb +19 -3
  200. data/lib/oci/ons/notification_control_plane_client.rb +95 -8
  201. data/lib/oci/ons/notification_data_plane_client.rb +109 -8
  202. data/lib/oci/ons/ons.rb +1 -0
  203. data/lib/oci/regions.rb +3 -0
  204. data/lib/oci/streaming/models/change_stream_compartment_details.rb +155 -0
  205. data/lib/oci/streaming/stream_admin_client.rb +58 -0
  206. data/lib/oci/streaming/streaming.rb +1 -0
  207. data/lib/oci/version.rb +1 -1
  208. data/lib/oci/waas/models/access_rule_criteria.rb +14 -2
  209. data/lib/oci/waas/models/change_certificate_compartment_details.rb +154 -0
  210. data/lib/oci/waas/models/change_waas_policy_compartment_details.rb +154 -0
  211. data/lib/oci/waas/models/create_certificate_details.rb +2 -2
  212. data/lib/oci/waas/models/protection_rule_exclusion.rb +16 -1
  213. data/lib/oci/waas/models/protection_settings.rb +9 -5
  214. data/lib/oci/waas/models/waas_policy.rb +1 -1
  215. data/lib/oci/waas/models/waf_config_details.rb +8 -8
  216. data/lib/oci/waas/models/waf_log.rb +40 -19
  217. data/lib/oci/waas/waas.rb +2 -0
  218. data/lib/oci/waas/waas_client.rb +155 -27
  219. data/lib/oci/work_requests/models/work_request.rb +14 -8
  220. data/lib/oci/work_requests/models/work_request_error.rb +3 -3
  221. data/lib/oci/work_requests/models/work_request_log_entry.rb +2 -2
  222. data/lib/oci/work_requests/models/work_request_resource.rb +9 -7
  223. data/lib/oci/work_requests/models/work_request_summary.rb +12 -6
  224. data/lib/oci/work_requests/work_request_client.rb +33 -16
  225. metadata +81 -2
@@ -0,0 +1,280 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # Properties to create a new function.
8
+ #
9
+ class Functions::Models::CreateFunctionDetails
10
+ # **[Required]** The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.
11
+ #
12
+ # @return [String]
13
+ attr_accessor :display_name
14
+
15
+ # **[Required]** The OCID of the application this function belongs to.
16
+ # @return [String]
17
+ attr_accessor :application_id
18
+
19
+ # **[Required]** The qualified name of the Docker image to use in the function, including the image tag.
20
+ # The image should be in the OCI Registry that is in the same region as the function itself.
21
+ # Example: `phx.ocir.io/ten/functions/function:0.0.1`
22
+ #
23
+ # @return [String]
24
+ attr_accessor :image
25
+
26
+ # The image digest for the version of the image that will be pulled when invoking this function.
27
+ # If no value is specified, the digest currently associated with the image in the OCI Registry will be used.
28
+ # Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`
29
+ #
30
+ # @return [String]
31
+ attr_accessor :image_digest
32
+
33
+ # **[Required]** Maximum usable memory for the function (MiB).
34
+ # @return [Integer]
35
+ attr_accessor :memory_in_m_bs
36
+
37
+ # Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values.
38
+ # Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
39
+ #
40
+ # Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
41
+ #
42
+ # The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.
43
+ #
44
+ # @return [Hash<String, String>]
45
+ attr_accessor :config
46
+
47
+ # Timeout for executions of the function. Value in seconds.
48
+ # @return [Integer]
49
+ attr_accessor :timeout_in_seconds
50
+
51
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
52
+ # For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
53
+ #
54
+ # Example: `{\"Department\": \"Finance\"}`
55
+ #
56
+ # @return [Hash<String, String>]
57
+ attr_accessor :freeform_tags
58
+
59
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
60
+ #
61
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
62
+ #
63
+ # @return [Hash<String, Hash<String, Object>>]
64
+ attr_accessor :defined_tags
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ # rubocop:disable Style/SymbolLiteral
70
+ 'display_name': :'displayName',
71
+ 'application_id': :'applicationId',
72
+ 'image': :'image',
73
+ 'image_digest': :'imageDigest',
74
+ 'memory_in_m_bs': :'memoryInMBs',
75
+ 'config': :'config',
76
+ 'timeout_in_seconds': :'timeoutInSeconds',
77
+ 'freeform_tags': :'freeformTags',
78
+ 'defined_tags': :'definedTags'
79
+ # rubocop:enable Style/SymbolLiteral
80
+ }
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.swagger_types
85
+ {
86
+ # rubocop:disable Style/SymbolLiteral
87
+ 'display_name': :'String',
88
+ 'application_id': :'String',
89
+ 'image': :'String',
90
+ 'image_digest': :'String',
91
+ 'memory_in_m_bs': :'Integer',
92
+ 'config': :'Hash<String, String>',
93
+ 'timeout_in_seconds': :'Integer',
94
+ 'freeform_tags': :'Hash<String, String>',
95
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
96
+ # rubocop:enable Style/SymbolLiteral
97
+ }
98
+ end
99
+
100
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
101
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
102
+
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
107
+ # @option attributes [String] :application_id The value to assign to the {#application_id} property
108
+ # @option attributes [String] :image The value to assign to the {#image} property
109
+ # @option attributes [String] :image_digest The value to assign to the {#image_digest} property
110
+ # @option attributes [Integer] :memory_in_m_bs The value to assign to the {#memory_in_m_bs} property
111
+ # @option attributes [Hash<String, String>] :config The value to assign to the {#config} property
112
+ # @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
113
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
114
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
115
+ def initialize(attributes = {})
116
+ return unless attributes.is_a?(Hash)
117
+
118
+ # convert string to symbol for hash key
119
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
120
+
121
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
122
+
123
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
124
+
125
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
126
+
127
+ self.application_id = attributes[:'applicationId'] if attributes[:'applicationId']
128
+
129
+ raise 'You cannot provide both :applicationId and :application_id' if attributes.key?(:'applicationId') && attributes.key?(:'application_id')
130
+
131
+ self.application_id = attributes[:'application_id'] if attributes[:'application_id']
132
+
133
+ self.image = attributes[:'image'] if attributes[:'image']
134
+
135
+ self.image_digest = attributes[:'imageDigest'] if attributes[:'imageDigest']
136
+
137
+ raise 'You cannot provide both :imageDigest and :image_digest' if attributes.key?(:'imageDigest') && attributes.key?(:'image_digest')
138
+
139
+ self.image_digest = attributes[:'image_digest'] if attributes[:'image_digest']
140
+
141
+ self.memory_in_m_bs = attributes[:'memoryInMBs'] if attributes[:'memoryInMBs']
142
+
143
+ raise 'You cannot provide both :memoryInMBs and :memory_in_m_bs' if attributes.key?(:'memoryInMBs') && attributes.key?(:'memory_in_m_bs')
144
+
145
+ self.memory_in_m_bs = attributes[:'memory_in_m_bs'] if attributes[:'memory_in_m_bs']
146
+
147
+ self.config = attributes[:'config'] if attributes[:'config']
148
+
149
+ self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
150
+ self.timeout_in_seconds = 30 if timeout_in_seconds.nil? && !attributes.key?(:'timeoutInSeconds') # rubocop:disable Style/StringLiterals
151
+
152
+ raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
153
+
154
+ self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
155
+ self.timeout_in_seconds = 30 if timeout_in_seconds.nil? && !attributes.key?(:'timeoutInSeconds') && !attributes.key?(:'timeout_in_seconds') # rubocop:disable Style/StringLiterals
156
+
157
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
158
+
159
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
160
+
161
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
162
+
163
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
164
+
165
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
166
+
167
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
168
+ end
169
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
170
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
171
+
172
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
173
+
174
+
175
+ # Checks equality by comparing each attribute.
176
+ # @param [Object] other the other object to be compared
177
+ def ==(other)
178
+ return true if equal?(other)
179
+
180
+ self.class == other.class &&
181
+ display_name == other.display_name &&
182
+ application_id == other.application_id &&
183
+ image == other.image &&
184
+ image_digest == other.image_digest &&
185
+ memory_in_m_bs == other.memory_in_m_bs &&
186
+ config == other.config &&
187
+ timeout_in_seconds == other.timeout_in_seconds &&
188
+ freeform_tags == other.freeform_tags &&
189
+ defined_tags == other.defined_tags
190
+ end
191
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
192
+
193
+ # @see the `==` method
194
+ # @param [Object] other the other object to be compared
195
+ def eql?(other)
196
+ self == other
197
+ end
198
+
199
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
200
+
201
+
202
+ # Calculates hash code according to all attributes.
203
+ # @return [Fixnum] Hash code
204
+ def hash
205
+ [display_name, application_id, image, image_digest, memory_in_m_bs, config, timeout_in_seconds, freeform_tags, defined_tags].hash
206
+ end
207
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
208
+
209
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
210
+
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+
218
+ self.class.swagger_types.each_pair do |key, type|
219
+ if type =~ /^Array<(.*)>/i
220
+ # check to ensure the input is an array given that the the attribute
221
+ # is documented as an array but the input is not
222
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
223
+ public_method("#{key}=").call(
224
+ attributes[self.class.attribute_map[key]]
225
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
226
+ )
227
+ end
228
+ elsif !attributes[self.class.attribute_map[key]].nil?
229
+ public_method("#{key}=").call(
230
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
231
+ )
232
+ end
233
+ # or else data not found in attributes(hash), not an issue as the data can be optional
234
+ end
235
+
236
+ self
237
+ end
238
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = public_method(attr).call
252
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
253
+
254
+ hash[param] = _to_hash(value)
255
+ end
256
+ hash
257
+ end
258
+
259
+ private
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+ end
279
+ end
280
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,397 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
+ module OCI
8
+ # A function resource defines the code (Docker image) and configuration for a specific function. Functions are defined in applications. Avoid entering confidential information.
9
+ #
10
+ class Functions::Models::Function
11
+ LIFECYCLE_STATE_ENUM = [
12
+ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
13
+ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
14
+ LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
15
+ LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
16
+ LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
17
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
18
+ LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
19
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
20
+ ].freeze
21
+
22
+ # The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the function.
23
+ #
24
+ # @return [String]
25
+ attr_accessor :id
26
+
27
+ # The display name of the function. The display name is unique within the application containing the function.
28
+ #
29
+ # @return [String]
30
+ attr_accessor :display_name
31
+
32
+ # The current state of the function.
33
+ #
34
+ # @return [String]
35
+ attr_reader :lifecycle_state
36
+
37
+ # The OCID of the application the function belongs to.
38
+ # @return [String]
39
+ attr_accessor :application_id
40
+
41
+ # The OCID of the compartment that contains the function.
42
+ #
43
+ # @return [String]
44
+ attr_accessor :compartment_id
45
+
46
+ # The qualified name of the Docker image to use in the function, including the image tag.
47
+ # The image should be in the OCI Registry that is in the same region as the function itself.
48
+ # Example: `phx.ocir.io/ten/functions/function:0.0.1`
49
+ #
50
+ # @return [String]
51
+ attr_accessor :image
52
+
53
+ # The image digest for the version of the image that will be pulled when invoking this function.
54
+ # If no value is specified, the digest currently associated with the image in the OCI Registry will be used.
55
+ # Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7`
56
+ #
57
+ # @return [String]
58
+ attr_accessor :image_digest
59
+
60
+ # Maximum usable memory for the function (MiB).
61
+ # @return [Integer]
62
+ attr_accessor :memory_in_m_bs
63
+
64
+ # Function configuration. Overrides application configuration.
65
+ # Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters.
66
+ #
67
+ # Example: `{\"MY_FUNCTION_CONFIG\": \"ConfVal\"}`
68
+ #
69
+ # The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.
70
+ #
71
+ # @return [Hash<String, String>]
72
+ attr_accessor :config
73
+
74
+ # Timeout for executions of the function. Value in seconds.
75
+ # @return [Integer]
76
+ attr_accessor :timeout_in_seconds
77
+
78
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
79
+ # For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
80
+ #
81
+ # Example: `{\"Department\": \"Finance\"}`
82
+ #
83
+ # @return [Hash<String, String>]
84
+ attr_accessor :freeform_tags
85
+
86
+ # The base https invoke URL to set on a client in order to invoke a function. This URL will never change over the lifetime of the function and can be cached.
87
+ #
88
+ # @return [String]
89
+ attr_accessor :invoke_endpoint
90
+
91
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
92
+ #
93
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
94
+ #
95
+ # @return [Hash<String, Hash<String, Object>>]
96
+ attr_accessor :defined_tags
97
+
98
+ # The time the function was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339)
99
+ # timestamp format.
100
+ #
101
+ # Example: `2018-09-12T22:47:12.613Z`
102
+ #
103
+ # @return [DateTime]
104
+ attr_accessor :time_created
105
+
106
+ # The time the function was updated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339)
107
+ # timestamp format.
108
+ #
109
+ # Example: `2018-09-12T22:47:12.613Z`
110
+ #
111
+ # @return [DateTime]
112
+ attr_accessor :time_updated
113
+
114
+ # Attribute mapping from ruby-style variable name to JSON key.
115
+ def self.attribute_map
116
+ {
117
+ # rubocop:disable Style/SymbolLiteral
118
+ 'id': :'id',
119
+ 'display_name': :'displayName',
120
+ 'lifecycle_state': :'lifecycleState',
121
+ 'application_id': :'applicationId',
122
+ 'compartment_id': :'compartmentId',
123
+ 'image': :'image',
124
+ 'image_digest': :'imageDigest',
125
+ 'memory_in_m_bs': :'memoryInMBs',
126
+ 'config': :'config',
127
+ 'timeout_in_seconds': :'timeoutInSeconds',
128
+ 'freeform_tags': :'freeformTags',
129
+ 'invoke_endpoint': :'invokeEndpoint',
130
+ 'defined_tags': :'definedTags',
131
+ 'time_created': :'timeCreated',
132
+ 'time_updated': :'timeUpdated'
133
+ # rubocop:enable Style/SymbolLiteral
134
+ }
135
+ end
136
+
137
+ # Attribute type mapping.
138
+ def self.swagger_types
139
+ {
140
+ # rubocop:disable Style/SymbolLiteral
141
+ 'id': :'String',
142
+ 'display_name': :'String',
143
+ 'lifecycle_state': :'String',
144
+ 'application_id': :'String',
145
+ 'compartment_id': :'String',
146
+ 'image': :'String',
147
+ 'image_digest': :'String',
148
+ 'memory_in_m_bs': :'Integer',
149
+ 'config': :'Hash<String, String>',
150
+ 'timeout_in_seconds': :'Integer',
151
+ 'freeform_tags': :'Hash<String, String>',
152
+ 'invoke_endpoint': :'String',
153
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
154
+ 'time_created': :'DateTime',
155
+ 'time_updated': :'DateTime'
156
+ # rubocop:enable Style/SymbolLiteral
157
+ }
158
+ end
159
+
160
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
161
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
162
+
163
+
164
+ # Initializes the object
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @option attributes [String] :id The value to assign to the {#id} property
167
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
168
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
169
+ # @option attributes [String] :application_id The value to assign to the {#application_id} property
170
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
171
+ # @option attributes [String] :image The value to assign to the {#image} property
172
+ # @option attributes [String] :image_digest The value to assign to the {#image_digest} property
173
+ # @option attributes [Integer] :memory_in_m_bs The value to assign to the {#memory_in_m_bs} property
174
+ # @option attributes [Hash<String, String>] :config The value to assign to the {#config} property
175
+ # @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
176
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
177
+ # @option attributes [String] :invoke_endpoint The value to assign to the {#invoke_endpoint} property
178
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
179
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
180
+ # @option attributes [DateTime] :time_updated The value to assign to the {#time_updated} property
181
+ def initialize(attributes = {})
182
+ return unless attributes.is_a?(Hash)
183
+
184
+ # convert string to symbol for hash key
185
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
186
+
187
+ self.id = attributes[:'id'] if attributes[:'id']
188
+
189
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
190
+
191
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
192
+
193
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
194
+
195
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
196
+
197
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
198
+
199
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
200
+
201
+ self.application_id = attributes[:'applicationId'] if attributes[:'applicationId']
202
+
203
+ raise 'You cannot provide both :applicationId and :application_id' if attributes.key?(:'applicationId') && attributes.key?(:'application_id')
204
+
205
+ self.application_id = attributes[:'application_id'] if attributes[:'application_id']
206
+
207
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
208
+
209
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
210
+
211
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
212
+
213
+ self.image = attributes[:'image'] if attributes[:'image']
214
+
215
+ self.image_digest = attributes[:'imageDigest'] if attributes[:'imageDigest']
216
+
217
+ raise 'You cannot provide both :imageDigest and :image_digest' if attributes.key?(:'imageDigest') && attributes.key?(:'image_digest')
218
+
219
+ self.image_digest = attributes[:'image_digest'] if attributes[:'image_digest']
220
+
221
+ self.memory_in_m_bs = attributes[:'memoryInMBs'] if attributes[:'memoryInMBs']
222
+
223
+ raise 'You cannot provide both :memoryInMBs and :memory_in_m_bs' if attributes.key?(:'memoryInMBs') && attributes.key?(:'memory_in_m_bs')
224
+
225
+ self.memory_in_m_bs = attributes[:'memory_in_m_bs'] if attributes[:'memory_in_m_bs']
226
+
227
+ self.config = attributes[:'config'] if attributes[:'config']
228
+
229
+ self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
230
+ self.timeout_in_seconds = 30 if timeout_in_seconds.nil? && !attributes.key?(:'timeoutInSeconds') # rubocop:disable Style/StringLiterals
231
+
232
+ raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
233
+
234
+ self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
235
+ self.timeout_in_seconds = 30 if timeout_in_seconds.nil? && !attributes.key?(:'timeoutInSeconds') && !attributes.key?(:'timeout_in_seconds') # rubocop:disable Style/StringLiterals
236
+
237
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
238
+
239
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
240
+
241
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
242
+
243
+ self.invoke_endpoint = attributes[:'invokeEndpoint'] if attributes[:'invokeEndpoint']
244
+
245
+ raise 'You cannot provide both :invokeEndpoint and :invoke_endpoint' if attributes.key?(:'invokeEndpoint') && attributes.key?(:'invoke_endpoint')
246
+
247
+ self.invoke_endpoint = attributes[:'invoke_endpoint'] if attributes[:'invoke_endpoint']
248
+
249
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
250
+
251
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
252
+
253
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
254
+
255
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
256
+
257
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
258
+
259
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
260
+
261
+ self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']
262
+
263
+ raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated')
264
+
265
+ self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated']
266
+ end
267
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
268
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
269
+
270
+ # Custom attribute writer method checking allowed values (enum).
271
+ # @param [Object] lifecycle_state Object to be assigned
272
+ def lifecycle_state=(lifecycle_state)
273
+ # rubocop:disable Style/ConditionalAssignment
274
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
275
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
276
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
277
+ else
278
+ @lifecycle_state = lifecycle_state
279
+ end
280
+ # rubocop:enable Style/ConditionalAssignment
281
+ end
282
+
283
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
284
+
285
+
286
+ # Checks equality by comparing each attribute.
287
+ # @param [Object] other the other object to be compared
288
+ def ==(other)
289
+ return true if equal?(other)
290
+
291
+ self.class == other.class &&
292
+ id == other.id &&
293
+ display_name == other.display_name &&
294
+ lifecycle_state == other.lifecycle_state &&
295
+ application_id == other.application_id &&
296
+ compartment_id == other.compartment_id &&
297
+ image == other.image &&
298
+ image_digest == other.image_digest &&
299
+ memory_in_m_bs == other.memory_in_m_bs &&
300
+ config == other.config &&
301
+ timeout_in_seconds == other.timeout_in_seconds &&
302
+ freeform_tags == other.freeform_tags &&
303
+ invoke_endpoint == other.invoke_endpoint &&
304
+ defined_tags == other.defined_tags &&
305
+ time_created == other.time_created &&
306
+ time_updated == other.time_updated
307
+ end
308
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
309
+
310
+ # @see the `==` method
311
+ # @param [Object] other the other object to be compared
312
+ def eql?(other)
313
+ self == other
314
+ end
315
+
316
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
317
+
318
+
319
+ # Calculates hash code according to all attributes.
320
+ # @return [Fixnum] Hash code
321
+ def hash
322
+ [id, display_name, lifecycle_state, application_id, compartment_id, image, image_digest, memory_in_m_bs, config, timeout_in_seconds, freeform_tags, invoke_endpoint, defined_tags, time_created, time_updated].hash
323
+ end
324
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
325
+
326
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
327
+
328
+
329
+ # Builds the object from hash
330
+ # @param [Hash] attributes Model attributes in the form of hash
331
+ # @return [Object] Returns the model itself
332
+ def build_from_hash(attributes)
333
+ return nil unless attributes.is_a?(Hash)
334
+
335
+ self.class.swagger_types.each_pair do |key, type|
336
+ if type =~ /^Array<(.*)>/i
337
+ # check to ensure the input is an array given that the the attribute
338
+ # is documented as an array but the input is not
339
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
340
+ public_method("#{key}=").call(
341
+ attributes[self.class.attribute_map[key]]
342
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
343
+ )
344
+ end
345
+ elsif !attributes[self.class.attribute_map[key]].nil?
346
+ public_method("#{key}=").call(
347
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
348
+ )
349
+ end
350
+ # or else data not found in attributes(hash), not an issue as the data can be optional
351
+ end
352
+
353
+ self
354
+ end
355
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
356
+
357
+ # Returns the string representation of the object
358
+ # @return [String] String presentation of the object
359
+ def to_s
360
+ to_hash.to_s
361
+ end
362
+
363
+ # Returns the object in the form of hash
364
+ # @return [Hash] Returns the object in the form of hash
365
+ def to_hash
366
+ hash = {}
367
+ self.class.attribute_map.each_pair do |attr, param|
368
+ value = public_method(attr).call
369
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
370
+
371
+ hash[param] = _to_hash(value)
372
+ end
373
+ hash
374
+ end
375
+
376
+ private
377
+
378
+ # Outputs non-array value in the form of hash
379
+ # For object, use to_hash. Otherwise, just return the value
380
+ # @param [Object] value Any valid value
381
+ # @return [Hash] Returns the value in the form of hash
382
+ def _to_hash(value)
383
+ if value.is_a?(Array)
384
+ value.compact.map { |v| _to_hash(v) }
385
+ elsif value.is_a?(Hash)
386
+ {}.tap do |hash|
387
+ value.each { |k, v| hash[k] = _to_hash(v) }
388
+ end
389
+ elsif value.respond_to? :to_hash
390
+ value.to_hash
391
+ else
392
+ value
393
+ end
394
+ end
395
+ end
396
+ end
397
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength