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.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/oci.rb +3 -0
- data/lib/oci/budget/budget.rb +1 -0
- data/lib/oci/budget/budget_client.rb +21 -1
- data/lib/oci/budget/models/budget.rb +52 -2
- data/lib/oci/budget/models/budget_summary.rb +52 -2
- data/lib/oci/budget/models/create_budget_details.rb +55 -2
- data/lib/oci/budget/models/target_type.rb +10 -0
- data/lib/oci/core/blockstorage_client.rb +18 -6
- data/lib/oci/core/compute_client.rb +75 -0
- data/lib/oci/core/compute_management_client.rb +4 -1
- data/lib/oci/core/core.rb +12 -0
- data/lib/oci/core/models/add_security_rule_details.rb +2 -2
- data/lib/oci/core/models/boot_volume_backup.rb +19 -1
- data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_boot_volume_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_cpe_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_cross_connect_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_cross_connect_group_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_instance_compartment_details.rb +154 -0
- data/lib/oci/core/models/change_ip_sec_connection_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_remote_peering_connection_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_virtual_circuit_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_volume_backup_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_volume_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_volume_group_compartment_details.rb +2 -2
- data/lib/oci/core/models/copy_volume_backup_details.rb +27 -4
- data/lib/oci/core/models/create_cross_connect_details.rb +37 -1
- data/lib/oci/core/models/create_cross_connect_group_details.rb +40 -4
- data/lib/oci/core/models/create_instance_configuration_base.rb +250 -0
- data/lib/oci/core/models/create_instance_configuration_details.rb +15 -57
- data/lib/oci/core/models/create_instance_configuration_from_instance_details.rb +179 -0
- data/lib/oci/core/models/create_ipv6_details.rb +249 -0
- data/lib/oci/core/models/create_remote_peering_connection_details.rb +40 -4
- data/lib/oci/core/models/create_service_gateway_details.rb +23 -1
- data/lib/oci/core/models/create_subnet_details.rb +24 -1
- data/lib/oci/core/models/create_vcn_details.rb +56 -4
- data/lib/oci/core/models/create_virtual_circuit_details.rb +38 -2
- data/lib/oci/core/models/cross_connect.rb +37 -1
- data/lib/oci/core/models/cross_connect_group.rb +37 -1
- data/lib/oci/core/models/cross_connect_mapping.rb +50 -1
- data/lib/oci/core/models/egress_security_rule.rb +10 -7
- data/lib/oci/core/models/ingress_security_rule.rb +10 -7
- data/lib/oci/core/models/instance.rb +1 -0
- data/lib/oci/core/models/ipv6.rb +375 -0
- data/lib/oci/core/models/private_ip.rb +1 -0
- data/lib/oci/core/models/remote_peering_connection.rb +37 -1
- data/lib/oci/core/models/route_rule.rb +4 -1
- data/lib/oci/core/models/security_rule.rb +2 -2
- data/lib/oci/core/models/service_gateway.rb +18 -1
- data/lib/oci/core/models/subnet.rb +56 -1
- data/lib/oci/core/models/update_cross_connect_details.rb +37 -1
- data/lib/oci/core/models/update_cross_connect_group_details.rb +40 -4
- data/lib/oci/core/models/update_ipv6_details.rb +229 -0
- data/lib/oci/core/models/update_remote_peering_connection_details.rb +40 -4
- data/lib/oci/core/models/update_security_rule_details.rb +2 -2
- data/lib/oci/core/models/update_service_gateway_details.rb +18 -1
- data/lib/oci/core/models/update_virtual_circuit_details.rb +37 -1
- data/lib/oci/core/models/vcn.rb +42 -1
- data/lib/oci/core/models/virtual_circuit.rb +37 -1
- data/lib/oci/core/models/volume_backup.rb +19 -1
- data/lib/oci/core/virtual_network_client.rb +744 -10
- data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
- data/lib/oci/database/database.rb +3 -0
- data/lib/oci/database/database_client.rb +320 -36
- data/lib/oci/database/models/autonomous_data_warehouse.rb +1 -0
- data/lib/oci/database/models/autonomous_data_warehouse_console_token_details.rb +164 -0
- data/lib/oci/database/models/autonomous_data_warehouse_summary.rb +1 -0
- data/lib/oci/database/models/autonomous_database.rb +5 -3
- data/lib/oci/database/models/autonomous_database_connection_urls.rb +1 -1
- data/lib/oci/database/models/autonomous_database_console_token_details.rb +163 -0
- data/lib/oci/database/models/autonomous_database_summary.rb +5 -3
- data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +1 -3
- data/lib/oci/database/models/change_compartment_details.rb +155 -0
- data/lib/oci/database/models/create_autonomous_database_base.rb +5 -4
- data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +2 -5
- data/lib/oci/database/models/create_database_details.rb +1 -1
- data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +2 -1
- data/lib/oci/database/models/create_db_home_with_db_system_id_from_backup_details.rb +2 -1
- data/lib/oci/database/models/db_system.rb +2 -5
- data/lib/oci/database/models/db_system_summary.rb +2 -5
- data/lib/oci/database/models/launch_db_system_base.rb +3 -5
- data/lib/oci/database/models/maintenance_window.rb +2 -1
- data/lib/oci/database/models/update_autonomous_database_details.rb +5 -3
- data/lib/oci/database/models/update_db_system_details.rb +2 -5
- data/lib/oci/dns/dns.rb +2 -0
- data/lib/oci/dns/dns_client.rb +138 -1
- data/lib/oci/dns/models/change_steering_policy_compartment_details.rb +155 -0
- data/lib/oci/dns/models/change_zone_compartment_details.rb +155 -0
- data/lib/oci/events/events.rb +34 -0
- data/lib/oci/events/events_client.rb +537 -0
- data/lib/oci/events/events_client_composite_operations.rb +145 -0
- data/lib/oci/events/models/action.rb +275 -0
- data/lib/oci/events/models/action_details.rb +222 -0
- data/lib/oci/events/models/action_details_list.rb +150 -0
- data/lib/oci/events/models/action_list.rb +151 -0
- data/lib/oci/events/models/change_rule_compartment_details.rb +156 -0
- data/lib/oci/events/models/create_faa_s_action_details.rb +170 -0
- data/lib/oci/events/models/create_notification_service_action_details.rb +170 -0
- data/lib/oci/events/models/create_rule_details.rb +284 -0
- data/lib/oci/events/models/create_streaming_service_action_details.rb +170 -0
- data/lib/oci/events/models/faa_s_action.rb +178 -0
- data/lib/oci/events/models/notification_service_action.rb +179 -0
- data/lib/oci/events/models/rule.rb +372 -0
- data/lib/oci/events/models/rule_summary.rb +321 -0
- data/lib/oci/events/models/streaming_service_action.rb +178 -0
- data/lib/oci/events/models/update_rule_details.rb +266 -0
- data/lib/oci/events/util.rb +2 -0
- data/lib/oci/functions/functions.rb +29 -0
- data/lib/oci/functions/functions_invoke_client.rb +237 -0
- data/lib/oci/functions/functions_invoke_client_composite_operations.rb +24 -0
- data/lib/oci/functions/functions_management_client.rb +851 -0
- data/lib/oci/functions/functions_management_client_composite_operations.rb +266 -0
- data/lib/oci/functions/models/application.rb +322 -0
- data/lib/oci/functions/models/application_summary.rb +281 -0
- data/lib/oci/functions/models/change_application_compartment_details.rb +156 -0
- data/lib/oci/functions/models/create_application_details.rb +236 -0
- data/lib/oci/functions/models/create_function_details.rb +280 -0
- data/lib/oci/functions/models/function.rb +397 -0
- data/lib/oci/functions/models/function_summary.rb +381 -0
- data/lib/oci/functions/models/update_application_details.rb +191 -0
- data/lib/oci/functions/models/update_function_details.rb +250 -0
- data/lib/oci/functions/util.rb +2 -0
- data/lib/oci/healthchecks/health_checks_client.rb +147 -1
- data/lib/oci/healthchecks/healthchecks.rb +2 -0
- data/lib/oci/healthchecks/models/change_http_monitor_compartment_details.rb +155 -0
- data/lib/oci/healthchecks/models/change_ping_monitor_compartment_details.rb +155 -0
- data/lib/oci/healthchecks/models/create_http_monitor_details.rb +2 -1
- data/lib/oci/healthchecks/models/create_on_demand_http_probe_details.rb +2 -1
- data/lib/oci/healthchecks/models/create_on_demand_ping_probe_details.rb +2 -1
- data/lib/oci/healthchecks/models/create_ping_monitor_details.rb +2 -1
- data/lib/oci/healthchecks/models/http_monitor.rb +2 -0
- data/lib/oci/healthchecks/models/http_probe.rb +2 -0
- data/lib/oci/healthchecks/models/ping_monitor.rb +2 -0
- data/lib/oci/healthchecks/models/ping_probe.rb +2 -0
- data/lib/oci/healthchecks/models/update_http_monitor_details.rb +2 -0
- data/lib/oci/healthchecks/models/update_ping_monitor_details.rb +2 -0
- data/lib/oci/identity/identity.rb +1 -0
- data/lib/oci/identity/identity_client.rb +70 -0
- data/lib/oci/identity/identity_client_composite_operations.rb +50 -0
- data/lib/oci/identity/models/move_compartment_details.rb +155 -0
- data/lib/oci/key_management/key_management.rb +2 -0
- data/lib/oci/key_management/kms_management_client.rb +73 -0
- data/lib/oci/key_management/kms_vault_client.rb +73 -0
- data/lib/oci/key_management/models/change_key_compartment_details.rb +153 -0
- data/lib/oci/key_management/models/change_vault_compartment_details.rb +153 -0
- data/lib/oci/key_management/models/key.rb +1 -0
- data/lib/oci/key_management/models/key_summary.rb +1 -0
- data/lib/oci/key_management/models/vault.rb +1 -0
- data/lib/oci/key_management/models/vault_summary.rb +1 -0
- data/lib/oci/limits/limits.rb +23 -0
- data/lib/oci/limits/models/create_quota_details.rb +220 -0
- data/lib/oci/limits/models/quota.rb +287 -0
- data/lib/oci/limits/models/quota_summary.rb +273 -0
- data/lib/oci/limits/models/update_quota_details.rb +194 -0
- data/lib/oci/limits/quotas_client.rb +439 -0
- data/lib/oci/limits/quotas_client_composite_operations.rb +143 -0
- data/lib/oci/limits/util.rb +2 -0
- data/lib/oci/load_balancer/load_balancer.rb +9 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +139 -0
- data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
- data/lib/oci/load_balancer/models/allow_rule.rb +181 -0
- data/lib/oci/load_balancer/models/backend_set.rb +21 -4
- data/lib/oci/load_balancer/models/backend_set_details.rb +21 -4
- data/lib/oci/load_balancer/models/change_load_balancer_compartment_details.rb +156 -0
- data/lib/oci/load_balancer/models/control_access_using_http_methods_rule.rb +205 -0
- data/lib/oci/load_balancer/models/create_backend_set_details.rb +21 -4
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +37 -1
- data/lib/oci/load_balancer/models/lb_cookie_session_persistence_configuration_details.rb +334 -0
- data/lib/oci/load_balancer/models/listener_rule_summary.rb +166 -0
- data/lib/oci/load_balancer/models/rule.rb +4 -0
- data/lib/oci/load_balancer/models/rule_condition.rb +192 -0
- data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +6 -0
- data/lib/oci/load_balancer/models/source_ip_address_condition.rb +167 -0
- data/lib/oci/load_balancer/models/source_vcn_id_condition.rb +169 -0
- data/lib/oci/load_balancer/models/source_vcn_ip_address_condition.rb +171 -0
- data/lib/oci/load_balancer/models/update_backend_set_details.rb +21 -4
- data/lib/oci/monitoring/models/alarm.rb +4 -3
- data/lib/oci/monitoring/models/alarm_summary.rb +4 -3
- data/lib/oci/monitoring/models/change_alarm_compartment_details.rb +155 -0
- data/lib/oci/monitoring/models/create_alarm_details.rb +4 -3
- data/lib/oci/monitoring/models/datapoint.rb +1 -1
- data/lib/oci/monitoring/models/list_metrics_details.rb +4 -4
- data/lib/oci/monitoring/models/metric_data.rb +14 -0
- data/lib/oci/monitoring/models/metric_data_details.rb +6 -4
- data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +3 -0
- data/lib/oci/monitoring/models/update_alarm_details.rb +4 -3
- data/lib/oci/monitoring/monitoring.rb +1 -0
- data/lib/oci/monitoring/monitoring_client.rb +140 -5
- data/lib/oci/ons/models/backoff_retry_policy.rb +2 -2
- data/lib/oci/ons/models/change_compartment_details.rb +156 -0
- data/lib/oci/ons/models/confirmation_result.rb +5 -6
- data/lib/oci/ons/models/create_topic_details.rb +1 -1
- data/lib/oci/ons/models/notification_topic.rb +2 -2
- data/lib/oci/ons/models/notification_topic_summary.rb +2 -2
- data/lib/oci/ons/models/subscription.rb +47 -4
- data/lib/oci/ons/models/subscription_summary.rb +19 -3
- data/lib/oci/ons/notification_control_plane_client.rb +95 -8
- data/lib/oci/ons/notification_data_plane_client.rb +109 -8
- data/lib/oci/ons/ons.rb +1 -0
- data/lib/oci/regions.rb +3 -0
- data/lib/oci/streaming/models/change_stream_compartment_details.rb +155 -0
- data/lib/oci/streaming/stream_admin_client.rb +58 -0
- data/lib/oci/streaming/streaming.rb +1 -0
- data/lib/oci/version.rb +1 -1
- data/lib/oci/waas/models/access_rule_criteria.rb +14 -2
- data/lib/oci/waas/models/change_certificate_compartment_details.rb +154 -0
- data/lib/oci/waas/models/change_waas_policy_compartment_details.rb +154 -0
- data/lib/oci/waas/models/create_certificate_details.rb +2 -2
- data/lib/oci/waas/models/protection_rule_exclusion.rb +16 -1
- data/lib/oci/waas/models/protection_settings.rb +9 -5
- data/lib/oci/waas/models/waas_policy.rb +1 -1
- data/lib/oci/waas/models/waf_config_details.rb +8 -8
- data/lib/oci/waas/models/waf_log.rb +40 -19
- data/lib/oci/waas/waas.rb +2 -0
- data/lib/oci/waas/waas_client.rb +155 -27
- data/lib/oci/work_requests/models/work_request.rb +14 -8
- data/lib/oci/work_requests/models/work_request_error.rb +3 -3
- data/lib/oci/work_requests/models/work_request_log_entry.rb +2 -2
- data/lib/oci/work_requests/models/work_request_resource.rb +9 -7
- data/lib/oci/work_requests/models/work_request_summary.rb +12 -6
- data/lib/oci/work_requests/work_request_client.rb +33 -16
- metadata +81 -2
|
@@ -1,38 +1,13 @@
|
|
|
1
1
|
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
|
2
2
|
|
|
3
3
|
require 'date'
|
|
4
|
+
require_relative 'create_instance_configuration_base'
|
|
4
5
|
|
|
5
6
|
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
|
6
7
|
module OCI
|
|
7
|
-
#
|
|
8
|
+
# Create an instance configuration from API input.
|
|
8
9
|
#
|
|
9
|
-
class Core::Models::CreateInstanceConfigurationDetails
|
|
10
|
-
# **[Required]** The OCID of the compartment containing the instance configuration.
|
|
11
|
-
#
|
|
12
|
-
# @return [String]
|
|
13
|
-
attr_accessor :compartment_id
|
|
14
|
-
|
|
15
|
-
# Defined tags for this resource. Each key is predefined and scoped to a
|
|
16
|
-
# namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
|
17
|
-
#
|
|
18
|
-
# Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
|
|
19
|
-
#
|
|
20
|
-
# @return [Hash<String, Hash<String, Object>>]
|
|
21
|
-
attr_accessor :defined_tags
|
|
22
|
-
|
|
23
|
-
# A user-friendly name for the instance configuration
|
|
24
|
-
#
|
|
25
|
-
# @return [String]
|
|
26
|
-
attr_accessor :display_name
|
|
27
|
-
|
|
28
|
-
# Free-form tags for this resource. Each tag is a simple key-value pair with no
|
|
29
|
-
# predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
|
30
|
-
#
|
|
31
|
-
# Example: `{\"Department\": \"Finance\"}`
|
|
32
|
-
#
|
|
33
|
-
# @return [Hash<String, String>]
|
|
34
|
-
attr_accessor :freeform_tags
|
|
35
|
-
|
|
10
|
+
class Core::Models::CreateInstanceConfigurationDetails < Core::Models::CreateInstanceConfigurationBase
|
|
36
11
|
# This attribute is required.
|
|
37
12
|
# @return [OCI::Core::Models::InstanceConfigurationInstanceDetails]
|
|
38
13
|
attr_accessor :instance_details
|
|
@@ -45,6 +20,7 @@ module OCI
|
|
|
45
20
|
'defined_tags': :'definedTags',
|
|
46
21
|
'display_name': :'displayName',
|
|
47
22
|
'freeform_tags': :'freeformTags',
|
|
23
|
+
'source': :'source',
|
|
48
24
|
'instance_details': :'instanceDetails'
|
|
49
25
|
# rubocop:enable Style/SymbolLiteral
|
|
50
26
|
}
|
|
@@ -58,6 +34,7 @@ module OCI
|
|
|
58
34
|
'defined_tags': :'Hash<String, Hash<String, Object>>',
|
|
59
35
|
'display_name': :'String',
|
|
60
36
|
'freeform_tags': :'Hash<String, String>',
|
|
37
|
+
'source': :'String',
|
|
61
38
|
'instance_details': :'OCI::Core::Models::InstanceConfigurationInstanceDetails'
|
|
62
39
|
# rubocop:enable Style/SymbolLiteral
|
|
63
40
|
}
|
|
@@ -69,40 +46,20 @@ module OCI
|
|
|
69
46
|
|
|
70
47
|
# Initializes the object
|
|
71
48
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
72
|
-
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id}
|
|
73
|
-
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags}
|
|
74
|
-
# @option attributes [String] :display_name The value to assign to the {#display_name}
|
|
75
|
-
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags}
|
|
49
|
+
# @option attributes [String] :compartment_id The value to assign to the {OCI::Core::Models::CreateInstanceConfigurationBase#compartment_id #compartment_id} proprety
|
|
50
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {OCI::Core::Models::CreateInstanceConfigurationBase#defined_tags #defined_tags} proprety
|
|
51
|
+
# @option attributes [String] :display_name The value to assign to the {OCI::Core::Models::CreateInstanceConfigurationBase#display_name #display_name} proprety
|
|
52
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {OCI::Core::Models::CreateInstanceConfigurationBase#freeform_tags #freeform_tags} proprety
|
|
76
53
|
# @option attributes [OCI::Core::Models::InstanceConfigurationInstanceDetails] :instance_details The value to assign to the {#instance_details} property
|
|
77
54
|
def initialize(attributes = {})
|
|
78
55
|
return unless attributes.is_a?(Hash)
|
|
79
56
|
|
|
80
|
-
|
|
81
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
82
|
-
|
|
83
|
-
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
|
84
|
-
|
|
85
|
-
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
|
86
|
-
|
|
87
|
-
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
|
88
|
-
|
|
89
|
-
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
|
90
|
-
|
|
91
|
-
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
|
57
|
+
attributes['source'] = 'NONE'
|
|
92
58
|
|
|
93
|
-
|
|
59
|
+
super(attributes)
|
|
94
60
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
|
98
|
-
|
|
99
|
-
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
|
100
|
-
|
|
101
|
-
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
|
102
|
-
|
|
103
|
-
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
|
104
|
-
|
|
105
|
-
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
|
61
|
+
# convert string to symbol for hash key
|
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
106
63
|
|
|
107
64
|
self.instance_details = attributes[:'instanceDetails'] if attributes[:'instanceDetails']
|
|
108
65
|
|
|
@@ -126,6 +83,7 @@ module OCI
|
|
|
126
83
|
defined_tags == other.defined_tags &&
|
|
127
84
|
display_name == other.display_name &&
|
|
128
85
|
freeform_tags == other.freeform_tags &&
|
|
86
|
+
source == other.source &&
|
|
129
87
|
instance_details == other.instance_details
|
|
130
88
|
end
|
|
131
89
|
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
@@ -142,7 +100,7 @@ module OCI
|
|
|
142
100
|
# Calculates hash code according to all attributes.
|
|
143
101
|
# @return [Fixnum] Hash code
|
|
144
102
|
def hash
|
|
145
|
-
[compartment_id, defined_tags, display_name, freeform_tags, instance_details].hash
|
|
103
|
+
[compartment_id, defined_tags, display_name, freeform_tags, source, instance_details].hash
|
|
146
104
|
end
|
|
147
105
|
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
148
106
|
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
require_relative 'create_instance_configuration_base'
|
|
5
|
+
|
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
|
7
|
+
module OCI
|
|
8
|
+
# Create an instance configuration from an existing instance.
|
|
9
|
+
#
|
|
10
|
+
class Core::Models::CreateInstanceConfigurationFromInstanceDetails < Core::Models::CreateInstanceConfigurationBase
|
|
11
|
+
# **[Required]** The ID of the instance that will be used to create instance configuration.
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :instance_id
|
|
15
|
+
|
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
17
|
+
def self.attribute_map
|
|
18
|
+
{
|
|
19
|
+
# rubocop:disable Style/SymbolLiteral
|
|
20
|
+
'compartment_id': :'compartmentId',
|
|
21
|
+
'defined_tags': :'definedTags',
|
|
22
|
+
'display_name': :'displayName',
|
|
23
|
+
'freeform_tags': :'freeformTags',
|
|
24
|
+
'source': :'source',
|
|
25
|
+
'instance_id': :'instanceId'
|
|
26
|
+
# rubocop:enable Style/SymbolLiteral
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Attribute type mapping.
|
|
31
|
+
def self.swagger_types
|
|
32
|
+
{
|
|
33
|
+
# rubocop:disable Style/SymbolLiteral
|
|
34
|
+
'compartment_id': :'String',
|
|
35
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>',
|
|
36
|
+
'display_name': :'String',
|
|
37
|
+
'freeform_tags': :'Hash<String, String>',
|
|
38
|
+
'source': :'String',
|
|
39
|
+
'instance_id': :'String'
|
|
40
|
+
# rubocop:enable Style/SymbolLiteral
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
45
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# Initializes the object
|
|
49
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
50
|
+
# @option attributes [String] :compartment_id The value to assign to the {OCI::Core::Models::CreateInstanceConfigurationBase#compartment_id #compartment_id} proprety
|
|
51
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {OCI::Core::Models::CreateInstanceConfigurationBase#defined_tags #defined_tags} proprety
|
|
52
|
+
# @option attributes [String] :display_name The value to assign to the {OCI::Core::Models::CreateInstanceConfigurationBase#display_name #display_name} proprety
|
|
53
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {OCI::Core::Models::CreateInstanceConfigurationBase#freeform_tags #freeform_tags} proprety
|
|
54
|
+
# @option attributes [String] :instance_id The value to assign to the {#instance_id} property
|
|
55
|
+
def initialize(attributes = {})
|
|
56
|
+
return unless attributes.is_a?(Hash)
|
|
57
|
+
|
|
58
|
+
attributes['source'] = 'INSTANCE'
|
|
59
|
+
|
|
60
|
+
super(attributes)
|
|
61
|
+
|
|
62
|
+
# convert string to symbol for hash key
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
64
|
+
|
|
65
|
+
self.instance_id = attributes[:'instanceId'] if attributes[:'instanceId']
|
|
66
|
+
|
|
67
|
+
raise 'You cannot provide both :instanceId and :instance_id' if attributes.key?(:'instanceId') && attributes.key?(:'instance_id')
|
|
68
|
+
|
|
69
|
+
self.instance_id = attributes[:'instance_id'] if attributes[:'instance_id']
|
|
70
|
+
end
|
|
71
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
72
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
73
|
+
|
|
74
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Checks equality by comparing each attribute.
|
|
78
|
+
# @param [Object] other the other object to be compared
|
|
79
|
+
def ==(other)
|
|
80
|
+
return true if equal?(other)
|
|
81
|
+
|
|
82
|
+
self.class == other.class &&
|
|
83
|
+
compartment_id == other.compartment_id &&
|
|
84
|
+
defined_tags == other.defined_tags &&
|
|
85
|
+
display_name == other.display_name &&
|
|
86
|
+
freeform_tags == other.freeform_tags &&
|
|
87
|
+
source == other.source &&
|
|
88
|
+
instance_id == other.instance_id
|
|
89
|
+
end
|
|
90
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
91
|
+
|
|
92
|
+
# @see the `==` method
|
|
93
|
+
# @param [Object] other the other object to be compared
|
|
94
|
+
def eql?(other)
|
|
95
|
+
self == other
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# Calculates hash code according to all attributes.
|
|
102
|
+
# @return [Fixnum] Hash code
|
|
103
|
+
def hash
|
|
104
|
+
[compartment_id, defined_tags, display_name, freeform_tags, source, instance_id].hash
|
|
105
|
+
end
|
|
106
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
107
|
+
|
|
108
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# Builds the object from hash
|
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
113
|
+
# @return [Object] Returns the model itself
|
|
114
|
+
def build_from_hash(attributes)
|
|
115
|
+
return nil unless attributes.is_a?(Hash)
|
|
116
|
+
|
|
117
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
118
|
+
if type =~ /^Array<(.*)>/i
|
|
119
|
+
# check to ensure the input is an array given that the the attribute
|
|
120
|
+
# is documented as an array but the input is not
|
|
121
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
122
|
+
public_method("#{key}=").call(
|
|
123
|
+
attributes[self.class.attribute_map[key]]
|
|
124
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
125
|
+
)
|
|
126
|
+
end
|
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
128
|
+
public_method("#{key}=").call(
|
|
129
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
130
|
+
)
|
|
131
|
+
end
|
|
132
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
self
|
|
136
|
+
end
|
|
137
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
138
|
+
|
|
139
|
+
# Returns the string representation of the object
|
|
140
|
+
# @return [String] String presentation of the object
|
|
141
|
+
def to_s
|
|
142
|
+
to_hash.to_s
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Returns the object in the form of hash
|
|
146
|
+
# @return [Hash] Returns the object in the form of hash
|
|
147
|
+
def to_hash
|
|
148
|
+
hash = {}
|
|
149
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
150
|
+
value = public_method(attr).call
|
|
151
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
152
|
+
|
|
153
|
+
hash[param] = _to_hash(value)
|
|
154
|
+
end
|
|
155
|
+
hash
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
private
|
|
159
|
+
|
|
160
|
+
# Outputs non-array value in the form of hash
|
|
161
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
162
|
+
# @param [Object] value Any valid value
|
|
163
|
+
# @return [Hash] Returns the value in the form of hash
|
|
164
|
+
def _to_hash(value)
|
|
165
|
+
if value.is_a?(Array)
|
|
166
|
+
value.compact.map { |v| _to_hash(v) }
|
|
167
|
+
elsif value.is_a?(Hash)
|
|
168
|
+
{}.tap do |hash|
|
|
169
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
170
|
+
end
|
|
171
|
+
elsif value.respond_to? :to_hash
|
|
172
|
+
value.to_hash
|
|
173
|
+
else
|
|
174
|
+
value
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
|
@@ -0,0 +1,249 @@
|
|
|
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
|
+
# CreateIpv6Details model.
|
|
8
|
+
class Core::Models::CreateIpv6Details
|
|
9
|
+
# Defined tags for this resource. Each key is predefined and scoped to a
|
|
10
|
+
# namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
|
11
|
+
#
|
|
12
|
+
# Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
|
|
13
|
+
#
|
|
14
|
+
# @return [Hash<String, Hash<String, Object>>]
|
|
15
|
+
attr_accessor :defined_tags
|
|
16
|
+
|
|
17
|
+
# A user-friendly name. Does not have to be unique, and it's changeable. Avoid
|
|
18
|
+
# entering confidential information.
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
attr_accessor :display_name
|
|
22
|
+
|
|
23
|
+
# Free-form tags for this resource. Each tag is a simple key-value pair with no
|
|
24
|
+
# predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
|
25
|
+
#
|
|
26
|
+
# Example: `{\"Department\": \"Finance\"}`
|
|
27
|
+
#
|
|
28
|
+
# @return [Hash<String, String>]
|
|
29
|
+
attr_accessor :freeform_tags
|
|
30
|
+
|
|
31
|
+
# An IPv6 address of your choice. Must be an available IP address within
|
|
32
|
+
# the subnet's CIDR. If you don't specify a value, Oracle automatically
|
|
33
|
+
# assigns an IPv6 address from the subnet. The subnet is the one that
|
|
34
|
+
# contains the VNIC you specify in `vnicId`.
|
|
35
|
+
#
|
|
36
|
+
# Example: `2001:0db8:0123:1111:abcd:ef01:2345:6789`
|
|
37
|
+
#
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :ip_address
|
|
40
|
+
|
|
41
|
+
# Whether the IPv6 can be used for internet communication. Allowed by default for an IPv6 in
|
|
42
|
+
# a public subnet. Never allowed for an IPv6 in a private subnet. If the value is `true`, the
|
|
43
|
+
# IPv6 uses its public IP address for internet communication.
|
|
44
|
+
#
|
|
45
|
+
# If `isInternetAccessAllowed` is set to `false`, the resulting `publicIpAddress` attribute
|
|
46
|
+
# for the Ipv6 is null.
|
|
47
|
+
#
|
|
48
|
+
# Example: `true`
|
|
49
|
+
#
|
|
50
|
+
# @return [BOOLEAN]
|
|
51
|
+
attr_accessor :is_internet_access_allowed
|
|
52
|
+
|
|
53
|
+
# **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VNIC to assign the IPv6 to. The
|
|
54
|
+
# IPv6 will be in the VNIC's subnet.
|
|
55
|
+
#
|
|
56
|
+
# @return [String]
|
|
57
|
+
attr_accessor :vnic_id
|
|
58
|
+
|
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
60
|
+
def self.attribute_map
|
|
61
|
+
{
|
|
62
|
+
# rubocop:disable Style/SymbolLiteral
|
|
63
|
+
'defined_tags': :'definedTags',
|
|
64
|
+
'display_name': :'displayName',
|
|
65
|
+
'freeform_tags': :'freeformTags',
|
|
66
|
+
'ip_address': :'ipAddress',
|
|
67
|
+
'is_internet_access_allowed': :'isInternetAccessAllowed',
|
|
68
|
+
'vnic_id': :'vnicId'
|
|
69
|
+
# rubocop:enable Style/SymbolLiteral
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute type mapping.
|
|
74
|
+
def self.swagger_types
|
|
75
|
+
{
|
|
76
|
+
# rubocop:disable Style/SymbolLiteral
|
|
77
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>',
|
|
78
|
+
'display_name': :'String',
|
|
79
|
+
'freeform_tags': :'Hash<String, String>',
|
|
80
|
+
'ip_address': :'String',
|
|
81
|
+
'is_internet_access_allowed': :'BOOLEAN',
|
|
82
|
+
'vnic_id': :'String'
|
|
83
|
+
# rubocop:enable Style/SymbolLiteral
|
|
84
|
+
}
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
88
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
# Initializes the object
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
|
|
94
|
+
# @option attributes [String] :display_name The value to assign to the {#display_name} property
|
|
95
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
|
|
96
|
+
# @option attributes [String] :ip_address The value to assign to the {#ip_address} property
|
|
97
|
+
# @option attributes [BOOLEAN] :is_internet_access_allowed The value to assign to the {#is_internet_access_allowed} property
|
|
98
|
+
# @option attributes [String] :vnic_id The value to assign to the {#vnic_id} property
|
|
99
|
+
def initialize(attributes = {})
|
|
100
|
+
return unless attributes.is_a?(Hash)
|
|
101
|
+
|
|
102
|
+
# convert string to symbol for hash key
|
|
103
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
104
|
+
|
|
105
|
+
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
|
106
|
+
|
|
107
|
+
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
|
108
|
+
|
|
109
|
+
self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
|
|
110
|
+
|
|
111
|
+
self.display_name = attributes[:'displayName'] if attributes[:'displayName']
|
|
112
|
+
|
|
113
|
+
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
|
114
|
+
|
|
115
|
+
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
|
116
|
+
|
|
117
|
+
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
|
118
|
+
|
|
119
|
+
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
|
120
|
+
|
|
121
|
+
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
|
122
|
+
|
|
123
|
+
self.ip_address = attributes[:'ipAddress'] if attributes[:'ipAddress']
|
|
124
|
+
|
|
125
|
+
raise 'You cannot provide both :ipAddress and :ip_address' if attributes.key?(:'ipAddress') && attributes.key?(:'ip_address')
|
|
126
|
+
|
|
127
|
+
self.ip_address = attributes[:'ip_address'] if attributes[:'ip_address']
|
|
128
|
+
|
|
129
|
+
self.is_internet_access_allowed = attributes[:'isInternetAccessAllowed'] unless attributes[:'isInternetAccessAllowed'].nil?
|
|
130
|
+
|
|
131
|
+
raise 'You cannot provide both :isInternetAccessAllowed and :is_internet_access_allowed' if attributes.key?(:'isInternetAccessAllowed') && attributes.key?(:'is_internet_access_allowed')
|
|
132
|
+
|
|
133
|
+
self.is_internet_access_allowed = attributes[:'is_internet_access_allowed'] unless attributes[:'is_internet_access_allowed'].nil?
|
|
134
|
+
|
|
135
|
+
self.vnic_id = attributes[:'vnicId'] if attributes[:'vnicId']
|
|
136
|
+
|
|
137
|
+
raise 'You cannot provide both :vnicId and :vnic_id' if attributes.key?(:'vnicId') && attributes.key?(:'vnic_id')
|
|
138
|
+
|
|
139
|
+
self.vnic_id = attributes[:'vnic_id'] if attributes[:'vnic_id']
|
|
140
|
+
end
|
|
141
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
142
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
143
|
+
|
|
144
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# Checks equality by comparing each attribute.
|
|
148
|
+
# @param [Object] other the other object to be compared
|
|
149
|
+
def ==(other)
|
|
150
|
+
return true if equal?(other)
|
|
151
|
+
|
|
152
|
+
self.class == other.class &&
|
|
153
|
+
defined_tags == other.defined_tags &&
|
|
154
|
+
display_name == other.display_name &&
|
|
155
|
+
freeform_tags == other.freeform_tags &&
|
|
156
|
+
ip_address == other.ip_address &&
|
|
157
|
+
is_internet_access_allowed == other.is_internet_access_allowed &&
|
|
158
|
+
vnic_id == other.vnic_id
|
|
159
|
+
end
|
|
160
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
161
|
+
|
|
162
|
+
# @see the `==` method
|
|
163
|
+
# @param [Object] other the other object to be compared
|
|
164
|
+
def eql?(other)
|
|
165
|
+
self == other
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
# Calculates hash code according to all attributes.
|
|
172
|
+
# @return [Fixnum] Hash code
|
|
173
|
+
def hash
|
|
174
|
+
[defined_tags, display_name, freeform_tags, ip_address, is_internet_access_allowed, vnic_id].hash
|
|
175
|
+
end
|
|
176
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
177
|
+
|
|
178
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
# Builds the object from hash
|
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
|
+
# @return [Object] Returns the model itself
|
|
184
|
+
def build_from_hash(attributes)
|
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
|
186
|
+
|
|
187
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
188
|
+
if type =~ /^Array<(.*)>/i
|
|
189
|
+
# check to ensure the input is an array given that the the attribute
|
|
190
|
+
# is documented as an array but the input is not
|
|
191
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
192
|
+
public_method("#{key}=").call(
|
|
193
|
+
attributes[self.class.attribute_map[key]]
|
|
194
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
198
|
+
public_method("#{key}=").call(
|
|
199
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
200
|
+
)
|
|
201
|
+
end
|
|
202
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
self
|
|
206
|
+
end
|
|
207
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
208
|
+
|
|
209
|
+
# Returns the string representation of the object
|
|
210
|
+
# @return [String] String presentation of the object
|
|
211
|
+
def to_s
|
|
212
|
+
to_hash.to_s
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Returns the object in the form of hash
|
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
|
217
|
+
def to_hash
|
|
218
|
+
hash = {}
|
|
219
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
220
|
+
value = public_method(attr).call
|
|
221
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
222
|
+
|
|
223
|
+
hash[param] = _to_hash(value)
|
|
224
|
+
end
|
|
225
|
+
hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
private
|
|
229
|
+
|
|
230
|
+
# Outputs non-array value in the form of hash
|
|
231
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
232
|
+
# @param [Object] value Any valid value
|
|
233
|
+
# @return [Hash] Returns the value in the form of hash
|
|
234
|
+
def _to_hash(value)
|
|
235
|
+
if value.is_a?(Array)
|
|
236
|
+
value.compact.map { |v| _to_hash(v) }
|
|
237
|
+
elsif value.is_a?(Hash)
|
|
238
|
+
{}.tap do |hash|
|
|
239
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
240
|
+
end
|
|
241
|
+
elsif value.respond_to? :to_hash
|
|
242
|
+
value.to_hash
|
|
243
|
+
else
|
|
244
|
+
value
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|