oci 2.5.11 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -0,0 +1,254 @@
|
|
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
|
+
# TransferDeviceSummary model.
|
9
|
+
class Dts::Models::TransferDeviceSummary
|
10
|
+
LIFECYCLE_STATE_ENUM = [
|
11
|
+
LIFECYCLE_STATE_PREPARING = 'PREPARING'.freeze,
|
12
|
+
LIFECYCLE_STATE_READY = 'READY'.freeze,
|
13
|
+
LIFECYCLE_STATE_PACKAGED = 'PACKAGED'.freeze,
|
14
|
+
LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
|
15
|
+
LIFECYCLE_STATE_PROCESSING = 'PROCESSING'.freeze,
|
16
|
+
LIFECYCLE_STATE_COMPLETE = 'COMPLETE'.freeze,
|
17
|
+
LIFECYCLE_STATE_MISSING = 'MISSING'.freeze,
|
18
|
+
LIFECYCLE_STATE_ERROR = 'ERROR'.freeze,
|
19
|
+
LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
|
20
|
+
LIFECYCLE_STATE_CANCELLED = 'CANCELLED'.freeze,
|
21
|
+
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
22
|
+
].freeze
|
23
|
+
|
24
|
+
# @return [String]
|
25
|
+
attr_accessor :serial_number
|
26
|
+
|
27
|
+
# @return [String]
|
28
|
+
attr_accessor :iscsi_iqn
|
29
|
+
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :label
|
32
|
+
|
33
|
+
# @return [String]
|
34
|
+
attr_reader :lifecycle_state
|
35
|
+
|
36
|
+
# @return [String]
|
37
|
+
attr_accessor :attached_transfer_package_label
|
38
|
+
|
39
|
+
# @return [DateTime]
|
40
|
+
attr_accessor :creation_time
|
41
|
+
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :upload_status_log_uri
|
44
|
+
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
46
|
+
def self.attribute_map
|
47
|
+
{
|
48
|
+
# rubocop:disable Style/SymbolLiteral
|
49
|
+
'serial_number': :'serialNumber',
|
50
|
+
'iscsi_iqn': :'iscsiIQN',
|
51
|
+
'label': :'label',
|
52
|
+
'lifecycle_state': :'lifecycleState',
|
53
|
+
'attached_transfer_package_label': :'attachedTransferPackageLabel',
|
54
|
+
'creation_time': :'creationTime',
|
55
|
+
'upload_status_log_uri': :'uploadStatusLogUri'
|
56
|
+
# rubocop:enable Style/SymbolLiteral
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# Attribute type mapping.
|
61
|
+
def self.swagger_types
|
62
|
+
{
|
63
|
+
# rubocop:disable Style/SymbolLiteral
|
64
|
+
'serial_number': :'String',
|
65
|
+
'iscsi_iqn': :'String',
|
66
|
+
'label': :'String',
|
67
|
+
'lifecycle_state': :'String',
|
68
|
+
'attached_transfer_package_label': :'String',
|
69
|
+
'creation_time': :'DateTime',
|
70
|
+
'upload_status_log_uri': :'String'
|
71
|
+
# rubocop:enable Style/SymbolLiteral
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
76
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
77
|
+
|
78
|
+
|
79
|
+
# Initializes the object
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
# @option attributes [String] :serial_number The value to assign to the {#serial_number} property
|
82
|
+
# @option attributes [String] :iscsi_iqn The value to assign to the {#iscsi_iqn} property
|
83
|
+
# @option attributes [String] :label The value to assign to the {#label} property
|
84
|
+
# @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
|
85
|
+
# @option attributes [String] :attached_transfer_package_label The value to assign to the {#attached_transfer_package_label} property
|
86
|
+
# @option attributes [DateTime] :creation_time The value to assign to the {#creation_time} property
|
87
|
+
# @option attributes [String] :upload_status_log_uri The value to assign to the {#upload_status_log_uri} property
|
88
|
+
def initialize(attributes = {})
|
89
|
+
return unless attributes.is_a?(Hash)
|
90
|
+
|
91
|
+
# convert string to symbol for hash key
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
93
|
+
|
94
|
+
self.serial_number = attributes[:'serialNumber'] if attributes[:'serialNumber']
|
95
|
+
|
96
|
+
raise 'You cannot provide both :serialNumber and :serial_number' if attributes.key?(:'serialNumber') && attributes.key?(:'serial_number')
|
97
|
+
|
98
|
+
self.serial_number = attributes[:'serial_number'] if attributes[:'serial_number']
|
99
|
+
|
100
|
+
self.iscsi_iqn = attributes[:'iscsiIQN'] if attributes[:'iscsiIQN']
|
101
|
+
|
102
|
+
raise 'You cannot provide both :iscsiIQN and :iscsi_iqn' if attributes.key?(:'iscsiIQN') && attributes.key?(:'iscsi_iqn')
|
103
|
+
|
104
|
+
self.iscsi_iqn = attributes[:'iscsi_iqn'] if attributes[:'iscsi_iqn']
|
105
|
+
|
106
|
+
self.label = attributes[:'label'] if attributes[:'label']
|
107
|
+
|
108
|
+
self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
|
109
|
+
|
110
|
+
raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
|
111
|
+
|
112
|
+
self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
|
113
|
+
|
114
|
+
self.attached_transfer_package_label = attributes[:'attachedTransferPackageLabel'] if attributes[:'attachedTransferPackageLabel']
|
115
|
+
|
116
|
+
raise 'You cannot provide both :attachedTransferPackageLabel and :attached_transfer_package_label' if attributes.key?(:'attachedTransferPackageLabel') && attributes.key?(:'attached_transfer_package_label')
|
117
|
+
|
118
|
+
self.attached_transfer_package_label = attributes[:'attached_transfer_package_label'] if attributes[:'attached_transfer_package_label']
|
119
|
+
|
120
|
+
self.creation_time = attributes[:'creationTime'] if attributes[:'creationTime']
|
121
|
+
|
122
|
+
raise 'You cannot provide both :creationTime and :creation_time' if attributes.key?(:'creationTime') && attributes.key?(:'creation_time')
|
123
|
+
|
124
|
+
self.creation_time = attributes[:'creation_time'] if attributes[:'creation_time']
|
125
|
+
|
126
|
+
self.upload_status_log_uri = attributes[:'uploadStatusLogUri'] if attributes[:'uploadStatusLogUri']
|
127
|
+
|
128
|
+
raise 'You cannot provide both :uploadStatusLogUri and :upload_status_log_uri' if attributes.key?(:'uploadStatusLogUri') && attributes.key?(:'upload_status_log_uri')
|
129
|
+
|
130
|
+
self.upload_status_log_uri = attributes[:'upload_status_log_uri'] if attributes[:'upload_status_log_uri']
|
131
|
+
end
|
132
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
133
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
134
|
+
|
135
|
+
# Custom attribute writer method checking allowed values (enum).
|
136
|
+
# @param [Object] lifecycle_state Object to be assigned
|
137
|
+
def lifecycle_state=(lifecycle_state)
|
138
|
+
# rubocop:disable Style/ConditionalAssignment
|
139
|
+
if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
|
140
|
+
OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
141
|
+
@lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
|
142
|
+
else
|
143
|
+
@lifecycle_state = lifecycle_state
|
144
|
+
end
|
145
|
+
# rubocop:enable Style/ConditionalAssignment
|
146
|
+
end
|
147
|
+
|
148
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
149
|
+
|
150
|
+
|
151
|
+
# Checks equality by comparing each attribute.
|
152
|
+
# @param [Object] other the other object to be compared
|
153
|
+
def ==(other)
|
154
|
+
return true if equal?(other)
|
155
|
+
|
156
|
+
self.class == other.class &&
|
157
|
+
serial_number == other.serial_number &&
|
158
|
+
iscsi_iqn == other.iscsi_iqn &&
|
159
|
+
label == other.label &&
|
160
|
+
lifecycle_state == other.lifecycle_state &&
|
161
|
+
attached_transfer_package_label == other.attached_transfer_package_label &&
|
162
|
+
creation_time == other.creation_time &&
|
163
|
+
upload_status_log_uri == other.upload_status_log_uri
|
164
|
+
end
|
165
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
166
|
+
|
167
|
+
# @see the `==` method
|
168
|
+
# @param [Object] other the other object to be compared
|
169
|
+
def eql?(other)
|
170
|
+
self == other
|
171
|
+
end
|
172
|
+
|
173
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
174
|
+
|
175
|
+
|
176
|
+
# Calculates hash code according to all attributes.
|
177
|
+
# @return [Fixnum] Hash code
|
178
|
+
def hash
|
179
|
+
[serial_number, iscsi_iqn, label, lifecycle_state, attached_transfer_package_label, creation_time, upload_status_log_uri].hash
|
180
|
+
end
|
181
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
182
|
+
|
183
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
184
|
+
|
185
|
+
|
186
|
+
# Builds the object from hash
|
187
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
188
|
+
# @return [Object] Returns the model itself
|
189
|
+
def build_from_hash(attributes)
|
190
|
+
return nil unless attributes.is_a?(Hash)
|
191
|
+
|
192
|
+
self.class.swagger_types.each_pair do |key, type|
|
193
|
+
if type =~ /^Array<(.*)>/i
|
194
|
+
# check to ensure the input is an array given that the the attribute
|
195
|
+
# is documented as an array but the input is not
|
196
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
197
|
+
public_method("#{key}=").call(
|
198
|
+
attributes[self.class.attribute_map[key]]
|
199
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
200
|
+
)
|
201
|
+
end
|
202
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
203
|
+
public_method("#{key}=").call(
|
204
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
205
|
+
)
|
206
|
+
end
|
207
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
208
|
+
end
|
209
|
+
|
210
|
+
self
|
211
|
+
end
|
212
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
213
|
+
|
214
|
+
# Returns the string representation of the object
|
215
|
+
# @return [String] String presentation of the object
|
216
|
+
def to_s
|
217
|
+
to_hash.to_s
|
218
|
+
end
|
219
|
+
|
220
|
+
# Returns the object in the form of hash
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
222
|
+
def to_hash
|
223
|
+
hash = {}
|
224
|
+
self.class.attribute_map.each_pair do |attr, param|
|
225
|
+
value = public_method(attr).call
|
226
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
227
|
+
|
228
|
+
hash[param] = _to_hash(value)
|
229
|
+
end
|
230
|
+
hash
|
231
|
+
end
|
232
|
+
|
233
|
+
private
|
234
|
+
|
235
|
+
# Outputs non-array value in the form of hash
|
236
|
+
# For object, use to_hash. Otherwise, just return the value
|
237
|
+
# @param [Object] value Any valid value
|
238
|
+
# @return [Hash] Returns the value in the form of hash
|
239
|
+
def _to_hash(value)
|
240
|
+
if value.is_a?(Array)
|
241
|
+
value.compact.map { |v| _to_hash(v) }
|
242
|
+
elsif value.is_a?(Hash)
|
243
|
+
{}.tap do |hash|
|
244
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
245
|
+
end
|
246
|
+
elsif value.respond_to? :to_hash
|
247
|
+
value.to_hash
|
248
|
+
else
|
249
|
+
value
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
@@ -0,0 +1,356 @@
|
|
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
|
+
# TransferJob model.
|
9
|
+
class Dts::Models::TransferJob
|
10
|
+
DEVICE_TYPE_ENUM = [
|
11
|
+
DEVICE_TYPE_DISK = 'DISK'.freeze,
|
12
|
+
DEVICE_TYPE_APPLIANCE = 'APPLIANCE'.freeze,
|
13
|
+
DEVICE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
14
|
+
].freeze
|
15
|
+
|
16
|
+
LIFECYCLE_STATE_ENUM = [
|
17
|
+
LIFECYCLE_STATE_INITIATED = 'INITIATED'.freeze,
|
18
|
+
LIFECYCLE_STATE_PREPARING = 'PREPARING'.freeze,
|
19
|
+
LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
|
20
|
+
LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
|
21
|
+
LIFECYCLE_STATE_CLOSED = 'CLOSED'.freeze,
|
22
|
+
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
23
|
+
].freeze
|
24
|
+
|
25
|
+
# This attribute is required.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :id
|
28
|
+
|
29
|
+
# This attribute is required.
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :compartment_id
|
32
|
+
|
33
|
+
# This attribute is required.
|
34
|
+
# @return [String]
|
35
|
+
attr_accessor :upload_bucket_name
|
36
|
+
|
37
|
+
# This attribute is required.
|
38
|
+
# @return [String]
|
39
|
+
attr_accessor :display_name
|
40
|
+
|
41
|
+
# @return [String]
|
42
|
+
attr_accessor :label
|
43
|
+
|
44
|
+
# @return [DateTime]
|
45
|
+
attr_accessor :creation_time
|
46
|
+
|
47
|
+
# This attribute is required.
|
48
|
+
# @return [String]
|
49
|
+
attr_reader :device_type
|
50
|
+
|
51
|
+
# @return [String]
|
52
|
+
attr_reader :lifecycle_state
|
53
|
+
|
54
|
+
# Transfer Appliance labels associated with this transfer Job
|
55
|
+
# @return [Array<String>]
|
56
|
+
attr_accessor :attached_transfer_appliance_labels
|
57
|
+
|
58
|
+
# Transfer Package labels associated with this transfer Job
|
59
|
+
# @return [Array<String>]
|
60
|
+
attr_accessor :attached_transfer_package_labels
|
61
|
+
|
62
|
+
# Transfer Device labels associated with this transfer Job
|
63
|
+
# @return [Array<String>]
|
64
|
+
attr_accessor :attached_transfer_device_labels
|
65
|
+
|
66
|
+
# Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
|
67
|
+
# Example: `{\"bar-key\": \"value\"}`
|
68
|
+
#
|
69
|
+
# @return [Hash<String, String>]
|
70
|
+
attr_accessor :freeform_tags
|
71
|
+
|
72
|
+
# Usage of predefined tag keys. These predefined keys are scoped to namespaces.
|
73
|
+
# Example: `{\"foo-namespace\": {\"bar-key\": \"foo-value\"}}`
|
74
|
+
#
|
75
|
+
# @return [Hash<String, Hash<String, Object>>]
|
76
|
+
attr_accessor :defined_tags
|
77
|
+
|
78
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
79
|
+
def self.attribute_map
|
80
|
+
{
|
81
|
+
# rubocop:disable Style/SymbolLiteral
|
82
|
+
'id': :'id',
|
83
|
+
'compartment_id': :'compartmentId',
|
84
|
+
'upload_bucket_name': :'uploadBucketName',
|
85
|
+
'display_name': :'displayName',
|
86
|
+
'label': :'label',
|
87
|
+
'creation_time': :'creationTime',
|
88
|
+
'device_type': :'deviceType',
|
89
|
+
'lifecycle_state': :'lifecycleState',
|
90
|
+
'attached_transfer_appliance_labels': :'attachedTransferApplianceLabels',
|
91
|
+
'attached_transfer_package_labels': :'attachedTransferPackageLabels',
|
92
|
+
'attached_transfer_device_labels': :'attachedTransferDeviceLabels',
|
93
|
+
'freeform_tags': :'freeformTags',
|
94
|
+
'defined_tags': :'definedTags'
|
95
|
+
# rubocop:enable Style/SymbolLiteral
|
96
|
+
}
|
97
|
+
end
|
98
|
+
|
99
|
+
# Attribute type mapping.
|
100
|
+
def self.swagger_types
|
101
|
+
{
|
102
|
+
# rubocop:disable Style/SymbolLiteral
|
103
|
+
'id': :'String',
|
104
|
+
'compartment_id': :'String',
|
105
|
+
'upload_bucket_name': :'String',
|
106
|
+
'display_name': :'String',
|
107
|
+
'label': :'String',
|
108
|
+
'creation_time': :'DateTime',
|
109
|
+
'device_type': :'String',
|
110
|
+
'lifecycle_state': :'String',
|
111
|
+
'attached_transfer_appliance_labels': :'Array<String>',
|
112
|
+
'attached_transfer_package_labels': :'Array<String>',
|
113
|
+
'attached_transfer_device_labels': :'Array<String>',
|
114
|
+
'freeform_tags': :'Hash<String, String>',
|
115
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>'
|
116
|
+
# rubocop:enable Style/SymbolLiteral
|
117
|
+
}
|
118
|
+
end
|
119
|
+
|
120
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
121
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
122
|
+
|
123
|
+
|
124
|
+
# Initializes the object
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
127
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
128
|
+
# @option attributes [String] :upload_bucket_name The value to assign to the {#upload_bucket_name} property
|
129
|
+
# @option attributes [String] :display_name The value to assign to the {#display_name} property
|
130
|
+
# @option attributes [String] :label The value to assign to the {#label} property
|
131
|
+
# @option attributes [DateTime] :creation_time The value to assign to the {#creation_time} property
|
132
|
+
# @option attributes [String] :device_type The value to assign to the {#device_type} property
|
133
|
+
# @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
|
134
|
+
# @option attributes [Array<String>] :attached_transfer_appliance_labels The value to assign to the {#attached_transfer_appliance_labels} property
|
135
|
+
# @option attributes [Array<String>] :attached_transfer_package_labels The value to assign to the {#attached_transfer_package_labels} property
|
136
|
+
# @option attributes [Array<String>] :attached_transfer_device_labels The value to assign to the {#attached_transfer_device_labels} property
|
137
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
|
138
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
|
139
|
+
def initialize(attributes = {})
|
140
|
+
return unless attributes.is_a?(Hash)
|
141
|
+
|
142
|
+
# convert string to symbol for hash key
|
143
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
144
|
+
|
145
|
+
self.id = attributes[:'id'] if attributes[:'id']
|
146
|
+
|
147
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
148
|
+
|
149
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
150
|
+
|
151
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
152
|
+
|
153
|
+
self.upload_bucket_name = attributes[:'uploadBucketName'] if attributes[:'uploadBucketName']
|
154
|
+
|
155
|
+
raise 'You cannot provide both :uploadBucketName and :upload_bucket_name' if attributes.key?(:'uploadBucketName') && attributes.key?(:'upload_bucket_name')
|
156
|
+
|
157
|
+
self.upload_bucket_name = attributes[:'upload_bucket_name'] if attributes[:'upload_bucket_name']
|
158
|
+
|
159
|
+
self.display_name = attributes[:'displayName'] if attributes[:'displayName']
|
160
|
+
|
161
|
+
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
162
|
+
|
163
|
+
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
164
|
+
|
165
|
+
self.label = attributes[:'label'] if attributes[:'label']
|
166
|
+
|
167
|
+
self.creation_time = attributes[:'creationTime'] if attributes[:'creationTime']
|
168
|
+
|
169
|
+
raise 'You cannot provide both :creationTime and :creation_time' if attributes.key?(:'creationTime') && attributes.key?(:'creation_time')
|
170
|
+
|
171
|
+
self.creation_time = attributes[:'creation_time'] if attributes[:'creation_time']
|
172
|
+
|
173
|
+
self.device_type = attributes[:'deviceType'] if attributes[:'deviceType']
|
174
|
+
|
175
|
+
raise 'You cannot provide both :deviceType and :device_type' if attributes.key?(:'deviceType') && attributes.key?(:'device_type')
|
176
|
+
|
177
|
+
self.device_type = attributes[:'device_type'] if attributes[:'device_type']
|
178
|
+
|
179
|
+
self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
|
180
|
+
|
181
|
+
raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
|
182
|
+
|
183
|
+
self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
|
184
|
+
|
185
|
+
self.attached_transfer_appliance_labels = attributes[:'attachedTransferApplianceLabels'] if attributes[:'attachedTransferApplianceLabels']
|
186
|
+
|
187
|
+
raise 'You cannot provide both :attachedTransferApplianceLabels and :attached_transfer_appliance_labels' if attributes.key?(:'attachedTransferApplianceLabels') && attributes.key?(:'attached_transfer_appliance_labels')
|
188
|
+
|
189
|
+
self.attached_transfer_appliance_labels = attributes[:'attached_transfer_appliance_labels'] if attributes[:'attached_transfer_appliance_labels']
|
190
|
+
|
191
|
+
self.attached_transfer_package_labels = attributes[:'attachedTransferPackageLabels'] if attributes[:'attachedTransferPackageLabels']
|
192
|
+
|
193
|
+
raise 'You cannot provide both :attachedTransferPackageLabels and :attached_transfer_package_labels' if attributes.key?(:'attachedTransferPackageLabels') && attributes.key?(:'attached_transfer_package_labels')
|
194
|
+
|
195
|
+
self.attached_transfer_package_labels = attributes[:'attached_transfer_package_labels'] if attributes[:'attached_transfer_package_labels']
|
196
|
+
|
197
|
+
self.attached_transfer_device_labels = attributes[:'attachedTransferDeviceLabels'] if attributes[:'attachedTransferDeviceLabels']
|
198
|
+
|
199
|
+
raise 'You cannot provide both :attachedTransferDeviceLabels and :attached_transfer_device_labels' if attributes.key?(:'attachedTransferDeviceLabels') && attributes.key?(:'attached_transfer_device_labels')
|
200
|
+
|
201
|
+
self.attached_transfer_device_labels = attributes[:'attached_transfer_device_labels'] if attributes[:'attached_transfer_device_labels']
|
202
|
+
|
203
|
+
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
204
|
+
|
205
|
+
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
206
|
+
|
207
|
+
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
208
|
+
|
209
|
+
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
210
|
+
|
211
|
+
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
212
|
+
|
213
|
+
self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
|
214
|
+
end
|
215
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
216
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
217
|
+
|
218
|
+
# Custom attribute writer method checking allowed values (enum).
|
219
|
+
# @param [Object] device_type Object to be assigned
|
220
|
+
def device_type=(device_type)
|
221
|
+
# rubocop:disable Style/ConditionalAssignment
|
222
|
+
if device_type && !DEVICE_TYPE_ENUM.include?(device_type)
|
223
|
+
OCI.logger.debug("Unknown value for 'device_type' [" + device_type + "]. Mapping to 'DEVICE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
224
|
+
@device_type = DEVICE_TYPE_UNKNOWN_ENUM_VALUE
|
225
|
+
else
|
226
|
+
@device_type = device_type
|
227
|
+
end
|
228
|
+
# rubocop:enable Style/ConditionalAssignment
|
229
|
+
end
|
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
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
245
|
+
|
246
|
+
|
247
|
+
# Checks equality by comparing each attribute.
|
248
|
+
# @param [Object] other the other object to be compared
|
249
|
+
def ==(other)
|
250
|
+
return true if equal?(other)
|
251
|
+
|
252
|
+
self.class == other.class &&
|
253
|
+
id == other.id &&
|
254
|
+
compartment_id == other.compartment_id &&
|
255
|
+
upload_bucket_name == other.upload_bucket_name &&
|
256
|
+
display_name == other.display_name &&
|
257
|
+
label == other.label &&
|
258
|
+
creation_time == other.creation_time &&
|
259
|
+
device_type == other.device_type &&
|
260
|
+
lifecycle_state == other.lifecycle_state &&
|
261
|
+
attached_transfer_appliance_labels == other.attached_transfer_appliance_labels &&
|
262
|
+
attached_transfer_package_labels == other.attached_transfer_package_labels &&
|
263
|
+
attached_transfer_device_labels == other.attached_transfer_device_labels &&
|
264
|
+
freeform_tags == other.freeform_tags &&
|
265
|
+
defined_tags == other.defined_tags
|
266
|
+
end
|
267
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
268
|
+
|
269
|
+
# @see the `==` method
|
270
|
+
# @param [Object] other the other object to be compared
|
271
|
+
def eql?(other)
|
272
|
+
self == other
|
273
|
+
end
|
274
|
+
|
275
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
276
|
+
|
277
|
+
|
278
|
+
# Calculates hash code according to all attributes.
|
279
|
+
# @return [Fixnum] Hash code
|
280
|
+
def hash
|
281
|
+
[id, compartment_id, upload_bucket_name, display_name, label, creation_time, device_type, lifecycle_state, attached_transfer_appliance_labels, attached_transfer_package_labels, attached_transfer_device_labels, freeform_tags, defined_tags].hash
|
282
|
+
end
|
283
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
284
|
+
|
285
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
286
|
+
|
287
|
+
|
288
|
+
# Builds the object from hash
|
289
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
290
|
+
# @return [Object] Returns the model itself
|
291
|
+
def build_from_hash(attributes)
|
292
|
+
return nil unless attributes.is_a?(Hash)
|
293
|
+
|
294
|
+
self.class.swagger_types.each_pair do |key, type|
|
295
|
+
if type =~ /^Array<(.*)>/i
|
296
|
+
# check to ensure the input is an array given that the the attribute
|
297
|
+
# is documented as an array but the input is not
|
298
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
299
|
+
public_method("#{key}=").call(
|
300
|
+
attributes[self.class.attribute_map[key]]
|
301
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
302
|
+
)
|
303
|
+
end
|
304
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
305
|
+
public_method("#{key}=").call(
|
306
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
307
|
+
)
|
308
|
+
end
|
309
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
310
|
+
end
|
311
|
+
|
312
|
+
self
|
313
|
+
end
|
314
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
315
|
+
|
316
|
+
# Returns the string representation of the object
|
317
|
+
# @return [String] String presentation of the object
|
318
|
+
def to_s
|
319
|
+
to_hash.to_s
|
320
|
+
end
|
321
|
+
|
322
|
+
# Returns the object in the form of hash
|
323
|
+
# @return [Hash] Returns the object in the form of hash
|
324
|
+
def to_hash
|
325
|
+
hash = {}
|
326
|
+
self.class.attribute_map.each_pair do |attr, param|
|
327
|
+
value = public_method(attr).call
|
328
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
329
|
+
|
330
|
+
hash[param] = _to_hash(value)
|
331
|
+
end
|
332
|
+
hash
|
333
|
+
end
|
334
|
+
|
335
|
+
private
|
336
|
+
|
337
|
+
# Outputs non-array value in the form of hash
|
338
|
+
# For object, use to_hash. Otherwise, just return the value
|
339
|
+
# @param [Object] value Any valid value
|
340
|
+
# @return [Hash] Returns the value in the form of hash
|
341
|
+
def _to_hash(value)
|
342
|
+
if value.is_a?(Array)
|
343
|
+
value.compact.map { |v| _to_hash(v) }
|
344
|
+
elsif value.is_a?(Hash)
|
345
|
+
{}.tap do |hash|
|
346
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
347
|
+
end
|
348
|
+
elsif value.respond_to? :to_hash
|
349
|
+
value.to_hash
|
350
|
+
else
|
351
|
+
value
|
352
|
+
end
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|