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,271 @@
|
|
|
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
|
+
# Summary information about a WAAS policy.
|
|
9
|
+
#
|
|
10
|
+
# **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
|
|
11
|
+
class Waas::Models::WaasPolicySummary # rubocop:disable Metrics/LineLength
|
|
12
|
+
LIFECYCLE_STATE_ENUM = [
|
|
13
|
+
LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
|
|
14
|
+
LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
|
|
15
|
+
LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
|
|
16
|
+
LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
|
|
17
|
+
LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
|
|
18
|
+
LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
|
|
19
|
+
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
|
20
|
+
].freeze
|
|
21
|
+
|
|
22
|
+
# The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the WAAS policy.
|
|
23
|
+
# @return [String]
|
|
24
|
+
attr_accessor :id
|
|
25
|
+
|
|
26
|
+
# The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the WAAS policy's compartment.
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :compartment_id
|
|
29
|
+
|
|
30
|
+
# The user-friendly name of the WAAS policy. The name can be changed and does not need to be unique.
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :display_name
|
|
33
|
+
|
|
34
|
+
# The web application domain that the WAAS policy protects.
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :domain
|
|
37
|
+
|
|
38
|
+
# The current lifecycle state of the WAAS policy.
|
|
39
|
+
# @return [String]
|
|
40
|
+
attr_reader :lifecycle_state
|
|
41
|
+
|
|
42
|
+
# The date and time the policy was created, expressed in RFC 3339 timestamp format.
|
|
43
|
+
# @return [DateTime]
|
|
44
|
+
attr_accessor :time_created
|
|
45
|
+
|
|
46
|
+
# A simple key-value pair without any defined schema.
|
|
47
|
+
# @return [Hash<String, String>]
|
|
48
|
+
attr_accessor :freeform_tags
|
|
49
|
+
|
|
50
|
+
# A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces.
|
|
51
|
+
# @return [Hash<String, Hash<String, Object>>]
|
|
52
|
+
attr_accessor :defined_tags
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
# rubocop:disable Style/SymbolLiteral
|
|
58
|
+
'id': :'id',
|
|
59
|
+
'compartment_id': :'compartmentId',
|
|
60
|
+
'display_name': :'displayName',
|
|
61
|
+
'domain': :'domain',
|
|
62
|
+
'lifecycle_state': :'lifecycleState',
|
|
63
|
+
'time_created': :'timeCreated',
|
|
64
|
+
'freeform_tags': :'freeformTags',
|
|
65
|
+
'defined_tags': :'definedTags'
|
|
66
|
+
# rubocop:enable Style/SymbolLiteral
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Attribute type mapping.
|
|
71
|
+
def self.swagger_types
|
|
72
|
+
{
|
|
73
|
+
# rubocop:disable Style/SymbolLiteral
|
|
74
|
+
'id': :'String',
|
|
75
|
+
'compartment_id': :'String',
|
|
76
|
+
'display_name': :'String',
|
|
77
|
+
'domain': :'String',
|
|
78
|
+
'lifecycle_state': :'String',
|
|
79
|
+
'time_created': :'DateTime',
|
|
80
|
+
'freeform_tags': :'Hash<String, String>',
|
|
81
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>'
|
|
82
|
+
# rubocop:enable Style/SymbolLiteral
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
87
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# Initializes the object
|
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
92
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
|
93
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
|
94
|
+
# @option attributes [String] :display_name The value to assign to the {#display_name} property
|
|
95
|
+
# @option attributes [String] :domain The value to assign to the {#domain} property
|
|
96
|
+
# @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
|
|
97
|
+
# @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
|
|
98
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
|
|
99
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
|
|
100
|
+
def initialize(attributes = {})
|
|
101
|
+
return unless attributes.is_a?(Hash)
|
|
102
|
+
|
|
103
|
+
# convert string to symbol for hash key
|
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
105
|
+
|
|
106
|
+
self.id = attributes[:'id'] if attributes[:'id']
|
|
107
|
+
|
|
108
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
|
109
|
+
|
|
110
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
|
111
|
+
|
|
112
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
|
113
|
+
|
|
114
|
+
self.display_name = attributes[:'displayName'] if attributes[:'displayName']
|
|
115
|
+
|
|
116
|
+
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
|
117
|
+
|
|
118
|
+
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
|
119
|
+
|
|
120
|
+
self.domain = attributes[:'domain'] if attributes[:'domain']
|
|
121
|
+
|
|
122
|
+
self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
|
|
123
|
+
|
|
124
|
+
raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
|
|
125
|
+
|
|
126
|
+
self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
|
|
127
|
+
|
|
128
|
+
self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
|
|
129
|
+
|
|
130
|
+
raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
|
|
131
|
+
|
|
132
|
+
self.time_created = attributes[:'time_created'] if attributes[:'time_created']
|
|
133
|
+
|
|
134
|
+
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
|
135
|
+
|
|
136
|
+
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
|
137
|
+
|
|
138
|
+
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
|
139
|
+
|
|
140
|
+
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
|
141
|
+
|
|
142
|
+
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
|
143
|
+
|
|
144
|
+
self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
|
|
145
|
+
end
|
|
146
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
147
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
150
|
+
# @param [Object] lifecycle_state Object to be assigned
|
|
151
|
+
def lifecycle_state=(lifecycle_state)
|
|
152
|
+
# rubocop:disable Style/ConditionalAssignment
|
|
153
|
+
if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
|
|
154
|
+
# rubocop: disable Metrics/LineLength
|
|
155
|
+
OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
|
156
|
+
# rubocop: enable Metrics/LineLength
|
|
157
|
+
@lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
|
|
158
|
+
else
|
|
159
|
+
@lifecycle_state = lifecycle_state
|
|
160
|
+
end
|
|
161
|
+
# rubocop:enable Style/ConditionalAssignment
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
# Checks equality by comparing each attribute.
|
|
168
|
+
# @param [Object] other the other object to be compared
|
|
169
|
+
def ==(other)
|
|
170
|
+
return true if equal?(other)
|
|
171
|
+
|
|
172
|
+
self.class == other.class &&
|
|
173
|
+
id == other.id &&
|
|
174
|
+
compartment_id == other.compartment_id &&
|
|
175
|
+
display_name == other.display_name &&
|
|
176
|
+
domain == other.domain &&
|
|
177
|
+
lifecycle_state == other.lifecycle_state &&
|
|
178
|
+
time_created == other.time_created &&
|
|
179
|
+
freeform_tags == other.freeform_tags &&
|
|
180
|
+
defined_tags == other.defined_tags
|
|
181
|
+
end
|
|
182
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
183
|
+
|
|
184
|
+
# @see the `==` method
|
|
185
|
+
# @param [Object] other the other object to be compared
|
|
186
|
+
def eql?(other)
|
|
187
|
+
self == other
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
# Calculates hash code according to all attributes.
|
|
194
|
+
# @return [Fixnum] Hash code
|
|
195
|
+
def hash
|
|
196
|
+
[id, compartment_id, display_name, domain, lifecycle_state, time_created, freeform_tags, defined_tags].hash
|
|
197
|
+
end
|
|
198
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
199
|
+
|
|
200
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
# Builds the object from hash
|
|
204
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
205
|
+
# @return [Object] Returns the model itself
|
|
206
|
+
def build_from_hash(attributes)
|
|
207
|
+
return nil unless attributes.is_a?(Hash)
|
|
208
|
+
|
|
209
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
210
|
+
if type =~ /^Array<(.*)>/i
|
|
211
|
+
# check to ensure the input is an array given that the the attribute
|
|
212
|
+
# is documented as an array but the input is not
|
|
213
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
214
|
+
public_method("#{key}=").call(
|
|
215
|
+
attributes[self.class.attribute_map[key]]
|
|
216
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
217
|
+
)
|
|
218
|
+
end
|
|
219
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
220
|
+
public_method("#{key}=").call(
|
|
221
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
222
|
+
)
|
|
223
|
+
end
|
|
224
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
self
|
|
228
|
+
end
|
|
229
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
230
|
+
|
|
231
|
+
# Returns the string representation of the object
|
|
232
|
+
# @return [String] String presentation of the object
|
|
233
|
+
def to_s
|
|
234
|
+
to_hash.to_s
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Returns the object in the form of hash
|
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
|
239
|
+
def to_hash
|
|
240
|
+
hash = {}
|
|
241
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
242
|
+
value = public_method(attr).call
|
|
243
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
244
|
+
|
|
245
|
+
hash[param] = _to_hash(value)
|
|
246
|
+
end
|
|
247
|
+
hash
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
private
|
|
251
|
+
|
|
252
|
+
# Outputs non-array value in the form of hash
|
|
253
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
254
|
+
# @param [Object] value Any valid value
|
|
255
|
+
# @return [Hash] Returns the value in the form of hash
|
|
256
|
+
def _to_hash(value)
|
|
257
|
+
if value.is_a?(Array)
|
|
258
|
+
value.compact.map { |v| _to_hash(v) }
|
|
259
|
+
elsif value.is_a?(Hash)
|
|
260
|
+
{}.tap do |hash|
|
|
261
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
262
|
+
end
|
|
263
|
+
elsif value.respond_to? :to_hash
|
|
264
|
+
value.to_hash
|
|
265
|
+
else
|
|
266
|
+
value
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
|
@@ -0,0 +1,219 @@
|
|
|
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
|
+
# WafBlockedRequest model.
|
|
9
|
+
class Waas::Models::WafBlockedRequest # rubocop:disable Metrics/LineLength
|
|
10
|
+
WAF_FEATURE_ENUM = [
|
|
11
|
+
WAF_FEATURE_PROTECTION_RULES = 'PROTECTION_RULES'.freeze,
|
|
12
|
+
WAF_FEATURE_JS_CHALLENGE = 'JS_CHALLENGE'.freeze,
|
|
13
|
+
WAF_FEATURE_ACCESS_RULES = 'ACCESS_RULES'.freeze,
|
|
14
|
+
WAF_FEATURE_THREAT_FEEDS = 'THREAT_FEEDS'.freeze,
|
|
15
|
+
WAF_FEATURE_HUMAN_INTERACTION_CHALLENGE = 'HUMAN_INTERACTION_CHALLENGE'.freeze,
|
|
16
|
+
WAF_FEATURE_DEVICE_FINGERPRINT_CHALLENGE = 'DEVICE_FINGERPRINT_CHALLENGE'.freeze,
|
|
17
|
+
WAF_FEATURE_CAPTCHA = 'CAPTCHA'.freeze,
|
|
18
|
+
WAF_FEATURE_ADDRESS_RATE_LIMITING = 'ADDRESS_RATE_LIMITING'.freeze,
|
|
19
|
+
WAF_FEATURE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
|
20
|
+
].freeze
|
|
21
|
+
|
|
22
|
+
# The date and time the blocked requests were observed, expressed in RFC 3339 timestamp format.
|
|
23
|
+
# @return [DateTime]
|
|
24
|
+
attr_accessor :time_observed
|
|
25
|
+
|
|
26
|
+
# The number of seconds the data covers.
|
|
27
|
+
# @return [Integer]
|
|
28
|
+
attr_accessor :time_range_in_seconds
|
|
29
|
+
|
|
30
|
+
# The specific Web Application Firewall feature that blocked the requests, such as JavaScript Challenge or Access Control.
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_reader :waf_feature
|
|
33
|
+
|
|
34
|
+
# The count of blocked requests.
|
|
35
|
+
# @return [Integer]
|
|
36
|
+
attr_accessor :count
|
|
37
|
+
|
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
39
|
+
def self.attribute_map
|
|
40
|
+
{
|
|
41
|
+
# rubocop:disable Style/SymbolLiteral
|
|
42
|
+
'time_observed': :'timeObserved',
|
|
43
|
+
'time_range_in_seconds': :'timeRangeInSeconds',
|
|
44
|
+
'waf_feature': :'wafFeature',
|
|
45
|
+
'count': :'count'
|
|
46
|
+
# rubocop:enable Style/SymbolLiteral
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.swagger_types
|
|
52
|
+
{
|
|
53
|
+
# rubocop:disable Style/SymbolLiteral
|
|
54
|
+
'time_observed': :'DateTime',
|
|
55
|
+
'time_range_in_seconds': :'Integer',
|
|
56
|
+
'waf_feature': :'String',
|
|
57
|
+
'count': :'Integer'
|
|
58
|
+
# rubocop:enable Style/SymbolLiteral
|
|
59
|
+
}
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
63
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
# @option attributes [DateTime] :time_observed The value to assign to the {#time_observed} property
|
|
69
|
+
# @option attributes [Integer] :time_range_in_seconds The value to assign to the {#time_range_in_seconds} property
|
|
70
|
+
# @option attributes [String] :waf_feature The value to assign to the {#waf_feature} property
|
|
71
|
+
# @option attributes [Integer] :count The value to assign to the {#count} property
|
|
72
|
+
def initialize(attributes = {})
|
|
73
|
+
return unless attributes.is_a?(Hash)
|
|
74
|
+
|
|
75
|
+
# convert string to symbol for hash key
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
77
|
+
|
|
78
|
+
self.time_observed = attributes[:'timeObserved'] if attributes[:'timeObserved']
|
|
79
|
+
|
|
80
|
+
raise 'You cannot provide both :timeObserved and :time_observed' if attributes.key?(:'timeObserved') && attributes.key?(:'time_observed')
|
|
81
|
+
|
|
82
|
+
self.time_observed = attributes[:'time_observed'] if attributes[:'time_observed']
|
|
83
|
+
|
|
84
|
+
self.time_range_in_seconds = attributes[:'timeRangeInSeconds'] if attributes[:'timeRangeInSeconds']
|
|
85
|
+
|
|
86
|
+
raise 'You cannot provide both :timeRangeInSeconds and :time_range_in_seconds' if attributes.key?(:'timeRangeInSeconds') && attributes.key?(:'time_range_in_seconds')
|
|
87
|
+
|
|
88
|
+
self.time_range_in_seconds = attributes[:'time_range_in_seconds'] if attributes[:'time_range_in_seconds']
|
|
89
|
+
|
|
90
|
+
self.waf_feature = attributes[:'wafFeature'] if attributes[:'wafFeature']
|
|
91
|
+
|
|
92
|
+
raise 'You cannot provide both :wafFeature and :waf_feature' if attributes.key?(:'wafFeature') && attributes.key?(:'waf_feature')
|
|
93
|
+
|
|
94
|
+
self.waf_feature = attributes[:'waf_feature'] if attributes[:'waf_feature']
|
|
95
|
+
|
|
96
|
+
self.count = attributes[:'count'] if attributes[:'count']
|
|
97
|
+
end
|
|
98
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
99
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
100
|
+
|
|
101
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
102
|
+
# @param [Object] waf_feature Object to be assigned
|
|
103
|
+
def waf_feature=(waf_feature)
|
|
104
|
+
# rubocop:disable Style/ConditionalAssignment
|
|
105
|
+
if waf_feature && !WAF_FEATURE_ENUM.include?(waf_feature)
|
|
106
|
+
# rubocop: disable Metrics/LineLength
|
|
107
|
+
OCI.logger.debug("Unknown value for 'waf_feature' [" + waf_feature + "]. Mapping to 'WAF_FEATURE_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
|
108
|
+
# rubocop: enable Metrics/LineLength
|
|
109
|
+
@waf_feature = WAF_FEATURE_UNKNOWN_ENUM_VALUE
|
|
110
|
+
else
|
|
111
|
+
@waf_feature = waf_feature
|
|
112
|
+
end
|
|
113
|
+
# rubocop:enable Style/ConditionalAssignment
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# Checks equality by comparing each attribute.
|
|
120
|
+
# @param [Object] other the other object to be compared
|
|
121
|
+
def ==(other)
|
|
122
|
+
return true if equal?(other)
|
|
123
|
+
|
|
124
|
+
self.class == other.class &&
|
|
125
|
+
time_observed == other.time_observed &&
|
|
126
|
+
time_range_in_seconds == other.time_range_in_seconds &&
|
|
127
|
+
waf_feature == other.waf_feature &&
|
|
128
|
+
count == other.count
|
|
129
|
+
end
|
|
130
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
|
131
|
+
|
|
132
|
+
# @see the `==` method
|
|
133
|
+
# @param [Object] other the other object to be compared
|
|
134
|
+
def eql?(other)
|
|
135
|
+
self == other
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
# Calculates hash code according to all attributes.
|
|
142
|
+
# @return [Fixnum] Hash code
|
|
143
|
+
def hash
|
|
144
|
+
[time_observed, time_range_in_seconds, waf_feature, count].hash
|
|
145
|
+
end
|
|
146
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
|
147
|
+
|
|
148
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
# Builds the object from hash
|
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
153
|
+
# @return [Object] Returns the model itself
|
|
154
|
+
def build_from_hash(attributes)
|
|
155
|
+
return nil unless attributes.is_a?(Hash)
|
|
156
|
+
|
|
157
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
158
|
+
if type =~ /^Array<(.*)>/i
|
|
159
|
+
# check to ensure the input is an array given that the the attribute
|
|
160
|
+
# is documented as an array but the input is not
|
|
161
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
162
|
+
public_method("#{key}=").call(
|
|
163
|
+
attributes[self.class.attribute_map[key]]
|
|
164
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
168
|
+
public_method("#{key}=").call(
|
|
169
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
170
|
+
)
|
|
171
|
+
end
|
|
172
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
self
|
|
176
|
+
end
|
|
177
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
178
|
+
|
|
179
|
+
# Returns the string representation of the object
|
|
180
|
+
# @return [String] String presentation of the object
|
|
181
|
+
def to_s
|
|
182
|
+
to_hash.to_s
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Returns the object in the form of hash
|
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
|
187
|
+
def to_hash
|
|
188
|
+
hash = {}
|
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
190
|
+
value = public_method(attr).call
|
|
191
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
192
|
+
|
|
193
|
+
hash[param] = _to_hash(value)
|
|
194
|
+
end
|
|
195
|
+
hash
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
private
|
|
199
|
+
|
|
200
|
+
# Outputs non-array value in the form of hash
|
|
201
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
202
|
+
# @param [Object] value Any valid value
|
|
203
|
+
# @return [Hash] Returns the value in the form of hash
|
|
204
|
+
def _to_hash(value)
|
|
205
|
+
if value.is_a?(Array)
|
|
206
|
+
value.compact.map { |v| _to_hash(v) }
|
|
207
|
+
elsif value.is_a?(Hash)
|
|
208
|
+
{}.tap do |hash|
|
|
209
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
210
|
+
end
|
|
211
|
+
elsif value.respond_to? :to_hash
|
|
212
|
+
value.to_hash
|
|
213
|
+
else
|
|
214
|
+
value
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|