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,239 @@
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
+ # Geographic information about a vantage point.
8
+ class Healthchecks::Models::Geolocation # rubocop:disable Metrics/LineLength
9
+ # An opaque identifier for the geographic location of the vantage point.
10
+ # @return [String]
11
+ attr_accessor :geo_key
12
+
13
+ # The ISO 3166-2 code for this location's first-level administrative
14
+ # division, either a US state or Canadian province. Only included for locations
15
+ # in the US or Canada. For a list of codes, see
16
+ # [Country Codes](https://www.iso.org/obp/ui/#search).
17
+ #
18
+ # @return [String]
19
+ attr_accessor :admin_div_code
20
+
21
+ # Common English-language name for the city.
22
+ #
23
+ # @return [String]
24
+ attr_accessor :city_name
25
+
26
+ # The ISO 3166-1 alpha-2 country code. For a list of codes,
27
+ # see [Country Codes](https://www.iso.org/obp/ui/#search).
28
+ #
29
+ # @return [String]
30
+ attr_accessor :country_code
31
+
32
+ # The common English-language name for the country.
33
+ #
34
+ # @return [String]
35
+ attr_accessor :country_name
36
+
37
+ # Degrees north of the Equator.
38
+ #
39
+ # @return [Float]
40
+ attr_accessor :latitude
41
+
42
+ # Degrees east of the prime meridian.
43
+ #
44
+ # @return [Float]
45
+ attr_accessor :longitude
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ # rubocop:disable Style/SymbolLiteral
51
+ 'geo_key': :'geoKey',
52
+ 'admin_div_code': :'adminDivCode',
53
+ 'city_name': :'cityName',
54
+ 'country_code': :'countryCode',
55
+ 'country_name': :'countryName',
56
+ 'latitude': :'latitude',
57
+ 'longitude': :'longitude'
58
+ # rubocop:enable Style/SymbolLiteral
59
+ }
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.swagger_types
64
+ {
65
+ # rubocop:disable Style/SymbolLiteral
66
+ 'geo_key': :'String',
67
+ 'admin_div_code': :'String',
68
+ 'city_name': :'String',
69
+ 'country_code': :'String',
70
+ 'country_name': :'String',
71
+ 'latitude': :'Float',
72
+ 'longitude': :'Float'
73
+ # rubocop:enable Style/SymbolLiteral
74
+ }
75
+ end
76
+
77
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
78
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
79
+
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @option attributes [String] :geo_key The value to assign to the {#geo_key} property
84
+ # @option attributes [String] :admin_div_code The value to assign to the {#admin_div_code} property
85
+ # @option attributes [String] :city_name The value to assign to the {#city_name} property
86
+ # @option attributes [String] :country_code The value to assign to the {#country_code} property
87
+ # @option attributes [String] :country_name The value to assign to the {#country_name} property
88
+ # @option attributes [Float] :latitude The value to assign to the {#latitude} property
89
+ # @option attributes [Float] :longitude The value to assign to the {#longitude} property
90
+ def initialize(attributes = {})
91
+ return unless attributes.is_a?(Hash)
92
+
93
+ # convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
95
+
96
+ self.geo_key = attributes[:'geoKey'] if attributes[:'geoKey']
97
+
98
+ raise 'You cannot provide both :geoKey and :geo_key' if attributes.key?(:'geoKey') && attributes.key?(:'geo_key')
99
+
100
+ self.geo_key = attributes[:'geo_key'] if attributes[:'geo_key']
101
+
102
+ self.admin_div_code = attributes[:'adminDivCode'] if attributes[:'adminDivCode']
103
+
104
+ raise 'You cannot provide both :adminDivCode and :admin_div_code' if attributes.key?(:'adminDivCode') && attributes.key?(:'admin_div_code')
105
+
106
+ self.admin_div_code = attributes[:'admin_div_code'] if attributes[:'admin_div_code']
107
+
108
+ self.city_name = attributes[:'cityName'] if attributes[:'cityName']
109
+
110
+ raise 'You cannot provide both :cityName and :city_name' if attributes.key?(:'cityName') && attributes.key?(:'city_name')
111
+
112
+ self.city_name = attributes[:'city_name'] if attributes[:'city_name']
113
+
114
+ self.country_code = attributes[:'countryCode'] if attributes[:'countryCode']
115
+
116
+ raise 'You cannot provide both :countryCode and :country_code' if attributes.key?(:'countryCode') && attributes.key?(:'country_code')
117
+
118
+ self.country_code = attributes[:'country_code'] if attributes[:'country_code']
119
+
120
+ self.country_name = attributes[:'countryName'] if attributes[:'countryName']
121
+
122
+ raise 'You cannot provide both :countryName and :country_name' if attributes.key?(:'countryName') && attributes.key?(:'country_name')
123
+
124
+ self.country_name = attributes[:'country_name'] if attributes[:'country_name']
125
+
126
+ self.latitude = attributes[:'latitude'] if attributes[:'latitude']
127
+
128
+ self.longitude = attributes[:'longitude'] if attributes[:'longitude']
129
+ end
130
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
131
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
132
+
133
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
134
+
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] other the other object to be compared
138
+ def ==(other)
139
+ return true if equal?(other)
140
+
141
+ self.class == other.class &&
142
+ geo_key == other.geo_key &&
143
+ admin_div_code == other.admin_div_code &&
144
+ city_name == other.city_name &&
145
+ country_code == other.country_code &&
146
+ country_name == other.country_name &&
147
+ latitude == other.latitude &&
148
+ longitude == other.longitude
149
+ end
150
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
151
+
152
+ # @see the `==` method
153
+ # @param [Object] other the other object to be compared
154
+ def eql?(other)
155
+ self == other
156
+ end
157
+
158
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
159
+
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Fixnum] Hash code
163
+ def hash
164
+ [geo_key, admin_div_code, city_name, country_code, country_name, latitude, longitude].hash
165
+ end
166
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
167
+
168
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
169
+
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+
177
+ self.class.swagger_types.each_pair do |key, type|
178
+ if type =~ /^Array<(.*)>/i
179
+ # check to ensure the input is an array given that the the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ public_method("#{key}=").call(
183
+ attributes[self.class.attribute_map[key]]
184
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
185
+ )
186
+ end
187
+ elsif !attributes[self.class.attribute_map[key]].nil?
188
+ public_method("#{key}=").call(
189
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
190
+ )
191
+ end
192
+ # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
198
+
199
+ # Returns the string representation of the object
200
+ # @return [String] String presentation of the object
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = public_method(attr).call
211
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ private
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+ end
238
+ end
239
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,211 @@
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
+ # Information about a vantage point.
8
+ class Healthchecks::Models::HealthChecksVantagePointSummary # rubocop:disable Metrics/LineLength
9
+ # The display name for the vantage point. Display names are determined by
10
+ # the best information available and may change over time.
11
+ #
12
+ # @return [String]
13
+ attr_accessor :display_name
14
+
15
+ # The organization on whose infrastructure this vantage point resides.
16
+ # Provider names are not unique, as Oracle Cloud Infrastructure maintains
17
+ # many vantage points in each major provider.
18
+ #
19
+ # @return [String]
20
+ attr_accessor :provider_name
21
+
22
+ # The unique, permanent name for the vantage point.
23
+ # @return [String]
24
+ attr_accessor :name
25
+
26
+ # @return [OCI::Healthchecks::Models::Geolocation]
27
+ attr_accessor :geo
28
+
29
+ # An array of objects that describe how traffic to this vantage point is
30
+ # routed, including which prefixes and ASNs connect it to the internet.
31
+ #
32
+ # The addresses are sorted from the most-specific to least-specific
33
+ # prefix (the smallest network to largest network). When a prefix has
34
+ # multiple origin ASNs (MOAS routing), they are sorted by weight
35
+ # (highest to lowest). Weight is determined by the total percentage of
36
+ # peers observing the prefix originating from an ASN. Only present if
37
+ # `fields` includes `routing`. The field will be null if the address's
38
+ # routing information is unknown.
39
+ #
40
+ # @return [Array<OCI::Healthchecks::Models::Routing>]
41
+ attr_accessor :routing
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ # rubocop:disable Style/SymbolLiteral
47
+ 'display_name': :'displayName',
48
+ 'provider_name': :'providerName',
49
+ 'name': :'name',
50
+ 'geo': :'geo',
51
+ 'routing': :'routing'
52
+ # rubocop:enable Style/SymbolLiteral
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ # rubocop:disable Style/SymbolLiteral
60
+ 'display_name': :'String',
61
+ 'provider_name': :'String',
62
+ 'name': :'String',
63
+ 'geo': :'OCI::Healthchecks::Models::Geolocation',
64
+ 'routing': :'Array<OCI::Healthchecks::Models::Routing>'
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] :display_name The value to assign to the {#display_name} property
76
+ # @option attributes [String] :provider_name The value to assign to the {#provider_name} property
77
+ # @option attributes [String] :name The value to assign to the {#name} property
78
+ # @option attributes [OCI::Healthchecks::Models::Geolocation] :geo The value to assign to the {#geo} property
79
+ # @option attributes [Array<OCI::Healthchecks::Models::Routing>] :routing The value to assign to the {#routing} property
80
+ def initialize(attributes = {})
81
+ return unless attributes.is_a?(Hash)
82
+
83
+ # convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
85
+
86
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
87
+
88
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
89
+
90
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
91
+
92
+ self.provider_name = attributes[:'providerName'] if attributes[:'providerName']
93
+
94
+ raise 'You cannot provide both :providerName and :provider_name' if attributes.key?(:'providerName') && attributes.key?(:'provider_name')
95
+
96
+ self.provider_name = attributes[:'provider_name'] if attributes[:'provider_name']
97
+
98
+ self.name = attributes[:'name'] if attributes[:'name']
99
+
100
+ self.geo = attributes[:'geo'] if attributes[:'geo']
101
+
102
+ self.routing = attributes[:'routing'] if attributes[:'routing']
103
+ end
104
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
105
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
106
+
107
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
108
+
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] other the other object to be compared
112
+ def ==(other)
113
+ return true if equal?(other)
114
+
115
+ self.class == other.class &&
116
+ display_name == other.display_name &&
117
+ provider_name == other.provider_name &&
118
+ name == other.name &&
119
+ geo == other.geo &&
120
+ routing == other.routing
121
+ end
122
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
123
+
124
+ # @see the `==` method
125
+ # @param [Object] other the other object to be compared
126
+ def eql?(other)
127
+ self == other
128
+ end
129
+
130
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
131
+
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Fixnum] Hash code
135
+ def hash
136
+ [display_name, provider_name, name, geo, routing].hash
137
+ end
138
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
139
+
140
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
141
+
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+
149
+ self.class.swagger_types.each_pair do |key, type|
150
+ if type =~ /^Array<(.*)>/i
151
+ # check to ensure the input is an array given that the the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ public_method("#{key}=").call(
155
+ attributes[self.class.attribute_map[key]]
156
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
157
+ )
158
+ end
159
+ elsif !attributes[self.class.attribute_map[key]].nil?
160
+ public_method("#{key}=").call(
161
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
162
+ )
163
+ end
164
+ # or else data not found in attributes(hash), not an issue as the data can be optional
165
+ end
166
+
167
+ self
168
+ end
169
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = public_method(attr).call
183
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ private
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map { |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+ end
210
+ end
211
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,395 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # This model contains all of the mutable and immutable properties for an HTTP monitor.
9
+ #
10
+ class Healthchecks::Models::HttpMonitor # 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
+ # A user-friendly and mutable name suitable for display in a user interface.
71
+ # @return [String]
72
+ attr_accessor :display_name
73
+
74
+ # The monitor interval in seconds. Valid values: 10, 30, and 60.
75
+ #
76
+ # @return [Integer]
77
+ attr_accessor :interval_in_seconds
78
+
79
+ # Enables or disables the monitor. Set to 'true' to launch monitoring.
80
+ #
81
+ # @return [BOOLEAN]
82
+ attr_accessor :is_enabled
83
+
84
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
85
+ # predefined name, type, or namespace. For more information,
86
+ # see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
87
+ # Example: `{\"Department\": \"Finance\"}`
88
+ #
89
+ # @return [Hash<String, String>]
90
+ attr_accessor :freeform_tags
91
+
92
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
93
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
94
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
95
+ #
96
+ # @return [Hash<String, Hash<String, Object>>]
97
+ attr_accessor :defined_tags
98
+
99
+ # Attribute mapping from ruby-style variable name to JSON key.
100
+ def self.attribute_map
101
+ {
102
+ # rubocop:disable Style/SymbolLiteral
103
+ 'id': :'id',
104
+ 'results_url': :'resultsUrl',
105
+ 'compartment_id': :'compartmentId',
106
+ 'targets': :'targets',
107
+ 'vantage_point_names': :'vantagePointNames',
108
+ 'port': :'port',
109
+ 'timeout_in_seconds': :'timeoutInSeconds',
110
+ 'protocol': :'protocol',
111
+ 'method': :'method',
112
+ 'path': :'path',
113
+ 'headers': :'headers',
114
+ 'display_name': :'displayName',
115
+ 'interval_in_seconds': :'intervalInSeconds',
116
+ 'is_enabled': :'isEnabled',
117
+ 'freeform_tags': :'freeformTags',
118
+ 'defined_tags': :'definedTags'
119
+ # rubocop:enable Style/SymbolLiteral
120
+ }
121
+ end
122
+
123
+ # Attribute type mapping.
124
+ def self.swagger_types
125
+ {
126
+ # rubocop:disable Style/SymbolLiteral
127
+ 'id': :'String',
128
+ 'results_url': :'String',
129
+ 'compartment_id': :'String',
130
+ 'targets': :'Array<String>',
131
+ 'vantage_point_names': :'Array<String>',
132
+ 'port': :'Integer',
133
+ 'timeout_in_seconds': :'Integer',
134
+ 'protocol': :'String',
135
+ 'method': :'String',
136
+ 'path': :'String',
137
+ 'headers': :'Hash<String, String>',
138
+ 'display_name': :'String',
139
+ 'interval_in_seconds': :'Integer',
140
+ 'is_enabled': :'BOOLEAN',
141
+ 'freeform_tags': :'Hash<String, String>',
142
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
143
+ # rubocop:enable Style/SymbolLiteral
144
+ }
145
+ end
146
+
147
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
148
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
149
+
150
+
151
+ # Initializes the object
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @option attributes [String] :id The value to assign to the {#id} property
154
+ # @option attributes [String] :results_url The value to assign to the {#results_url} property
155
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
156
+ # @option attributes [Array<String>] :targets The value to assign to the {#targets} property
157
+ # @option attributes [Array<String>] :vantage_point_names The value to assign to the {#vantage_point_names} property
158
+ # @option attributes [Integer] :port The value to assign to the {#port} property
159
+ # @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
160
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
161
+ # @option attributes [String] :method The value to assign to the {#method} property
162
+ # @option attributes [String] :path The value to assign to the {#path} property
163
+ # @option attributes [Hash<String, String>] :headers The value to assign to the {#headers} property
164
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
165
+ # @option attributes [Integer] :interval_in_seconds The value to assign to the {#interval_in_seconds} property
166
+ # @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
167
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
168
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
169
+ def initialize(attributes = {})
170
+ return unless attributes.is_a?(Hash)
171
+
172
+ # convert string to symbol for hash key
173
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
174
+
175
+ self.id = attributes[:'id'] if attributes[:'id']
176
+
177
+ self.results_url = attributes[:'resultsUrl'] if attributes[:'resultsUrl']
178
+
179
+ raise 'You cannot provide both :resultsUrl and :results_url' if attributes.key?(:'resultsUrl') && attributes.key?(:'results_url')
180
+
181
+ self.results_url = attributes[:'results_url'] if attributes[:'results_url']
182
+
183
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
184
+
185
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
186
+
187
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
188
+
189
+ self.targets = attributes[:'targets'] if attributes[:'targets']
190
+
191
+ self.vantage_point_names = attributes[:'vantagePointNames'] if attributes[:'vantagePointNames']
192
+
193
+ raise 'You cannot provide both :vantagePointNames and :vantage_point_names' if attributes.key?(:'vantagePointNames') && attributes.key?(:'vantage_point_names')
194
+
195
+ self.vantage_point_names = attributes[:'vantage_point_names'] if attributes[:'vantage_point_names']
196
+
197
+ self.port = attributes[:'port'] if attributes[:'port']
198
+
199
+ self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
200
+
201
+ raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
202
+
203
+ self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
204
+
205
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
206
+
207
+ self.method = attributes[:'method'] if attributes[:'method']
208
+ self.method = "HEAD" if method.nil? && !attributes.key?(:'method') # rubocop:disable Style/StringLiterals
209
+
210
+ self.path = attributes[:'path'] if attributes[:'path']
211
+ self.path = "/" if path.nil? && !attributes.key?(:'path') # rubocop:disable Style/StringLiterals
212
+
213
+ self.headers = attributes[:'headers'] if attributes[:'headers']
214
+
215
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
216
+
217
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
218
+
219
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
220
+
221
+ self.interval_in_seconds = attributes[:'intervalInSeconds'] if attributes[:'intervalInSeconds']
222
+
223
+ raise 'You cannot provide both :intervalInSeconds and :interval_in_seconds' if attributes.key?(:'intervalInSeconds') && attributes.key?(:'interval_in_seconds')
224
+
225
+ self.interval_in_seconds = attributes[:'interval_in_seconds'] if attributes[:'interval_in_seconds']
226
+
227
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
228
+ self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') # rubocop:disable Style/StringLiterals
229
+
230
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
231
+
232
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
233
+ self.is_enabled = true if is_enabled.nil? && !attributes.key?(:'isEnabled') && !attributes.key?(:'is_enabled') # rubocop:disable Style/StringLiterals
234
+
235
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
236
+
237
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
238
+
239
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
240
+
241
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
242
+
243
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
244
+
245
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
246
+ end
247
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
248
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
249
+
250
+ # Custom attribute writer method checking allowed values (enum).
251
+ # @param [Object] protocol Object to be assigned
252
+ def protocol=(protocol)
253
+ # rubocop:disable Style/ConditionalAssignment
254
+ if protocol && !PROTOCOL_ENUM.include?(protocol)
255
+ # rubocop: disable Metrics/LineLength
256
+ OCI.logger.debug("Unknown value for 'protocol' [" + protocol + "]. Mapping to 'PROTOCOL_UNKNOWN_ENUM_VALUE'") if OCI.logger
257
+ # rubocop: enable Metrics/LineLength
258
+ @protocol = PROTOCOL_UNKNOWN_ENUM_VALUE
259
+ else
260
+ @protocol = protocol
261
+ end
262
+ # rubocop:enable Style/ConditionalAssignment
263
+ end
264
+
265
+ # Custom attribute writer method checking allowed values (enum).
266
+ # @param [Object] method Object to be assigned
267
+ def method=(method)
268
+ # rubocop:disable Style/ConditionalAssignment
269
+ if method && !METHOD_ENUM.include?(method)
270
+ # rubocop: disable Metrics/LineLength
271
+ OCI.logger.debug("Unknown value for 'method' [" + method + "]. Mapping to 'METHOD_UNKNOWN_ENUM_VALUE'") if OCI.logger
272
+ # rubocop: enable Metrics/LineLength
273
+ @method = METHOD_UNKNOWN_ENUM_VALUE
274
+ else
275
+ @method = method
276
+ end
277
+ # rubocop:enable Style/ConditionalAssignment
278
+ end
279
+
280
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
281
+
282
+
283
+ # Checks equality by comparing each attribute.
284
+ # @param [Object] other the other object to be compared
285
+ def ==(other)
286
+ return true if equal?(other)
287
+
288
+ self.class == other.class &&
289
+ id == other.id &&
290
+ results_url == other.results_url &&
291
+ compartment_id == other.compartment_id &&
292
+ targets == other.targets &&
293
+ vantage_point_names == other.vantage_point_names &&
294
+ port == other.port &&
295
+ timeout_in_seconds == other.timeout_in_seconds &&
296
+ protocol == other.protocol &&
297
+ method == other.method &&
298
+ path == other.path &&
299
+ headers == other.headers &&
300
+ display_name == other.display_name &&
301
+ interval_in_seconds == other.interval_in_seconds &&
302
+ is_enabled == other.is_enabled &&
303
+ freeform_tags == other.freeform_tags &&
304
+ defined_tags == other.defined_tags
305
+ end
306
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
307
+
308
+ # @see the `==` method
309
+ # @param [Object] other the other object to be compared
310
+ def eql?(other)
311
+ self == other
312
+ end
313
+
314
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
315
+
316
+
317
+ # Calculates hash code according to all attributes.
318
+ # @return [Fixnum] Hash code
319
+ def hash
320
+ [id, results_url, compartment_id, targets, vantage_point_names, port, timeout_in_seconds, protocol, method, path, headers, display_name, interval_in_seconds, is_enabled, freeform_tags, defined_tags].hash
321
+ end
322
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
323
+
324
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
325
+
326
+
327
+ # Builds the object from hash
328
+ # @param [Hash] attributes Model attributes in the form of hash
329
+ # @return [Object] Returns the model itself
330
+ def build_from_hash(attributes)
331
+ return nil unless attributes.is_a?(Hash)
332
+
333
+ self.class.swagger_types.each_pair do |key, type|
334
+ if type =~ /^Array<(.*)>/i
335
+ # check to ensure the input is an array given that the the attribute
336
+ # is documented as an array but the input is not
337
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
338
+ public_method("#{key}=").call(
339
+ attributes[self.class.attribute_map[key]]
340
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
341
+ )
342
+ end
343
+ elsif !attributes[self.class.attribute_map[key]].nil?
344
+ public_method("#{key}=").call(
345
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
346
+ )
347
+ end
348
+ # or else data not found in attributes(hash), not an issue as the data can be optional
349
+ end
350
+
351
+ self
352
+ end
353
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
354
+
355
+ # Returns the string representation of the object
356
+ # @return [String] String presentation of the object
357
+ def to_s
358
+ to_hash.to_s
359
+ end
360
+
361
+ # Returns the object in the form of hash
362
+ # @return [Hash] Returns the object in the form of hash
363
+ def to_hash
364
+ hash = {}
365
+ self.class.attribute_map.each_pair do |attr, param|
366
+ value = public_method(attr).call
367
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
368
+
369
+ hash[param] = _to_hash(value)
370
+ end
371
+ hash
372
+ end
373
+
374
+ private
375
+
376
+ # Outputs non-array value in the form of hash
377
+ # For object, use to_hash. Otherwise, just return the value
378
+ # @param [Object] value Any valid value
379
+ # @return [Hash] Returns the value in the form of hash
380
+ def _to_hash(value)
381
+ if value.is_a?(Array)
382
+ value.compact.map { |v| _to_hash(v) }
383
+ elsif value.is_a?(Hash)
384
+ {}.tap do |hash|
385
+ value.each { |k, v| hash[k] = _to_hash(v) }
386
+ end
387
+ elsif value.respond_to? :to_hash
388
+ value.to_hash
389
+ else
390
+ value
391
+ end
392
+ end
393
+ end
394
+ end
395
+ # rubocop:enable Lint/UnneededCopDisableDirective