oci 2.5.9 → 2.5.10

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 (129) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/autoscaling/auto_scaling_client.rb +73 -0
  4. data/lib/oci/autoscaling/autoscaling.rb +1 -0
  5. data/lib/oci/autoscaling/models/change_auto_scaling_compartment_details.rb +154 -0
  6. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +0 -1
  7. data/lib/oci/container_engine/models/work_request_error.rb +0 -1
  8. data/lib/oci/core/blockstorage_client.rb +342 -0
  9. data/lib/oci/core/compute_client.rb +77 -5
  10. data/lib/oci/core/compute_client_composite_operations.rb +3 -3
  11. data/lib/oci/core/compute_management_client.rb +211 -0
  12. data/lib/oci/core/core.rb +27 -0
  13. data/lib/oci/core/models/add_network_security_group_security_rules_details.rb +153 -0
  14. data/lib/oci/core/models/add_security_rule_details.rb +388 -0
  15. data/lib/oci/core/models/added_network_security_group_security_rules.rb +153 -0
  16. data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +153 -0
  17. data/lib/oci/core/models/change_boot_volume_compartment_details.rb +153 -0
  18. data/lib/oci/core/models/change_image_compartment_details.rb +154 -0
  19. data/lib/oci/core/models/change_instance_configuration_compartment_details.rb +155 -0
  20. data/lib/oci/core/models/change_instance_pool_compartment_details.rb +155 -0
  21. data/lib/oci/core/models/change_nat_gateway_compartment_details.rb +153 -0
  22. data/lib/oci/core/models/change_route_table_compartment_details.rb +155 -0
  23. data/lib/oci/core/models/change_security_list_compartment_details.rb +155 -0
  24. data/lib/oci/core/models/change_service_gateway_compartment_details.rb +155 -0
  25. data/lib/oci/core/models/change_subnet_compartment_details.rb +155 -0
  26. data/lib/oci/core/models/change_vcn_compartment_details.rb +155 -0
  27. data/lib/oci/core/models/change_volume_backup_compartment_details.rb +153 -0
  28. data/lib/oci/core/models/change_volume_compartment_details.rb +153 -0
  29. data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +153 -0
  30. data/lib/oci/core/models/change_volume_group_compartment_details.rb +153 -0
  31. data/lib/oci/core/models/create_network_security_group_details.rb +223 -0
  32. data/lib/oci/core/models/create_vnic_details.rb +18 -1
  33. data/lib/oci/core/models/image.rb +2 -1
  34. data/lib/oci/core/models/instance_configuration.rb +3 -1
  35. data/lib/oci/core/models/instance_configuration_create_vnic_details.rb +18 -1
  36. data/lib/oci/core/models/instance_configuration_instance_source_via_image_details.rb +15 -1
  37. data/lib/oci/core/models/instance_configuration_summary.rb +3 -3
  38. data/lib/oci/core/models/instance_pool.rb +4 -1
  39. data/lib/oci/core/models/instance_pool_summary.rb +3 -3
  40. data/lib/oci/core/models/network_security_group.rb +324 -0
  41. data/lib/oci/core/models/network_security_group_vnic.rb +188 -0
  42. data/lib/oci/core/models/remove_network_security_group_security_rules_details.rb +154 -0
  43. data/lib/oci/core/models/security_list.rb +5 -0
  44. data/lib/oci/core/models/security_rule.rb +455 -0
  45. data/lib/oci/core/models/update_network_security_group_details.rb +189 -0
  46. data/lib/oci/core/models/update_network_security_group_security_rules_details.rb +153 -0
  47. data/lib/oci/core/models/update_security_rule_details.rb +404 -0
  48. data/lib/oci/core/models/update_vnic_details.rb +20 -1
  49. data/lib/oci/core/models/updated_network_security_group_security_rules.rb +153 -0
  50. data/lib/oci/core/models/vnic.rb +18 -1
  51. data/lib/oci/core/virtual_network_client.rb +1228 -132
  52. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  53. data/lib/oci/database/database.rb +19 -0
  54. data/lib/oci/database/database_client.rb +1066 -46
  55. data/lib/oci/database/database_client_composite_operations.rb +317 -0
  56. data/lib/oci/database/models/autonomous_container_database.rb +416 -0
  57. data/lib/oci/database/models/autonomous_container_database_backup_config.rb +157 -0
  58. data/lib/oci/database/models/autonomous_container_database_summary.rb +420 -0
  59. data/lib/oci/database/models/autonomous_database.rb +58 -1
  60. data/lib/oci/database/models/autonomous_database_backup.rb +16 -1
  61. data/lib/oci/database/models/autonomous_database_backup_summary.rb +16 -1
  62. data/lib/oci/database/models/autonomous_database_connection_strings.rb +11 -1
  63. data/lib/oci/database/models/autonomous_database_connection_urls.rb +170 -0
  64. data/lib/oci/database/models/autonomous_database_summary.rb +58 -1
  65. data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +224 -0
  66. data/lib/oci/database/models/autonomous_exadata_infrastructure.rb +419 -0
  67. data/lib/oci/database/models/autonomous_exadata_infrastructure_maintenance_window.rb +186 -0
  68. data/lib/oci/database/models/autonomous_exadata_infrastructure_shape_summary.rb +224 -0
  69. data/lib/oci/database/models/autonomous_exadata_infrastructure_summary.rb +436 -0
  70. data/lib/oci/database/models/backup.rb +1 -0
  71. data/lib/oci/database/models/backup_summary.rb +1 -0
  72. data/lib/oci/database/models/create_autonomous_container_database_details.rb +284 -0
  73. data/lib/oci/database/models/create_autonomous_database_base.rb +46 -1
  74. data/lib/oci/database/models/create_autonomous_database_clone_details.rb +13 -1
  75. data/lib/oci/database/models/create_autonomous_database_details.rb +13 -1
  76. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +34 -1
  77. data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +1 -1
  78. data/lib/oci/database/models/day_of_week.rb +174 -0
  79. data/lib/oci/database/models/db_system.rb +34 -1
  80. data/lib/oci/database/models/db_system_summary.rb +34 -1
  81. data/lib/oci/database/models/launch_autonomous_exadata_infrastructure_details.rb +304 -0
  82. data/lib/oci/database/models/launch_db_system_base.rb +35 -2
  83. data/lib/oci/database/models/launch_db_system_details.rb +11 -2
  84. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +11 -2
  85. data/lib/oci/database/models/maintenance_run.rb +392 -0
  86. data/lib/oci/database/models/maintenance_run_summary.rb +395 -0
  87. data/lib/oci/database/models/maintenance_window.rb +226 -0
  88. data/lib/oci/database/models/month.rb +179 -0
  89. data/lib/oci/database/models/restore_autonomous_database_details.rb +30 -4
  90. data/lib/oci/database/models/update_autonomous_container_database_details.rb +230 -0
  91. data/lib/oci/database/models/update_autonomous_database_details.rb +18 -1
  92. data/lib/oci/database/models/update_autonomous_exadata_infrastructure_details.rb +203 -0
  93. data/lib/oci/database/models/update_db_system_details.rb +37 -4
  94. data/lib/oci/database/models/update_maintenance_run_details.rb +154 -0
  95. data/lib/oci/email/email.rb +1 -0
  96. data/lib/oci/email/email_client.rb +62 -0
  97. data/lib/oci/email/models/change_sender_compartment_details.rb +157 -0
  98. data/lib/oci/key_management/key_management.rb +1 -0
  99. data/lib/oci/key_management/kms_crypto_client.rb +4 -4
  100. data/lib/oci/key_management/kms_management_client.rb +161 -10
  101. data/lib/oci/key_management/kms_management_client_composite_operations.rb +79 -0
  102. data/lib/oci/key_management/kms_vault_client.rb +16 -11
  103. data/lib/oci/key_management/models/key.rb +17 -1
  104. data/lib/oci/key_management/models/schedule_key_deletion_details.rb +156 -0
  105. data/lib/oci/load_balancer/load_balancer.rb +1 -0
  106. data/lib/oci/load_balancer/load_balancer_client.rb +64 -0
  107. data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
  108. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +16 -1
  109. data/lib/oci/load_balancer/models/load_balancer.rb +16 -1
  110. data/lib/oci/load_balancer/models/remove_http_request_header_rule.rb +1 -1
  111. data/lib/oci/load_balancer/models/remove_http_response_header_rule.rb +1 -1
  112. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +9 -5
  113. data/lib/oci/load_balancer/models/update_backend_set_details.rb +2 -0
  114. data/lib/oci/load_balancer/models/update_network_security_groups_details.rb +154 -0
  115. data/lib/oci/monitoring/models/metric.rb +1 -0
  116. data/lib/oci/object_storage/models/work_request_error.rb +1 -0
  117. data/lib/oci/resource_manager/models/change_stack_compartment_details.rb +155 -0
  118. data/lib/oci/resource_manager/models/work_request.rb +293 -0
  119. data/lib/oci/resource_manager/models/work_request_error.rb +170 -0
  120. data/lib/oci/resource_manager/models/work_request_log_entry.rb +159 -0
  121. data/lib/oci/resource_manager/models/work_request_resource.rb +217 -0
  122. data/lib/oci/resource_manager/models/work_request_summary.rb +254 -0
  123. data/lib/oci/resource_manager/resource_manager.rb +6 -0
  124. data/lib/oci/resource_manager/resource_manager_client.rb +338 -0
  125. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +50 -0
  126. data/lib/oci/streaming/stream_admin_client.rb +2 -2
  127. data/lib/oci/streaming/stream_client.rb +1 -1
  128. data/lib/oci/version.rb +1 -1
  129. metadata +58 -2
