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,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
+ # A summary containing all of the mutable and immutable properties for an HTTP monitor.
9
+ #
10
+ class Healthchecks::Models::HttpMonitorSummary # rubocop:disable Metrics/LineLength
11
+ PROTOCOL_ENUM = [
12
+ PROTOCOL_HTTP = 'HTTP'.freeze,
13
+ PROTOCOL_HTTPS = 'HTTPS'.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
@@ -0,0 +1,314 @@
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 that contains all of the mutable and immutable properties for an HTTP probe.
9
+ #
10
+ class Healthchecks::Models::HttpProbe # rubocop:disable Metrics/LineLength
11
+ PROTOCOL_ENUM = [
12
+ PROTOCOL_HTTP = 'HTTP'.freeze,
13
+ PROTOCOL_HTTPS = 'HTTPS'.freeze,
14
+ PROTOCOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
15
+ ].freeze
16
+
17
+ METHOD_ENUM = [
18
+ METHOD_GET = 'GET'.freeze,
19
+ METHOD_HEAD = 'HEAD'.freeze,
20
+ METHOD_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
21
+ ].freeze
22
+
23
+ # The OCID of the resource.
24
+ # @return [String]
25
+ attr_accessor :id
26
+
27
+ # A URL for fetching the probe results.
28
+ # @return [String]
29
+ attr_accessor :results_url
30
+
31
+ # The OCID of the compartment.
32
+ # @return [String]
33
+ attr_accessor :compartment_id
34
+
35
+ # @return [Array<String>]
36
+ attr_accessor :targets
37
+
38
+ # @return [Array<String>]
39
+ attr_accessor :vantage_point_names
40
+
41
+ # The port on which to probe endpoints. If unspecified, probes will use the
42
+ # default port of their protocol.
43
+ #
44
+ # @return [Integer]
45
+ attr_accessor :port
46
+
47
+ # The probe timeout in seconds. Valid values: 10, 20, 30, and 60.
48
+ # The probe timeout must be less than or equal to `intervalInSeconds` for monitors.
49
+ #
50
+ # @return [Integer]
51
+ attr_accessor :timeout_in_seconds
52
+
53
+ # @return [String]
54
+ attr_reader :protocol
55
+
56
+ # @return [String]
57
+ attr_reader :method
58
+
59
+ # The optional URL path to probe, including query parameters.
60
+ # @return [String]
61
+ attr_accessor :path
62
+
63
+ # A dictionary of HTTP request headers.
64
+ #
65
+ # *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header.
66
+ #
67
+ # @return [Hash<String, String>]
68
+ attr_accessor :headers
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ # rubocop:disable Style/SymbolLiteral
74
+ 'id': :'id',
75
+ 'results_url': :'resultsUrl',
76
+ 'compartment_id': :'compartmentId',
77
+ 'targets': :'targets',
78
+ 'vantage_point_names': :'vantagePointNames',
79
+ 'port': :'port',
80
+ 'timeout_in_seconds': :'timeoutInSeconds',
81
+ 'protocol': :'protocol',
82
+ 'method': :'method',
83
+ 'path': :'path',
84
+ 'headers': :'headers'
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
+ 'id': :'String',
94
+ 'results_url': :'String',
95
+ 'compartment_id': :'String',
96
+ 'targets': :'Array<String>',
97
+ 'vantage_point_names': :'Array<String>',
98
+ 'port': :'Integer',
99
+ 'timeout_in_seconds': :'Integer',
100
+ 'protocol': :'String',
101
+ 'method': :'String',
102
+ 'path': :'String',
103
+ 'headers': :'Hash<String, String>'
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] :id The value to assign to the {#id} property
115
+ # @option attributes [String] :results_url The value to assign to the {#results_url} property
116
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
117
+ # @option attributes [Array<String>] :targets The value to assign to the {#targets} property
118
+ # @option attributes [Array<String>] :vantage_point_names The value to assign to the {#vantage_point_names} property
119
+ # @option attributes [Integer] :port The value to assign to the {#port} property
120
+ # @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
121
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
122
+ # @option attributes [String] :method The value to assign to the {#method} property
123
+ # @option attributes [String] :path The value to assign to the {#path} property
124
+ # @option attributes [Hash<String, String>] :headers The value to assign to the {#headers} 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.id = attributes[:'id'] if attributes[:'id']
132
+
133
+ self.results_url = attributes[:'resultsUrl'] if attributes[:'resultsUrl']
134
+
135
+ raise 'You cannot provide both :resultsUrl and :results_url' if attributes.key?(:'resultsUrl') && attributes.key?(:'results_url')
136
+
137
+ self.results_url = attributes[:'results_url'] if attributes[:'results_url']
138
+
139
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
140
+
141
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
142
+
143
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
144
+
145
+ self.targets = attributes[:'targets'] if attributes[:'targets']
146
+
147
+ self.vantage_point_names = attributes[:'vantagePointNames'] if attributes[:'vantagePointNames']
148
+
149
+ raise 'You cannot provide both :vantagePointNames and :vantage_point_names' if attributes.key?(:'vantagePointNames') && attributes.key?(:'vantage_point_names')
150
+
151
+ self.vantage_point_names = attributes[:'vantage_point_names'] if attributes[:'vantage_point_names']
152
+
153
+ self.port = attributes[:'port'] if attributes[:'port']
154
+
155
+ self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
156
+
157
+ raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
158
+
159
+ self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
160
+
161
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
162
+
163
+ self.method = attributes[:'method'] if attributes[:'method']
164
+ self.method = "HEAD" if method.nil? && !attributes.key?(:'method') # rubocop:disable Style/StringLiterals
165
+
166
+ self.path = attributes[:'path'] if attributes[:'path']
167
+ self.path = "/" if path.nil? && !attributes.key?(:'path') # rubocop:disable Style/StringLiterals
168
+
169
+ self.headers = attributes[:'headers'] if attributes[:'headers']
170
+ end
171
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
172
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
173
+
174
+ # Custom attribute writer method checking allowed values (enum).
175
+ # @param [Object] protocol Object to be assigned
176
+ def protocol=(protocol)
177
+ # rubocop:disable Style/ConditionalAssignment
178
+ if protocol && !PROTOCOL_ENUM.include?(protocol)
179
+ # rubocop: disable Metrics/LineLength
180
+ OCI.logger.debug("Unknown value for 'protocol' [" + protocol + "]. Mapping to 'PROTOCOL_UNKNOWN_ENUM_VALUE'") if OCI.logger
181
+ # rubocop: enable Metrics/LineLength
182
+ @protocol = PROTOCOL_UNKNOWN_ENUM_VALUE
183
+ else
184
+ @protocol = protocol
185
+ end
186
+ # rubocop:enable Style/ConditionalAssignment
187
+ end
188
+
189
+ # Custom attribute writer method checking allowed values (enum).
190
+ # @param [Object] method Object to be assigned
191
+ def method=(method)
192
+ # rubocop:disable Style/ConditionalAssignment
193
+ if method && !METHOD_ENUM.include?(method)
194
+ # rubocop: disable Metrics/LineLength
195
+ OCI.logger.debug("Unknown value for 'method' [" + method + "]. Mapping to 'METHOD_UNKNOWN_ENUM_VALUE'") if OCI.logger
196
+ # rubocop: enable Metrics/LineLength
197
+ @method = METHOD_UNKNOWN_ENUM_VALUE
198
+ else
199
+ @method = method
200
+ end
201
+ # rubocop:enable Style/ConditionalAssignment
202
+ end
203
+
204
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
205
+
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] other the other object to be compared
209
+ def ==(other)
210
+ return true if equal?(other)
211
+
212
+ self.class == other.class &&
213
+ id == other.id &&
214
+ results_url == other.results_url &&
215
+ compartment_id == other.compartment_id &&
216
+ targets == other.targets &&
217
+ vantage_point_names == other.vantage_point_names &&
218
+ port == other.port &&
219
+ timeout_in_seconds == other.timeout_in_seconds &&
220
+ protocol == other.protocol &&
221
+ method == other.method &&
222
+ path == other.path &&
223
+ headers == other.headers
224
+ end
225
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
226
+
227
+ # @see the `==` method
228
+ # @param [Object] other the other object to be compared
229
+ def eql?(other)
230
+ self == other
231
+ end
232
+
233
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
234
+
235
+
236
+ # Calculates hash code according to all attributes.
237
+ # @return [Fixnum] Hash code
238
+ def hash
239
+ [id, results_url, compartment_id, targets, vantage_point_names, port, timeout_in_seconds, protocol, method, path, headers].hash
240
+ end
241
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
242
+
243
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
244
+
245
+
246
+ # Builds the object from hash
247
+ # @param [Hash] attributes Model attributes in the form of hash
248
+ # @return [Object] Returns the model itself
249
+ def build_from_hash(attributes)
250
+ return nil unless attributes.is_a?(Hash)
251
+
252
+ self.class.swagger_types.each_pair do |key, type|
253
+ if type =~ /^Array<(.*)>/i
254
+ # check to ensure the input is an array given that the the attribute
255
+ # is documented as an array but the input is not
256
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
257
+ public_method("#{key}=").call(
258
+ attributes[self.class.attribute_map[key]]
259
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
260
+ )
261
+ end
262
+ elsif !attributes[self.class.attribute_map[key]].nil?
263
+ public_method("#{key}=").call(
264
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
265
+ )
266
+ end
267
+ # or else data not found in attributes(hash), not an issue as the data can be optional
268
+ end
269
+
270
+ self
271
+ end
272
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
273
+
274
+ # Returns the string representation of the object
275
+ # @return [String] String presentation of the object
276
+ def to_s
277
+ to_hash.to_s
278
+ end
279
+
280
+ # Returns the object in the form of hash
281
+ # @return [Hash] Returns the object in the form of hash
282
+ def to_hash
283
+ hash = {}
284
+ self.class.attribute_map.each_pair do |attr, param|
285
+ value = public_method(attr).call
286
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
287
+
288
+ hash[param] = _to_hash(value)
289
+ end
290
+ hash
291
+ end
292
+
293
+ private
294
+
295
+ # Outputs non-array value in the form of hash
296
+ # For object, use to_hash. Otherwise, just return the value
297
+ # @param [Object] value Any valid value
298
+ # @return [Hash] Returns the value in the form of hash
299
+ def _to_hash(value)
300
+ if value.is_a?(Array)
301
+ value.compact.map { |v| _to_hash(v) }
302
+ elsif value.is_a?(Hash)
303
+ {}.tap do |hash|
304
+ value.each { |k, v| hash[k] = _to_hash(v) }
305
+ end
306
+ elsif value.respond_to? :to_hash
307
+ value.to_hash
308
+ else
309
+ value
310
+ end
311
+ end
312
+ end
313
+ end
314
+ # rubocop:enable Lint/UnneededCopDisableDirective