oci 2.4.6 → 2.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/oci.rb +2 -0
- data/lib/oci/database/database.rb +1 -0
- data/lib/oci/database/models/database.rb +18 -4
- data/lib/oci/database/models/database_connection_strings.rb +182 -0
- data/lib/oci/database/models/database_summary.rb +18 -4
- data/lib/oci/dns/dns.rb +23 -0
- data/lib/oci/dns/dns_client.rb +802 -75
- data/lib/oci/dns/dns_client_composite_operations.rb +238 -0
- data/lib/oci/dns/models/create_steering_policy_attachment_details.rb +205 -0
- data/lib/oci/dns/models/create_steering_policy_details.rb +333 -0
- data/lib/oci/dns/models/steering_policy.rb +418 -0
- data/lib/oci/dns/models/steering_policy_answer.rb +205 -0
- data/lib/oci/dns/models/steering_policy_attachment.rb +308 -0
- data/lib/oci/dns/models/steering_policy_attachment_summary.rb +304 -0
- data/lib/oci/dns/models/steering_policy_filter_answer_data.rb +168 -0
- data/lib/oci/dns/models/steering_policy_filter_rule.rb +178 -0
- data/lib/oci/dns/models/steering_policy_filter_rule_case.rb +165 -0
- data/lib/oci/dns/models/steering_policy_health_rule.rb +160 -0
- data/lib/oci/dns/models/steering_policy_health_rule_case.rb +152 -0
- data/lib/oci/dns/models/steering_policy_limit_rule.rb +179 -0
- data/lib/oci/dns/models/steering_policy_limit_rule_case.rb +162 -0
- data/lib/oci/dns/models/steering_policy_priority_answer_data.rb +161 -0
- data/lib/oci/dns/models/steering_policy_priority_rule.rb +178 -0
- data/lib/oci/dns/models/steering_policy_priority_rule_case.rb +165 -0
- data/lib/oci/dns/models/steering_policy_rule.rb +237 -0
- data/lib/oci/dns/models/steering_policy_summary.rb +391 -0
- data/lib/oci/dns/models/steering_policy_weighted_answer_data.rb +161 -0
- data/lib/oci/dns/models/steering_policy_weighted_rule.rb +178 -0
- data/lib/oci/dns/models/steering_policy_weighted_rule_case.rb +165 -0
- data/lib/oci/dns/models/update_steering_policy_attachment_details.rb +156 -0
- data/lib/oci/dns/models/update_steering_policy_details.rb +319 -0
- data/lib/oci/email/email.rb +1 -0
- data/lib/oci/email/email_client.rb +87 -16
- data/lib/oci/email/email_client_composite_operations.rb +40 -0
- data/lib/oci/email/models/create_sender_details.rb +40 -6
- data/lib/oci/email/models/create_suppression_details.rb +2 -2
- data/lib/oci/email/models/sender.rb +53 -5
- data/lib/oci/email/models/sender_summary.rb +38 -4
- data/lib/oci/email/models/suppression.rb +20 -3
- data/lib/oci/email/models/update_sender_details.rb +174 -0
- data/lib/oci/healthchecks/health_checks_client.rb +1137 -0
- data/lib/oci/healthchecks/health_checks_client_composite_operations.rb +24 -0
- data/lib/oci/healthchecks/healthchecks.rb +41 -0
- data/lib/oci/healthchecks/models/connection.rb +159 -0
- data/lib/oci/healthchecks/models/create_http_monitor_details.rb +359 -0
- data/lib/oci/healthchecks/models/create_on_demand_http_probe_details.rb +278 -0
- data/lib/oci/healthchecks/models/create_on_demand_ping_probe_details.rb +229 -0
- data/lib/oci/healthchecks/models/create_ping_monitor_details.rb +310 -0
- data/lib/oci/healthchecks/models/dns.rb +165 -0
- data/lib/oci/healthchecks/models/geolocation.rb +239 -0
- data/lib/oci/healthchecks/models/health_checks_vantage_point_summary.rb +211 -0
- data/lib/oci/healthchecks/models/http_monitor.rb +395 -0
- data/lib/oci/healthchecks/models/http_monitor_summary.rb +290 -0
- data/lib/oci/healthchecks/models/http_probe.rb +314 -0
- data/lib/oci/healthchecks/models/http_probe_method.rb +10 -0
- data/lib/oci/healthchecks/models/http_probe_protocol.rb +10 -0
- data/lib/oci/healthchecks/models/http_probe_result_summary.rb +542 -0
- data/lib/oci/healthchecks/models/ping_monitor.rb +340 -0
- data/lib/oci/healthchecks/models/ping_monitor_summary.rb +290 -0
- data/lib/oci/healthchecks/models/ping_probe.rb +259 -0
- data/lib/oci/healthchecks/models/ping_probe_protocol.rb +10 -0
- data/lib/oci/healthchecks/models/ping_probe_result_summary.rb +418 -0
- data/lib/oci/healthchecks/models/routing.rb +192 -0
- data/lib/oci/healthchecks/models/tcp_connection.rb +189 -0
- data/lib/oci/healthchecks/models/update_http_monitor_details.rb +339 -0
- data/lib/oci/healthchecks/models/update_ping_monitor_details.rb +292 -0
- data/lib/oci/healthchecks/util.rb +2 -0
- data/lib/oci/regions.rb +3 -1
- data/lib/oci/version.rb +1 -1
- data/lib/oci/waas/models/access_rule.rb +283 -0
- data/lib/oci/waas/models/access_rule_criteria.rb +206 -0
- data/lib/oci/waas/models/address_rate_limiting.rb +195 -0
- data/lib/oci/waas/models/block_challenge_settings.rb +288 -0
- data/lib/oci/waas/models/captcha.rb +231 -0
- data/lib/oci/waas/models/certificate.rb +383 -0
- data/lib/oci/waas/models/certificate_extensions.rb +170 -0
- data/lib/oci/waas/models/certificate_public_key_info.rb +170 -0
- data/lib/oci/waas/models/certificate_subject_name.rb +218 -0
- data/lib/oci/waas/models/certificate_summary.rb +274 -0
- data/lib/oci/waas/models/create_certificate_details.rb +241 -0
- data/lib/oci/waas/models/create_waas_policy_details.rb +257 -0
- data/lib/oci/waas/models/device_fingerprint_challenge.rb +268 -0
- data/lib/oci/waas/models/edge_subnet.rb +173 -0
- data/lib/oci/waas/models/good_bot.rb +183 -0
- data/lib/oci/waas/models/header.rb +159 -0
- data/lib/oci/waas/models/human_interaction_challenge.rb +282 -0
- data/lib/oci/waas/models/js_challenge.rb +240 -0
- data/lib/oci/waas/models/lifecycle_states.rb +14 -0
- data/lib/oci/waas/models/origin.rb +191 -0
- data/lib/oci/waas/models/policy_config.rb +181 -0
- data/lib/oci/waas/models/protection_rule.rb +237 -0
- data/lib/oci/waas/models/protection_rule_action.rb +185 -0
- data/lib/oci/waas/models/protection_rule_exclusion.rb +182 -0
- data/lib/oci/waas/models/protection_settings.rb +404 -0
- data/lib/oci/waas/models/recommendation.rb +210 -0
- data/lib/oci/waas/models/threat_feed.rb +202 -0
- data/lib/oci/waas/models/threat_feed_action.rb +175 -0
- data/lib/oci/waas/models/update_certificate_details.rb +183 -0
- data/lib/oci/waas/models/update_waas_policy_details.rb +233 -0
- data/lib/oci/waas/models/waas_policy.rb +331 -0
- data/lib/oci/waas/models/waas_policy_summary.rb +271 -0
- data/lib/oci/waas/models/waf_blocked_request.rb +219 -0
- data/lib/oci/waas/models/waf_config.rb +295 -0
- data/lib/oci/waas/models/waf_config_details.rb +253 -0
- data/lib/oci/waas/models/waf_log.rb +510 -0
- data/lib/oci/waas/models/waf_meter_datum.rb +279 -0
- data/lib/oci/waas/models/waf_request.rb +177 -0
- data/lib/oci/waas/models/waf_traffic_datum.rb +223 -0
- data/lib/oci/waas/models/whitelist.rb +159 -0
- data/lib/oci/waas/models/work_request.rb +322 -0
- data/lib/oci/waas/models/work_request_error.rb +170 -0
- data/lib/oci/waas/models/work_request_log_entry.rb +159 -0
- data/lib/oci/waas/models/work_request_operation_types.rb +12 -0
- data/lib/oci/waas/models/work_request_resource.rb +217 -0
- data/lib/oci/waas/models/work_request_status_values.rb +14 -0
- data/lib/oci/waas/models/work_request_summary.rb +302 -0
- data/lib/oci/waas/util.rb +2 -0
- data/lib/oci/waas/waas.rb +66 -0
- data/lib/oci/waas/waas_client.rb +3044 -0
- data/lib/oci/waas/waas_client_composite_operations.rb +990 -0
- metadata +105 -2
|
@@ -0,0 +1,259 @@
|
|
|
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
|
|
7
|
+
module OCI
|
|
8
|
+
# This model contains all of the mutable and immutable properties for a ping probe.
|
|
9
|
+
#
|
|
10
|
+
class Healthchecks::Models::PingProbe # rubocop:disable Metrics/LineLength
|
|
11
|
+
PROTOCOL_ENUM = [
|
|
12
|
+
PROTOCOL_ICMP = 'ICMP'.freeze,
|
|
13
|
+
PROTOCOL_TCP = 'TCP'.freeze,
|
|
14
|
+
PROTOCOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
# The OCID of the resource.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# A URL for fetching the probe results.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :results_url
|
|
24
|
+
|
|
25
|
+
# The OCID of the compartment.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :compartment_id
|
|
28
|
+
|
|
29
|
+
# @return [Array<String>]
|
|
30
|
+
attr_accessor :targets
|
|
31
|
+
|
|
32
|
+
# @return [Array<String>]
|
|
33
|
+
attr_accessor :vantage_point_names
|
|
34
|
+
|
|
35
|
+
# The port on which to probe endpoints. If unspecified, probes will use the
|
|
36
|
+
# default port of their protocol.
|
|
37
|
+
#
|
|
38
|
+
# @return [Integer]
|
|
39
|
+
attr_accessor :port
|
|
40
|
+
|
|
41
|
+
# The probe timeout in seconds. Valid values: 10, 20, 30, and 60.
|
|
42
|
+
# The probe timeout must be less than or equal to `intervalInSeconds` for monitors.
|
|
43
|
+
#
|
|
44
|
+
# @return [Integer]
|
|
45
|
+
attr_accessor :timeout_in_seconds
|
|
46
|
+
|
|
47
|
+
# @return [String]
|
|
48
|
+
attr_reader :protocol
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
# rubocop:disable Style/SymbolLiteral
|
|
54
|
+
'id': :'id',
|
|
55
|
+
'results_url': :'resultsUrl',
|
|
56
|
+
'compartment_id': :'compartmentId',
|
|
57
|
+
'targets': :'targets',
|
|
58
|
+
'vantage_point_names': :'vantagePointNames',
|
|
59
|
+
'port': :'port',
|
|
60
|
+
'timeout_in_seconds': :'timeoutInSeconds',
|
|
61
|
+
'protocol': :'protocol'
|
|
62
|
+
# rubocop:enable Style/SymbolLiteral
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Attribute type mapping.
|
|
67
|
+
def self.swagger_types
|
|
68
|
+
{
|
|
69
|
+
# rubocop:disable Style/SymbolLiteral
|
|
70
|
+
'id': :'String',
|
|
71
|
+
'results_url': :'String',
|
|
72
|
+
'compartment_id': :'String',
|
|
73
|
+
'targets': :'Array<String>',
|
|
74
|
+
'vantage_point_names': :'Array<String>',
|
|
75
|
+
'port': :'Integer',
|
|
76
|
+
'timeout_in_seconds': :'Integer',
|
|
77
|
+
'protocol': :'String'
|
|
78
|
+
# rubocop:enable Style/SymbolLiteral
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
83
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Initializes the object
|
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
|
89
|
+
# @option attributes [String] :results_url The value to assign to the {#results_url} property
|
|
90
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
|
91
|
+
# @option attributes [Array<String>] :targets The value to assign to the {#targets} property
|
|
92
|
+
# @option attributes [Array<String>] :vantage_point_names The value to assign to the {#vantage_point_names} property
|
|
93
|
+
# @option attributes [Integer] :port The value to assign to the {#port} property
|
|
94
|
+
# @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
|
|
95
|
+
# @option attributes [String] :protocol The value to assign to the {#protocol} property
|
|
96
|
+
def initialize(attributes = {})
|
|
97
|
+
return unless attributes.is_a?(Hash)
|
|
98
|
+
|
|
99
|
+
# convert string to symbol for hash key
|
|
100
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
101
|
+
|
|
102
|
+
self.id = attributes[:'id'] if attributes[:'id']
|
|
103
|
+
|
|
104
|
+
self.results_url = attributes[:'resultsUrl'] if attributes[:'resultsUrl']
|
|
105
|
+
|
|
106
|
+
raise 'You cannot provide both :resultsUrl and :results_url' if attributes.key?(:'resultsUrl') && attributes.key?(:'results_url')
|
|
107
|
+
|
|
108
|
+
self.results_url = attributes[:'results_url'] if attributes[:'results_url']
|
|
109
|
+
|
|
110
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
|
111
|
+
|
|
112
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
|
113
|
+
|
|
114
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
|
115
|
+
|
|
116
|
+
self.targets = attributes[:'targets'] if attributes[:'targets']
|
|
117
|
+
|
|
118
|
+
self.vantage_point_names = attributes[:'vantagePointNames'] if attributes[:'vantagePointNames']
|
|
119
|
+
|
|
120
|
+
raise 'You cannot provide both :vantagePointNames and :vantage_point_names' if attributes.key?(:'vantagePointNames') && attributes.key?(:'vantage_point_names')
|
|
121
|
+
|
|
122
|
+
self.vantage_point_names = attributes[:'vantage_point_names'] if attributes[:'vantage_point_names']
|
|
123
|
+
|
|
124
|
+
self.port = attributes[:'port'] if attributes[:'port']
|
|
125
|
+
|
|
126
|
+
self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
|
|
127
|
+
|
|
128
|
+
raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
|
|
129
|
+
|
|
130
|
+
self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
|
|
131
|
+
|
|
132
|
+
self.protocol = attributes[:'protocol'] if attributes[:'protocol']
|
|
133
|
+
end
|
|
134
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
135
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
136
|
+
|
|
137
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
138
|
+
# @param [Object] protocol Object to be assigned
|
|
139
|
+
def protocol=(protocol)
|
|
140
|
+
# rubocop:disable Style/ConditionalAssignment
|
|
141
|
+
if protocol && !PROTOCOL_ENUM.include?(protocol)
|
|
142
|
+
# rubocop: disable Metrics/LineLength
|
|
143
|
+
OCI.logger.debug("Unknown value for 'protocol' [" + protocol + "]. Mapping to 'PROTOCOL_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
|
144
|
+
# rubocop: enable Metrics/LineLength
|
|
145
|
+
@protocol = PROTOCOL_UNKNOWN_ENUM_VALUE
|
|
146
|
+
else
|
|
147
|
+
@protocol = protocol
|
|
148
|
+
end
|
|
149
|
+
# rubocop:enable Style/ConditionalAssignment
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
# Checks equality by comparing each attribute.
|
|
156
|
+
# @param [Object] other the other object to be compared
|
|
157
|
+
def ==(other)
|
|
158
|
+
return true if equal?(other)
|
|
159
|
+
|
|
160
|
+
self.class == other.class &&
|
|
161
|
+
id == other.id &&
|
|
162
|
+
results_url == other.results_url &&
|
|
163
|
+
compartment_id == other.compartment_id &&
|
|
164
|
+
targets == other.targets &&
|
|
165
|
+
vantage_point_names == other.vantage_point_names &&
|
|
166
|
+
port == other.port &&
|
|
167
|
+
timeout_in_seconds == other.timeout_in_seconds &&
|
|
168
|
+
protocol == other.protocol
|
|
169
|
+
end
|
|
170
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
171
|
+
|
|
172
|
+
# @see the `==` method
|
|
173
|
+
# @param [Object] other the other object to be compared
|
|
174
|
+
def eql?(other)
|
|
175
|
+
self == other
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
# Calculates hash code according to all attributes.
|
|
182
|
+
# @return [Fixnum] Hash code
|
|
183
|
+
def hash
|
|
184
|
+
[id, results_url, compartment_id, targets, vantage_point_names, port, timeout_in_seconds, protocol].hash
|
|
185
|
+
end
|
|
186
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
187
|
+
|
|
188
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
# Builds the object from hash
|
|
192
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
193
|
+
# @return [Object] Returns the model itself
|
|
194
|
+
def build_from_hash(attributes)
|
|
195
|
+
return nil unless attributes.is_a?(Hash)
|
|
196
|
+
|
|
197
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
198
|
+
if type =~ /^Array<(.*)>/i
|
|
199
|
+
# check to ensure the input is an array given that the the attribute
|
|
200
|
+
# is documented as an array but the input is not
|
|
201
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
202
|
+
public_method("#{key}=").call(
|
|
203
|
+
attributes[self.class.attribute_map[key]]
|
|
204
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
205
|
+
)
|
|
206
|
+
end
|
|
207
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
208
|
+
public_method("#{key}=").call(
|
|
209
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
210
|
+
)
|
|
211
|
+
end
|
|
212
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
self
|
|
216
|
+
end
|
|
217
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
218
|
+
|
|
219
|
+
# Returns the string representation of the object
|
|
220
|
+
# @return [String] String presentation of the object
|
|
221
|
+
def to_s
|
|
222
|
+
to_hash.to_s
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Returns the object in the form of hash
|
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
|
227
|
+
def to_hash
|
|
228
|
+
hash = {}
|
|
229
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
230
|
+
value = public_method(attr).call
|
|
231
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
232
|
+
|
|
233
|
+
hash[param] = _to_hash(value)
|
|
234
|
+
end
|
|
235
|
+
hash
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
private
|
|
239
|
+
|
|
240
|
+
# Outputs non-array value in the form of hash
|
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
242
|
+
# @param [Object] value Any valid value
|
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
|
244
|
+
def _to_hash(value)
|
|
245
|
+
if value.is_a?(Array)
|
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
|
247
|
+
elsif value.is_a?(Hash)
|
|
248
|
+
{}.tap do |hash|
|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
250
|
+
end
|
|
251
|
+
elsif value.respond_to? :to_hash
|
|
252
|
+
value.to_hash
|
|
253
|
+
else
|
|
254
|
+
value
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
module OCI
|
|
4
|
+
module Healthchecks::Models
|
|
5
|
+
PING_PROBE_PROTOCOL_ENUM = [
|
|
6
|
+
PING_PROBE_PROTOCOL_ICMP = 'ICMP'.freeze,
|
|
7
|
+
PING_PROBE_PROTOCOL_TCP = 'TCP'.freeze
|
|
8
|
+
].freeze
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,418 @@
|
|
|
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
|
|
7
|
+
module OCI
|
|
8
|
+
# The results returned by running a ping probe. All times and durations are
|
|
9
|
+
# returned in milliseconds. All times are relative to the POSIX epoch
|
|
10
|
+
# (1970-01-01T00:00Z).
|
|
11
|
+
#
|
|
12
|
+
class Healthchecks::Models::PingProbeResultSummary # rubocop:disable Metrics/LineLength
|
|
13
|
+
ERROR_CATEGORY_ENUM = [
|
|
14
|
+
ERROR_CATEGORY_NONE = 'NONE'.freeze,
|
|
15
|
+
ERROR_CATEGORY_DNS = 'DNS'.freeze,
|
|
16
|
+
ERROR_CATEGORY_TRANSPORT = 'TRANSPORT'.freeze,
|
|
17
|
+
ERROR_CATEGORY_NETWORK = 'NETWORK'.freeze,
|
|
18
|
+
ERROR_CATEGORY_SYSTEM = 'SYSTEM'.freeze,
|
|
19
|
+
ERROR_CATEGORY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
|
20
|
+
].freeze
|
|
21
|
+
|
|
22
|
+
PROTOCOL_ENUM = [
|
|
23
|
+
PROTOCOL_ICMP = 'ICMP'.freeze,
|
|
24
|
+
PROTOCOL_TCP = 'TCP'.freeze,
|
|
25
|
+
PROTOCOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
|
26
|
+
].freeze
|
|
27
|
+
|
|
28
|
+
# A value identifying this specific probe result. The key is only unique within
|
|
29
|
+
# the results of its probe configuration. The key may be reused after 90 days.
|
|
30
|
+
#
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :key
|
|
33
|
+
|
|
34
|
+
# The OCID of the monitor or on-demand probe responsible for creating this result.
|
|
35
|
+
#
|
|
36
|
+
# @return [String]
|
|
37
|
+
attr_accessor :probe_configuration_id
|
|
38
|
+
|
|
39
|
+
# The date and time the probe was executed, expressed in milliseconds since the
|
|
40
|
+
# POSIX epoch. This field is defined by the PerformanceResourceTiming interface
|
|
41
|
+
# of the W3C Resource Timing specification. For more information, see
|
|
42
|
+
# [Resource Timing](https://w3c.github.io/resource-timing/#sec-resource-timing).
|
|
43
|
+
#
|
|
44
|
+
# @return [Float]
|
|
45
|
+
attr_accessor :start_time
|
|
46
|
+
|
|
47
|
+
# The target hostname or IP address of the probe.
|
|
48
|
+
# @return [String]
|
|
49
|
+
attr_accessor :target
|
|
50
|
+
|
|
51
|
+
# The name of the vantage point that executed the probe.
|
|
52
|
+
# @return [String]
|
|
53
|
+
attr_accessor :vantage_point_name
|
|
54
|
+
|
|
55
|
+
# True if the probe did not complete before the configured `timeoutInSeconds` value.
|
|
56
|
+
#
|
|
57
|
+
# @return [BOOLEAN]
|
|
58
|
+
attr_accessor :is_timed_out
|
|
59
|
+
|
|
60
|
+
# True if the probe result is determined to be healthy based on probe
|
|
61
|
+
# type-specific criteria. For HTTP probes, a probe result is considered
|
|
62
|
+
# healthy if the HTTP response code is greater than or equal to 200 and
|
|
63
|
+
# less than 300.
|
|
64
|
+
#
|
|
65
|
+
# @return [BOOLEAN]
|
|
66
|
+
attr_accessor :is_healthy
|
|
67
|
+
|
|
68
|
+
# The category of error if an error occurs executing the probe.
|
|
69
|
+
# The `errorMessage` field provides a message with the error details.
|
|
70
|
+
# * NONE - No error
|
|
71
|
+
# * DNS - DNS errors
|
|
72
|
+
# * TRANSPORT - Transport-related errors, for example a \"TLS certificate expired\" error.
|
|
73
|
+
# * NETWORK - Network-related errors, for example a \"network unreachable\" error.
|
|
74
|
+
# * SYSTEM - Internal system errors.
|
|
75
|
+
#
|
|
76
|
+
# @return [String]
|
|
77
|
+
attr_reader :error_category
|
|
78
|
+
|
|
79
|
+
# The error information indicating why a probe execution failed.
|
|
80
|
+
# @return [String]
|
|
81
|
+
attr_accessor :error_message
|
|
82
|
+
|
|
83
|
+
# @return [String]
|
|
84
|
+
attr_reader :protocol
|
|
85
|
+
|
|
86
|
+
# @return [OCI::Healthchecks::Models::Connection]
|
|
87
|
+
attr_accessor :connection
|
|
88
|
+
|
|
89
|
+
# @return [OCI::Healthchecks::Models::DNS]
|
|
90
|
+
attr_accessor :dns
|
|
91
|
+
|
|
92
|
+
# The time immediately before the vantage point starts the domain name lookup for
|
|
93
|
+
# the resource.
|
|
94
|
+
#
|
|
95
|
+
# @return [Float]
|
|
96
|
+
attr_accessor :domain_lookup_start
|
|
97
|
+
|
|
98
|
+
# The time immediately before the vantage point finishes the domain name lookup for
|
|
99
|
+
# the resource.
|
|
100
|
+
#
|
|
101
|
+
# @return [Float]
|
|
102
|
+
attr_accessor :domain_lookup_end
|
|
103
|
+
|
|
104
|
+
# The latency of the probe execution, in milliseconds.
|
|
105
|
+
#
|
|
106
|
+
# @return [Float]
|
|
107
|
+
attr_accessor :latency_in_ms
|
|
108
|
+
|
|
109
|
+
# The ICMP code of the response message. This field is not used when the protocol
|
|
110
|
+
# is set to TCP. For more information on ICMP codes, see
|
|
111
|
+
# [Internet Control Message Protocol (ICMP) Parameters](https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml).
|
|
112
|
+
#
|
|
113
|
+
# @return [Integer]
|
|
114
|
+
attr_accessor :icmp_code
|
|
115
|
+
|
|
116
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
117
|
+
def self.attribute_map
|
|
118
|
+
{
|
|
119
|
+
# rubocop:disable Style/SymbolLiteral
|
|
120
|
+
'key': :'key',
|
|
121
|
+
'probe_configuration_id': :'probeConfigurationId',
|
|
122
|
+
'start_time': :'startTime',
|
|
123
|
+
'target': :'target',
|
|
124
|
+
'vantage_point_name': :'vantagePointName',
|
|
125
|
+
'is_timed_out': :'isTimedOut',
|
|
126
|
+
'is_healthy': :'isHealthy',
|
|
127
|
+
'error_category': :'errorCategory',
|
|
128
|
+
'error_message': :'errorMessage',
|
|
129
|
+
'protocol': :'protocol',
|
|
130
|
+
'connection': :'connection',
|
|
131
|
+
'dns': :'dns',
|
|
132
|
+
'domain_lookup_start': :'domainLookupStart',
|
|
133
|
+
'domain_lookup_end': :'domainLookupEnd',
|
|
134
|
+
'latency_in_ms': :'latencyInMs',
|
|
135
|
+
'icmp_code': :'icmpCode'
|
|
136
|
+
# rubocop:enable Style/SymbolLiteral
|
|
137
|
+
}
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Attribute type mapping.
|
|
141
|
+
def self.swagger_types
|
|
142
|
+
{
|
|
143
|
+
# rubocop:disable Style/SymbolLiteral
|
|
144
|
+
'key': :'String',
|
|
145
|
+
'probe_configuration_id': :'String',
|
|
146
|
+
'start_time': :'Float',
|
|
147
|
+
'target': :'String',
|
|
148
|
+
'vantage_point_name': :'String',
|
|
149
|
+
'is_timed_out': :'BOOLEAN',
|
|
150
|
+
'is_healthy': :'BOOLEAN',
|
|
151
|
+
'error_category': :'String',
|
|
152
|
+
'error_message': :'String',
|
|
153
|
+
'protocol': :'String',
|
|
154
|
+
'connection': :'OCI::Healthchecks::Models::Connection',
|
|
155
|
+
'dns': :'OCI::Healthchecks::Models::DNS',
|
|
156
|
+
'domain_lookup_start': :'Float',
|
|
157
|
+
'domain_lookup_end': :'Float',
|
|
158
|
+
'latency_in_ms': :'Float',
|
|
159
|
+
'icmp_code': :'Integer'
|
|
160
|
+
# rubocop:enable Style/SymbolLiteral
|
|
161
|
+
}
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
165
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
# Initializes the object
|
|
169
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
170
|
+
# @option attributes [String] :key The value to assign to the {#key} property
|
|
171
|
+
# @option attributes [String] :probe_configuration_id The value to assign to the {#probe_configuration_id} property
|
|
172
|
+
# @option attributes [Float] :start_time The value to assign to the {#start_time} property
|
|
173
|
+
# @option attributes [String] :target The value to assign to the {#target} property
|
|
174
|
+
# @option attributes [String] :vantage_point_name The value to assign to the {#vantage_point_name} property
|
|
175
|
+
# @option attributes [BOOLEAN] :is_timed_out The value to assign to the {#is_timed_out} property
|
|
176
|
+
# @option attributes [BOOLEAN] :is_healthy The value to assign to the {#is_healthy} property
|
|
177
|
+
# @option attributes [String] :error_category The value to assign to the {#error_category} property
|
|
178
|
+
# @option attributes [String] :error_message The value to assign to the {#error_message} property
|
|
179
|
+
# @option attributes [String] :protocol The value to assign to the {#protocol} property
|
|
180
|
+
# @option attributes [OCI::Healthchecks::Models::Connection] :connection The value to assign to the {#connection} property
|
|
181
|
+
# @option attributes [OCI::Healthchecks::Models::DNS] :dns The value to assign to the {#dns} property
|
|
182
|
+
# @option attributes [Float] :domain_lookup_start The value to assign to the {#domain_lookup_start} property
|
|
183
|
+
# @option attributes [Float] :domain_lookup_end The value to assign to the {#domain_lookup_end} property
|
|
184
|
+
# @option attributes [Float] :latency_in_ms The value to assign to the {#latency_in_ms} property
|
|
185
|
+
# @option attributes [Integer] :icmp_code The value to assign to the {#icmp_code} property
|
|
186
|
+
def initialize(attributes = {})
|
|
187
|
+
return unless attributes.is_a?(Hash)
|
|
188
|
+
|
|
189
|
+
# convert string to symbol for hash key
|
|
190
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
191
|
+
|
|
192
|
+
self.key = attributes[:'key'] if attributes[:'key']
|
|
193
|
+
|
|
194
|
+
self.probe_configuration_id = attributes[:'probeConfigurationId'] if attributes[:'probeConfigurationId']
|
|
195
|
+
|
|
196
|
+
raise 'You cannot provide both :probeConfigurationId and :probe_configuration_id' if attributes.key?(:'probeConfigurationId') && attributes.key?(:'probe_configuration_id')
|
|
197
|
+
|
|
198
|
+
self.probe_configuration_id = attributes[:'probe_configuration_id'] if attributes[:'probe_configuration_id']
|
|
199
|
+
|
|
200
|
+
self.start_time = attributes[:'startTime'] if attributes[:'startTime']
|
|
201
|
+
|
|
202
|
+
raise 'You cannot provide both :startTime and :start_time' if attributes.key?(:'startTime') && attributes.key?(:'start_time')
|
|
203
|
+
|
|
204
|
+
self.start_time = attributes[:'start_time'] if attributes[:'start_time']
|
|
205
|
+
|
|
206
|
+
self.target = attributes[:'target'] if attributes[:'target']
|
|
207
|
+
|
|
208
|
+
self.vantage_point_name = attributes[:'vantagePointName'] if attributes[:'vantagePointName']
|
|
209
|
+
|
|
210
|
+
raise 'You cannot provide both :vantagePointName and :vantage_point_name' if attributes.key?(:'vantagePointName') && attributes.key?(:'vantage_point_name')
|
|
211
|
+
|
|
212
|
+
self.vantage_point_name = attributes[:'vantage_point_name'] if attributes[:'vantage_point_name']
|
|
213
|
+
|
|
214
|
+
self.is_timed_out = attributes[:'isTimedOut'] unless attributes[:'isTimedOut'].nil?
|
|
215
|
+
|
|
216
|
+
raise 'You cannot provide both :isTimedOut and :is_timed_out' if attributes.key?(:'isTimedOut') && attributes.key?(:'is_timed_out')
|
|
217
|
+
|
|
218
|
+
self.is_timed_out = attributes[:'is_timed_out'] unless attributes[:'is_timed_out'].nil?
|
|
219
|
+
|
|
220
|
+
self.is_healthy = attributes[:'isHealthy'] unless attributes[:'isHealthy'].nil?
|
|
221
|
+
|
|
222
|
+
raise 'You cannot provide both :isHealthy and :is_healthy' if attributes.key?(:'isHealthy') && attributes.key?(:'is_healthy')
|
|
223
|
+
|
|
224
|
+
self.is_healthy = attributes[:'is_healthy'] unless attributes[:'is_healthy'].nil?
|
|
225
|
+
|
|
226
|
+
self.error_category = attributes[:'errorCategory'] if attributes[:'errorCategory']
|
|
227
|
+
self.error_category = "NONE" if error_category.nil? && !attributes.key?(:'errorCategory') # rubocop:disable Style/StringLiterals
|
|
228
|
+
|
|
229
|
+
raise 'You cannot provide both :errorCategory and :error_category' if attributes.key?(:'errorCategory') && attributes.key?(:'error_category')
|
|
230
|
+
|
|
231
|
+
self.error_category = attributes[:'error_category'] if attributes[:'error_category']
|
|
232
|
+
self.error_category = "NONE" if error_category.nil? && !attributes.key?(:'errorCategory') && !attributes.key?(:'error_category') # rubocop:disable Style/StringLiterals
|
|
233
|
+
|
|
234
|
+
self.error_message = attributes[:'errorMessage'] if attributes[:'errorMessage']
|
|
235
|
+
|
|
236
|
+
raise 'You cannot provide both :errorMessage and :error_message' if attributes.key?(:'errorMessage') && attributes.key?(:'error_message')
|
|
237
|
+
|
|
238
|
+
self.error_message = attributes[:'error_message'] if attributes[:'error_message']
|
|
239
|
+
|
|
240
|
+
self.protocol = attributes[:'protocol'] if attributes[:'protocol']
|
|
241
|
+
|
|
242
|
+
self.connection = attributes[:'connection'] if attributes[:'connection']
|
|
243
|
+
|
|
244
|
+
self.dns = attributes[:'dns'] if attributes[:'dns']
|
|
245
|
+
|
|
246
|
+
self.domain_lookup_start = attributes[:'domainLookupStart'] if attributes[:'domainLookupStart']
|
|
247
|
+
|
|
248
|
+
raise 'You cannot provide both :domainLookupStart and :domain_lookup_start' if attributes.key?(:'domainLookupStart') && attributes.key?(:'domain_lookup_start')
|
|
249
|
+
|
|
250
|
+
self.domain_lookup_start = attributes[:'domain_lookup_start'] if attributes[:'domain_lookup_start']
|
|
251
|
+
|
|
252
|
+
self.domain_lookup_end = attributes[:'domainLookupEnd'] if attributes[:'domainLookupEnd']
|
|
253
|
+
|
|
254
|
+
raise 'You cannot provide both :domainLookupEnd and :domain_lookup_end' if attributes.key?(:'domainLookupEnd') && attributes.key?(:'domain_lookup_end')
|
|
255
|
+
|
|
256
|
+
self.domain_lookup_end = attributes[:'domain_lookup_end'] if attributes[:'domain_lookup_end']
|
|
257
|
+
|
|
258
|
+
self.latency_in_ms = attributes[:'latencyInMs'] if attributes[:'latencyInMs']
|
|
259
|
+
|
|
260
|
+
raise 'You cannot provide both :latencyInMs and :latency_in_ms' if attributes.key?(:'latencyInMs') && attributes.key?(:'latency_in_ms')
|
|
261
|
+
|
|
262
|
+
self.latency_in_ms = attributes[:'latency_in_ms'] if attributes[:'latency_in_ms']
|
|
263
|
+
|
|
264
|
+
self.icmp_code = attributes[:'icmpCode'] if attributes[:'icmpCode']
|
|
265
|
+
|
|
266
|
+
raise 'You cannot provide both :icmpCode and :icmp_code' if attributes.key?(:'icmpCode') && attributes.key?(:'icmp_code')
|
|
267
|
+
|
|
268
|
+
self.icmp_code = attributes[:'icmp_code'] if attributes[:'icmp_code']
|
|
269
|
+
end
|
|
270
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
271
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
272
|
+
|
|
273
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
274
|
+
# @param [Object] error_category Object to be assigned
|
|
275
|
+
def error_category=(error_category)
|
|
276
|
+
# rubocop:disable Style/ConditionalAssignment
|
|
277
|
+
if error_category && !ERROR_CATEGORY_ENUM.include?(error_category)
|
|
278
|
+
# rubocop: disable Metrics/LineLength
|
|
279
|
+
OCI.logger.debug("Unknown value for 'error_category' [" + error_category + "]. Mapping to 'ERROR_CATEGORY_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
|
280
|
+
# rubocop: enable Metrics/LineLength
|
|
281
|
+
@error_category = ERROR_CATEGORY_UNKNOWN_ENUM_VALUE
|
|
282
|
+
else
|
|
283
|
+
@error_category = error_category
|
|
284
|
+
end
|
|
285
|
+
# rubocop:enable Style/ConditionalAssignment
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
289
|
+
# @param [Object] protocol Object to be assigned
|
|
290
|
+
def protocol=(protocol)
|
|
291
|
+
# rubocop:disable Style/ConditionalAssignment
|
|
292
|
+
if protocol && !PROTOCOL_ENUM.include?(protocol)
|
|
293
|
+
# rubocop: disable Metrics/LineLength
|
|
294
|
+
OCI.logger.debug("Unknown value for 'protocol' [" + protocol + "]. Mapping to 'PROTOCOL_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
|
295
|
+
# rubocop: enable Metrics/LineLength
|
|
296
|
+
@protocol = PROTOCOL_UNKNOWN_ENUM_VALUE
|
|
297
|
+
else
|
|
298
|
+
@protocol = protocol
|
|
299
|
+
end
|
|
300
|
+
# rubocop:enable Style/ConditionalAssignment
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
# Checks equality by comparing each attribute.
|
|
307
|
+
# @param [Object] other the other object to be compared
|
|
308
|
+
def ==(other)
|
|
309
|
+
return true if equal?(other)
|
|
310
|
+
|
|
311
|
+
self.class == other.class &&
|
|
312
|
+
key == other.key &&
|
|
313
|
+
probe_configuration_id == other.probe_configuration_id &&
|
|
314
|
+
start_time == other.start_time &&
|
|
315
|
+
target == other.target &&
|
|
316
|
+
vantage_point_name == other.vantage_point_name &&
|
|
317
|
+
is_timed_out == other.is_timed_out &&
|
|
318
|
+
is_healthy == other.is_healthy &&
|
|
319
|
+
error_category == other.error_category &&
|
|
320
|
+
error_message == other.error_message &&
|
|
321
|
+
protocol == other.protocol &&
|
|
322
|
+
connection == other.connection &&
|
|
323
|
+
dns == other.dns &&
|
|
324
|
+
domain_lookup_start == other.domain_lookup_start &&
|
|
325
|
+
domain_lookup_end == other.domain_lookup_end &&
|
|
326
|
+
latency_in_ms == other.latency_in_ms &&
|
|
327
|
+
icmp_code == other.icmp_code
|
|
328
|
+
end
|
|
329
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
330
|
+
|
|
331
|
+
# @see the `==` method
|
|
332
|
+
# @param [Object] other the other object to be compared
|
|
333
|
+
def eql?(other)
|
|
334
|
+
self == other
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
# Calculates hash code according to all attributes.
|
|
341
|
+
# @return [Fixnum] Hash code
|
|
342
|
+
def hash
|
|
343
|
+
[key, probe_configuration_id, start_time, target, vantage_point_name, is_timed_out, is_healthy, error_category, error_message, protocol, connection, dns, domain_lookup_start, domain_lookup_end, latency_in_ms, icmp_code].hash
|
|
344
|
+
end
|
|
345
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
346
|
+
|
|
347
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
# Builds the object from hash
|
|
351
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
352
|
+
# @return [Object] Returns the model itself
|
|
353
|
+
def build_from_hash(attributes)
|
|
354
|
+
return nil unless attributes.is_a?(Hash)
|
|
355
|
+
|
|
356
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
357
|
+
if type =~ /^Array<(.*)>/i
|
|
358
|
+
# check to ensure the input is an array given that the the attribute
|
|
359
|
+
# is documented as an array but the input is not
|
|
360
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
361
|
+
public_method("#{key}=").call(
|
|
362
|
+
attributes[self.class.attribute_map[key]]
|
|
363
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
364
|
+
)
|
|
365
|
+
end
|
|
366
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
367
|
+
public_method("#{key}=").call(
|
|
368
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
369
|
+
)
|
|
370
|
+
end
|
|
371
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
self
|
|
375
|
+
end
|
|
376
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
377
|
+
|
|
378
|
+
# Returns the string representation of the object
|
|
379
|
+
# @return [String] String presentation of the object
|
|
380
|
+
def to_s
|
|
381
|
+
to_hash.to_s
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
# Returns the object in the form of hash
|
|
385
|
+
# @return [Hash] Returns the object in the form of hash
|
|
386
|
+
def to_hash
|
|
387
|
+
hash = {}
|
|
388
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
389
|
+
value = public_method(attr).call
|
|
390
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
391
|
+
|
|
392
|
+
hash[param] = _to_hash(value)
|
|
393
|
+
end
|
|
394
|
+
hash
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
private
|
|
398
|
+
|
|
399
|
+
# Outputs non-array value in the form of hash
|
|
400
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
401
|
+
# @param [Object] value Any valid value
|
|
402
|
+
# @return [Hash] Returns the value in the form of hash
|
|
403
|
+
def _to_hash(value)
|
|
404
|
+
if value.is_a?(Array)
|
|
405
|
+
value.compact.map { |v| _to_hash(v) }
|
|
406
|
+
elsif value.is_a?(Hash)
|
|
407
|
+
{}.tap do |hash|
|
|
408
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
409
|
+
end
|
|
410
|
+
elsif value.respond_to? :to_hash
|
|
411
|
+
value.to_hash
|
|
412
|
+
else
|
|
413
|
+
value
|
|
414
|
+
end
|
|
415
|
+
end
|
|
416
|
+
end
|
|
417
|
+
end
|
|
418
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|