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.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/oci.rb +2 -0
  4. data/lib/oci/database/database.rb +1 -0
  5. data/lib/oci/database/models/database.rb +18 -4
  6. data/lib/oci/database/models/database_connection_strings.rb +182 -0
  7. data/lib/oci/database/models/database_summary.rb +18 -4
  8. data/lib/oci/dns/dns.rb +23 -0
  9. data/lib/oci/dns/dns_client.rb +802 -75
  10. data/lib/oci/dns/dns_client_composite_operations.rb +238 -0
  11. data/lib/oci/dns/models/create_steering_policy_attachment_details.rb +205 -0
  12. data/lib/oci/dns/models/create_steering_policy_details.rb +333 -0
  13. data/lib/oci/dns/models/steering_policy.rb +418 -0
  14. data/lib/oci/dns/models/steering_policy_answer.rb +205 -0
  15. data/lib/oci/dns/models/steering_policy_attachment.rb +308 -0
  16. data/lib/oci/dns/models/steering_policy_attachment_summary.rb +304 -0
  17. data/lib/oci/dns/models/steering_policy_filter_answer_data.rb +168 -0
  18. data/lib/oci/dns/models/steering_policy_filter_rule.rb +178 -0
  19. data/lib/oci/dns/models/steering_policy_filter_rule_case.rb +165 -0
  20. data/lib/oci/dns/models/steering_policy_health_rule.rb +160 -0
  21. data/lib/oci/dns/models/steering_policy_health_rule_case.rb +152 -0
  22. data/lib/oci/dns/models/steering_policy_limit_rule.rb +179 -0
  23. data/lib/oci/dns/models/steering_policy_limit_rule_case.rb +162 -0
  24. data/lib/oci/dns/models/steering_policy_priority_answer_data.rb +161 -0
  25. data/lib/oci/dns/models/steering_policy_priority_rule.rb +178 -0
  26. data/lib/oci/dns/models/steering_policy_priority_rule_case.rb +165 -0
  27. data/lib/oci/dns/models/steering_policy_rule.rb +237 -0
  28. data/lib/oci/dns/models/steering_policy_summary.rb +391 -0
  29. data/lib/oci/dns/models/steering_policy_weighted_answer_data.rb +161 -0
  30. data/lib/oci/dns/models/steering_policy_weighted_rule.rb +178 -0
  31. data/lib/oci/dns/models/steering_policy_weighted_rule_case.rb +165 -0
  32. data/lib/oci/dns/models/update_steering_policy_attachment_details.rb +156 -0
  33. data/lib/oci/dns/models/update_steering_policy_details.rb +319 -0
  34. data/lib/oci/email/email.rb +1 -0
  35. data/lib/oci/email/email_client.rb +87 -16
  36. data/lib/oci/email/email_client_composite_operations.rb +40 -0
  37. data/lib/oci/email/models/create_sender_details.rb +40 -6
  38. data/lib/oci/email/models/create_suppression_details.rb +2 -2
  39. data/lib/oci/email/models/sender.rb +53 -5
  40. data/lib/oci/email/models/sender_summary.rb +38 -4
  41. data/lib/oci/email/models/suppression.rb +20 -3
  42. data/lib/oci/email/models/update_sender_details.rb +174 -0
  43. data/lib/oci/healthchecks/health_checks_client.rb +1137 -0
  44. data/lib/oci/healthchecks/health_checks_client_composite_operations.rb +24 -0
  45. data/lib/oci/healthchecks/healthchecks.rb +41 -0
  46. data/lib/oci/healthchecks/models/connection.rb +159 -0
  47. data/lib/oci/healthchecks/models/create_http_monitor_details.rb +359 -0
  48. data/lib/oci/healthchecks/models/create_on_demand_http_probe_details.rb +278 -0
  49. data/lib/oci/healthchecks/models/create_on_demand_ping_probe_details.rb +229 -0
  50. data/lib/oci/healthchecks/models/create_ping_monitor_details.rb +310 -0
  51. data/lib/oci/healthchecks/models/dns.rb +165 -0
  52. data/lib/oci/healthchecks/models/geolocation.rb +239 -0
  53. data/lib/oci/healthchecks/models/health_checks_vantage_point_summary.rb +211 -0
  54. data/lib/oci/healthchecks/models/http_monitor.rb +395 -0
  55. data/lib/oci/healthchecks/models/http_monitor_summary.rb +290 -0
  56. data/lib/oci/healthchecks/models/http_probe.rb +314 -0
  57. data/lib/oci/healthchecks/models/http_probe_method.rb +10 -0
  58. data/lib/oci/healthchecks/models/http_probe_protocol.rb +10 -0
  59. data/lib/oci/healthchecks/models/http_probe_result_summary.rb +542 -0
  60. data/lib/oci/healthchecks/models/ping_monitor.rb +340 -0
  61. data/lib/oci/healthchecks/models/ping_monitor_summary.rb +290 -0
  62. data/lib/oci/healthchecks/models/ping_probe.rb +259 -0
  63. data/lib/oci/healthchecks/models/ping_probe_protocol.rb +10 -0
  64. data/lib/oci/healthchecks/models/ping_probe_result_summary.rb +418 -0
  65. data/lib/oci/healthchecks/models/routing.rb +192 -0
  66. data/lib/oci/healthchecks/models/tcp_connection.rb +189 -0
  67. data/lib/oci/healthchecks/models/update_http_monitor_details.rb +339 -0
  68. data/lib/oci/healthchecks/models/update_ping_monitor_details.rb +292 -0
  69. data/lib/oci/healthchecks/util.rb +2 -0
  70. data/lib/oci/regions.rb +3 -1
  71. data/lib/oci/version.rb +1 -1
  72. data/lib/oci/waas/models/access_rule.rb +283 -0
  73. data/lib/oci/waas/models/access_rule_criteria.rb +206 -0
  74. data/lib/oci/waas/models/address_rate_limiting.rb +195 -0
  75. data/lib/oci/waas/models/block_challenge_settings.rb +288 -0
  76. data/lib/oci/waas/models/captcha.rb +231 -0
  77. data/lib/oci/waas/models/certificate.rb +383 -0
  78. data/lib/oci/waas/models/certificate_extensions.rb +170 -0
  79. data/lib/oci/waas/models/certificate_public_key_info.rb +170 -0
  80. data/lib/oci/waas/models/certificate_subject_name.rb +218 -0
  81. data/lib/oci/waas/models/certificate_summary.rb +274 -0
  82. data/lib/oci/waas/models/create_certificate_details.rb +241 -0
  83. data/lib/oci/waas/models/create_waas_policy_details.rb +257 -0
  84. data/lib/oci/waas/models/device_fingerprint_challenge.rb +268 -0
  85. data/lib/oci/waas/models/edge_subnet.rb +173 -0
  86. data/lib/oci/waas/models/good_bot.rb +183 -0
  87. data/lib/oci/waas/models/header.rb +159 -0
  88. data/lib/oci/waas/models/human_interaction_challenge.rb +282 -0
  89. data/lib/oci/waas/models/js_challenge.rb +240 -0
  90. data/lib/oci/waas/models/lifecycle_states.rb +14 -0
  91. data/lib/oci/waas/models/origin.rb +191 -0
  92. data/lib/oci/waas/models/policy_config.rb +181 -0
  93. data/lib/oci/waas/models/protection_rule.rb +237 -0
  94. data/lib/oci/waas/models/protection_rule_action.rb +185 -0
  95. data/lib/oci/waas/models/protection_rule_exclusion.rb +182 -0
  96. data/lib/oci/waas/models/protection_settings.rb +404 -0
  97. data/lib/oci/waas/models/recommendation.rb +210 -0
  98. data/lib/oci/waas/models/threat_feed.rb +202 -0
  99. data/lib/oci/waas/models/threat_feed_action.rb +175 -0
  100. data/lib/oci/waas/models/update_certificate_details.rb +183 -0
  101. data/lib/oci/waas/models/update_waas_policy_details.rb +233 -0
  102. data/lib/oci/waas/models/waas_policy.rb +331 -0
  103. data/lib/oci/waas/models/waas_policy_summary.rb +271 -0
  104. data/lib/oci/waas/models/waf_blocked_request.rb +219 -0
  105. data/lib/oci/waas/models/waf_config.rb +295 -0
  106. data/lib/oci/waas/models/waf_config_details.rb +253 -0
  107. data/lib/oci/waas/models/waf_log.rb +510 -0
  108. data/lib/oci/waas/models/waf_meter_datum.rb +279 -0
  109. data/lib/oci/waas/models/waf_request.rb +177 -0
  110. data/lib/oci/waas/models/waf_traffic_datum.rb +223 -0
  111. data/lib/oci/waas/models/whitelist.rb +159 -0
  112. data/lib/oci/waas/models/work_request.rb +322 -0
  113. data/lib/oci/waas/models/work_request_error.rb +170 -0
  114. data/lib/oci/waas/models/work_request_log_entry.rb +159 -0
  115. data/lib/oci/waas/models/work_request_operation_types.rb +12 -0
  116. data/lib/oci/waas/models/work_request_resource.rb +217 -0
  117. data/lib/oci/waas/models/work_request_status_values.rb +14 -0
  118. data/lib/oci/waas/models/work_request_summary.rb +302 -0
  119. data/lib/oci/waas/util.rb +2 -0
  120. data/lib/oci/waas/waas.rb +66 -0
  121. data/lib/oci/waas/waas_client.rb +3044 -0
  122. data/lib/oci/waas/waas_client_composite_operations.rb +990 -0
  123. metadata +105 -2
