oci 2.4.6 → 2.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/oci.rb +2 -0
- data/lib/oci/database/database.rb +1 -0
- data/lib/oci/database/models/database.rb +18 -4
- data/lib/oci/database/models/database_connection_strings.rb +182 -0
- data/lib/oci/database/models/database_summary.rb +18 -4
- data/lib/oci/dns/dns.rb +23 -0
- data/lib/oci/dns/dns_client.rb +802 -75
- data/lib/oci/dns/dns_client_composite_operations.rb +238 -0
- data/lib/oci/dns/models/create_steering_policy_attachment_details.rb +205 -0
- data/lib/oci/dns/models/create_steering_policy_details.rb +333 -0
- data/lib/oci/dns/models/steering_policy.rb +418 -0
- data/lib/oci/dns/models/steering_policy_answer.rb +205 -0
- data/lib/oci/dns/models/steering_policy_attachment.rb +308 -0
- data/lib/oci/dns/models/steering_policy_attachment_summary.rb +304 -0
- data/lib/oci/dns/models/steering_policy_filter_answer_data.rb +168 -0
- data/lib/oci/dns/models/steering_policy_filter_rule.rb +178 -0
- data/lib/oci/dns/models/steering_policy_filter_rule_case.rb +165 -0
- data/lib/oci/dns/models/steering_policy_health_rule.rb +160 -0
- data/lib/oci/dns/models/steering_policy_health_rule_case.rb +152 -0
- data/lib/oci/dns/models/steering_policy_limit_rule.rb +179 -0
- data/lib/oci/dns/models/steering_policy_limit_rule_case.rb +162 -0
- data/lib/oci/dns/models/steering_policy_priority_answer_data.rb +161 -0
- data/lib/oci/dns/models/steering_policy_priority_rule.rb +178 -0
- data/lib/oci/dns/models/steering_policy_priority_rule_case.rb +165 -0
- data/lib/oci/dns/models/steering_policy_rule.rb +237 -0
- data/lib/oci/dns/models/steering_policy_summary.rb +391 -0
- data/lib/oci/dns/models/steering_policy_weighted_answer_data.rb +161 -0
- data/lib/oci/dns/models/steering_policy_weighted_rule.rb +178 -0
- data/lib/oci/dns/models/steering_policy_weighted_rule_case.rb +165 -0
- data/lib/oci/dns/models/update_steering_policy_attachment_details.rb +156 -0
- data/lib/oci/dns/models/update_steering_policy_details.rb +319 -0
- data/lib/oci/email/email.rb +1 -0
- data/lib/oci/email/email_client.rb +87 -16
- data/lib/oci/email/email_client_composite_operations.rb +40 -0
- data/lib/oci/email/models/create_sender_details.rb +40 -6
- data/lib/oci/email/models/create_suppression_details.rb +2 -2
- data/lib/oci/email/models/sender.rb +53 -5
- data/lib/oci/email/models/sender_summary.rb +38 -4
- data/lib/oci/email/models/suppression.rb +20 -3
- data/lib/oci/email/models/update_sender_details.rb +174 -0
- data/lib/oci/healthchecks/health_checks_client.rb +1137 -0
- data/lib/oci/healthchecks/health_checks_client_composite_operations.rb +24 -0
- data/lib/oci/healthchecks/healthchecks.rb +41 -0
- data/lib/oci/healthchecks/models/connection.rb +159 -0
- data/lib/oci/healthchecks/models/create_http_monitor_details.rb +359 -0
- data/lib/oci/healthchecks/models/create_on_demand_http_probe_details.rb +278 -0
- data/lib/oci/healthchecks/models/create_on_demand_ping_probe_details.rb +229 -0
- data/lib/oci/healthchecks/models/create_ping_monitor_details.rb +310 -0
- data/lib/oci/healthchecks/models/dns.rb +165 -0
- data/lib/oci/healthchecks/models/geolocation.rb +239 -0
- data/lib/oci/healthchecks/models/health_checks_vantage_point_summary.rb +211 -0
- data/lib/oci/healthchecks/models/http_monitor.rb +395 -0
- data/lib/oci/healthchecks/models/http_monitor_summary.rb +290 -0
- data/lib/oci/healthchecks/models/http_probe.rb +314 -0
- data/lib/oci/healthchecks/models/http_probe_method.rb +10 -0
- data/lib/oci/healthchecks/models/http_probe_protocol.rb +10 -0
- data/lib/oci/healthchecks/models/http_probe_result_summary.rb +542 -0
- data/lib/oci/healthchecks/models/ping_monitor.rb +340 -0
- data/lib/oci/healthchecks/models/ping_monitor_summary.rb +290 -0
- data/lib/oci/healthchecks/models/ping_probe.rb +259 -0
- data/lib/oci/healthchecks/models/ping_probe_protocol.rb +10 -0
- data/lib/oci/healthchecks/models/ping_probe_result_summary.rb +418 -0
- data/lib/oci/healthchecks/models/routing.rb +192 -0
- data/lib/oci/healthchecks/models/tcp_connection.rb +189 -0
- data/lib/oci/healthchecks/models/update_http_monitor_details.rb +339 -0
- data/lib/oci/healthchecks/models/update_ping_monitor_details.rb +292 -0
- data/lib/oci/healthchecks/util.rb +2 -0
- data/lib/oci/regions.rb +3 -1
- data/lib/oci/version.rb +1 -1
- data/lib/oci/waas/models/access_rule.rb +283 -0
- data/lib/oci/waas/models/access_rule_criteria.rb +206 -0
- data/lib/oci/waas/models/address_rate_limiting.rb +195 -0
- data/lib/oci/waas/models/block_challenge_settings.rb +288 -0
- data/lib/oci/waas/models/captcha.rb +231 -0
- data/lib/oci/waas/models/certificate.rb +383 -0
- data/lib/oci/waas/models/certificate_extensions.rb +170 -0
- data/lib/oci/waas/models/certificate_public_key_info.rb +170 -0
- data/lib/oci/waas/models/certificate_subject_name.rb +218 -0
- data/lib/oci/waas/models/certificate_summary.rb +274 -0
- data/lib/oci/waas/models/create_certificate_details.rb +241 -0
- data/lib/oci/waas/models/create_waas_policy_details.rb +257 -0
- data/lib/oci/waas/models/device_fingerprint_challenge.rb +268 -0
- data/lib/oci/waas/models/edge_subnet.rb +173 -0
- data/lib/oci/waas/models/good_bot.rb +183 -0
- data/lib/oci/waas/models/header.rb +159 -0
- data/lib/oci/waas/models/human_interaction_challenge.rb +282 -0
- data/lib/oci/waas/models/js_challenge.rb +240 -0
- data/lib/oci/waas/models/lifecycle_states.rb +14 -0
- data/lib/oci/waas/models/origin.rb +191 -0
- data/lib/oci/waas/models/policy_config.rb +181 -0
- data/lib/oci/waas/models/protection_rule.rb +237 -0
- data/lib/oci/waas/models/protection_rule_action.rb +185 -0
- data/lib/oci/waas/models/protection_rule_exclusion.rb +182 -0
- data/lib/oci/waas/models/protection_settings.rb +404 -0
- data/lib/oci/waas/models/recommendation.rb +210 -0
- data/lib/oci/waas/models/threat_feed.rb +202 -0
- data/lib/oci/waas/models/threat_feed_action.rb +175 -0
- data/lib/oci/waas/models/update_certificate_details.rb +183 -0
- data/lib/oci/waas/models/update_waas_policy_details.rb +233 -0
- data/lib/oci/waas/models/waas_policy.rb +331 -0
- data/lib/oci/waas/models/waas_policy_summary.rb +271 -0
- data/lib/oci/waas/models/waf_blocked_request.rb +219 -0
- data/lib/oci/waas/models/waf_config.rb +295 -0
- data/lib/oci/waas/models/waf_config_details.rb +253 -0
- data/lib/oci/waas/models/waf_log.rb +510 -0
- data/lib/oci/waas/models/waf_meter_datum.rb +279 -0
- data/lib/oci/waas/models/waf_request.rb +177 -0
- data/lib/oci/waas/models/waf_traffic_datum.rb +223 -0
- data/lib/oci/waas/models/whitelist.rb +159 -0
- data/lib/oci/waas/models/work_request.rb +322 -0
- data/lib/oci/waas/models/work_request_error.rb +170 -0
- data/lib/oci/waas/models/work_request_log_entry.rb +159 -0
- data/lib/oci/waas/models/work_request_operation_types.rb +12 -0
- data/lib/oci/waas/models/work_request_resource.rb +217 -0
- data/lib/oci/waas/models/work_request_status_values.rb +14 -0
- data/lib/oci/waas/models/work_request_summary.rb +302 -0
- data/lib/oci/waas/util.rb +2 -0
- data/lib/oci/waas/waas.rb +66 -0
- data/lib/oci/waas/waas_client.rb +3044 -0
- data/lib/oci/waas/waas_client_composite_operations.rb +990 -0
- metadata +105 -2
|
@@ -0,0 +1,278 @@
|
|
|
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 an on-demand HTTP probe.
|
|
8
|
+
class Healthchecks::Models::CreateOnDemandHttpProbeDetails # rubocop:disable Metrics/LineLength
|
|
9
|
+
PROTOCOL_ENUM = [
|
|
10
|
+
PROTOCOL_HTTP = 'HTTP'.freeze,
|
|
11
|
+
PROTOCOL_HTTPS = 'HTTPS'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
METHOD_ENUM = [
|
|
15
|
+
METHOD_GET = 'GET'.freeze,
|
|
16
|
+
METHOD_HEAD = 'HEAD'.freeze
|
|
17
|
+
].freeze
|
|
18
|
+
|
|
19
|
+
# **[Required]** The OCID of the compartment.
|
|
20
|
+
# @return [String]
|
|
21
|
+
attr_accessor :compartment_id
|
|
22
|
+
|
|
23
|
+
# This attribute is required.
|
|
24
|
+
# @return [Array<String>]
|
|
25
|
+
attr_accessor :targets
|
|
26
|
+
|
|
27
|
+
# @return [Array<String>]
|
|
28
|
+
attr_accessor :vantage_point_names
|
|
29
|
+
|
|
30
|
+
# The port on which to probe endpoints. If unspecified, probes will use the
|
|
31
|
+
# default port of their protocol.
|
|
32
|
+
#
|
|
33
|
+
# @return [Integer]
|
|
34
|
+
attr_accessor :port
|
|
35
|
+
|
|
36
|
+
# The probe timeout in seconds. Valid values: 10, 20, 30, and 60.
|
|
37
|
+
# The probe timeout must be less than or equal to `intervalInSeconds` for monitors.
|
|
38
|
+
#
|
|
39
|
+
# @return [Integer]
|
|
40
|
+
attr_accessor :timeout_in_seconds
|
|
41
|
+
|
|
42
|
+
# This attribute is required.
|
|
43
|
+
# @return [String]
|
|
44
|
+
attr_reader :protocol
|
|
45
|
+
|
|
46
|
+
# @return [String]
|
|
47
|
+
attr_reader :method
|
|
48
|
+
|
|
49
|
+
# The optional URL path to probe, including query parameters.
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :path
|
|
52
|
+
|
|
53
|
+
# A dictionary of HTTP request headers.
|
|
54
|
+
#
|
|
55
|
+
# *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header.
|
|
56
|
+
#
|
|
57
|
+
# @return [Hash<String, String>]
|
|
58
|
+
attr_accessor :headers
|
|
59
|
+
|
|
60
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
61
|
+
def self.attribute_map
|
|
62
|
+
{
|
|
63
|
+
# rubocop:disable Style/SymbolLiteral
|
|
64
|
+
'compartment_id': :'compartmentId',
|
|
65
|
+
'targets': :'targets',
|
|
66
|
+
'vantage_point_names': :'vantagePointNames',
|
|
67
|
+
'port': :'port',
|
|
68
|
+
'timeout_in_seconds': :'timeoutInSeconds',
|
|
69
|
+
'protocol': :'protocol',
|
|
70
|
+
'method': :'method',
|
|
71
|
+
'path': :'path',
|
|
72
|
+
'headers': :'headers'
|
|
73
|
+
# rubocop:enable Style/SymbolLiteral
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute type mapping.
|
|
78
|
+
def self.swagger_types
|
|
79
|
+
{
|
|
80
|
+
# rubocop:disable Style/SymbolLiteral
|
|
81
|
+
'compartment_id': :'String',
|
|
82
|
+
'targets': :'Array<String>',
|
|
83
|
+
'vantage_point_names': :'Array<String>',
|
|
84
|
+
'port': :'Integer',
|
|
85
|
+
'timeout_in_seconds': :'Integer',
|
|
86
|
+
'protocol': :'String',
|
|
87
|
+
'method': :'String',
|
|
88
|
+
'path': :'String',
|
|
89
|
+
'headers': :'Hash<String, String>'
|
|
90
|
+
# rubocop:enable Style/SymbolLiteral
|
|
91
|
+
}
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
95
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# Initializes the object
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
|
101
|
+
# @option attributes [Array<String>] :targets The value to assign to the {#targets} property
|
|
102
|
+
# @option attributes [Array<String>] :vantage_point_names The value to assign to the {#vantage_point_names} property
|
|
103
|
+
# @option attributes [Integer] :port The value to assign to the {#port} property
|
|
104
|
+
# @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
|
|
105
|
+
# @option attributes [String] :protocol The value to assign to the {#protocol} property
|
|
106
|
+
# @option attributes [String] :method The value to assign to the {#method} property
|
|
107
|
+
# @option attributes [String] :path The value to assign to the {#path} property
|
|
108
|
+
# @option attributes [Hash<String, String>] :headers The value to assign to the {#headers} property
|
|
109
|
+
def initialize(attributes = {})
|
|
110
|
+
return unless attributes.is_a?(Hash)
|
|
111
|
+
|
|
112
|
+
# convert string to symbol for hash key
|
|
113
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
114
|
+
|
|
115
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
|
116
|
+
|
|
117
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
|
118
|
+
|
|
119
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
|
120
|
+
|
|
121
|
+
self.targets = attributes[:'targets'] if attributes[:'targets']
|
|
122
|
+
|
|
123
|
+
self.vantage_point_names = attributes[:'vantagePointNames'] if attributes[:'vantagePointNames']
|
|
124
|
+
|
|
125
|
+
raise 'You cannot provide both :vantagePointNames and :vantage_point_names' if attributes.key?(:'vantagePointNames') && attributes.key?(:'vantage_point_names')
|
|
126
|
+
|
|
127
|
+
self.vantage_point_names = attributes[:'vantage_point_names'] if attributes[:'vantage_point_names']
|
|
128
|
+
|
|
129
|
+
self.port = attributes[:'port'] if attributes[:'port']
|
|
130
|
+
|
|
131
|
+
self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
|
|
132
|
+
|
|
133
|
+
raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
|
|
134
|
+
|
|
135
|
+
self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
|
|
136
|
+
|
|
137
|
+
self.protocol = attributes[:'protocol'] if attributes[:'protocol']
|
|
138
|
+
|
|
139
|
+
self.method = attributes[:'method'] if attributes[:'method']
|
|
140
|
+
self.method = "HEAD" if method.nil? && !attributes.key?(:'method') # rubocop:disable Style/StringLiterals
|
|
141
|
+
|
|
142
|
+
self.path = attributes[:'path'] if attributes[:'path']
|
|
143
|
+
self.path = "/" if path.nil? && !attributes.key?(:'path') # rubocop:disable Style/StringLiterals
|
|
144
|
+
|
|
145
|
+
self.headers = attributes[:'headers'] if attributes[:'headers']
|
|
146
|
+
end
|
|
147
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
148
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
149
|
+
|
|
150
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
151
|
+
# @param [Object] protocol Object to be assigned
|
|
152
|
+
def protocol=(protocol)
|
|
153
|
+
# rubocop: disable Metrics/LineLength
|
|
154
|
+
raise "Invalid value for 'protocol': this must be one of the values in PROTOCOL_ENUM." if protocol && !PROTOCOL_ENUM.include?(protocol)
|
|
155
|
+
|
|
156
|
+
# rubocop: enable Metrics/LineLength
|
|
157
|
+
@protocol = protocol
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
161
|
+
# @param [Object] method Object to be assigned
|
|
162
|
+
def method=(method)
|
|
163
|
+
# rubocop: disable Metrics/LineLength
|
|
164
|
+
raise "Invalid value for 'method': this must be one of the values in METHOD_ENUM." if method && !METHOD_ENUM.include?(method)
|
|
165
|
+
|
|
166
|
+
# rubocop: enable Metrics/LineLength
|
|
167
|
+
@method = method
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# Checks equality by comparing each attribute.
|
|
174
|
+
# @param [Object] other the other object to be compared
|
|
175
|
+
def ==(other)
|
|
176
|
+
return true if equal?(other)
|
|
177
|
+
|
|
178
|
+
self.class == other.class &&
|
|
179
|
+
compartment_id == other.compartment_id &&
|
|
180
|
+
targets == other.targets &&
|
|
181
|
+
vantage_point_names == other.vantage_point_names &&
|
|
182
|
+
port == other.port &&
|
|
183
|
+
timeout_in_seconds == other.timeout_in_seconds &&
|
|
184
|
+
protocol == other.protocol &&
|
|
185
|
+
method == other.method &&
|
|
186
|
+
path == other.path &&
|
|
187
|
+
headers == other.headers
|
|
188
|
+
end
|
|
189
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
190
|
+
|
|
191
|
+
# @see the `==` method
|
|
192
|
+
# @param [Object] other the other object to be compared
|
|
193
|
+
def eql?(other)
|
|
194
|
+
self == other
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# Calculates hash code according to all attributes.
|
|
201
|
+
# @return [Fixnum] Hash code
|
|
202
|
+
def hash
|
|
203
|
+
[compartment_id, targets, vantage_point_names, port, timeout_in_seconds, protocol, method, path, headers].hash
|
|
204
|
+
end
|
|
205
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
206
|
+
|
|
207
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
# Builds the object from hash
|
|
211
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
212
|
+
# @return [Object] Returns the model itself
|
|
213
|
+
def build_from_hash(attributes)
|
|
214
|
+
return nil unless attributes.is_a?(Hash)
|
|
215
|
+
|
|
216
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
217
|
+
if type =~ /^Array<(.*)>/i
|
|
218
|
+
# check to ensure the input is an array given that the the attribute
|
|
219
|
+
# is documented as an array but the input is not
|
|
220
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
221
|
+
public_method("#{key}=").call(
|
|
222
|
+
attributes[self.class.attribute_map[key]]
|
|
223
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
224
|
+
)
|
|
225
|
+
end
|
|
226
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
227
|
+
public_method("#{key}=").call(
|
|
228
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
229
|
+
)
|
|
230
|
+
end
|
|
231
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
self
|
|
235
|
+
end
|
|
236
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
237
|
+
|
|
238
|
+
# Returns the string representation of the object
|
|
239
|
+
# @return [String] String presentation of the object
|
|
240
|
+
def to_s
|
|
241
|
+
to_hash.to_s
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Returns the object in the form of hash
|
|
245
|
+
# @return [Hash] Returns the object in the form of hash
|
|
246
|
+
def to_hash
|
|
247
|
+
hash = {}
|
|
248
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
249
|
+
value = public_method(attr).call
|
|
250
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
251
|
+
|
|
252
|
+
hash[param] = _to_hash(value)
|
|
253
|
+
end
|
|
254
|
+
hash
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
private
|
|
258
|
+
|
|
259
|
+
# Outputs non-array value in the form of hash
|
|
260
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
261
|
+
# @param [Object] value Any valid value
|
|
262
|
+
# @return [Hash] Returns the value in the form of hash
|
|
263
|
+
def _to_hash(value)
|
|
264
|
+
if value.is_a?(Array)
|
|
265
|
+
value.compact.map { |v| _to_hash(v) }
|
|
266
|
+
elsif value.is_a?(Hash)
|
|
267
|
+
{}.tap do |hash|
|
|
268
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
269
|
+
end
|
|
270
|
+
elsif value.respond_to? :to_hash
|
|
271
|
+
value.to_hash
|
|
272
|
+
else
|
|
273
|
+
value
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
end
|
|
278
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
|
@@ -0,0 +1,229 @@
|
|
|
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 an on-demand ping probe.
|
|
8
|
+
class Healthchecks::Models::CreateOnDemandPingProbeDetails # 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
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
42
|
+
def self.attribute_map
|
|
43
|
+
{
|
|
44
|
+
# rubocop:disable Style/SymbolLiteral
|
|
45
|
+
'compartment_id': :'compartmentId',
|
|
46
|
+
'targets': :'targets',
|
|
47
|
+
'vantage_point_names': :'vantagePointNames',
|
|
48
|
+
'port': :'port',
|
|
49
|
+
'timeout_in_seconds': :'timeoutInSeconds',
|
|
50
|
+
'protocol': :'protocol'
|
|
51
|
+
# rubocop:enable Style/SymbolLiteral
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute type mapping.
|
|
56
|
+
def self.swagger_types
|
|
57
|
+
{
|
|
58
|
+
# rubocop:disable Style/SymbolLiteral
|
|
59
|
+
'compartment_id': :'String',
|
|
60
|
+
'targets': :'Array<String>',
|
|
61
|
+
'vantage_point_names': :'Array<String>',
|
|
62
|
+
'port': :'Integer',
|
|
63
|
+
'timeout_in_seconds': :'Integer',
|
|
64
|
+
'protocol': :'String'
|
|
65
|
+
# rubocop:enable Style/SymbolLiteral
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
70
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# Initializes the object
|
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
75
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
|
76
|
+
# @option attributes [Array<String>] :targets The value to assign to the {#targets} property
|
|
77
|
+
# @option attributes [Array<String>] :vantage_point_names The value to assign to the {#vantage_point_names} property
|
|
78
|
+
# @option attributes [Integer] :port The value to assign to the {#port} property
|
|
79
|
+
# @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
|
|
80
|
+
# @option attributes [String] :protocol The value to assign to the {#protocol} property
|
|
81
|
+
def initialize(attributes = {})
|
|
82
|
+
return unless attributes.is_a?(Hash)
|
|
83
|
+
|
|
84
|
+
# convert string to symbol for hash key
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
86
|
+
|
|
87
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
|
88
|
+
|
|
89
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
|
90
|
+
|
|
91
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
|
92
|
+
|
|
93
|
+
self.targets = attributes[:'targets'] if attributes[:'targets']
|
|
94
|
+
|
|
95
|
+
self.vantage_point_names = attributes[:'vantagePointNames'] if attributes[:'vantagePointNames']
|
|
96
|
+
|
|
97
|
+
raise 'You cannot provide both :vantagePointNames and :vantage_point_names' if attributes.key?(:'vantagePointNames') && attributes.key?(:'vantage_point_names')
|
|
98
|
+
|
|
99
|
+
self.vantage_point_names = attributes[:'vantage_point_names'] if attributes[:'vantage_point_names']
|
|
100
|
+
|
|
101
|
+
self.port = attributes[:'port'] if attributes[:'port']
|
|
102
|
+
|
|
103
|
+
self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
|
|
104
|
+
|
|
105
|
+
raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
|
|
106
|
+
|
|
107
|
+
self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
|
|
108
|
+
|
|
109
|
+
self.protocol = attributes[:'protocol'] if attributes[:'protocol']
|
|
110
|
+
end
|
|
111
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
112
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
113
|
+
|
|
114
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
115
|
+
# @param [Object] protocol Object to be assigned
|
|
116
|
+
def protocol=(protocol)
|
|
117
|
+
# rubocop: disable Metrics/LineLength
|
|
118
|
+
raise "Invalid value for 'protocol': this must be one of the values in PROTOCOL_ENUM." if protocol && !PROTOCOL_ENUM.include?(protocol)
|
|
119
|
+
|
|
120
|
+
# rubocop: enable Metrics/LineLength
|
|
121
|
+
@protocol = protocol
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
# Checks equality by comparing each attribute.
|
|
128
|
+
# @param [Object] other the other object to be compared
|
|
129
|
+
def ==(other)
|
|
130
|
+
return true if equal?(other)
|
|
131
|
+
|
|
132
|
+
self.class == other.class &&
|
|
133
|
+
compartment_id == other.compartment_id &&
|
|
134
|
+
targets == other.targets &&
|
|
135
|
+
vantage_point_names == other.vantage_point_names &&
|
|
136
|
+
port == other.port &&
|
|
137
|
+
timeout_in_seconds == other.timeout_in_seconds &&
|
|
138
|
+
protocol == other.protocol
|
|
139
|
+
end
|
|
140
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
141
|
+
|
|
142
|
+
# @see the `==` method
|
|
143
|
+
# @param [Object] other the other object to be compared
|
|
144
|
+
def eql?(other)
|
|
145
|
+
self == other
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
# Calculates hash code according to all attributes.
|
|
152
|
+
# @return [Fixnum] Hash code
|
|
153
|
+
def hash
|
|
154
|
+
[compartment_id, targets, vantage_point_names, port, timeout_in_seconds, protocol].hash
|
|
155
|
+
end
|
|
156
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
157
|
+
|
|
158
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
# Builds the object from hash
|
|
162
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
163
|
+
# @return [Object] Returns the model itself
|
|
164
|
+
def build_from_hash(attributes)
|
|
165
|
+
return nil unless attributes.is_a?(Hash)
|
|
166
|
+
|
|
167
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
168
|
+
if type =~ /^Array<(.*)>/i
|
|
169
|
+
# check to ensure the input is an array given that the the attribute
|
|
170
|
+
# is documented as an array but the input is not
|
|
171
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
172
|
+
public_method("#{key}=").call(
|
|
173
|
+
attributes[self.class.attribute_map[key]]
|
|
174
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
175
|
+
)
|
|
176
|
+
end
|
|
177
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
178
|
+
public_method("#{key}=").call(
|
|
179
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
180
|
+
)
|
|
181
|
+
end
|
|
182
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
self
|
|
186
|
+
end
|
|
187
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
188
|
+
|
|
189
|
+
# Returns the string representation of the object
|
|
190
|
+
# @return [String] String presentation of the object
|
|
191
|
+
def to_s
|
|
192
|
+
to_hash.to_s
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Returns the object in the form of hash
|
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
|
197
|
+
def to_hash
|
|
198
|
+
hash = {}
|
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
200
|
+
value = public_method(attr).call
|
|
201
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
202
|
+
|
|
203
|
+
hash[param] = _to_hash(value)
|
|
204
|
+
end
|
|
205
|
+
hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
private
|
|
209
|
+
|
|
210
|
+
# Outputs non-array value in the form of hash
|
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
212
|
+
# @param [Object] value Any valid value
|
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
|
214
|
+
def _to_hash(value)
|
|
215
|
+
if value.is_a?(Array)
|
|
216
|
+
value.compact.map { |v| _to_hash(v) }
|
|
217
|
+
elsif value.is_a?(Hash)
|
|
218
|
+
{}.tap do |hash|
|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
220
|
+
end
|
|
221
|
+
elsif value.respond_to? :to_hash
|
|
222
|
+
value.to_hash
|
|
223
|
+
else
|
|
224
|
+
value
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|