@@ -0,0 +1,392 @@
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
+ # Details of a Maintenance Run.
9
+ #
10
+ class Database::Models::MaintenanceRun
11
+ LIFECYCLE_STATE_ENUM = [
12
+ LIFECYCLE_STATE_SCHEDULED = 'SCHEDULED'.freeze,
13
+ LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'.freeze,
14
+ LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED'.freeze,
15
+ LIFECYCLE_STATE_SKIPPED = 'SKIPPED'.freeze,
16
+ LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
17
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
18
+ ].freeze
19
+
20
+ TARGET_RESOURCE_TYPE_ENUM = [
21
+ TARGET_RESOURCE_TYPE_AUTONOMOUS_EXADATA_INFRASTRUCTURE = 'AUTONOMOUS_EXADATA_INFRASTRUCTURE'.freeze,
22
+ TARGET_RESOURCE_TYPE_AUTONOMOUS_CONTAINER_DATABASE = 'AUTONOMOUS_CONTAINER_DATABASE'.freeze,
23
+ TARGET_RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
24
+ ].freeze
25
+
26
+ MAINTENANCE_TYPE_ENUM = [
27
+ MAINTENANCE_TYPE_PLANNED = 'PLANNED'.freeze,
28
+ MAINTENANCE_TYPE_UNPLANNED = 'UNPLANNED'.freeze,
29
+ MAINTENANCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
30
+ ].freeze
31
+
32
+ MAINTENANCE_SUBTYPE_ENUM = [
33
+ MAINTENANCE_SUBTYPE_QUARTERLY = 'QUARTERLY'.freeze,
34
+ MAINTENANCE_SUBTYPE_HARDWARE = 'HARDWARE'.freeze,
35
+ MAINTENANCE_SUBTYPE_CRITICAL = 'CRITICAL'.freeze,
36
+ MAINTENANCE_SUBTYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
37
+ ].freeze
38
+
39
+ # **[Required]** The OCID of the Maintenance Run.
40
+ # @return [String]
41
+ attr_accessor :id
42
+
43
+ # **[Required]** The OCID of the compartment.
44
+ # @return [String]
45
+ attr_accessor :compartment_id
46
+
47
+ # **[Required]** The user-friendly name for the Maintenance Run.
48
+ # @return [String]
49
+ attr_accessor :display_name
50
+
51
+ # The text describing this Maintenance Run.
52
+ # @return [String]
53
+ attr_accessor :description
54
+
55
+ # **[Required]** The current state of the Maintenance Run.
56
+ # @return [String]
57
+ attr_reader :lifecycle_state
58
+
59
+ # Additional information about the current lifecycleState.
60
+ # @return [String]
61
+ attr_accessor :lifecycle_details
62
+
63
+ # **[Required]** The date and time the Maintenance Run is scheduled for.
64
+ # @return [DateTime]
65
+ attr_accessor :time_scheduled
66
+
67
+ # The date and time the Maintenance Run starts.
68
+ # @return [DateTime]
69
+ attr_accessor :time_started
70
+
71
+ # The date and time the Maintenance Run was completed.
72
+ # @return [DateTime]
73
+ attr_accessor :time_ended
74
+
75
+ # The type of the target resource on which the Maintenance Run occurs.
76
+ # @return [String]
77
+ attr_reader :target_resource_type
78
+
79
+ # The ID of the target resource on which the Maintenance Run occurs.
80
+ # @return [String]
81
+ attr_accessor :target_resource_id
82
+
83
+ # Maintenance type.
84
+ # @return [String]
85
+ attr_reader :maintenance_type
86
+
87
+ # Maintenance sub-type.
88
+ # @return [String]
89
+ attr_reader :maintenance_subtype
90
+
91
+ # Attribute mapping from ruby-style variable name to JSON key.
92
+ def self.attribute_map
93
+ {
94
+ # rubocop:disable Style/SymbolLiteral
95
+ 'id': :'id',
96
+ 'compartment_id': :'compartmentId',
97
+ 'display_name': :'displayName',
98
+ 'description': :'description',
99
+ 'lifecycle_state': :'lifecycleState',
100
+ 'lifecycle_details': :'lifecycleDetails',
101
+ 'time_scheduled': :'timeScheduled',
102
+ 'time_started': :'timeStarted',
103
+ 'time_ended': :'timeEnded',
104
+ 'target_resource_type': :'targetResourceType',
105
+ 'target_resource_id': :'targetResourceId',
106
+ 'maintenance_type': :'maintenanceType',
107
+ 'maintenance_subtype': :'maintenanceSubtype'
108
+ # rubocop:enable Style/SymbolLiteral
109
+ }
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.swagger_types
114
+ {
115
+ # rubocop:disable Style/SymbolLiteral
116
+ 'id': :'String',
117
+ 'compartment_id': :'String',
118
+ 'display_name': :'String',
119
+ 'description': :'String',
120
+ 'lifecycle_state': :'String',
121
+ 'lifecycle_details': :'String',
122
+ 'time_scheduled': :'DateTime',
123
+ 'time_started': :'DateTime',
124
+ 'time_ended': :'DateTime',
125
+ 'target_resource_type': :'String',
126
+ 'target_resource_id': :'String',
127
+ 'maintenance_type': :'String',
128
+ 'maintenance_subtype': :'String'
129
+ # rubocop:enable Style/SymbolLiteral
130
+ }
131
+ end
132
+
133
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
134
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
135
+
136
+
137
+ # Initializes the object
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @option attributes [String] :id The value to assign to the {#id} property
140
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
141
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
142
+ # @option attributes [String] :description The value to assign to the {#description} property
143
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
144
+ # @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property
145
+ # @option attributes [DateTime] :time_scheduled The value to assign to the {#time_scheduled} property
146
+ # @option attributes [DateTime] :time_started The value to assign to the {#time_started} property
147
+ # @option attributes [DateTime] :time_ended The value to assign to the {#time_ended} property
148
+ # @option attributes [String] :target_resource_type The value to assign to the {#target_resource_type} property
149
+ # @option attributes [String] :target_resource_id The value to assign to the {#target_resource_id} property
150
+ # @option attributes [String] :maintenance_type The value to assign to the {#maintenance_type} property
151
+ # @option attributes [String] :maintenance_subtype The value to assign to the {#maintenance_subtype} property
152
+ def initialize(attributes = {})
153
+ return unless attributes.is_a?(Hash)
154
+
155
+ self.id = attributes[:'id'] if attributes[:'id']
156
+
157
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
158
+
159
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
160
+
161
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
162
+
163
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
164
+
165
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
166
+
167
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
168
+
169
+ self.description = attributes[:'description'] if attributes[:'description']
170
+
171
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
172
+
173
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
174
+
175
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
176
+
177
+ self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']
178
+
179
+ raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details')
180
+
181
+ self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']
182
+
183
+ self.time_scheduled = attributes[:'timeScheduled'] if attributes[:'timeScheduled']
184
+
185
+ raise 'You cannot provide both :timeScheduled and :time_scheduled' if attributes.key?(:'timeScheduled') && attributes.key?(:'time_scheduled')
186
+
187
+ self.time_scheduled = attributes[:'time_scheduled'] if attributes[:'time_scheduled']
188
+
189
+ self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']
190
+
191
+ raise 'You cannot provide both :timeStarted and :time_started' if attributes.key?(:'timeStarted') && attributes.key?(:'time_started')
192
+
193
+ self.time_started = attributes[:'time_started'] if attributes[:'time_started']
194
+
195
+ self.time_ended = attributes[:'timeEnded'] if attributes[:'timeEnded']
196
+
197
+ raise 'You cannot provide both :timeEnded and :time_ended' if attributes.key?(:'timeEnded') && attributes.key?(:'time_ended')
198
+
199
+ self.time_ended = attributes[:'time_ended'] if attributes[:'time_ended']
200
+
201
+ self.target_resource_type = attributes[:'targetResourceType'] if attributes[:'targetResourceType']
202
+
203
+ raise 'You cannot provide both :targetResourceType and :target_resource_type' if attributes.key?(:'targetResourceType') && attributes.key?(:'target_resource_type')
204
+
205
+ self.target_resource_type = attributes[:'target_resource_type'] if attributes[:'target_resource_type']
206
+
207
+ self.target_resource_id = attributes[:'targetResourceId'] if attributes[:'targetResourceId']
208
+
209
+ raise 'You cannot provide both :targetResourceId and :target_resource_id' if attributes.key?(:'targetResourceId') && attributes.key?(:'target_resource_id')
210
+
211
+ self.target_resource_id = attributes[:'target_resource_id'] if attributes[:'target_resource_id']
212
+
213
+ self.maintenance_type = attributes[:'maintenanceType'] if attributes[:'maintenanceType']
214
+
215
+ raise 'You cannot provide both :maintenanceType and :maintenance_type' if attributes.key?(:'maintenanceType') && attributes.key?(:'maintenance_type')
216
+
217
+ self.maintenance_type = attributes[:'maintenance_type'] if attributes[:'maintenance_type']
218
+
219
+ self.maintenance_subtype = attributes[:'maintenanceSubtype'] if attributes[:'maintenanceSubtype']
220
+
221
+ raise 'You cannot provide both :maintenanceSubtype and :maintenance_subtype' if attributes.key?(:'maintenanceSubtype') && attributes.key?(:'maintenance_subtype')
222
+
223
+ self.maintenance_subtype = attributes[:'maintenance_subtype'] if attributes[:'maintenance_subtype']
224
+ end
225
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
226
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
227
+
228
+ # Custom attribute writer method checking allowed values (enum).
229
+ # @param [Object] lifecycle_state Object to be assigned
230
+ def lifecycle_state=(lifecycle_state)
231
+ # rubocop:disable Style/ConditionalAssignment
232
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
233
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
234
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
235
+ else
236
+ @lifecycle_state = lifecycle_state
237
+ end
238
+ # rubocop:enable Style/ConditionalAssignment
239
+ end
240
+
241
+ # Custom attribute writer method checking allowed values (enum).
242
+ # @param [Object] target_resource_type Object to be assigned
243
+ def target_resource_type=(target_resource_type)
244
+ # rubocop:disable Style/ConditionalAssignment
245
+ if target_resource_type && !TARGET_RESOURCE_TYPE_ENUM.include?(target_resource_type)
246
+ OCI.logger.debug("Unknown value for 'target_resource_type' [" + target_resource_type + "]. Mapping to 'TARGET_RESOURCE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
247
+ @target_resource_type = TARGET_RESOURCE_TYPE_UNKNOWN_ENUM_VALUE
248
+ else
249
+ @target_resource_type = target_resource_type
250
+ end
251
+ # rubocop:enable Style/ConditionalAssignment
252
+ end
253
+
254
+ # Custom attribute writer method checking allowed values (enum).
255
+ # @param [Object] maintenance_type Object to be assigned
256
+ def maintenance_type=(maintenance_type)
257
+ # rubocop:disable Style/ConditionalAssignment
258
+ if maintenance_type && !MAINTENANCE_TYPE_ENUM.include?(maintenance_type)
259
+ OCI.logger.debug("Unknown value for 'maintenance_type' [" + maintenance_type + "]. Mapping to 'MAINTENANCE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
260
+ @maintenance_type = MAINTENANCE_TYPE_UNKNOWN_ENUM_VALUE
261
+ else
262
+ @maintenance_type = maintenance_type
263
+ end
264
+ # rubocop:enable Style/ConditionalAssignment
265
+ end
266
+
267
+ # Custom attribute writer method checking allowed values (enum).
268
+ # @param [Object] maintenance_subtype Object to be assigned
269
+ def maintenance_subtype=(maintenance_subtype)
270
+ # rubocop:disable Style/ConditionalAssignment
271
+ if maintenance_subtype && !MAINTENANCE_SUBTYPE_ENUM.include?(maintenance_subtype)
272
+ OCI.logger.debug("Unknown value for 'maintenance_subtype' [" + maintenance_subtype + "]. Mapping to 'MAINTENANCE_SUBTYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
273
+ @maintenance_subtype = MAINTENANCE_SUBTYPE_UNKNOWN_ENUM_VALUE
274
+ else
275
+ @maintenance_subtype = maintenance_subtype
276
+ end
277
+ # rubocop:enable Style/ConditionalAssignment
278
+ end
279
+
280
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
281
+
282
+
283
+ # Checks equality by comparing each attribute.
284
+ # @param [Object] other the other object to be compared
285
+ def ==(other)
286
+ return true if equal?(other)
287
+
288
+ self.class == other.class &&
289
+ id == other.id &&
290
+ compartment_id == other.compartment_id &&
291
+ display_name == other.display_name &&
292
+ description == other.description &&
293
+ lifecycle_state == other.lifecycle_state &&
294
+ lifecycle_details == other.lifecycle_details &&
295
+ time_scheduled == other.time_scheduled &&
296
+ time_started == other.time_started &&
297
+ time_ended == other.time_ended &&
298
+ target_resource_type == other.target_resource_type &&
299
+ target_resource_id == other.target_resource_id &&
300
+ maintenance_type == other.maintenance_type &&
301
+ maintenance_subtype == other.maintenance_subtype
302
+ end
303
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
304
+
305
+ # @see the `==` method
306
+ # @param [Object] other the other object to be compared
307
+ def eql?(other)
308
+ self == other
309
+ end
310
+
311
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
312
+
313
+
314
+ # Calculates hash code according to all attributes.
315
+ # @return [Fixnum] Hash code
316
+ def hash
317
+ [id, compartment_id, display_name, description, lifecycle_state, lifecycle_details, time_scheduled, time_started, time_ended, target_resource_type, target_resource_id, maintenance_type, maintenance_subtype].hash
318
+ end
319
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
320
+
321
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
322
+
323
+
324
+ # Builds the object from hash
325
+ # @param [Hash] attributes Model attributes in the form of hash
326
+ # @return [Object] Returns the model itself
327
+ def build_from_hash(attributes)
328
+ return nil unless attributes.is_a?(Hash)
329
+
330
+ self.class.swagger_types.each_pair do |key, type|
331
+ if type =~ /^Array<(.*)>/i
332
+ # check to ensure the input is an array given that the the attribute
333
+ # is documented as an array but the input is not
334
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
335
+ public_method("#{key}=").call(
336
+ attributes[self.class.attribute_map[key]]
337
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
338
+ )
339
+ end
340
+ elsif !attributes[self.class.attribute_map[key]].nil?
341
+ public_method("#{key}=").call(
342
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
343
+ )
344
+ end
345
+ # or else data not found in attributes(hash), not an issue as the data can be optional
346
+ end
347
+
348
+ self
349
+ end
350
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
351
+
352
+ # Returns the string representation of the object
353
+ # @return [String] String presentation of the object
354
+ def to_s
355
+ to_hash.to_s
356
+ end
357
+
358
+ # Returns the object in the form of hash
359
+ # @return [Hash] Returns the object in the form of hash
360
+ def to_hash
361
+ hash = {}
362
+ self.class.attribute_map.each_pair do |attr, param|
363
+ value = public_method(attr).call
364
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
365
+
366
+ hash[param] = _to_hash(value)
367
+ end
368
+ hash
369
+ end
370
+
371
+ private
372
+
373
+ # Outputs non-array value in the form of hash
374
+ # For object, use to_hash. Otherwise, just return the value
375
+ # @param [Object] value Any valid value
376
+ # @return [Hash] Returns the value in the form of hash
377
+ def _to_hash(value)
378
+ if value.is_a?(Array)
379
+ value.compact.map { |v| _to_hash(v) }
380
+ elsif value.is_a?(Hash)
381
+ {}.tap do |hash|
382
+ value.each { |k, v| hash[k] = _to_hash(v) }
383
+ end
384
+ elsif value.respond_to? :to_hash
385
+ value.to_hash
386
+ else
387
+ value
388
+ end
389
+ end
390
+ end
391
+ end
392
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,395 @@
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
+ # Details of a Maintenance Run.
9
+ #
10
+ class Database::Models::MaintenanceRunSummary
11
+ LIFECYCLE_STATE_ENUM = [
12
+ LIFECYCLE_STATE_SCHEDULED = 'SCHEDULED'.freeze,
13
+ LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'.freeze,
14
+ LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED'.freeze,
15
+ LIFECYCLE_STATE_SKIPPED = 'SKIPPED'.freeze,
16
+ LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
17
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
18
+ ].freeze
19
+
20
+ TARGET_RESOURCE_TYPE_ENUM = [
21
+ TARGET_RESOURCE_TYPE_AUTONOMOUS_EXADATA_INFRASTRUCTURE = 'AUTONOMOUS_EXADATA_INFRASTRUCTURE'.freeze,
22
+ TARGET_RESOURCE_TYPE_AUTONOMOUS_CONTAINER_DATABASE = 'AUTONOMOUS_CONTAINER_DATABASE'.freeze,
23
+ TARGET_RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
24
+ ].freeze
25
+
26
+ MAINTENANCE_TYPE_ENUM = [
27
+ MAINTENANCE_TYPE_PLANNED = 'PLANNED'.freeze,
28
+ MAINTENANCE_TYPE_UNPLANNED = 'UNPLANNED'.freeze,
29
+ MAINTENANCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
30
+ ].freeze
31
+
32
+ MAINTENANCE_SUBTYPE_ENUM = [
33
+ MAINTENANCE_SUBTYPE_QUARTERLY = 'QUARTERLY'.freeze,
34
+ MAINTENANCE_SUBTYPE_HARDWARE = 'HARDWARE'.freeze,
35
+ MAINTENANCE_SUBTYPE_CRITICAL = 'CRITICAL'.freeze,
36
+ MAINTENANCE_SUBTYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
37
+ ].freeze
38
+
39
+ # **[Required]** The OCID of the Maintenance Run.
40
+ # @return [String]
41
+ attr_accessor :id
42
+
43
+ # **[Required]** The OCID of the compartment.
44
+ # @return [String]
45
+ attr_accessor :compartment_id
46
+
47
+ # **[Required]** The user-friendly name for the Maintenance Run.
48
+ # @return [String]
49
+ attr_accessor :display_name
50
+
51
+ # The text describing this Maintenance Run.
52
+ # @return [String]
53
+ attr_accessor :description
54
+
55
+ # **[Required]** The current state of the Maintenance Run.
56
+ # @return [String]
57
+ attr_reader :lifecycle_state
58
+
59
+ # Additional information about the current lifecycleState.
60
+ # @return [String]
61
+ attr_accessor :lifecycle_details
62
+
63
+ # **[Required]** The date and time the Maintenance Run is scheduled for.
64
+ # @return [DateTime]
65
+ attr_accessor :time_scheduled
66
+
67
+ # The date and time the Maintenance Run starts.
68
+ # @return [DateTime]
69
+ attr_accessor :time_started
70
+
71
+ # The date and time the Maintenance Run was completed.
72
+ # @return [DateTime]
73
+ attr_accessor :time_ended
74
+
75
+ # The type of the target resource on which the Maintenance Run occurs.
76
+ # @return [String]
77
+ attr_reader :target_resource_type
78
+
79
+ # The ID of the target resource on which the Maintenance Run occurs.
80
+ # @return [String]
81
+ attr_accessor :target_resource_id
82
+
83
+ # Maintenance type.
84
+ # @return [String]
85
+ attr_reader :maintenance_type
86
+
87
+ # Maintenance sub-type.
88
+ # @return [String]
89
+ attr_reader :maintenance_subtype
90
+
91
+ # Attribute mapping from ruby-style variable name to JSON key.
92
+ def self.attribute_map
93
+ {
94
+ # rubocop:disable Style/SymbolLiteral
95
+ 'id': :'id',
96
+ 'compartment_id': :'compartmentId',
97
+ 'display_name': :'displayName',
98
+ 'description': :'description',
99
+ 'lifecycle_state': :'lifecycleState',
100
+ 'lifecycle_details': :'lifecycleDetails',
101
+ 'time_scheduled': :'timeScheduled',
102
+ 'time_started': :'timeStarted',
103
+ 'time_ended': :'timeEnded',
104
+ 'target_resource_type': :'targetResourceType',
105
+ 'target_resource_id': :'targetResourceId',
106
+ 'maintenance_type': :'maintenanceType',
107
+ 'maintenance_subtype': :'maintenanceSubtype'
108
+ # rubocop:enable Style/SymbolLiteral
109
+ }
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.swagger_types
114
+ {
115
+ # rubocop:disable Style/SymbolLiteral
116
+ 'id': :'String',
117
+ 'compartment_id': :'String',
118
+ 'display_name': :'String',
119
+ 'description': :'String',
120
+ 'lifecycle_state': :'String',
121
+ 'lifecycle_details': :'String',
122
+ 'time_scheduled': :'DateTime',
123
+ 'time_started': :'DateTime',
124
+ 'time_ended': :'DateTime',
125
+ 'target_resource_type': :'String',
126
+ 'target_resource_id': :'String',
127
+ 'maintenance_type': :'String',
128
+ 'maintenance_subtype': :'String'
129
+ # rubocop:enable Style/SymbolLiteral
130
+ }
131
+ end
132
+
133
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
134
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
135
+
136
+
137
+ # Initializes the object
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @option attributes [String] :id The value to assign to the {#id} property
140
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
141
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
142
+ # @option attributes [String] :description The value to assign to the {#description} property
143
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
144
+ # @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property
145
+ # @option attributes [DateTime] :time_scheduled The value to assign to the {#time_scheduled} property
146
+ # @option attributes [DateTime] :time_started The value to assign to the {#time_started} property
147
+ # @option attributes [DateTime] :time_ended The value to assign to the {#time_ended} property
148
+ # @option attributes [String] :target_resource_type The value to assign to the {#target_resource_type} property
149
+ # @option attributes [String] :target_resource_id The value to assign to the {#target_resource_id} property
150
+ # @option attributes [String] :maintenance_type The value to assign to the {#maintenance_type} property
151
+ # @option attributes [String] :maintenance_subtype The value to assign to the {#maintenance_subtype} property
152
+ def initialize(attributes = {})
153
+ return unless attributes.is_a?(Hash)
154
+
155
+ # convert string to symbol for hash key
156
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
157
+
158
+ self.id = attributes[:'id'] if attributes[:'id']
159
+
160
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
161
+
162
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
163
+
164
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
165
+
166
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
167
+
168
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
169
+
170
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
171
+
172
+ self.description = attributes[:'description'] if attributes[:'description']
173
+
174
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
175
+
176
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
177
+
178
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
179
+
180
+ self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']
181
+
182
+ raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details')
183
+
184
+ self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']
185
+
186
+ self.time_scheduled = attributes[:'timeScheduled'] if attributes[:'timeScheduled']
187
+
188
+ raise 'You cannot provide both :timeScheduled and :time_scheduled' if attributes.key?(:'timeScheduled') && attributes.key?(:'time_scheduled')
189
+
190
+ self.time_scheduled = attributes[:'time_scheduled'] if attributes[:'time_scheduled']
191
+
192
+ self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']
193
+
194
+ raise 'You cannot provide both :timeStarted and :time_started' if attributes.key?(:'timeStarted') && attributes.key?(:'time_started')
195
+
196
+ self.time_started = attributes[:'time_started'] if attributes[:'time_started']
197
+
198
+ self.time_ended = attributes[:'timeEnded'] if attributes[:'timeEnded']
199
+
200
+ raise 'You cannot provide both :timeEnded and :time_ended' if attributes.key?(:'timeEnded') && attributes.key?(:'time_ended')
201
+
202
+ self.time_ended = attributes[:'time_ended'] if attributes[:'time_ended']
203
+
204
+ self.target_resource_type = attributes[:'targetResourceType'] if attributes[:'targetResourceType']
205
+
206
+ raise 'You cannot provide both :targetResourceType and :target_resource_type' if attributes.key?(:'targetResourceType') && attributes.key?(:'target_resource_type')
207
+
208
+ self.target_resource_type = attributes[:'target_resource_type'] if attributes[:'target_resource_type']
209
+
210
+ self.target_resource_id = attributes[:'targetResourceId'] if attributes[:'targetResourceId']
211
+
212
+ raise 'You cannot provide both :targetResourceId and :target_resource_id' if attributes.key?(:'targetResourceId') && attributes.key?(:'target_resource_id')
213
+
214
+ self.target_resource_id = attributes[:'target_resource_id'] if attributes[:'target_resource_id']
215
+
216
+ self.maintenance_type = attributes[:'maintenanceType'] if attributes[:'maintenanceType']
217
+
218
+ raise 'You cannot provide both :maintenanceType and :maintenance_type' if attributes.key?(:'maintenanceType') && attributes.key?(:'maintenance_type')
219
+
220
+ self.maintenance_type = attributes[:'maintenance_type'] if attributes[:'maintenance_type']
221
+
222
+ self.maintenance_subtype = attributes[:'maintenanceSubtype'] if attributes[:'maintenanceSubtype']
223
+
224
+ raise 'You cannot provide both :maintenanceSubtype and :maintenance_subtype' if attributes.key?(:'maintenanceSubtype') && attributes.key?(:'maintenance_subtype')
225
+
226
+ self.maintenance_subtype = attributes[:'maintenance_subtype'] if attributes[:'maintenance_subtype']
227
+ end
228
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
229
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
230
+
231
+ # Custom attribute writer method checking allowed values (enum).
232
+ # @param [Object] lifecycle_state Object to be assigned
233
+ def lifecycle_state=(lifecycle_state)
234
+ # rubocop:disable Style/ConditionalAssignment
235
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
236
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
237
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
238
+ else
239
+ @lifecycle_state = lifecycle_state
240
+ end
241
+ # rubocop:enable Style/ConditionalAssignment
242
+ end
243
+
244
+ # Custom attribute writer method checking allowed values (enum).
245
+ # @param [Object] target_resource_type Object to be assigned
246
+ def target_resource_type=(target_resource_type)
247
+ # rubocop:disable Style/ConditionalAssignment
248
+ if target_resource_type && !TARGET_RESOURCE_TYPE_ENUM.include?(target_resource_type)
249
+ OCI.logger.debug("Unknown value for 'target_resource_type' [" + target_resource_type + "]. Mapping to 'TARGET_RESOURCE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
250
+ @target_resource_type = TARGET_RESOURCE_TYPE_UNKNOWN_ENUM_VALUE
251
+ else
252
+ @target_resource_type = target_resource_type
253
+ end
254
+ # rubocop:enable Style/ConditionalAssignment
255
+ end
256
+
257
+ # Custom attribute writer method checking allowed values (enum).
258
+ # @param [Object] maintenance_type Object to be assigned
259
+ def maintenance_type=(maintenance_type)
260
+ # rubocop:disable Style/ConditionalAssignment
261
+ if maintenance_type && !MAINTENANCE_TYPE_ENUM.include?(maintenance_type)
262
+ OCI.logger.debug("Unknown value for 'maintenance_type' [" + maintenance_type + "]. Mapping to 'MAINTENANCE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
263
+ @maintenance_type = MAINTENANCE_TYPE_UNKNOWN_ENUM_VALUE
264
+ else
265
+ @maintenance_type = maintenance_type
266
+ end
267
+ # rubocop:enable Style/ConditionalAssignment
268
+ end
269
+
270
+ # Custom attribute writer method checking allowed values (enum).
271
+ # @param [Object] maintenance_subtype Object to be assigned
272
+ def maintenance_subtype=(maintenance_subtype)
273
+ # rubocop:disable Style/ConditionalAssignment
274
+ if maintenance_subtype && !MAINTENANCE_SUBTYPE_ENUM.include?(maintenance_subtype)
275
+ OCI.logger.debug("Unknown value for 'maintenance_subtype' [" + maintenance_subtype + "]. Mapping to 'MAINTENANCE_SUBTYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
276
+ @maintenance_subtype = MAINTENANCE_SUBTYPE_UNKNOWN_ENUM_VALUE
277
+ else
278
+ @maintenance_subtype = maintenance_subtype
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
+ compartment_id == other.compartment_id &&
294
+ display_name == other.display_name &&
295
+ description == other.description &&
296
+ lifecycle_state == other.lifecycle_state &&
297
+ lifecycle_details == other.lifecycle_details &&
298
+ time_scheduled == other.time_scheduled &&
299
+ time_started == other.time_started &&
300
+ time_ended == other.time_ended &&
301
+ target_resource_type == other.target_resource_type &&
302
+ target_resource_id == other.target_resource_id &&
303
+ maintenance_type == other.maintenance_type &&
304
+ maintenance_subtype == other.maintenance_subtype
305
+ end
306
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
307
+
308
+ # @see the `==` method
309
+ # @param [Object] other the other object to be compared
310
+ def eql?(other)
311
+ self == other
312
+ end
313
+
314
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
315
+
316
+
317
+ # Calculates hash code according to all attributes.
318
+ # @return [Fixnum] Hash code
319
+ def hash
320
+ [id, compartment_id, display_name, description, lifecycle_state, lifecycle_details, time_scheduled, time_started, time_ended, target_resource_type, target_resource_id, maintenance_type, maintenance_subtype].hash
321
+ end
322
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
323
+
324
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
325
+
326
+
327
+ # Builds the object from hash
328
+ # @param [Hash] attributes Model attributes in the form of hash
329
+ # @return [Object] Returns the model itself
330
+ def build_from_hash(attributes)
331
+ return nil unless attributes.is_a?(Hash)
332
+
333
+ self.class.swagger_types.each_pair do |key, type|
334
+ if type =~ /^Array<(.*)>/i
335
+ # check to ensure the input is an array given that the the attribute
336
+ # is documented as an array but the input is not
337
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
338
+ public_method("#{key}=").call(
339
+ attributes[self.class.attribute_map[key]]
340
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
341
+ )
342
+ end
343
+ elsif !attributes[self.class.attribute_map[key]].nil?
344
+ public_method("#{key}=").call(
345
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
346
+ )
347
+ end
348
+ # or else data not found in attributes(hash), not an issue as the data can be optional
349
+ end
350
+
351
+ self
352
+ end
353
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
354
+
355
+ # Returns the string representation of the object
356
+ # @return [String] String presentation of the object
357
+ def to_s
358
+ to_hash.to_s
359
+ end
360
+
361
+ # Returns the object in the form of hash
362
+ # @return [Hash] Returns the object in the form of hash
363
+ def to_hash
364
+ hash = {}
365
+ self.class.attribute_map.each_pair do |attr, param|
366
+ value = public_method(attr).call
367
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
368
+
369
+ hash[param] = _to_hash(value)
370
+ end
371
+ hash
372
+ end
373
+
374
+ private
375
+
376
+ # Outputs non-array value in the form of hash
377
+ # For object, use to_hash. Otherwise, just return the value
378
+ # @param [Object] value Any valid value
379
+ # @return [Hash] Returns the value in the form of hash
380
+ def _to_hash(value)
381
+ if value.is_a?(Array)
382
+ value.compact.map { |v| _to_hash(v) }
383
+ elsif value.is_a?(Hash)
384
+ {}.tap do |hash|
385
+ value.each { |k, v| hash[k] = _to_hash(v) }
386
+ end
387
+ elsif value.respond_to? :to_hash
388
+ value.to_hash
389
+ else
390
+ value
391
+ end
392
+ end
393
+ end
394
+ end
395
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength