oci 2.5.11 → 2.6.0
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.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/oci.rb +1 -0
- data/lib/oci/auth/federation_client.rb +2 -1
- data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +6 -1
- data/lib/oci/auth/url_based_certificate_retriever.rb +6 -2
- data/lib/oci/auth/util.rb +18 -0
- data/lib/oci/core/compute_client.rb +730 -48
- data/lib/oci/core/compute_client_composite_operations.rb +119 -0
- data/lib/oci/core/compute_management_client.rb +11 -4
- data/lib/oci/core/core.rb +13 -0
- data/lib/oci/core/models/add_security_rule_details.rb +4 -2
- data/lib/oci/core/models/attach_vnic_details.rb +1 -0
- data/lib/oci/core/models/capture_console_history_details.rb +1 -0
- data/lib/oci/core/models/change_dedicated_vm_host_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_dhcp_options_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_internet_gateway_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_local_peering_gateway_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_network_security_group_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_public_ip_compartment_details.rb +155 -0
- data/lib/oci/core/models/create_dedicated_vm_host_details.rb +262 -0
- data/lib/oci/core/models/create_drg_attachment_details.rb +4 -2
- data/lib/oci/core/models/create_image_details.rb +1 -1
- data/lib/oci/core/models/create_instance_configuration_base.rb +16 -6
- data/lib/oci/core/models/create_instance_configuration_details.rb +1 -1
- data/lib/oci/core/models/create_instance_configuration_from_instance_details.rb +3 -2
- data/lib/oci/core/models/create_instance_pool_details.rb +3 -1
- data/lib/oci/core/models/create_local_peering_gateway_details.rb +1 -1
- data/lib/oci/core/models/create_service_gateway_details.rb +1 -1
- data/lib/oci/core/models/create_volume_group_backup_details.rb +3 -1
- data/lib/oci/core/models/create_volume_group_details.rb +1 -1
- data/lib/oci/core/models/cross_connect_mapping.rb +4 -0
- data/lib/oci/core/models/dedicated_vm_host.rb +359 -0
- data/lib/oci/core/models/dedicated_vm_host_instance_shape_summary.rb +170 -0
- data/lib/oci/core/models/dedicated_vm_host_instance_summary.rb +215 -0
- data/lib/oci/core/models/dedicated_vm_host_shape_summary.rb +171 -0
- data/lib/oci/core/models/dedicated_vm_host_summary.rb +325 -0
- data/lib/oci/core/models/drg_attachment.rb +6 -3
- data/lib/oci/core/models/egress_security_rule.rb +1 -0
- data/lib/oci/core/models/image.rb +2 -0
- data/lib/oci/core/models/ingress_security_rule.rb +2 -1
- data/lib/oci/core/models/instance.rb +16 -1
- data/lib/oci/core/models/instance_configuration.rb +10 -7
- data/lib/oci/core/models/ipv6.rb +2 -0
- data/lib/oci/core/models/launch_instance_details.rb +16 -1
- data/lib/oci/core/models/launch_options.rb +3 -2
- data/lib/oci/core/models/local_peering_gateway.rb +4 -3
- data/lib/oci/core/models/route_rule.rb +2 -1
- data/lib/oci/core/models/security_rule.rb +3 -1
- data/lib/oci/core/models/service_gateway.rb +4 -3
- data/lib/oci/core/models/subnet.rb +2 -1
- data/lib/oci/core/models/update_console_history_details.rb +1 -0
- data/lib/oci/core/models/update_dedicated_vm_host_details.rb +194 -0
- data/lib/oci/core/models/update_drg_attachment_details.rb +6 -3
- data/lib/oci/core/models/update_instance_pool_details.rb +3 -1
- data/lib/oci/core/models/update_local_peering_gateway_details.rb +4 -3
- data/lib/oci/core/models/update_network_security_group_details.rb +2 -0
- data/lib/oci/core/models/update_security_rule_details.rb +4 -2
- data/lib/oci/core/models/update_service_gateway_details.rb +4 -3
- data/lib/oci/core/models/update_vnic_details.rb +2 -0
- data/lib/oci/core/models/update_volume_backup_details.rb +1 -1
- data/lib/oci/core/models/update_volume_group_backup_details.rb +2 -1
- data/lib/oci/core/models/update_volume_group_details.rb +2 -1
- data/lib/oci/core/models/vcn.rb +2 -1
- data/lib/oci/core/models/volume_backup_schedule.rb +1 -1
- data/lib/oci/core/virtual_network_client.rb +396 -59
- data/lib/oci/dts/dts.rb +57 -0
- data/lib/oci/dts/models/attach_devices_details.rb +153 -0
- data/lib/oci/dts/models/change_transfer_job_compartment_details.rb +154 -0
- data/lib/oci/dts/models/create_transfer_appliance_details.rb +152 -0
- data/lib/oci/dts/models/create_transfer_appliance_entitlement_details.rb +178 -0
- data/lib/oci/dts/models/create_transfer_device_details.rb +165 -0
- data/lib/oci/dts/models/create_transfer_job_details.rb +238 -0
- data/lib/oci/dts/models/create_transfer_package_details.rb +178 -0
- data/lib/oci/dts/models/detach_devices_details.rb +153 -0
- data/lib/oci/dts/models/multiple_transfer_appliances.rb +153 -0
- data/lib/oci/dts/models/multiple_transfer_devices.rb +153 -0
- data/lib/oci/dts/models/multiple_transfer_packages.rb +153 -0
- data/lib/oci/dts/models/new_transfer_device.rb +246 -0
- data/lib/oci/dts/models/shipping_address.rb +263 -0
- data/lib/oci/dts/models/shipping_vendors.rb +149 -0
- data/lib/oci/dts/models/transfer_appliance.rb +367 -0
- data/lib/oci/dts/models/transfer_appliance_certificate.rb +148 -0
- data/lib/oci/dts/models/transfer_appliance_encryption_passphrase.rb +152 -0
- data/lib/oci/dts/models/transfer_appliance_entitlement.rb +240 -0
- data/lib/oci/dts/models/transfer_appliance_public_key.rb +152 -0
- data/lib/oci/dts/models/transfer_appliance_summary.rb +223 -0
- data/lib/oci/dts/models/transfer_device.rb +268 -0
- data/lib/oci/dts/models/transfer_device_summary.rb +254 -0
- data/lib/oci/dts/models/transfer_job.rb +356 -0
- data/lib/oci/dts/models/transfer_job_summary.rb +296 -0
- data/lib/oci/dts/models/transfer_package.rb +281 -0
- data/lib/oci/dts/models/transfer_package_summary.rb +201 -0
- data/lib/oci/dts/models/update_transfer_appliance_details.rb +180 -0
- data/lib/oci/dts/models/update_transfer_device_details.rb +166 -0
- data/lib/oci/dts/models/update_transfer_job_details.rb +237 -0
- data/lib/oci/dts/models/update_transfer_package_details.rb +204 -0
- data/lib/oci/dts/shipping_vendors_client.rb +165 -0
- data/lib/oci/dts/shipping_vendors_client_composite_operations.rb +24 -0
- data/lib/oci/dts/transfer_appliance_client.rb +569 -0
- data/lib/oci/dts/transfer_appliance_client_composite_operations.rb +104 -0
- data/lib/oci/dts/transfer_appliance_entitlement_client.rb +223 -0
- data/lib/oci/dts/transfer_appliance_entitlement_client_composite_operations.rb +24 -0
- data/lib/oci/dts/transfer_device_client.rb +402 -0
- data/lib/oci/dts/transfer_device_client_composite_operations.rb +65 -0
- data/lib/oci/dts/transfer_job_client.rb +458 -0
- data/lib/oci/dts/transfer_job_client_composite_operations.rb +143 -0
- data/lib/oci/dts/transfer_package_client.rb +515 -0
- data/lib/oci/dts/transfer_package_client_composite_operations.rb +104 -0
- data/lib/oci/dts/util.rb +2 -0
- data/lib/oci/file_storage/models/create_file_system_details.rb +19 -4
- data/lib/oci/file_storage/models/file_system.rb +19 -4
- data/lib/oci/file_storage/models/file_system_summary.rb +19 -4
- data/lib/oci/file_storage/models/update_file_system_details.rb +22 -4
- data/lib/oci/limits/limits.rb +5 -0
- data/lib/oci/limits/limits_client.rb +444 -0
- data/lib/oci/limits/limits_client_composite_operations.rb +24 -0
- data/lib/oci/limits/models/create_quota_details.rb +1 -1
- data/lib/oci/limits/models/limit_definition_summary.rb +241 -0
- data/lib/oci/limits/models/limit_value_summary.rb +210 -0
- data/lib/oci/limits/models/quota.rb +1 -1
- data/lib/oci/limits/models/resource_availability.rb +163 -0
- data/lib/oci/limits/models/service_summary.rb +159 -0
- data/lib/oci/limits/models/update_quota_details.rb +1 -1
- data/lib/oci/limits/quotas_client.rb +12 -11
- data/lib/oci/monitoring/models/alarm.rb +20 -1
- data/lib/oci/monitoring/models/create_alarm_details.rb +20 -1
- data/lib/oci/monitoring/models/list_metrics_details.rb +23 -3
- data/lib/oci/monitoring/models/metric.rb +20 -1
- data/lib/oci/monitoring/models/metric_data.rb +20 -1
- data/lib/oci/monitoring/models/metric_data_details.rb +20 -1
- data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +20 -1
- data/lib/oci/monitoring/models/update_alarm_details.rb +20 -1
- data/lib/oci/regions.rb +14 -8
- data/lib/oci/streaming/models/archiver.rb +291 -0
- data/lib/oci/streaming/models/archiver_error.rb +159 -0
- data/lib/oci/streaming/models/archiver_lifecycle_state.rb +14 -0
- data/lib/oci/streaming/models/archiver_start_position.rb +10 -0
- data/lib/oci/streaming/models/create_archiver_details.rb +223 -0
- data/lib/oci/streaming/models/update_archiver_details.rb +222 -0
- data/lib/oci/streaming/stream_admin_client.rb +304 -0
- data/lib/oci/streaming/stream_admin_client_composite_operations.rb +162 -0
- data/lib/oci/streaming/streaming.rb +6 -0
- data/lib/oci/version.rb +1 -1
- data/lib/oci/waas/models/access_rule.rb +121 -4
- data/lib/oci/waas/models/access_rule_criteria.rb +12 -0
- data/lib/oci/waas/models/address_list.rb +289 -0
- data/lib/oci/waas/models/address_list_summary.rb +279 -0
- data/lib/oci/waas/models/caching_rule.rb +243 -0
- data/lib/oci/waas/models/caching_rule_criteria.rb +194 -0
- data/lib/oci/waas/models/caching_rule_summary.rb +246 -0
- data/lib/oci/waas/models/certificate.rb +22 -9
- data/lib/oci/waas/models/certificate_extensions.rb +3 -0
- data/lib/oci/waas/models/certificate_issuer_name.rb +225 -0
- data/lib/oci/waas/models/certificate_public_key_info.rb +4 -1
- data/lib/oci/waas/models/certificate_subject_name.rb +8 -1
- data/lib/oci/waas/models/certificate_summary.rb +10 -2
- data/lib/oci/waas/models/change_address_list_compartment_details.rb +154 -0
- data/lib/oci/waas/models/change_custom_protection_rule_compartment_details.rb +154 -0
- data/lib/oci/waas/models/create_address_list_details.rb +213 -0
- data/lib/oci/waas/models/create_certificate_details.rb +22 -3
- data/lib/oci/waas/models/create_custom_protection_rule_details.rb +251 -0
- data/lib/oci/waas/models/create_waas_policy_details.rb +26 -4
- data/lib/oci/waas/models/custom_protection_rule.rb +326 -0
- data/lib/oci/waas/models/custom_protection_rule_setting.rb +180 -0
- data/lib/oci/waas/models/custom_protection_rule_summary.rb +279 -0
- data/lib/oci/waas/models/origin_group.rb +149 -0
- data/lib/oci/waas/models/origin_group_origins.rb +159 -0
- data/lib/oci/waas/models/policy_config.rb +201 -4
- data/lib/oci/waas/models/protection_rule_exclusion.rb +2 -2
- data/lib/oci/waas/models/purge_cache.rb +149 -0
- data/lib/oci/waas/models/update_address_list_details.rb +199 -0
- data/lib/oci/waas/models/update_certificate_details.rb +10 -2
- data/lib/oci/waas/models/update_custom_protection_rule_details.rb +237 -0
- data/lib/oci/waas/models/update_waas_policy_details.rb +26 -4
- data/lib/oci/waas/models/waas_policy.rb +25 -3
- data/lib/oci/waas/models/waas_policy_custom_protection_rule_summary.rb +207 -0
- data/lib/oci/waas/models/waas_policy_summary.rb +10 -2
- data/lib/oci/waas/models/waf_config.rb +43 -1
- data/lib/oci/waas/models/waf_config_details.rb +43 -1
- data/lib/oci/waas/models/waf_log.rb +3 -3
- data/lib/oci/waas/models/work_request.rb +4 -1
- data/lib/oci/waas/models/work_request_operation_types.rb +4 -1
- data/lib/oci/waas/models/work_request_summary.rb +4 -1
- data/lib/oci/waas/waas.rb +19 -0
- data/lib/oci/waas/waas_client.rb +1147 -61
- data/lib/oci/waas/waas_client_composite_operations.rb +386 -0
- metadata +90 -2
|
@@ -180,6 +180,45 @@ module OCI
|
|
|
180
180
|
# rubocop:disable Layout/EmptyLines
|
|
181
181
|
|
|
182
182
|
|
|
183
|
+
# Calls {OCI::Core::ComputeClient#create_dedicated_vm_host} and then waits for the {OCI::Core::Models::DedicatedVmHost} acted upon
|
|
184
|
+
# to enter the given state(s).
|
|
185
|
+
#
|
|
186
|
+
# @param [OCI::Core::Models::CreateDedicatedVmHostDetails] create_dedicated_vm_host_details The details for creating a new dedicated virtual machine (VM) host.
|
|
187
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::DedicatedVmHost#lifecycle_state}
|
|
188
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#create_dedicated_vm_host}
|
|
189
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
190
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
191
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
192
|
+
#
|
|
193
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::DedicatedVmHost}
|
|
194
|
+
def create_dedicated_vm_host_and_wait_for_state(create_dedicated_vm_host_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
195
|
+
operation_result = @service_client.create_dedicated_vm_host(create_dedicated_vm_host_details, base_operation_opts)
|
|
196
|
+
|
|
197
|
+
return operation_result if wait_for_states.empty?
|
|
198
|
+
|
|
199
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
200
|
+
wait_for_resource_id = operation_result.data.id
|
|
201
|
+
|
|
202
|
+
begin
|
|
203
|
+
waiter_result = @service_client.get_dedicated_vm_host(wait_for_resource_id).wait_until(
|
|
204
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
205
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
206
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
207
|
+
)
|
|
208
|
+
result_to_return = waiter_result
|
|
209
|
+
|
|
210
|
+
return result_to_return
|
|
211
|
+
rescue StandardError
|
|
212
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
216
|
+
# rubocop:enable Layout/EmptyLines
|
|
217
|
+
|
|
218
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
219
|
+
# rubocop:disable Layout/EmptyLines
|
|
220
|
+
|
|
221
|
+
|
|
183
222
|
# Calls {OCI::Core::ComputeClient#create_image} and then waits for the {OCI::Core::Models::Image} acted upon
|
|
184
223
|
# to enter the given state(s).
|
|
185
224
|
#
|
|
@@ -298,6 +337,46 @@ module OCI
|
|
|
298
337
|
# rubocop:disable Layout/EmptyLines
|
|
299
338
|
|
|
300
339
|
|
|
340
|
+
# Calls {OCI::Core::ComputeClient#delete_dedicated_vm_host} and then waits for the {OCI::Core::Models::DedicatedVmHost} acted upon
|
|
341
|
+
# to enter the given state(s).
|
|
342
|
+
#
|
|
343
|
+
# @param [String] dedicated_vm_host_id The OCID of the dedicated VM host.
|
|
344
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::DedicatedVmHost#lifecycle_state}
|
|
345
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#delete_dedicated_vm_host}
|
|
346
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
347
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
348
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
349
|
+
#
|
|
350
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
|
351
|
+
def delete_dedicated_vm_host_and_wait_for_state(dedicated_vm_host_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
352
|
+
initial_get_result = @service_client.get_dedicated_vm_host(dedicated_vm_host_id)
|
|
353
|
+
operation_result = @service_client.delete_dedicated_vm_host(dedicated_vm_host_id, base_operation_opts)
|
|
354
|
+
|
|
355
|
+
return operation_result if wait_for_states.empty?
|
|
356
|
+
|
|
357
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
358
|
+
|
|
359
|
+
begin
|
|
360
|
+
waiter_result = initial_get_result.wait_until(
|
|
361
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
362
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
363
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
|
364
|
+
succeed_on_not_found: true
|
|
365
|
+
)
|
|
366
|
+
result_to_return = waiter_result
|
|
367
|
+
|
|
368
|
+
return result_to_return
|
|
369
|
+
rescue StandardError
|
|
370
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
371
|
+
end
|
|
372
|
+
end
|
|
373
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
374
|
+
# rubocop:enable Layout/EmptyLines
|
|
375
|
+
|
|
376
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
377
|
+
# rubocop:disable Layout/EmptyLines
|
|
378
|
+
|
|
379
|
+
|
|
301
380
|
# Calls {OCI::Core::ComputeClient#delete_image} and then waits for the {OCI::Core::Models::Image} acted upon
|
|
302
381
|
# to enter the given state(s).
|
|
303
382
|
#
|
|
@@ -698,6 +777,46 @@ module OCI
|
|
|
698
777
|
# rubocop:disable Layout/EmptyLines
|
|
699
778
|
|
|
700
779
|
|
|
780
|
+
# Calls {OCI::Core::ComputeClient#update_dedicated_vm_host} and then waits for the {OCI::Core::Models::DedicatedVmHost} acted upon
|
|
781
|
+
# to enter the given state(s).
|
|
782
|
+
#
|
|
783
|
+
# @param [String] dedicated_vm_host_id The OCID of the dedicated VM host.
|
|
784
|
+
# @param [OCI::Core::Models::UpdateDedicatedVmHostDetails] update_dedicated_vm_host_details Update dedicated VM host details
|
|
785
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Core::Models::DedicatedVmHost#lifecycle_state}
|
|
786
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Core::ComputeClient#update_dedicated_vm_host}
|
|
787
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
|
788
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
|
789
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
|
790
|
+
#
|
|
791
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Core::Models::DedicatedVmHost}
|
|
792
|
+
def update_dedicated_vm_host_and_wait_for_state(dedicated_vm_host_id, update_dedicated_vm_host_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
|
793
|
+
operation_result = @service_client.update_dedicated_vm_host(dedicated_vm_host_id, update_dedicated_vm_host_details, base_operation_opts)
|
|
794
|
+
|
|
795
|
+
return operation_result if wait_for_states.empty?
|
|
796
|
+
|
|
797
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
|
798
|
+
wait_for_resource_id = operation_result.data.id
|
|
799
|
+
|
|
800
|
+
begin
|
|
801
|
+
waiter_result = @service_client.get_dedicated_vm_host(wait_for_resource_id).wait_until(
|
|
802
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
|
803
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
|
804
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
|
805
|
+
)
|
|
806
|
+
result_to_return = waiter_result
|
|
807
|
+
|
|
808
|
+
return result_to_return
|
|
809
|
+
rescue StandardError
|
|
810
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
|
811
|
+
end
|
|
812
|
+
end
|
|
813
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
814
|
+
# rubocop:enable Layout/EmptyLines
|
|
815
|
+
|
|
816
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
|
817
|
+
# rubocop:disable Layout/EmptyLines
|
|
818
|
+
|
|
819
|
+
|
|
701
820
|
# Calls {OCI::Core::ComputeClient#update_image} and then waits for the {OCI::Core::Models::Image} acted upon
|
|
702
821
|
# to enter the given state(s).
|
|
703
822
|
#
|
|
@@ -336,7 +336,8 @@ module OCI
|
|
|
336
336
|
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
337
337
|
|
|
338
338
|
|
|
339
|
-
# Creates an instance configuration
|
|
339
|
+
# Creates an instance configuration. An instance configuration is a template that defines the
|
|
340
|
+
# settings to use when creating Compute instances.
|
|
340
341
|
#
|
|
341
342
|
# @param [OCI::Core::Models::CreateInstanceConfigurationBase] create_instance_configuration Instance configuration creation details
|
|
342
343
|
# @param [Hash] opts the optional parameters
|
|
@@ -738,7 +739,13 @@ module OCI
|
|
|
738
739
|
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
739
740
|
|
|
740
741
|
|
|
741
|
-
#
|
|
742
|
+
# Launches an instance from an instance configuration.
|
|
743
|
+
#
|
|
744
|
+
# If the instance configuration does not include all of the parameters that are
|
|
745
|
+
# required to launch an instance, such as the availability domain and subnet ID, you must
|
|
746
|
+
# provide these parameters when you launch an instance from the instance configuration.
|
|
747
|
+
# For more information, see the {InstanceConfiguration}
|
|
748
|
+
# resource.
|
|
742
749
|
#
|
|
743
750
|
# @param [String] instance_configuration_id The OCID of the instance configuration.
|
|
744
751
|
# @param [OCI::Core::Models::InstanceConfigurationInstanceDetails] instance_configuration Instance configuration Instance Details
|
|
@@ -800,7 +807,7 @@ module OCI
|
|
|
800
807
|
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
801
808
|
|
|
802
809
|
|
|
803
|
-
# Lists the
|
|
810
|
+
# Lists the instance configurations in the specified compartment.
|
|
804
811
|
#
|
|
805
812
|
# @param [String] compartment_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment.
|
|
806
813
|
# @param [Hash] opts the optional parameters
|
|
@@ -1397,7 +1404,7 @@ module OCI
|
|
|
1397
1404
|
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
1398
1405
|
|
|
1399
1406
|
|
|
1400
|
-
# Updates the
|
|
1407
|
+
# Updates the free-form tags, defined tags, and display name of an instance configuration.
|
|
1401
1408
|
# @param [String] instance_configuration_id The OCID of the instance configuration.
|
|
1402
1409
|
# @param [OCI::Core::Models::UpdateInstanceConfigurationDetails] update_instance_configuration_details Updates the freeFormTags, definedTags, and display name of an instance configuration.
|
|
1403
1410
|
# @param [Hash] opts the optional parameters
|
data/lib/oci/core/core.rb
CHANGED
|
@@ -44,12 +44,18 @@ require 'oci/core/models/change_boot_volume_compartment_details'
|
|
|
44
44
|
require 'oci/core/models/change_cpe_compartment_details'
|
|
45
45
|
require 'oci/core/models/change_cross_connect_compartment_details'
|
|
46
46
|
require 'oci/core/models/change_cross_connect_group_compartment_details'
|
|
47
|
+
require 'oci/core/models/change_dedicated_vm_host_compartment_details'
|
|
48
|
+
require 'oci/core/models/change_dhcp_options_compartment_details'
|
|
47
49
|
require 'oci/core/models/change_ip_sec_connection_compartment_details'
|
|
48
50
|
require 'oci/core/models/change_image_compartment_details'
|
|
49
51
|
require 'oci/core/models/change_instance_compartment_details'
|
|
50
52
|
require 'oci/core/models/change_instance_configuration_compartment_details'
|
|
51
53
|
require 'oci/core/models/change_instance_pool_compartment_details'
|
|
54
|
+
require 'oci/core/models/change_internet_gateway_compartment_details'
|
|
55
|
+
require 'oci/core/models/change_local_peering_gateway_compartment_details'
|
|
52
56
|
require 'oci/core/models/change_nat_gateway_compartment_details'
|
|
57
|
+
require 'oci/core/models/change_network_security_group_compartment_details'
|
|
58
|
+
require 'oci/core/models/change_public_ip_compartment_details'
|
|
53
59
|
require 'oci/core/models/change_remote_peering_connection_compartment_details'
|
|
54
60
|
require 'oci/core/models/change_route_table_compartment_details'
|
|
55
61
|
require 'oci/core/models/change_security_list_compartment_details'
|
|
@@ -73,6 +79,7 @@ require 'oci/core/models/create_boot_volume_details'
|
|
|
73
79
|
require 'oci/core/models/create_cpe_details'
|
|
74
80
|
require 'oci/core/models/create_cross_connect_details'
|
|
75
81
|
require 'oci/core/models/create_cross_connect_group_details'
|
|
82
|
+
require 'oci/core/models/create_dedicated_vm_host_details'
|
|
76
83
|
require 'oci/core/models/create_dhcp_details'
|
|
77
84
|
require 'oci/core/models/create_drg_attachment_details'
|
|
78
85
|
require 'oci/core/models/create_drg_details'
|
|
@@ -113,6 +120,11 @@ require 'oci/core/models/cross_connect_location'
|
|
|
113
120
|
require 'oci/core/models/cross_connect_mapping'
|
|
114
121
|
require 'oci/core/models/cross_connect_port_speed_shape'
|
|
115
122
|
require 'oci/core/models/cross_connect_status'
|
|
123
|
+
require 'oci/core/models/dedicated_vm_host'
|
|
124
|
+
require 'oci/core/models/dedicated_vm_host_instance_shape_summary'
|
|
125
|
+
require 'oci/core/models/dedicated_vm_host_instance_summary'
|
|
126
|
+
require 'oci/core/models/dedicated_vm_host_shape_summary'
|
|
127
|
+
require 'oci/core/models/dedicated_vm_host_summary'
|
|
116
128
|
require 'oci/core/models/delete_virtual_circuit_public_prefix_details'
|
|
117
129
|
require 'oci/core/models/detach_load_balancer_details'
|
|
118
130
|
require 'oci/core/models/device'
|
|
@@ -213,6 +225,7 @@ require 'oci/core/models/update_console_history_details'
|
|
|
213
225
|
require 'oci/core/models/update_cpe_details'
|
|
214
226
|
require 'oci/core/models/update_cross_connect_details'
|
|
215
227
|
require 'oci/core/models/update_cross_connect_group_details'
|
|
228
|
+
require 'oci/core/models/update_dedicated_vm_host_details'
|
|
216
229
|
require 'oci/core/models/update_dhcp_details'
|
|
217
230
|
require 'oci/core/models/update_drg_attachment_details'
|
|
218
231
|
require 'oci/core/models/update_drg_details'
|
|
@@ -23,7 +23,7 @@ module OCI
|
|
|
23
23
|
SOURCE_TYPE_NETWORK_SECURITY_GROUP = 'NETWORK_SECURITY_GROUP'.freeze
|
|
24
24
|
].freeze
|
|
25
25
|
|
|
26
|
-
# An optional description of your choice for the rule.
|
|
26
|
+
# An optional description of your choice for the rule. Avoid entering confidential information.
|
|
27
27
|
#
|
|
28
28
|
# @return [String]
|
|
29
29
|
attr_accessor :description
|
|
@@ -34,6 +34,7 @@ module OCI
|
|
|
34
34
|
# Allowed values:
|
|
35
35
|
#
|
|
36
36
|
# * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56`
|
|
37
|
+
# Note that IPv6 addressing is currently supported only in the Government Cloud.
|
|
37
38
|
#
|
|
38
39
|
# * The `cidrBlock` value for a {Service}, if you're
|
|
39
40
|
# setting up a security rule for traffic destined for a particular `Service` through
|
|
@@ -103,6 +104,7 @@ module OCI
|
|
|
103
104
|
# Allowed values:
|
|
104
105
|
#
|
|
105
106
|
# * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56`
|
|
107
|
+
# Note that IPv6 addressing is currently supported only in the Government Cloud.
|
|
106
108
|
#
|
|
107
109
|
# * The `cidrBlock` value for a {Service}, if you're
|
|
108
110
|
# setting up a security rule for traffic coming from a particular `Service` through
|
|
@@ -123,7 +125,7 @@ module OCI
|
|
|
123
125
|
# {Service} (the rule is for traffic coming from a
|
|
124
126
|
# particular `Service` through a service gateway).
|
|
125
127
|
#
|
|
126
|
-
# * `NETWORK_SECURITY_GROUP`: If the rule's `
|
|
128
|
+
# * `NETWORK_SECURITY_GROUP`: If the rule's `source` is the OCID of a
|
|
127
129
|
# {NetworkSecurityGroup}.
|
|
128
130
|
#
|
|
129
131
|
# @return [String]
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
# Contains details indicating which compartment the resource should move to
|
|
8
|
+
class Core::Models::ChangeDedicatedVmHostCompartmentDetails
|
|
9
|
+
# **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment
|
|
10
|
+
# into which the resource should be moved.
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :compartment_id
|
|
14
|
+
|
|
15
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
16
|
+
def self.attribute_map
|
|
17
|
+
{
|
|
18
|
+
# rubocop:disable Style/SymbolLiteral
|
|
19
|
+
'compartment_id': :'compartmentId'
|
|
20
|
+
# rubocop:enable Style/SymbolLiteral
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Attribute type mapping.
|
|
25
|
+
def self.swagger_types
|
|
26
|
+
{
|
|
27
|
+
# rubocop:disable Style/SymbolLiteral
|
|
28
|
+
'compartment_id': :'String'
|
|
29
|
+
# rubocop:enable Style/SymbolLiteral
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
34
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# Initializes the object
|
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
39
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
|
40
|
+
def initialize(attributes = {})
|
|
41
|
+
return unless attributes.is_a?(Hash)
|
|
42
|
+
|
|
43
|
+
# convert string to symbol for hash key
|
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
45
|
+
|
|
46
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
|
47
|
+
|
|
48
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
|
49
|
+
|
|
50
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
|
51
|
+
end
|
|
52
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
53
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
54
|
+
|
|
55
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# Checks equality by comparing each attribute.
|
|
59
|
+
# @param [Object] other the other object to be compared
|
|
60
|
+
def ==(other)
|
|
61
|
+
return true if equal?(other)
|
|
62
|
+
|
|
63
|
+
self.class == other.class &&
|
|
64
|
+
compartment_id == other.compartment_id
|
|
65
|
+
end
|
|
66
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
67
|
+
|
|
68
|
+
# @see the `==` method
|
|
69
|
+
# @param [Object] other the other object to be compared
|
|
70
|
+
def eql?(other)
|
|
71
|
+
self == other
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Calculates hash code according to all attributes.
|
|
78
|
+
# @return [Fixnum] Hash code
|
|
79
|
+
def hash
|
|
80
|
+
[compartment_id].hash
|
|
81
|
+
end
|
|
82
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
83
|
+
|
|
84
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# Builds the object from hash
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
# @return [Object] Returns the model itself
|
|
90
|
+
def build_from_hash(attributes)
|
|
91
|
+
return nil unless attributes.is_a?(Hash)
|
|
92
|
+
|
|
93
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
94
|
+
if type =~ /^Array<(.*)>/i
|
|
95
|
+
# check to ensure the input is an array given that the the attribute
|
|
96
|
+
# is documented as an array but the input is not
|
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
98
|
+
public_method("#{key}=").call(
|
|
99
|
+
attributes[self.class.attribute_map[key]]
|
|
100
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
104
|
+
public_method("#{key}=").call(
|
|
105
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
self
|
|
112
|
+
end
|
|
113
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
114
|
+
|
|
115
|
+
# Returns the string representation of the object
|
|
116
|
+
# @return [String] String presentation of the object
|
|
117
|
+
def to_s
|
|
118
|
+
to_hash.to_s
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Returns the object in the form of hash
|
|
122
|
+
# @return [Hash] Returns the object in the form of hash
|
|
123
|
+
def to_hash
|
|
124
|
+
hash = {}
|
|
125
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
126
|
+
value = public_method(attr).call
|
|
127
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
128
|
+
|
|
129
|
+
hash[param] = _to_hash(value)
|
|
130
|
+
end
|
|
131
|
+
hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
private
|
|
135
|
+
|
|
136
|
+
# Outputs non-array value in the form of hash
|
|
137
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
138
|
+
# @param [Object] value Any valid value
|
|
139
|
+
# @return [Hash] Returns the value in the form of hash
|
|
140
|
+
def _to_hash(value)
|
|
141
|
+
if value.is_a?(Array)
|
|
142
|
+
value.compact.map { |v| _to_hash(v) }
|
|
143
|
+
elsif value.is_a?(Hash)
|
|
144
|
+
{}.tap do |hash|
|
|
145
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
146
|
+
end
|
|
147
|
+
elsif value.respond_to? :to_hash
|
|
148
|
+
value.to_hash
|
|
149
|
+
else
|
|
150
|
+
value
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
# The configuration details for the move operation.
|
|
8
|
+
class Core::Models::ChangeDhcpOptionsCompartmentDetails
|
|
9
|
+
# **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the
|
|
10
|
+
# set of DHCP options to.
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :compartment_id
|
|
14
|
+
|
|
15
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
16
|
+
def self.attribute_map
|
|
17
|
+
{
|
|
18
|
+
# rubocop:disable Style/SymbolLiteral
|
|
19
|
+
'compartment_id': :'compartmentId'
|
|
20
|
+
# rubocop:enable Style/SymbolLiteral
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Attribute type mapping.
|
|
25
|
+
def self.swagger_types
|
|
26
|
+
{
|
|
27
|
+
# rubocop:disable Style/SymbolLiteral
|
|
28
|
+
'compartment_id': :'String'
|
|
29
|
+
# rubocop:enable Style/SymbolLiteral
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
34
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# Initializes the object
|
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
39
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
|
40
|
+
def initialize(attributes = {})
|
|
41
|
+
return unless attributes.is_a?(Hash)
|
|
42
|
+
|
|
43
|
+
# convert string to symbol for hash key
|
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
45
|
+
|
|
46
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
|
47
|
+
|
|
48
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
|
49
|
+
|
|
50
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
|
51
|
+
end
|
|
52
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
53
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
54
|
+
|
|
55
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# Checks equality by comparing each attribute.
|
|
59
|
+
# @param [Object] other the other object to be compared
|
|
60
|
+
def ==(other)
|
|
61
|
+
return true if equal?(other)
|
|
62
|
+
|
|
63
|
+
self.class == other.class &&
|
|
64
|
+
compartment_id == other.compartment_id
|
|
65
|
+
end
|
|
66
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
67
|
+
|
|
68
|
+
# @see the `==` method
|
|
69
|
+
# @param [Object] other the other object to be compared
|
|
70
|
+
def eql?(other)
|
|
71
|
+
self == other
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Calculates hash code according to all attributes.
|
|
78
|
+
# @return [Fixnum] Hash code
|
|
79
|
+
def hash
|
|
80
|
+
[compartment_id].hash
|
|
81
|
+
end
|
|
82
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
83
|
+
|
|
84
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# Builds the object from hash
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
# @return [Object] Returns the model itself
|
|
90
|
+
def build_from_hash(attributes)
|
|
91
|
+
return nil unless attributes.is_a?(Hash)
|
|
92
|
+
|
|
93
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
94
|
+
if type =~ /^Array<(.*)>/i
|
|
95
|
+
# check to ensure the input is an array given that the the attribute
|
|
96
|
+
# is documented as an array but the input is not
|
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
98
|
+
public_method("#{key}=").call(
|
|
99
|
+
attributes[self.class.attribute_map[key]]
|
|
100
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
104
|
+
public_method("#{key}=").call(
|
|
105
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
self
|
|
112
|
+
end
|
|
113
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
114
|
+
|
|
115
|
+
# Returns the string representation of the object
|
|
116
|
+
# @return [String] String presentation of the object
|
|
117
|
+
def to_s
|
|
118
|
+
to_hash.to_s
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Returns the object in the form of hash
|
|
122
|
+
# @return [Hash] Returns the object in the form of hash
|
|
123
|
+
def to_hash
|
|
124
|
+
hash = {}
|
|
125
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
126
|
+
value = public_method(attr).call
|
|
127
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
128
|
+
|
|
129
|
+
hash[param] = _to_hash(value)
|
|
130
|
+
end
|
|
131
|
+
hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
private
|
|
135
|
+
|
|
136
|
+
# Outputs non-array value in the form of hash
|
|
137
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
138
|
+
# @param [Object] value Any valid value
|
|
139
|
+
# @return [Hash] Returns the value in the form of hash
|
|
140
|
+
def _to_hash(value)
|
|
141
|
+
if value.is_a?(Array)
|
|
142
|
+
value.compact.map { |v| _to_hash(v) }
|
|
143
|
+
elsif value.is_a?(Hash)
|
|
144
|
+
{}.tap do |hash|
|
|
145
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
146
|
+
end
|
|
147
|
+
elsif value.respond_to? :to_hash
|
|
148
|
+
value.to_hash
|
|
149
|
+
else
|
|
150
|
+
value
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|