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,340 @@
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
+ # A summary containing all of the mutable and immutable properties for a ping monitor.
9
+ #
10
+ class Healthchecks::Models::PingMonitor # 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
+ # A user-friendly and mutable name suitable for display in a user interface.
51
+ # @return [String]
52
+ attr_accessor :display_name
53
+
54
+ # The monitor interval in seconds. Valid values: 10, 30, and 60.
55
+ #
56
+ # @return [Integer]
57
+ attr_accessor :interval_in_seconds
58
+
59
+ # Enables or disables the monitor. Set to 'true' to launch monitoring.
60
+ #
61
+ # @return [BOOLEAN]
62
+ attr_accessor :is_enabled
63
+
64
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
65
+ # predefined name, type, or namespace. For more information,
66
+ # see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
67
+ # Example: `{\"Department\": \"Finance\"}`
68
+ #
69
+ # @return [Hash<String, String>]
70
+ attr_accessor :freeform_tags
71
+
72
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
73
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
74
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
75
+ #
76
+ # @return [Hash<String, Hash<String, Object>>]
77
+ attr_accessor :defined_tags
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ # rubocop:disable Style/SymbolLiteral
83
+ 'id': :'id',
84
+ 'results_url': :'resultsUrl',
85
+ 'compartment_id': :'compartmentId',
86
+ 'targets': :'targets',
87
+ 'vantage_point_names': :'vantagePointNames',
88
+ 'port': :'port',
89
+ 'timeout_in_seconds': :'timeoutInSeconds',
90
+ 'protocol': :'protocol',
91
+ 'display_name': :'displayName',
92
+ 'interval_in_seconds': :'intervalInSeconds',
93
+ 'is_enabled': :'isEnabled',
94
+ 'freeform_tags': :'freeformTags',
95
+ 'defined_tags': :'definedTags'
96
+ # rubocop:enable Style/SymbolLiteral
97
+ }
98
+ end
99
+
100
+ # Attribute type mapping.
101
+ def self.swagger_types
102
+ {
103
+ # rubocop:disable Style/SymbolLiteral
104
+ 'id': :'String',
105
+ 'results_url': :'String',
106
+ 'compartment_id': :'String',
107
+ 'targets': :'Array<String>',
108
+ 'vantage_point_names': :'Array<String>',
109
+ 'port': :'Integer',
110
+ 'timeout_in_seconds': :'Integer',
111
+ 'protocol': :'String',
112
+ 'display_name': :'String',
113
+ 'interval_in_seconds': :'Integer',
114
+ 'is_enabled': :'BOOLEAN',
115
+ 'freeform_tags': :'Hash<String, String>',
116
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
117
+ # rubocop:enable Style/SymbolLiteral
118
+ }
119
+ end
120
+
121
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
122
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
123
+
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @option attributes [String] :id The value to assign to the {#id} property
128
+ # @option attributes [String] :results_url The value to assign to the {#results_url} property
129
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
130
+ # @option attributes [Array<String>] :targets The value to assign to the {#targets} property
131
+ # @option attributes [Array<String>] :vantage_point_names The value to assign to the {#vantage_point_names} property
132
+ # @option attributes [Integer] :port The value to assign to the {#port} property
133
+ # @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
134
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
135
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
136
+ # @option attributes [Integer] :interval_in_seconds The value to assign to the {#interval_in_seconds} property
137
+ # @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
138
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
139
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
140
+ def initialize(attributes = {})
141
+ return unless attributes.is_a?(Hash)
142
+
143
+ # convert string to symbol for hash key
144
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
145
+
146
+ self.id = attributes[:'id'] if attributes[:'id']
147
+
148
+ self.results_url = attributes[:'resultsUrl'] if attributes[:'resultsUrl']
149
+
150
+ raise 'You cannot provide both :resultsUrl and :results_url' if attributes.key?(:'resultsUrl') && attributes.key?(:'results_url')
151
+
152
+ self.results_url = attributes[:'results_url'] if attributes[:'results_url']
153
+
154
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
155
+
156
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
157
+
158
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
159
+
160
+ self.targets = attributes[:'targets'] if attributes[:'targets']
161
+
162
+ self.vantage_point_names = attributes[:'vantagePointNames'] if attributes[:'vantagePointNames']
163
+
164
+ raise 'You cannot provide both :vantagePointNames and :vantage_point_names' if attributes.key?(:'vantagePointNames') && attributes.key?(:'vantage_point_names')
165
+
166
+ self.vantage_point_names = attributes[:'vantage_point_names'] if attributes[:'vantage_point_names']
167
+
168
+ self.port = attributes[:'port'] if attributes[:'port']
169
+
170
+ self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
171
+
172
+ raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
173
+
174
+ self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
175
+
176
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
177
+
178
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
179
+
180
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
181
+
182
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
183
+
184
+ self.interval_in_seconds = attributes[:'intervalInSeconds'] if attributes[:'intervalInSeconds']
185
+
186
+ raise 'You cannot provide both :intervalInSeconds and :interval_in_seconds' if attributes.key?(:'intervalInSeconds') && attributes.key?(:'interval_in_seconds')
187
+
188
+ self.interval_in_seconds = attributes[:'interval_in_seconds'] if attributes[:'interval_in_seconds']
189
+
190
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
191
+ self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') # rubocop:disable Style/StringLiterals
192
+
193
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
194
+
195
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
196
+ self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') && !attributes.key?(:'is_enabled') # rubocop:disable Style/StringLiterals
197
+
198
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
199
+
200
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
201
+
202
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
203
+
204
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
205
+
206
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
207
+
208
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
209
+ end
210
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
211
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
212
+
213
+ # Custom attribute writer method checking allowed values (enum).
214
+ # @param [Object] protocol Object to be assigned
215
+ def protocol=(protocol)
216
+ # rubocop:disable Style/ConditionalAssignment
217
+ if protocol && !PROTOCOL_ENUM.include?(protocol)
218
+ # rubocop: disable Metrics/LineLength
219
+ OCI.logger.debug("Unknown value for 'protocol' [" + protocol + "]. Mapping to 'PROTOCOL_UNKNOWN_ENUM_VALUE'") if OCI.logger
220
+ # rubocop: enable Metrics/LineLength
221
+ @protocol = PROTOCOL_UNKNOWN_ENUM_VALUE
222
+ else
223
+ @protocol = protocol
224
+ end
225
+ # rubocop:enable Style/ConditionalAssignment
226
+ end
227
+
228
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
229
+
230
+
231
+ # Checks equality by comparing each attribute.
232
+ # @param [Object] other the other object to be compared
233
+ def ==(other)
234
+ return true if equal?(other)
235
+
236
+ self.class == other.class &&
237
+ id == other.id &&
238
+ results_url == other.results_url &&
239
+ compartment_id == other.compartment_id &&
240
+ targets == other.targets &&
241
+ vantage_point_names == other.vantage_point_names &&
242
+ port == other.port &&
243
+ timeout_in_seconds == other.timeout_in_seconds &&
244
+ protocol == other.protocol &&
245
+ display_name == other.display_name &&
246
+ interval_in_seconds == other.interval_in_seconds &&
247
+ is_enabled == other.is_enabled &&
248
+ freeform_tags == other.freeform_tags &&
249
+ defined_tags == other.defined_tags
250
+ end
251
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
252
+
253
+ # @see the `==` method
254
+ # @param [Object] other the other object to be compared
255
+ def eql?(other)
256
+ self == other
257
+ end
258
+
259
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
260
+
261
+
262
+ # Calculates hash code according to all attributes.
263
+ # @return [Fixnum] Hash code
264
+ def hash
265
+ [id, results_url, compartment_id, targets, vantage_point_names, port, timeout_in_seconds, protocol, display_name, interval_in_seconds, is_enabled, freeform_tags, defined_tags].hash
266
+ end
267
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
268
+
269
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
270
+
271
+
272
+ # Builds the object from hash
273
+ # @param [Hash] attributes Model attributes in the form of hash
274
+ # @return [Object] Returns the model itself
275
+ def build_from_hash(attributes)
276
+ return nil unless attributes.is_a?(Hash)
277
+
278
+ self.class.swagger_types.each_pair do |key, type|
279
+ if type =~ /^Array<(.*)>/i
280
+ # check to ensure the input is an array given that the the attribute
281
+ # is documented as an array but the input is not
282
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
283
+ public_method("#{key}=").call(
284
+ attributes[self.class.attribute_map[key]]
285
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
286
+ )
287
+ end
288
+ elsif !attributes[self.class.attribute_map[key]].nil?
289
+ public_method("#{key}=").call(
290
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
291
+ )
292
+ end
293
+ # or else data not found in attributes(hash), not an issue as the data can be optional
294
+ end
295
+
296
+ self
297
+ end
298
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
299
+
300
+ # Returns the string representation of the object
301
+ # @return [String] String presentation of the object
302
+ def to_s
303
+ to_hash.to_s
304
+ end
305
+
306
+ # Returns the object in the form of hash
307
+ # @return [Hash] Returns the object in the form of hash
308
+ def to_hash
309
+ hash = {}
310
+ self.class.attribute_map.each_pair do |attr, param|
311
+ value = public_method(attr).call
312
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
313
+
314
+ hash[param] = _to_hash(value)
315
+ end
316
+ hash
317
+ end
318
+
319
+ private
320
+
321
+ # Outputs non-array value in the form of hash
322
+ # For object, use to_hash. Otherwise, just return the value
323
+ # @param [Object] value Any valid value
324
+ # @return [Hash] Returns the value in the form of hash
325
+ def _to_hash(value)
326
+ if value.is_a?(Array)
327
+ value.compact.map { |v| _to_hash(v) }
328
+ elsif value.is_a?(Hash)
329
+ {}.tap do |hash|
330
+ value.each { |k, v| hash[k] = _to_hash(v) }
331
+ end
332
+ elsif value.respond_to? :to_hash
333
+ value.to_hash
334
+ else
335
+ value
336
+ end
337
+ end
338
+ end
339
+ end
340
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,290 @@
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 summary properties for an HTTP monitor.
9
+ #
10
+ class Healthchecks::Models::PingMonitorSummary # 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
+ # A user-friendly and mutable name suitable for display in a user interface.
30
+ # @return [String]
31
+ attr_accessor :display_name
32
+
33
+ # The monitor interval in seconds. Valid values: 10, 30, and 60.
34
+ #
35
+ # @return [Integer]
36
+ attr_accessor :interval_in_seconds
37
+
38
+ # Enables or disables the monitor. Set to 'true' to launch monitoring.
39
+ #
40
+ # @return [BOOLEAN]
41
+ attr_accessor :is_enabled
42
+
43
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
44
+ # predefined name, type, or namespace. For more information,
45
+ # see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
46
+ # Example: `{\"Department\": \"Finance\"}`
47
+ #
48
+ # @return [Hash<String, String>]
49
+ attr_accessor :freeform_tags
50
+
51
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
52
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
53
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
54
+ #
55
+ # @return [Hash<String, Hash<String, Object>>]
56
+ attr_accessor :defined_tags
57
+
58
+ # @return [String]
59
+ attr_reader :protocol
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ # rubocop:disable Style/SymbolLiteral
65
+ 'id': :'id',
66
+ 'results_url': :'resultsUrl',
67
+ 'compartment_id': :'compartmentId',
68
+ 'display_name': :'displayName',
69
+ 'interval_in_seconds': :'intervalInSeconds',
70
+ 'is_enabled': :'isEnabled',
71
+ 'freeform_tags': :'freeformTags',
72
+ 'defined_tags': :'definedTags',
73
+ 'protocol': :'protocol'
74
+ # rubocop:enable Style/SymbolLiteral
75
+ }
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.swagger_types
80
+ {
81
+ # rubocop:disable Style/SymbolLiteral
82
+ 'id': :'String',
83
+ 'results_url': :'String',
84
+ 'compartment_id': :'String',
85
+ 'display_name': :'String',
86
+ 'interval_in_seconds': :'Integer',
87
+ 'is_enabled': :'BOOLEAN',
88
+ 'freeform_tags': :'Hash<String, String>',
89
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
90
+ 'protocol': :'String'
91
+ # rubocop:enable Style/SymbolLiteral
92
+ }
93
+ end
94
+
95
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
96
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
97
+
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @option attributes [String] :id The value to assign to the {#id} property
102
+ # @option attributes [String] :results_url The value to assign to the {#results_url} property
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 [Integer] :interval_in_seconds The value to assign to the {#interval_in_seconds} property
106
+ # @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} 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
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
110
+ def initialize(attributes = {})
111
+ return unless attributes.is_a?(Hash)
112
+
113
+ # convert string to symbol for hash key
114
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
115
+
116
+ self.id = attributes[:'id'] if attributes[:'id']
117
+
118
+ self.results_url = attributes[:'resultsUrl'] if attributes[:'resultsUrl']
119
+
120
+ raise 'You cannot provide both :resultsUrl and :results_url' if attributes.key?(:'resultsUrl') && attributes.key?(:'results_url')
121
+
122
+ self.results_url = attributes[:'results_url'] if attributes[:'results_url']
123
+
124
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
125
+
126
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
127
+
128
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
129
+
130
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
131
+
132
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
133
+
134
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
135
+
136
+ self.interval_in_seconds = attributes[:'intervalInSeconds'] if attributes[:'intervalInSeconds']
137
+
138
+ raise 'You cannot provide both :intervalInSeconds and :interval_in_seconds' if attributes.key?(:'intervalInSeconds') && attributes.key?(:'interval_in_seconds')
139
+
140
+ self.interval_in_seconds = attributes[:'interval_in_seconds'] if attributes[:'interval_in_seconds']
141
+
142
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
143
+ self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') # rubocop:disable Style/StringLiterals
144
+
145
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
146
+
147
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
148
+ self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') && !attributes.key?(:'is_enabled') # rubocop:disable Style/StringLiterals
149
+
150
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
151
+
152
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
153
+
154
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
155
+
156
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
157
+
158
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
159
+
160
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
161
+
162
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
163
+ end
164
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
165
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
166
+
167
+ # Custom attribute writer method checking allowed values (enum).
168
+ # @param [Object] protocol Object to be assigned
169
+ def protocol=(protocol)
170
+ # rubocop:disable Style/ConditionalAssignment
171
+ if protocol && !PROTOCOL_ENUM.include?(protocol)
172
+ # rubocop: disable Metrics/LineLength
173
+ OCI.logger.debug("Unknown value for 'protocol' [" + protocol + "]. Mapping to 'PROTOCOL_UNKNOWN_ENUM_VALUE'") if OCI.logger
174
+ # rubocop: enable Metrics/LineLength
175
+ @protocol = PROTOCOL_UNKNOWN_ENUM_VALUE
176
+ else
177
+ @protocol = protocol
178
+ end
179
+ # rubocop:enable Style/ConditionalAssignment
180
+ end
181
+
182
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
183
+
184
+
185
+ # Checks equality by comparing each attribute.
186
+ # @param [Object] other the other object to be compared
187
+ def ==(other)
188
+ return true if equal?(other)
189
+
190
+ self.class == other.class &&
191
+ id == other.id &&
192
+ results_url == other.results_url &&
193
+ compartment_id == other.compartment_id &&
194
+ display_name == other.display_name &&
195
+ interval_in_seconds == other.interval_in_seconds &&
196
+ is_enabled == other.is_enabled &&
197
+ freeform_tags == other.freeform_tags &&
198
+ defined_tags == other.defined_tags &&
199
+ protocol == other.protocol
200
+ end
201
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
202
+
203
+ # @see the `==` method
204
+ # @param [Object] other the other object to be compared
205
+ def eql?(other)
206
+ self == other
207
+ end
208
+
209
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
210
+
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Fixnum] Hash code
214
+ def hash
215
+ [id, results_url, compartment_id, display_name, interval_in_seconds, is_enabled, freeform_tags, defined_tags, protocol].hash
216
+ end
217
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
218
+
219
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
220
+
221
+
222
+ # Builds the object from hash
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ # @return [Object] Returns the model itself
225
+ def build_from_hash(attributes)
226
+ return nil unless attributes.is_a?(Hash)
227
+
228
+ self.class.swagger_types.each_pair do |key, type|
229
+ if type =~ /^Array<(.*)>/i
230
+ # check to ensure the input is an array given that the the attribute
231
+ # is documented as an array but the input is not
232
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
233
+ public_method("#{key}=").call(
234
+ attributes[self.class.attribute_map[key]]
235
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
236
+ )
237
+ end
238
+ elsif !attributes[self.class.attribute_map[key]].nil?
239
+ public_method("#{key}=").call(
240
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
241
+ )
242
+ end
243
+ # or else data not found in attributes(hash), not an issue as the data can be optional
244
+ end
245
+
246
+ self
247
+ end
248
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
249
+
250
+ # Returns the string representation of the object
251
+ # @return [String] String presentation of the object
252
+ def to_s
253
+ to_hash.to_s
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = public_method(attr).call
262
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ private
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+ end
289
+ end
290
+ # rubocop:enable Lint/UnneededCopDisableDirective