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,154 @@
|
|
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
|
+
# ChangeCustomProtectionRuleCompartmentDetails model.
|
8
|
+
class Waas::Models::ChangeCustomProtectionRuleCompartmentDetails
|
9
|
+
# **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment into which the resource should be moved.
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :compartment_id
|
13
|
+
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
15
|
+
def self.attribute_map
|
16
|
+
{
|
17
|
+
# rubocop:disable Style/SymbolLiteral
|
18
|
+
'compartment_id': :'compartmentId'
|
19
|
+
# rubocop:enable Style/SymbolLiteral
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.swagger_types
|
25
|
+
{
|
26
|
+
# rubocop:disable Style/SymbolLiteral
|
27
|
+
'compartment_id': :'String'
|
28
|
+
# rubocop:enable Style/SymbolLiteral
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
33
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
34
|
+
|
35
|
+
|
36
|
+
# Initializes the object
|
37
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
38
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
39
|
+
def initialize(attributes = {})
|
40
|
+
return unless attributes.is_a?(Hash)
|
41
|
+
|
42
|
+
# convert string to symbol for hash key
|
43
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
44
|
+
|
45
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
46
|
+
|
47
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
48
|
+
|
49
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
50
|
+
end
|
51
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
52
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
53
|
+
|
54
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
55
|
+
|
56
|
+
|
57
|
+
# Checks equality by comparing each attribute.
|
58
|
+
# @param [Object] other the other object to be compared
|
59
|
+
def ==(other)
|
60
|
+
return true if equal?(other)
|
61
|
+
|
62
|
+
self.class == other.class &&
|
63
|
+
compartment_id == other.compartment_id
|
64
|
+
end
|
65
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
66
|
+
|
67
|
+
# @see the `==` method
|
68
|
+
# @param [Object] other the other object to be compared
|
69
|
+
def eql?(other)
|
70
|
+
self == other
|
71
|
+
end
|
72
|
+
|
73
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
74
|
+
|
75
|
+
|
76
|
+
# Calculates hash code according to all attributes.
|
77
|
+
# @return [Fixnum] Hash code
|
78
|
+
def hash
|
79
|
+
[compartment_id].hash
|
80
|
+
end
|
81
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
82
|
+
|
83
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
84
|
+
|
85
|
+
|
86
|
+
# Builds the object from hash
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
# @return [Object] Returns the model itself
|
89
|
+
def build_from_hash(attributes)
|
90
|
+
return nil unless attributes.is_a?(Hash)
|
91
|
+
|
92
|
+
self.class.swagger_types.each_pair do |key, type|
|
93
|
+
if type =~ /^Array<(.*)>/i
|
94
|
+
# check to ensure the input is an array given that the the attribute
|
95
|
+
# is documented as an array but the input is not
|
96
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
97
|
+
public_method("#{key}=").call(
|
98
|
+
attributes[self.class.attribute_map[key]]
|
99
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
100
|
+
)
|
101
|
+
end
|
102
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
103
|
+
public_method("#{key}=").call(
|
104
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
105
|
+
)
|
106
|
+
end
|
107
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
108
|
+
end
|
109
|
+
|
110
|
+
self
|
111
|
+
end
|
112
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
113
|
+
|
114
|
+
# Returns the string representation of the object
|
115
|
+
# @return [String] String presentation of the object
|
116
|
+
def to_s
|
117
|
+
to_hash.to_s
|
118
|
+
end
|
119
|
+
|
120
|
+
# Returns the object in the form of hash
|
121
|
+
# @return [Hash] Returns the object in the form of hash
|
122
|
+
def to_hash
|
123
|
+
hash = {}
|
124
|
+
self.class.attribute_map.each_pair do |attr, param|
|
125
|
+
value = public_method(attr).call
|
126
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
127
|
+
|
128
|
+
hash[param] = _to_hash(value)
|
129
|
+
end
|
130
|
+
hash
|
131
|
+
end
|
132
|
+
|
133
|
+
private
|
134
|
+
|
135
|
+
# Outputs non-array value in the form of hash
|
136
|
+
# For object, use to_hash. Otherwise, just return the value
|
137
|
+
# @param [Object] value Any valid value
|
138
|
+
# @return [Hash] Returns the value in the form of hash
|
139
|
+
def _to_hash(value)
|
140
|
+
if value.is_a?(Array)
|
141
|
+
value.compact.map { |v| _to_hash(v) }
|
142
|
+
elsif value.is_a?(Hash)
|
143
|
+
{}.tap do |hash|
|
144
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
145
|
+
end
|
146
|
+
elsif value.respond_to? :to_hash
|
147
|
+
value.to_hash
|
148
|
+
else
|
149
|
+
value
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
@@ -0,0 +1,213 @@
|
|
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 data used to create a new address list.
|
8
|
+
class Waas::Models::CreateAddressListDetails
|
9
|
+
# **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the address list.
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :compartment_id
|
12
|
+
|
13
|
+
# **[Required]** A unique user-friendly name for the address list.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :display_name
|
16
|
+
|
17
|
+
# **[Required]** A list of IP addresses or CIDR notations.
|
18
|
+
# @return [Array<String>]
|
19
|
+
attr_accessor :addresses
|
20
|
+
|
21
|
+
# Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
|
22
|
+
# For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
23
|
+
#
|
24
|
+
# Example: `{\"Department\": \"Finance\"}`
|
25
|
+
#
|
26
|
+
# @return [Hash<String, String>]
|
27
|
+
attr_accessor :freeform_tags
|
28
|
+
|
29
|
+
# Defined tags for this resource. Each key is predefined and scoped to a namespace.
|
30
|
+
# For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
31
|
+
#
|
32
|
+
# Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
|
33
|
+
#
|
34
|
+
# @return [Hash<String, Hash<String, Object>>]
|
35
|
+
attr_accessor :defined_tags
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
# rubocop:disable Style/SymbolLiteral
|
41
|
+
'compartment_id': :'compartmentId',
|
42
|
+
'display_name': :'displayName',
|
43
|
+
'addresses': :'addresses',
|
44
|
+
'freeform_tags': :'freeformTags',
|
45
|
+
'defined_tags': :'definedTags'
|
46
|
+
# rubocop:enable Style/SymbolLiteral
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Attribute type mapping.
|
51
|
+
def self.swagger_types
|
52
|
+
{
|
53
|
+
# rubocop:disable Style/SymbolLiteral
|
54
|
+
'compartment_id': :'String',
|
55
|
+
'display_name': :'String',
|
56
|
+
'addresses': :'Array<String>',
|
57
|
+
'freeform_tags': :'Hash<String, String>',
|
58
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>'
|
59
|
+
# rubocop:enable Style/SymbolLiteral
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
64
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
65
|
+
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
70
|
+
# @option attributes [String] :display_name The value to assign to the {#display_name} property
|
71
|
+
# @option attributes [Array<String>] :addresses The value to assign to the {#addresses} property
|
72
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
|
73
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
|
74
|
+
def initialize(attributes = {})
|
75
|
+
return unless attributes.is_a?(Hash)
|
76
|
+
|
77
|
+
# convert string to symbol for hash key
|
78
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
79
|
+
|
80
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
81
|
+
|
82
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
83
|
+
|
84
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
85
|
+
|
86
|
+
self.display_name = attributes[:'displayName'] if attributes[:'displayName']
|
87
|
+
|
88
|
+
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
89
|
+
|
90
|
+
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
91
|
+
|
92
|
+
self.addresses = attributes[:'addresses'] if attributes[:'addresses']
|
93
|
+
|
94
|
+
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
95
|
+
|
96
|
+
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
97
|
+
|
98
|
+
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
99
|
+
|
100
|
+
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
101
|
+
|
102
|
+
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
103
|
+
|
104
|
+
self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
|
105
|
+
end
|
106
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
107
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
108
|
+
|
109
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
110
|
+
|
111
|
+
|
112
|
+
# Checks equality by comparing each attribute.
|
113
|
+
# @param [Object] other the other object to be compared
|
114
|
+
def ==(other)
|
115
|
+
return true if equal?(other)
|
116
|
+
|
117
|
+
self.class == other.class &&
|
118
|
+
compartment_id == other.compartment_id &&
|
119
|
+
display_name == other.display_name &&
|
120
|
+
addresses == other.addresses &&
|
121
|
+
freeform_tags == other.freeform_tags &&
|
122
|
+
defined_tags == other.defined_tags
|
123
|
+
end
|
124
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
125
|
+
|
126
|
+
# @see the `==` method
|
127
|
+
# @param [Object] other the other object to be compared
|
128
|
+
def eql?(other)
|
129
|
+
self == other
|
130
|
+
end
|
131
|
+
|
132
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
133
|
+
|
134
|
+
|
135
|
+
# Calculates hash code according to all attributes.
|
136
|
+
# @return [Fixnum] Hash code
|
137
|
+
def hash
|
138
|
+
[compartment_id, display_name, addresses, freeform_tags, defined_tags].hash
|
139
|
+
end
|
140
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
141
|
+
|
142
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
143
|
+
|
144
|
+
|
145
|
+
# Builds the object from hash
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
+
# @return [Object] Returns the model itself
|
148
|
+
def build_from_hash(attributes)
|
149
|
+
return nil unless attributes.is_a?(Hash)
|
150
|
+
|
151
|
+
self.class.swagger_types.each_pair do |key, type|
|
152
|
+
if type =~ /^Array<(.*)>/i
|
153
|
+
# check to ensure the input is an array given that the the attribute
|
154
|
+
# is documented as an array but the input is not
|
155
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
156
|
+
public_method("#{key}=").call(
|
157
|
+
attributes[self.class.attribute_map[key]]
|
158
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
159
|
+
)
|
160
|
+
end
|
161
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
162
|
+
public_method("#{key}=").call(
|
163
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
164
|
+
)
|
165
|
+
end
|
166
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
167
|
+
end
|
168
|
+
|
169
|
+
self
|
170
|
+
end
|
171
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
172
|
+
|
173
|
+
# Returns the string representation of the object
|
174
|
+
# @return [String] String presentation of the object
|
175
|
+
def to_s
|
176
|
+
to_hash.to_s
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = public_method(attr).call
|
185
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
186
|
+
|
187
|
+
hash[param] = _to_hash(value)
|
188
|
+
end
|
189
|
+
hash
|
190
|
+
end
|
191
|
+
|
192
|
+
private
|
193
|
+
|
194
|
+
# Outputs non-array value in the form of hash
|
195
|
+
# For object, use to_hash. Otherwise, just return the value
|
196
|
+
# @param [Object] value Any valid value
|
197
|
+
# @return [Hash] Returns the value in the form of hash
|
198
|
+
def _to_hash(value)
|
199
|
+
if value.is_a?(Array)
|
200
|
+
value.compact.map { |v| _to_hash(v) }
|
201
|
+
elsif value.is_a?(Hash)
|
202
|
+
{}.tap do |hash|
|
203
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
204
|
+
end
|
205
|
+
elsif value.respond_to? :to_hash
|
206
|
+
value.to_hash
|
207
|
+
else
|
208
|
+
value
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
@@ -17,6 +17,17 @@ module OCI
|
|
17
17
|
attr_accessor :display_name
|
18
18
|
|
19
19
|
# **[Required]** The data of the SSL certificate.
|
20
|
+
#
|
21
|
+
#
|
22
|
+
# **Note:** Many SSL certificate providers require an intermediate certificate chain to ensure a trusted status.
|
23
|
+
# If your SSL certificate requires an intermediate certificate chain, please append the intermediate certificate
|
24
|
+
# key in the `certificateData` field after the leaf certificate issued by the SSL certificate provider. If you
|
25
|
+
# are unsure if your certificate requires an intermediate certificate chain, see your certificate
|
26
|
+
# provider's documentation.
|
27
|
+
#
|
28
|
+
#
|
29
|
+
# The example below shows an intermediate certificate appended to a leaf certificate.
|
30
|
+
#
|
20
31
|
# @return [String]
|
21
32
|
attr_accessor :certificate_data
|
22
33
|
|
@@ -24,15 +35,23 @@ module OCI
|
|
24
35
|
# @return [String]
|
25
36
|
attr_accessor :private_key_data
|
26
37
|
|
27
|
-
# Set to true if the SSL certificate is self-signed.
|
38
|
+
# Set to `true` if the SSL certificate is self-signed.
|
28
39
|
# @return [BOOLEAN]
|
29
40
|
attr_accessor :is_trust_verification_disabled
|
30
41
|
|
31
|
-
# Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
|
42
|
+
# Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
|
43
|
+
# For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
44
|
+
#
|
45
|
+
# Example: `{\"Department\": \"Finance\"}`
|
46
|
+
#
|
32
47
|
# @return [Hash<String, String>]
|
33
48
|
attr_accessor :freeform_tags
|
34
49
|
|
35
|
-
# Defined tags for this resource. Each key is predefined and scoped to a namespace.
|
50
|
+
# Defined tags for this resource. Each key is predefined and scoped to a namespace.
|
51
|
+
# For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
52
|
+
#
|
53
|
+
# Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
|
54
|
+
#
|
36
55
|
# @return [Hash<String, Hash<String, Object>>]
|
37
56
|
attr_accessor :defined_tags
|
38
57
|
|
@@ -0,0 +1,251 @@
|
|
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 required data to create a Custom Protection rule.
|
8
|
+
# **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
|
9
|
+
class Waas::Models::CreateCustomProtectionRuleDetails
|
10
|
+
# **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the Custom Protection rule.
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :compartment_id
|
13
|
+
|
14
|
+
# **[Required]** A user-friendly name for the Custom Protection rule.
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :display_name
|
17
|
+
|
18
|
+
# A description for the Custom Protection rule.
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :description
|
21
|
+
|
22
|
+
# **[Required]** The template text of the Custom Protection rule. The syntax is based on ModSecurity Rule Language. Additionaly it needs to include two variables / placeholders which will be replaced during publishing.
|
23
|
+
#
|
24
|
+
# - **{{mode}}** - rule action, defined by user in UI, like `OFF`, `DETECT` or `BLOCK`.
|
25
|
+
#
|
26
|
+
# - **{{id_1}}** - unique rule ID which identifies a `SecRule`, generated by the system. Multiple IDs can be used by increasing the number of the variable for every `SecRule` defined in the template.
|
27
|
+
#
|
28
|
+
# *Example usage:*
|
29
|
+
# ```
|
30
|
+
# SecRule REQUEST_COOKIES \"regex matching SQL injection - part 1/2\" \\
|
31
|
+
# \"phase:2, \\
|
32
|
+
# msg:'Detects chained SQL injection attempts 1/2.', \\
|
33
|
+
# id: {{id_1}}, \\
|
34
|
+
# ctl:ruleEngine={{mode}}, \\
|
35
|
+
# deny\"
|
36
|
+
# SecRule REQUEST_COOKIES \"regex matching SQL injection - part 2/2\" \\
|
37
|
+
# \"phase:2, \\
|
38
|
+
# msg:'Detects chained SQL injection attempts 2/2.', \\
|
39
|
+
# id: {{id_2}}, \\
|
40
|
+
# ctl:ruleEngine={{mode}}, \\
|
41
|
+
# deny\"
|
42
|
+
# ```
|
43
|
+
# The example contains two `SecRules` each having distinct regex expression to match
|
44
|
+
# `Cookie` header value during second input analysis phase.
|
45
|
+
# The disruptive `deny` action takes effect only when `{{mode}}` is set to `BLOCK`.
|
46
|
+
# The message is logged either when `{{mode}}` is set to `DETECT` or `BLOCK`.
|
47
|
+
#
|
48
|
+
#
|
49
|
+
# For more information about ModSecurity's open source WAF rules, see [Mod Security's documentation](https://www.modsecurity.org/CRS/Documentation/making.html).
|
50
|
+
# @return [String]
|
51
|
+
attr_accessor :template
|
52
|
+
|
53
|
+
# Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
|
54
|
+
# For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
55
|
+
#
|
56
|
+
# Example: `{\"Department\": \"Finance\"}`
|
57
|
+
#
|
58
|
+
# @return [Hash<String, String>]
|
59
|
+
attr_accessor :freeform_tags
|
60
|
+
|
61
|
+
# Defined tags for this resource. Each key is predefined and scoped to a namespace.
|
62
|
+
# For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
|
63
|
+
#
|
64
|
+
# Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
|
65
|
+
#
|
66
|
+
# @return [Hash<String, Hash<String, Object>>]
|
67
|
+
attr_accessor :defined_tags
|
68
|
+
|
69
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
70
|
+
def self.attribute_map
|
71
|
+
{
|
72
|
+
# rubocop:disable Style/SymbolLiteral
|
73
|
+
'compartment_id': :'compartmentId',
|
74
|
+
'display_name': :'displayName',
|
75
|
+
'description': :'description',
|
76
|
+
'template': :'template',
|
77
|
+
'freeform_tags': :'freeformTags',
|
78
|
+
'defined_tags': :'definedTags'
|
79
|
+
# rubocop:enable Style/SymbolLiteral
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
# Attribute type mapping.
|
84
|
+
def self.swagger_types
|
85
|
+
{
|
86
|
+
# rubocop:disable Style/SymbolLiteral
|
87
|
+
'compartment_id': :'String',
|
88
|
+
'display_name': :'String',
|
89
|
+
'description': :'String',
|
90
|
+
'template': :'String',
|
91
|
+
'freeform_tags': :'Hash<String, String>',
|
92
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>'
|
93
|
+
# rubocop:enable Style/SymbolLiteral
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
97
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
98
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
99
|
+
|
100
|
+
|
101
|
+
# Initializes the object
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
104
|
+
# @option attributes [String] :display_name The value to assign to the {#display_name} property
|
105
|
+
# @option attributes [String] :description The value to assign to the {#description} property
|
106
|
+
# @option attributes [String] :template The value to assign to the {#template} property
|
107
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
|
108
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
|
109
|
+
def initialize(attributes = {})
|
110
|
+
return unless attributes.is_a?(Hash)
|
111
|
+
|
112
|
+
# convert string to symbol for hash key
|
113
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
114
|
+
|
115
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
116
|
+
|
117
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
118
|
+
|
119
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
120
|
+
|
121
|
+
self.display_name = attributes[:'displayName'] if attributes[:'displayName']
|
122
|
+
|
123
|
+
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
124
|
+
|
125
|
+
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
126
|
+
|
127
|
+
self.description = attributes[:'description'] if attributes[:'description']
|
128
|
+
|
129
|
+
self.template = attributes[:'template'] if attributes[:'template']
|
130
|
+
|
131
|
+
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
132
|
+
|
133
|
+
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
134
|
+
|
135
|
+
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
136
|
+
|
137
|
+
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
138
|
+
|
139
|
+
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
140
|
+
|
141
|
+
self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
|
142
|
+
end
|
143
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
144
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
145
|
+
|
146
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
147
|
+
|
148
|
+
|
149
|
+
# Checks equality by comparing each attribute.
|
150
|
+
# @param [Object] other the other object to be compared
|
151
|
+
def ==(other)
|
152
|
+
return true if equal?(other)
|
153
|
+
|
154
|
+
self.class == other.class &&
|
155
|
+
compartment_id == other.compartment_id &&
|
156
|
+
display_name == other.display_name &&
|
157
|
+
description == other.description &&
|
158
|
+
template == other.template &&
|
159
|
+
freeform_tags == other.freeform_tags &&
|
160
|
+
defined_tags == other.defined_tags
|
161
|
+
end
|
162
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
163
|
+
|
164
|
+
# @see the `==` method
|
165
|
+
# @param [Object] other the other object to be compared
|
166
|
+
def eql?(other)
|
167
|
+
self == other
|
168
|
+
end
|
169
|
+
|
170
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
171
|
+
|
172
|
+
|
173
|
+
# Calculates hash code according to all attributes.
|
174
|
+
# @return [Fixnum] Hash code
|
175
|
+
def hash
|
176
|
+
[compartment_id, display_name, description, template, freeform_tags, defined_tags].hash
|
177
|
+
end
|
178
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
179
|
+
|
180
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
181
|
+
|
182
|
+
|
183
|
+
# Builds the object from hash
|
184
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
185
|
+
# @return [Object] Returns the model itself
|
186
|
+
def build_from_hash(attributes)
|
187
|
+
return nil unless attributes.is_a?(Hash)
|
188
|
+
|
189
|
+
self.class.swagger_types.each_pair do |key, type|
|
190
|
+
if type =~ /^Array<(.*)>/i
|
191
|
+
# check to ensure the input is an array given that the the attribute
|
192
|
+
# is documented as an array but the input is not
|
193
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
194
|
+
public_method("#{key}=").call(
|
195
|
+
attributes[self.class.attribute_map[key]]
|
196
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
197
|
+
)
|
198
|
+
end
|
199
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
200
|
+
public_method("#{key}=").call(
|
201
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
202
|
+
)
|
203
|
+
end
|
204
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
205
|
+
end
|
206
|
+
|
207
|
+
self
|
208
|
+
end
|
209
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
210
|
+
|
211
|
+
# Returns the string representation of the object
|
212
|
+
# @return [String] String presentation of the object
|
213
|
+
def to_s
|
214
|
+
to_hash.to_s
|
215
|
+
end
|
216
|
+
|
217
|
+
# Returns the object in the form of hash
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
219
|
+
def to_hash
|
220
|
+
hash = {}
|
221
|
+
self.class.attribute_map.each_pair do |attr, param|
|
222
|
+
value = public_method(attr).call
|
223
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
224
|
+
|
225
|
+
hash[param] = _to_hash(value)
|
226
|
+
end
|
227
|
+
hash
|
228
|
+
end
|
229
|
+
|
230
|
+
private
|
231
|
+
|
232
|
+
# Outputs non-array value in the form of hash
|
233
|
+
# For object, use to_hash. Otherwise, just return the value
|
234
|
+
# @param [Object] value Any valid value
|
235
|
+
# @return [Hash] Returns the value in the form of hash
|
236
|
+
def _to_hash(value)
|
237
|
+
if value.is_a?(Array)
|
238
|
+
value.compact.map { |v| _to_hash(v) }
|
239
|
+
elsif value.is_a?(Hash)
|
240
|
+
{}.tap do |hash|
|
241
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
242
|
+
end
|
243
|
+
elsif value.respond_to? :to_hash
|
244
|
+
value.to_hash
|
245
|
+
else
|
246
|
+
value
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|