@@ -0,0 +1,310 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # The request body used to create a Ping monitor.
8
+ class Healthchecks::Models::CreatePingMonitorDetails # rubocop:disable Metrics/LineLength
9
+ PROTOCOL_ENUM = [
10
+ PROTOCOL_ICMP = 'ICMP'.freeze,
11
+ PROTOCOL_TCP = 'TCP'.freeze
12
+ ].freeze
13
+
14
+ # **[Required]** The OCID of the compartment.
15
+ # @return [String]
16
+ attr_accessor :compartment_id
17
+
18
+ # This attribute is required.
19
+ # @return [Array<String>]
20
+ attr_accessor :targets
21
+
22
+ # @return [Array<String>]
23
+ attr_accessor :vantage_point_names
24
+
25
+ # The port on which to probe endpoints. If unspecified, probes will use the
26
+ # default port of their protocol.
27
+ #
28
+ # @return [Integer]
29
+ attr_accessor :port
30
+
31
+ # The probe timeout in seconds. Valid values: 10, 20, 30, and 60.
32
+ # The probe timeout must be less than or equal to `intervalInSeconds` for monitors.
33
+ #
34
+ # @return [Integer]
35
+ attr_accessor :timeout_in_seconds
36
+
37
+ # This attribute is required.
38
+ # @return [String]
39
+ attr_reader :protocol
40
+
41
+ # **[Required]** A user-friendly and mutable name suitable for display in a user interface.
42
+ # @return [String]
43
+ attr_accessor :display_name
44
+
45
+ # **[Required]** The monitor interval in seconds. Valid values: 10, 30, and 60.
46
+ #
47
+ # @return [Integer]
48
+ attr_accessor :interval_in_seconds
49
+
50
+ # Enables or disables the monitor. Set to 'true' to launch monitoring.
51
+ #
52
+ # @return [BOOLEAN]
53
+ attr_accessor :is_enabled
54
+
55
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
56
+ # predefined name, type, or namespace. For more information,
57
+ # see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
58
+ # Example: `{\"Department\": \"Finance\"}`
59
+ #
60
+ # @return [Hash<String, String>]
61
+ attr_accessor :freeform_tags
62
+
63
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
64
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
65
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
66
+ #
67
+ # @return [Hash<String, Hash<String, Object>>]
68
+ attr_accessor :defined_tags
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ # rubocop:disable Style/SymbolLiteral
74
+ 'compartment_id': :'compartmentId',
75
+ 'targets': :'targets',
76
+ 'vantage_point_names': :'vantagePointNames',
77
+ 'port': :'port',
78
+ 'timeout_in_seconds': :'timeoutInSeconds',
79
+ 'protocol': :'protocol',
80
+ 'display_name': :'displayName',
81
+ 'interval_in_seconds': :'intervalInSeconds',
82
+ 'is_enabled': :'isEnabled',
83
+ 'freeform_tags': :'freeformTags',
84
+ 'defined_tags': :'definedTags'
85
+ # rubocop:enable Style/SymbolLiteral
86
+ }
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.swagger_types
91
+ {
92
+ # rubocop:disable Style/SymbolLiteral
93
+ 'compartment_id': :'String',
94
+ 'targets': :'Array<String>',
95
+ 'vantage_point_names': :'Array<String>',
96
+ 'port': :'Integer',
97
+ 'timeout_in_seconds': :'Integer',
98
+ 'protocol': :'String',
99
+ 'display_name': :'String',
100
+ 'interval_in_seconds': :'Integer',
101
+ 'is_enabled': :'BOOLEAN',
102
+ 'freeform_tags': :'Hash<String, String>',
103
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
104
+ # rubocop:enable Style/SymbolLiteral
105
+ }
106
+ end
107
+
108
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
109
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
110
+
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
115
+ # @option attributes [Array<String>] :targets The value to assign to the {#targets} property
116
+ # @option attributes [Array<String>] :vantage_point_names The value to assign to the {#vantage_point_names} property
117
+ # @option attributes [Integer] :port The value to assign to the {#port} property
118
+ # @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
119
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
120
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
121
+ # @option attributes [Integer] :interval_in_seconds The value to assign to the {#interval_in_seconds} property
122
+ # @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
123
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
124
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
125
+ def initialize(attributes = {})
126
+ return unless attributes.is_a?(Hash)
127
+
128
+ # convert string to symbol for hash key
129
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
130
+
131
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
132
+
133
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
134
+
135
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
136
+
137
+ self.targets = attributes[:'targets'] if attributes[:'targets']
138
+
139
+ self.vantage_point_names = attributes[:'vantagePointNames'] if attributes[:'vantagePointNames']
140
+
141
+ raise 'You cannot provide both :vantagePointNames and :vantage_point_names' if attributes.key?(:'vantagePointNames') && attributes.key?(:'vantage_point_names')
142
+
143
+ self.vantage_point_names = attributes[:'vantage_point_names'] if attributes[:'vantage_point_names']
144
+
145
+ self.port = attributes[:'port'] if attributes[:'port']
146
+
147
+ self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
148
+
149
+ raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
150
+
151
+ self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
152
+
153
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
154
+
155
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
156
+
157
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
158
+
159
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
160
+
161
+ self.interval_in_seconds = attributes[:'intervalInSeconds'] if attributes[:'intervalInSeconds']
162
+
163
+ raise 'You cannot provide both :intervalInSeconds and :interval_in_seconds' if attributes.key?(:'intervalInSeconds') && attributes.key?(:'interval_in_seconds')
164
+
165
+ self.interval_in_seconds = attributes[:'interval_in_seconds'] if attributes[:'interval_in_seconds']
166
+
167
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
168
+ self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') # rubocop:disable Style/StringLiterals
169
+
170
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
171
+
172
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
173
+ self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') && !attributes.key?(:'is_enabled') # rubocop:disable Style/StringLiterals
174
+
175
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
176
+
177
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
178
+
179
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
180
+
181
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
182
+
183
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
184
+
185
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
186
+ end
187
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
188
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
189
+
190
+ # Custom attribute writer method checking allowed values (enum).
191
+ # @param [Object] protocol Object to be assigned
192
+ def protocol=(protocol)
193
+ # rubocop: disable Metrics/LineLength
194
+ raise "Invalid value for 'protocol': this must be one of the values in PROTOCOL_ENUM." if protocol && !PROTOCOL_ENUM.include?(protocol)
195
+
196
+ # rubocop: enable Metrics/LineLength
197
+ @protocol = protocol
198
+ end
199
+
200
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
201
+
202
+
203
+ # Checks equality by comparing each attribute.
204
+ # @param [Object] other the other object to be compared
205
+ def ==(other)
206
+ return true if equal?(other)
207
+
208
+ self.class == other.class &&
209
+ compartment_id == other.compartment_id &&
210
+ targets == other.targets &&
211
+ vantage_point_names == other.vantage_point_names &&
212
+ port == other.port &&
213
+ timeout_in_seconds == other.timeout_in_seconds &&
214
+ protocol == other.protocol &&
215
+ display_name == other.display_name &&
216
+ interval_in_seconds == other.interval_in_seconds &&
217
+ is_enabled == other.is_enabled &&
218
+ freeform_tags == other.freeform_tags &&
219
+ defined_tags == other.defined_tags
220
+ end
221
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
222
+
223
+ # @see the `==` method
224
+ # @param [Object] other the other object to be compared
225
+ def eql?(other)
226
+ self == other
227
+ end
228
+
229
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
230
+
231
+
232
+ # Calculates hash code according to all attributes.
233
+ # @return [Fixnum] Hash code
234
+ def hash
235
+ [compartment_id, targets, vantage_point_names, port, timeout_in_seconds, protocol, display_name, interval_in_seconds, is_enabled, freeform_tags, defined_tags].hash
236
+ end
237
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
238
+
239
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
240
+
241
+
242
+ # Builds the object from hash
243
+ # @param [Hash] attributes Model attributes in the form of hash
244
+ # @return [Object] Returns the model itself
245
+ def build_from_hash(attributes)
246
+ return nil unless attributes.is_a?(Hash)
247
+
248
+ self.class.swagger_types.each_pair do |key, type|
249
+ if type =~ /^Array<(.*)>/i
250
+ # check to ensure the input is an array given that the the attribute
251
+ # is documented as an array but the input is not
252
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
253
+ public_method("#{key}=").call(
254
+ attributes[self.class.attribute_map[key]]
255
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
256
+ )
257
+ end
258
+ elsif !attributes[self.class.attribute_map[key]].nil?
259
+ public_method("#{key}=").call(
260
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
261
+ )
262
+ end
263
+ # or else data not found in attributes(hash), not an issue as the data can be optional
264
+ end
265
+
266
+ self
267
+ end
268
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
269
+
270
+ # Returns the string representation of the object
271
+ # @return [String] String presentation of the object
272
+ def to_s
273
+ to_hash.to_s
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = public_method(attr).call
282
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ private
290
+
291
+ # Outputs non-array value in the form of hash
292
+ # For object, use to_hash. Otherwise, just return the value
293
+ # @param [Object] value Any valid value
294
+ # @return [Hash] Returns the value in the form of hash
295
+ def _to_hash(value)
296
+ if value.is_a?(Array)
297
+ value.compact.map { |v| _to_hash(v) }
298
+ elsif value.is_a?(Hash)
299
+ {}.tap do |hash|
300
+ value.each { |k, v| hash[k] = _to_hash(v) }
301
+ end
302
+ elsif value.respond_to? :to_hash
303
+ value.to_hash
304
+ else
305
+ value
306
+ end
307
+ end
308
+ end
309
+ end
310
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,165 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # The DNS resolution results.
8
+ class Healthchecks::Models::DNS # rubocop:disable Metrics/LineLength
9
+ # Total DNS resolution duration, in milliseconds. Calculated using `domainLookupEnd`
10
+ # minus `domainLookupStart`.
11
+ #
12
+ # @return [Float]
13
+ attr_accessor :domain_lookup_duration
14
+
15
+ # The addresses returned by DNS resolution.
16
+ # @return [Array<String>]
17
+ attr_accessor :addresses
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ # rubocop:disable Style/SymbolLiteral
23
+ 'domain_lookup_duration': :'domainLookupDuration',
24
+ 'addresses': :'addresses'
25
+ # rubocop:enable Style/SymbolLiteral
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ # rubocop:disable Style/SymbolLiteral
33
+ 'domain_lookup_duration': :'Float',
34
+ 'addresses': :'Array<String>'
35
+ # rubocop:enable Style/SymbolLiteral
36
+ }
37
+ end
38
+
39
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
40
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
41
+
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ # @option attributes [Float] :domain_lookup_duration The value to assign to the {#domain_lookup_duration} property
46
+ # @option attributes [Array<String>] :addresses The value to assign to the {#addresses} property
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ self.domain_lookup_duration = attributes[:'domainLookupDuration'] if attributes[:'domainLookupDuration']
54
+
55
+ raise 'You cannot provide both :domainLookupDuration and :domain_lookup_duration' if attributes.key?(:'domainLookupDuration') && attributes.key?(:'domain_lookup_duration')
56
+
57
+ self.domain_lookup_duration = attributes[:'domain_lookup_duration'] if attributes[:'domain_lookup_duration']
58
+
59
+ self.addresses = attributes[:'addresses'] if attributes[:'addresses']
60
+ end
61
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
62
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
63
+
64
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
65
+
66
+
67
+ # Checks equality by comparing each attribute.
68
+ # @param [Object] other the other object to be compared
69
+ def ==(other)
70
+ return true if equal?(other)
71
+
72
+ self.class == other.class &&
73
+ domain_lookup_duration == other.domain_lookup_duration &&
74
+ addresses == other.addresses
75
+ end
76
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
77
+
78
+ # @see the `==` method
79
+ # @param [Object] other the other object to be compared
80
+ def eql?(other)
81
+ self == other
82
+ end
83
+
84
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
85
+
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Fixnum] Hash code
89
+ def hash
90
+ [domain_lookup_duration, addresses].hash
91
+ end
92
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
93
+
94
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
95
+
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def build_from_hash(attributes)
101
+ return nil unless attributes.is_a?(Hash)
102
+
103
+ self.class.swagger_types.each_pair do |key, type|
104
+ if type =~ /^Array<(.*)>/i
105
+ # check to ensure the input is an array given that the the attribute
106
+ # is documented as an array but the input is not
107
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
108
+ public_method("#{key}=").call(
109
+ attributes[self.class.attribute_map[key]]
110
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
111
+ )
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ public_method("#{key}=").call(
115
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
116
+ )
117
+ end
118
+ # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
124
+
125
+ # Returns the string representation of the object
126
+ # @return [String] String presentation of the object
127
+ def to_s
128
+ to_hash.to_s
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = public_method(attr).call
137
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
138
+
139
+ hash[param] = _to_hash(value)
140
+ end
141
+ hash
142
+ end
143
+
144
+ private
145
+
146
+ # Outputs non-array value in the form of hash
147
+ # For object, use to_hash. Otherwise, just return the value
148
+ # @param [Object] value Any valid value
149
+ # @return [Hash] Returns the value in the form of hash
150
+ def _to_hash(value)
151
+ if value.is_a?(Array)
152
+ value.compact.map { |v| _to_hash(v) }
153
+ elsif value.is_a?(Hash)
154
+ {}.tap do |hash|
155
+ value.each { |k, v| hash[k] = _to_hash(v) }
156
+ end
157
+ elsif value.respond_to? :to_hash
158
+ value.to_hash
159
+ else
160
+ value
161
+ end
162
+ end
163
+ end
164
+ end
165
+ # rubocop:enable Lint/UnneededCopDisableDirective