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,295 @@
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 Web Application Firewall configuration for the WAAS policy.
8
+ class Waas::Models::WafConfig # rubocop:disable Metrics/LineLength
9
+ # The access rules applied to the Web Application Firewall. Used for defining custom access policies with the combination of `ALLOW`, `DETECT`, and `BLOCK` rules, based on different criteria.
10
+ # @return [Array<OCI::Waas::Models::AccessRule>]
11
+ attr_accessor :access_rules
12
+
13
+ # The IP address rate limiting settings used to limit the number of requests from an address.
14
+ # @return [OCI::Waas::Models::AddressRateLimiting]
15
+ attr_accessor :address_rate_limiting
16
+
17
+ # A list of CAPTCHA challenge settings. These are used to challenge requests with a CAPTCHA to block bots.
18
+ # @return [Array<OCI::Waas::Models::Captcha>]
19
+ attr_accessor :captchas
20
+
21
+ # The device fingerprint challenge settings. Used to detect unique devices based on the device fingerprint information collected in order to block bots.
22
+ # @return [OCI::Waas::Models::DeviceFingerprintChallenge]
23
+ attr_accessor :device_fingerprint_challenge
24
+
25
+ # A list of bots allowed to access the web application.
26
+ # @return [Array<OCI::Waas::Models::GoodBot>]
27
+ attr_accessor :good_bots
28
+
29
+ # The human interaction challenge settings. Used to look for natural human interactions such as mouse movements, time on site, and page scrolling to identify bots.
30
+ # @return [OCI::Waas::Models::HumanInteractionChallenge]
31
+ attr_accessor :human_interaction_challenge
32
+
33
+ # The JavaScript challenge settings. Used to challenge requests with a JavaScript challenge and take the action if a browser has no JavaScript support in order to block bots.
34
+ # @return [OCI::Waas::Models::JsChallenge]
35
+ attr_accessor :js_challenge
36
+
37
+ # The key in the map of origins referencing the origin used for the Web Application Firewall. The origin must already be included in `Origins`. Required when creating the `WafConfig` resource, but not on update.
38
+ # @return [String]
39
+ attr_accessor :origin
40
+
41
+ # A list of the protection rules and their details.
42
+ # @return [Array<OCI::Waas::Models::ProtectionRule>]
43
+ attr_accessor :protection_rules
44
+
45
+ # The settings to apply to protection rules.
46
+ # @return [OCI::Waas::Models::ProtectionSettings]
47
+ attr_accessor :protection_settings
48
+
49
+ # A list of threat intelligence feeds and the actions to apply to known malicious traffic based on internet intelligence.
50
+ # @return [Array<OCI::Waas::Models::ThreatFeed>]
51
+ attr_accessor :threat_feeds
52
+
53
+ # A list of IP addresses that bypass the Web Application Firewall.
54
+ # @return [Array<OCI::Waas::Models::Whitelist>]
55
+ attr_accessor :whitelists
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ # rubocop:disable Style/SymbolLiteral
61
+ 'access_rules': :'accessRules',
62
+ 'address_rate_limiting': :'addressRateLimiting',
63
+ 'captchas': :'captchas',
64
+ 'device_fingerprint_challenge': :'deviceFingerprintChallenge',
65
+ 'good_bots': :'goodBots',
66
+ 'human_interaction_challenge': :'humanInteractionChallenge',
67
+ 'js_challenge': :'jsChallenge',
68
+ 'origin': :'origin',
69
+ 'protection_rules': :'protectionRules',
70
+ 'protection_settings': :'protectionSettings',
71
+ 'threat_feeds': :'threatFeeds',
72
+ 'whitelists': :'whitelists'
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
+ 'access_rules': :'Array<OCI::Waas::Models::AccessRule>',
82
+ 'address_rate_limiting': :'OCI::Waas::Models::AddressRateLimiting',
83
+ 'captchas': :'Array<OCI::Waas::Models::Captcha>',
84
+ 'device_fingerprint_challenge': :'OCI::Waas::Models::DeviceFingerprintChallenge',
85
+ 'good_bots': :'Array<OCI::Waas::Models::GoodBot>',
86
+ 'human_interaction_challenge': :'OCI::Waas::Models::HumanInteractionChallenge',
87
+ 'js_challenge': :'OCI::Waas::Models::JsChallenge',
88
+ 'origin': :'String',
89
+ 'protection_rules': :'Array<OCI::Waas::Models::ProtectionRule>',
90
+ 'protection_settings': :'OCI::Waas::Models::ProtectionSettings',
91
+ 'threat_feeds': :'Array<OCI::Waas::Models::ThreatFeed>',
92
+ 'whitelists': :'Array<OCI::Waas::Models::Whitelist>'
93
+ # rubocop:enable Style/SymbolLiteral
94
+ }
95
+ end
96
+
97
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
98
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
99
+
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @option attributes [Array<OCI::Waas::Models::AccessRule>] :access_rules The value to assign to the {#access_rules} property
104
+ # @option attributes [OCI::Waas::Models::AddressRateLimiting] :address_rate_limiting The value to assign to the {#address_rate_limiting} property
105
+ # @option attributes [Array<OCI::Waas::Models::Captcha>] :captchas The value to assign to the {#captchas} property
106
+ # @option attributes [OCI::Waas::Models::DeviceFingerprintChallenge] :device_fingerprint_challenge The value to assign to the {#device_fingerprint_challenge} property
107
+ # @option attributes [Array<OCI::Waas::Models::GoodBot>] :good_bots The value to assign to the {#good_bots} property
108
+ # @option attributes [OCI::Waas::Models::HumanInteractionChallenge] :human_interaction_challenge The value to assign to the {#human_interaction_challenge} property
109
+ # @option attributes [OCI::Waas::Models::JsChallenge] :js_challenge The value to assign to the {#js_challenge} property
110
+ # @option attributes [String] :origin The value to assign to the {#origin} property
111
+ # @option attributes [Array<OCI::Waas::Models::ProtectionRule>] :protection_rules The value to assign to the {#protection_rules} property
112
+ # @option attributes [OCI::Waas::Models::ProtectionSettings] :protection_settings The value to assign to the {#protection_settings} property
113
+ # @option attributes [Array<OCI::Waas::Models::ThreatFeed>] :threat_feeds The value to assign to the {#threat_feeds} property
114
+ # @option attributes [Array<OCI::Waas::Models::Whitelist>] :whitelists The value to assign to the {#whitelists} property
115
+ def initialize(attributes = {})
116
+ return unless attributes.is_a?(Hash)
117
+
118
+ # convert string to symbol for hash key
119
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
120
+
121
+ self.access_rules = attributes[:'accessRules'] if attributes[:'accessRules']
122
+
123
+ raise 'You cannot provide both :accessRules and :access_rules' if attributes.key?(:'accessRules') && attributes.key?(:'access_rules')
124
+
125
+ self.access_rules = attributes[:'access_rules'] if attributes[:'access_rules']
126
+
127
+ self.address_rate_limiting = attributes[:'addressRateLimiting'] if attributes[:'addressRateLimiting']
128
+
129
+ raise 'You cannot provide both :addressRateLimiting and :address_rate_limiting' if attributes.key?(:'addressRateLimiting') && attributes.key?(:'address_rate_limiting')
130
+
131
+ self.address_rate_limiting = attributes[:'address_rate_limiting'] if attributes[:'address_rate_limiting']
132
+
133
+ self.captchas = attributes[:'captchas'] if attributes[:'captchas']
134
+
135
+ self.device_fingerprint_challenge = attributes[:'deviceFingerprintChallenge'] if attributes[:'deviceFingerprintChallenge']
136
+
137
+ raise 'You cannot provide both :deviceFingerprintChallenge and :device_fingerprint_challenge' if attributes.key?(:'deviceFingerprintChallenge') && attributes.key?(:'device_fingerprint_challenge')
138
+
139
+ self.device_fingerprint_challenge = attributes[:'device_fingerprint_challenge'] if attributes[:'device_fingerprint_challenge']
140
+
141
+ self.good_bots = attributes[:'goodBots'] if attributes[:'goodBots']
142
+
143
+ raise 'You cannot provide both :goodBots and :good_bots' if attributes.key?(:'goodBots') && attributes.key?(:'good_bots')
144
+
145
+ self.good_bots = attributes[:'good_bots'] if attributes[:'good_bots']
146
+
147
+ self.human_interaction_challenge = attributes[:'humanInteractionChallenge'] if attributes[:'humanInteractionChallenge']
148
+
149
+ raise 'You cannot provide both :humanInteractionChallenge and :human_interaction_challenge' if attributes.key?(:'humanInteractionChallenge') && attributes.key?(:'human_interaction_challenge')
150
+
151
+ self.human_interaction_challenge = attributes[:'human_interaction_challenge'] if attributes[:'human_interaction_challenge']
152
+
153
+ self.js_challenge = attributes[:'jsChallenge'] if attributes[:'jsChallenge']
154
+
155
+ raise 'You cannot provide both :jsChallenge and :js_challenge' if attributes.key?(:'jsChallenge') && attributes.key?(:'js_challenge')
156
+
157
+ self.js_challenge = attributes[:'js_challenge'] if attributes[:'js_challenge']
158
+
159
+ self.origin = attributes[:'origin'] if attributes[:'origin']
160
+
161
+ self.protection_rules = attributes[:'protectionRules'] if attributes[:'protectionRules']
162
+
163
+ raise 'You cannot provide both :protectionRules and :protection_rules' if attributes.key?(:'protectionRules') && attributes.key?(:'protection_rules')
164
+
165
+ self.protection_rules = attributes[:'protection_rules'] if attributes[:'protection_rules']
166
+
167
+ self.protection_settings = attributes[:'protectionSettings'] if attributes[:'protectionSettings']
168
+
169
+ raise 'You cannot provide both :protectionSettings and :protection_settings' if attributes.key?(:'protectionSettings') && attributes.key?(:'protection_settings')
170
+
171
+ self.protection_settings = attributes[:'protection_settings'] if attributes[:'protection_settings']
172
+
173
+ self.threat_feeds = attributes[:'threatFeeds'] if attributes[:'threatFeeds']
174
+
175
+ raise 'You cannot provide both :threatFeeds and :threat_feeds' if attributes.key?(:'threatFeeds') && attributes.key?(:'threat_feeds')
176
+
177
+ self.threat_feeds = attributes[:'threat_feeds'] if attributes[:'threat_feeds']
178
+
179
+ self.whitelists = attributes[:'whitelists'] if attributes[:'whitelists']
180
+ end
181
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
182
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
183
+
184
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
185
+
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] other the other object to be compared
189
+ def ==(other)
190
+ return true if equal?(other)
191
+
192
+ self.class == other.class &&
193
+ access_rules == other.access_rules &&
194
+ address_rate_limiting == other.address_rate_limiting &&
195
+ captchas == other.captchas &&
196
+ device_fingerprint_challenge == other.device_fingerprint_challenge &&
197
+ good_bots == other.good_bots &&
198
+ human_interaction_challenge == other.human_interaction_challenge &&
199
+ js_challenge == other.js_challenge &&
200
+ origin == other.origin &&
201
+ protection_rules == other.protection_rules &&
202
+ protection_settings == other.protection_settings &&
203
+ threat_feeds == other.threat_feeds &&
204
+ whitelists == other.whitelists
205
+ end
206
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
207
+
208
+ # @see the `==` method
209
+ # @param [Object] other the other object to be compared
210
+ def eql?(other)
211
+ self == other
212
+ end
213
+
214
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
215
+
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Fixnum] Hash code
219
+ def hash
220
+ [access_rules, address_rate_limiting, captchas, device_fingerprint_challenge, good_bots, human_interaction_challenge, js_challenge, origin, protection_rules, protection_settings, threat_feeds, whitelists].hash
221
+ end
222
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
223
+
224
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
225
+
226
+
227
+ # Builds the object from hash
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ # @return [Object] Returns the model itself
230
+ def build_from_hash(attributes)
231
+ return nil unless attributes.is_a?(Hash)
232
+
233
+ self.class.swagger_types.each_pair do |key, type|
234
+ if type =~ /^Array<(.*)>/i
235
+ # check to ensure the input is an array given that the the attribute
236
+ # is documented as an array but the input is not
237
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
238
+ public_method("#{key}=").call(
239
+ attributes[self.class.attribute_map[key]]
240
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
241
+ )
242
+ end
243
+ elsif !attributes[self.class.attribute_map[key]].nil?
244
+ public_method("#{key}=").call(
245
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
246
+ )
247
+ end
248
+ # or else data not found in attributes(hash), not an issue as the data can be optional
249
+ end
250
+
251
+ self
252
+ end
253
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
254
+
255
+ # Returns the string representation of the object
256
+ # @return [String] String presentation of the object
257
+ def to_s
258
+ to_hash.to_s
259
+ end
260
+
261
+ # Returns the object in the form of hash
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_hash
264
+ hash = {}
265
+ self.class.attribute_map.each_pair do |attr, param|
266
+ value = public_method(attr).call
267
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ private
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+ end
294
+ end
295
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,253 @@
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 Web Application Firewall configuration for the WAAS policy creation.
8
+ class Waas::Models::WafConfigDetails # rubocop:disable Metrics/LineLength
9
+ # The access rules applied to the Web Application Firewall. Used for defining custom access policies with the combination of `ALLOW`, `DETECT`, and `BLOCK` rules, based on different criteria.
10
+ # @return [Array<OCI::Waas::Models::AccessRule>]
11
+ attr_accessor :access_rules
12
+
13
+ # The IP address rate limiting settings used to limit the number of requests from an address.
14
+ # @return [OCI::Waas::Models::AddressRateLimiting]
15
+ attr_accessor :address_rate_limiting
16
+
17
+ # A list of CAPTCHA challenge settings. These are used to challenge requests with a CAPTCHA to block bots.
18
+ # @return [Array<OCI::Waas::Models::Captcha>]
19
+ attr_accessor :captchas
20
+
21
+ # The device fingerprint challenge settings. Used to detect unique devices based on the device fingerprint information collected in order to block bots.
22
+ # @return [OCI::Waas::Models::DeviceFingerprintChallenge]
23
+ attr_accessor :device_fingerprint_challenge
24
+
25
+ # The human interaction challenge settings. Used to look for natural human interactions such as mouse movements, time on site, and page scrolling to identify bots.
26
+ # @return [OCI::Waas::Models::HumanInteractionChallenge]
27
+ attr_accessor :human_interaction_challenge
28
+
29
+ # The JavaScript challenge settings. Used to challenge requests with a JavaScript challenge and take the action if a browser has no JavaScript support in order to block bots.
30
+ # @return [OCI::Waas::Models::JsChallenge]
31
+ attr_accessor :js_challenge
32
+
33
+ # The key in the map of origins referencing the origin used for the Web Application Firewall. The origin must already be included in `Origins`. Required when creating the `WafConfig` resource, but not on update.
34
+ # @return [String]
35
+ attr_accessor :origin
36
+
37
+ # The settings to apply to protection rules.
38
+ # @return [OCI::Waas::Models::ProtectionSettings]
39
+ attr_accessor :protection_settings
40
+
41
+ # A list of IP addresses that bypass the Web Application Firewall.
42
+ # @return [Array<OCI::Waas::Models::Whitelist>]
43
+ attr_accessor :whitelists
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ # rubocop:disable Style/SymbolLiteral
49
+ 'access_rules': :'accessRules',
50
+ 'address_rate_limiting': :'addressRateLimiting',
51
+ 'captchas': :'captchas',
52
+ 'device_fingerprint_challenge': :'deviceFingerprintChallenge',
53
+ 'human_interaction_challenge': :'humanInteractionChallenge',
54
+ 'js_challenge': :'jsChallenge',
55
+ 'origin': :'origin',
56
+ 'protection_settings': :'protectionSettings',
57
+ 'whitelists': :'whitelists'
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
+ 'access_rules': :'Array<OCI::Waas::Models::AccessRule>',
67
+ 'address_rate_limiting': :'OCI::Waas::Models::AddressRateLimiting',
68
+ 'captchas': :'Array<OCI::Waas::Models::Captcha>',
69
+ 'device_fingerprint_challenge': :'OCI::Waas::Models::DeviceFingerprintChallenge',
70
+ 'human_interaction_challenge': :'OCI::Waas::Models::HumanInteractionChallenge',
71
+ 'js_challenge': :'OCI::Waas::Models::JsChallenge',
72
+ 'origin': :'String',
73
+ 'protection_settings': :'OCI::Waas::Models::ProtectionSettings',
74
+ 'whitelists': :'Array<OCI::Waas::Models::Whitelist>'
75
+ # rubocop:enable Style/SymbolLiteral
76
+ }
77
+ end
78
+
79
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
80
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
81
+
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @option attributes [Array<OCI::Waas::Models::AccessRule>] :access_rules The value to assign to the {#access_rules} property
86
+ # @option attributes [OCI::Waas::Models::AddressRateLimiting] :address_rate_limiting The value to assign to the {#address_rate_limiting} property
87
+ # @option attributes [Array<OCI::Waas::Models::Captcha>] :captchas The value to assign to the {#captchas} property
88
+ # @option attributes [OCI::Waas::Models::DeviceFingerprintChallenge] :device_fingerprint_challenge The value to assign to the {#device_fingerprint_challenge} property
89
+ # @option attributes [OCI::Waas::Models::HumanInteractionChallenge] :human_interaction_challenge The value to assign to the {#human_interaction_challenge} property
90
+ # @option attributes [OCI::Waas::Models::JsChallenge] :js_challenge The value to assign to the {#js_challenge} property
91
+ # @option attributes [String] :origin The value to assign to the {#origin} property
92
+ # @option attributes [OCI::Waas::Models::ProtectionSettings] :protection_settings The value to assign to the {#protection_settings} property
93
+ # @option attributes [Array<OCI::Waas::Models::Whitelist>] :whitelists The value to assign to the {#whitelists} property
94
+ def initialize(attributes = {})
95
+ return unless attributes.is_a?(Hash)
96
+
97
+ # convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
99
+
100
+ self.access_rules = attributes[:'accessRules'] if attributes[:'accessRules']
101
+
102
+ raise 'You cannot provide both :accessRules and :access_rules' if attributes.key?(:'accessRules') && attributes.key?(:'access_rules')
103
+
104
+ self.access_rules = attributes[:'access_rules'] if attributes[:'access_rules']
105
+
106
+ self.address_rate_limiting = attributes[:'addressRateLimiting'] if attributes[:'addressRateLimiting']
107
+
108
+ raise 'You cannot provide both :addressRateLimiting and :address_rate_limiting' if attributes.key?(:'addressRateLimiting') && attributes.key?(:'address_rate_limiting')
109
+
110
+ self.address_rate_limiting = attributes[:'address_rate_limiting'] if attributes[:'address_rate_limiting']
111
+
112
+ self.captchas = attributes[:'captchas'] if attributes[:'captchas']
113
+
114
+ self.device_fingerprint_challenge = attributes[:'deviceFingerprintChallenge'] if attributes[:'deviceFingerprintChallenge']
115
+
116
+ raise 'You cannot provide both :deviceFingerprintChallenge and :device_fingerprint_challenge' if attributes.key?(:'deviceFingerprintChallenge') && attributes.key?(:'device_fingerprint_challenge')
117
+
118
+ self.device_fingerprint_challenge = attributes[:'device_fingerprint_challenge'] if attributes[:'device_fingerprint_challenge']
119
+
120
+ self.human_interaction_challenge = attributes[:'humanInteractionChallenge'] if attributes[:'humanInteractionChallenge']
121
+
122
+ raise 'You cannot provide both :humanInteractionChallenge and :human_interaction_challenge' if attributes.key?(:'humanInteractionChallenge') && attributes.key?(:'human_interaction_challenge')
123
+
124
+ self.human_interaction_challenge = attributes[:'human_interaction_challenge'] if attributes[:'human_interaction_challenge']
125
+
126
+ self.js_challenge = attributes[:'jsChallenge'] if attributes[:'jsChallenge']
127
+
128
+ raise 'You cannot provide both :jsChallenge and :js_challenge' if attributes.key?(:'jsChallenge') && attributes.key?(:'js_challenge')
129
+
130
+ self.js_challenge = attributes[:'js_challenge'] if attributes[:'js_challenge']
131
+
132
+ self.origin = attributes[:'origin'] if attributes[:'origin']
133
+
134
+ self.protection_settings = attributes[:'protectionSettings'] if attributes[:'protectionSettings']
135
+
136
+ raise 'You cannot provide both :protectionSettings and :protection_settings' if attributes.key?(:'protectionSettings') && attributes.key?(:'protection_settings')
137
+
138
+ self.protection_settings = attributes[:'protection_settings'] if attributes[:'protection_settings']
139
+
140
+ self.whitelists = attributes[:'whitelists'] if attributes[:'whitelists']
141
+ end
142
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
143
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
144
+
145
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
146
+
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] other the other object to be compared
150
+ def ==(other)
151
+ return true if equal?(other)
152
+
153
+ self.class == other.class &&
154
+ access_rules == other.access_rules &&
155
+ address_rate_limiting == other.address_rate_limiting &&
156
+ captchas == other.captchas &&
157
+ device_fingerprint_challenge == other.device_fingerprint_challenge &&
158
+ human_interaction_challenge == other.human_interaction_challenge &&
159
+ js_challenge == other.js_challenge &&
160
+ origin == other.origin &&
161
+ protection_settings == other.protection_settings &&
162
+ whitelists == other.whitelists
163
+ end
164
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
165
+
166
+ # @see the `==` method
167
+ # @param [Object] other the other object to be compared
168
+ def eql?(other)
169
+ self == other
170
+ end
171
+
172
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
173
+
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Fixnum] Hash code
177
+ def hash
178
+ [access_rules, address_rate_limiting, captchas, device_fingerprint_challenge, human_interaction_challenge, js_challenge, origin, protection_settings, whitelists].hash
179
+ end
180
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
181
+
182
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
183
+
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+
191
+ self.class.swagger_types.each_pair do |key, type|
192
+ if type =~ /^Array<(.*)>/i
193
+ # check to ensure the input is an array given that the the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
196
+ public_method("#{key}=").call(
197
+ attributes[self.class.attribute_map[key]]
198
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
199
+ )
200
+ end
201
+ elsif !attributes[self.class.attribute_map[key]].nil?
202
+ public_method("#{key}=").call(
203
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
204
+ )
205
+ end
206
+ # or else data not found in attributes(hash), not an issue as the data can be optional
207
+ end
208
+
209
+ self
210
+ end
211
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = public_method(attr).call
225
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ private
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+ end
252
+ end
253
+ # rubocop:enable Lint/UnneededCopDisableDirective