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,257 @@
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 required data to create a WAAS policy.
8
+ #
9
+ # **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
10
+ class Waas::Models::CreateWaasPolicyDetails # rubocop:disable Metrics/LineLength
11
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the WAAS policy.
12
+ # @return [String]
13
+ attr_accessor :compartment_id
14
+
15
+ # A user-friendly name for the WAAS policy. The name is can be changed and does not need to be unique.
16
+ # @return [String]
17
+ attr_accessor :display_name
18
+
19
+ # **[Required]** The web application domain that the WAAS policy protects.
20
+ # @return [String]
21
+ attr_accessor :domain
22
+
23
+ # An array of additional domains for the specified web application.
24
+ # @return [Array<String>]
25
+ attr_accessor :additional_domains
26
+
27
+ # A map of host to origin for the web application. The key should be a customer friendly name for the host, ex. primary, secondary, etc.
28
+ # @return [Hash<String, OCI::Waas::Models::Origin>]
29
+ attr_accessor :origins
30
+
31
+ # @return [OCI::Waas::Models::PolicyConfig]
32
+ attr_accessor :policy_config
33
+
34
+ # @return [OCI::Waas::Models::WafConfigDetails]
35
+ attr_accessor :waf_config
36
+
37
+ # A simple key-value pair without any defined schema.
38
+ # @return [Hash<String, String>]
39
+ attr_accessor :freeform_tags
40
+
41
+ # A key-value pair with a defined schema that restricts the values of tags. These predefined keys are scoped to namespaces.
42
+ # @return [Hash<String, Hash<String, Object>>]
43
+ attr_accessor :defined_tags
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ # rubocop:disable Style/SymbolLiteral
49
+ 'compartment_id': :'compartmentId',
50
+ 'display_name': :'displayName',
51
+ 'domain': :'domain',
52
+ 'additional_domains': :'additionalDomains',
53
+ 'origins': :'origins',
54
+ 'policy_config': :'policyConfig',
55
+ 'waf_config': :'wafConfig',
56
+ 'freeform_tags': :'freeformTags',
57
+ 'defined_tags': :'definedTags'
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
+ 'compartment_id': :'String',
67
+ 'display_name': :'String',
68
+ 'domain': :'String',
69
+ 'additional_domains': :'Array<String>',
70
+ 'origins': :'Hash<String, OCI::Waas::Models::Origin>',
71
+ 'policy_config': :'OCI::Waas::Models::PolicyConfig',
72
+ 'waf_config': :'OCI::Waas::Models::WafConfigDetails',
73
+ 'freeform_tags': :'Hash<String, String>',
74
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
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 [String] :compartment_id The value to assign to the {#compartment_id} property
86
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
87
+ # @option attributes [String] :domain The value to assign to the {#domain} property
88
+ # @option attributes [Array<String>] :additional_domains The value to assign to the {#additional_domains} property
89
+ # @option attributes [Hash<String, OCI::Waas::Models::Origin>] :origins The value to assign to the {#origins} property
90
+ # @option attributes [OCI::Waas::Models::PolicyConfig] :policy_config The value to assign to the {#policy_config} property
91
+ # @option attributes [OCI::Waas::Models::WafConfigDetails] :waf_config The value to assign to the {#waf_config} property
92
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
93
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} 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.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
101
+
102
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
103
+
104
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
105
+
106
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
107
+
108
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
109
+
110
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
111
+
112
+ self.domain = attributes[:'domain'] if attributes[:'domain']
113
+
114
+ self.additional_domains = attributes[:'additionalDomains'] if attributes[:'additionalDomains']
115
+
116
+ raise 'You cannot provide both :additionalDomains and :additional_domains' if attributes.key?(:'additionalDomains') && attributes.key?(:'additional_domains')
117
+
118
+ self.additional_domains = attributes[:'additional_domains'] if attributes[:'additional_domains']
119
+
120
+ self.origins = attributes[:'origins'] if attributes[:'origins']
121
+
122
+ self.policy_config = attributes[:'policyConfig'] if attributes[:'policyConfig']
123
+
124
+ raise 'You cannot provide both :policyConfig and :policy_config' if attributes.key?(:'policyConfig') && attributes.key?(:'policy_config')
125
+
126
+ self.policy_config = attributes[:'policy_config'] if attributes[:'policy_config']
127
+
128
+ self.waf_config = attributes[:'wafConfig'] if attributes[:'wafConfig']
129
+
130
+ raise 'You cannot provide both :wafConfig and :waf_config' if attributes.key?(:'wafConfig') && attributes.key?(:'waf_config')
131
+
132
+ self.waf_config = attributes[:'waf_config'] if attributes[:'waf_config']
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
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
150
+
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] other the other object to be compared
154
+ def ==(other)
155
+ return true if equal?(other)
156
+
157
+ self.class == other.class &&
158
+ compartment_id == other.compartment_id &&
159
+ display_name == other.display_name &&
160
+ domain == other.domain &&
161
+ additional_domains == other.additional_domains &&
162
+ origins == other.origins &&
163
+ policy_config == other.policy_config &&
164
+ waf_config == other.waf_config &&
165
+ freeform_tags == other.freeform_tags &&
166
+ defined_tags == other.defined_tags
167
+ end
168
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
169
+
170
+ # @see the `==` method
171
+ # @param [Object] other the other object to be compared
172
+ def eql?(other)
173
+ self == other
174
+ end
175
+
176
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
177
+
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Fixnum] Hash code
181
+ def hash
182
+ [compartment_id, display_name, domain, additional_domains, origins, policy_config, waf_config, freeform_tags, defined_tags].hash
183
+ end
184
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
185
+
186
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
187
+
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def build_from_hash(attributes)
193
+ return nil unless attributes.is_a?(Hash)
194
+
195
+ self.class.swagger_types.each_pair do |key, type|
196
+ if type =~ /^Array<(.*)>/i
197
+ # check to ensure the input is an array given that the the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
200
+ public_method("#{key}=").call(
201
+ attributes[self.class.attribute_map[key]]
202
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
203
+ )
204
+ end
205
+ elsif !attributes[self.class.attribute_map[key]].nil?
206
+ public_method("#{key}=").call(
207
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
208
+ )
209
+ end
210
+ # or else data not found in attributes(hash), not an issue as the data can be optional
211
+ end
212
+
213
+ self
214
+ end
215
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = public_method(attr).call
229
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ private
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+ end
256
+ end
257
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,268 @@
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
+ # The device fingerprint challenge settings. The device fingerprint challenge generates hashed signatures of both virtual and real browsers to identify and block malicious bots.
9
+ class Waas::Models::DeviceFingerprintChallenge # rubocop:disable Metrics/LineLength
10
+ ACTION_ENUM = [
11
+ ACTION_DETECT = 'DETECT'.freeze,
12
+ ACTION_BLOCK = 'BLOCK'.freeze,
13
+ ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
14
+ ].freeze
15
+
16
+ # **[Required]** Enables or disables the device fingerprint challenge Web Application Firewall feature.
17
+ # @return [BOOLEAN]
18
+ attr_accessor :is_enabled
19
+
20
+ # The action to take on requests from detected bots. If unspecified, defaults to `DETECT`.
21
+ # @return [String]
22
+ attr_reader :action
23
+
24
+ # The number of failed requests allowed before taking action. If unspecified, defaults to `10`.
25
+ # @return [Integer]
26
+ attr_accessor :failure_threshold
27
+
28
+ # The number of seconds between challenges for the same IP address. If unspecified, defaults to `60`.
29
+ # @return [Integer]
30
+ attr_accessor :action_expiration_in_seconds
31
+
32
+ # The number of seconds before the failure threshold resets. If unspecified, defaults to `60`.
33
+ # @return [Integer]
34
+ attr_accessor :failure_threshold_expiration_in_seconds
35
+
36
+ # The maximum number of IP addresses permitted with the same device fingerprint. If unspecified, defaults to `20`.
37
+ # @return [Integer]
38
+ attr_accessor :max_address_count
39
+
40
+ # The number of seconds before the maximum addresses count resets. If unspecified, defaults to `60`.
41
+ # @return [Integer]
42
+ attr_accessor :max_address_count_expiration_in_seconds
43
+
44
+ # @return [OCI::Waas::Models::BlockChallengeSettings]
45
+ attr_accessor :challenge_settings
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ # rubocop:disable Style/SymbolLiteral
51
+ 'is_enabled': :'isEnabled',
52
+ 'action': :'action',
53
+ 'failure_threshold': :'failureThreshold',
54
+ 'action_expiration_in_seconds': :'actionExpirationInSeconds',
55
+ 'failure_threshold_expiration_in_seconds': :'failureThresholdExpirationInSeconds',
56
+ 'max_address_count': :'maxAddressCount',
57
+ 'max_address_count_expiration_in_seconds': :'maxAddressCountExpirationInSeconds',
58
+ 'challenge_settings': :'challengeSettings'
59
+ # rubocop:enable Style/SymbolLiteral
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ # rubocop:disable Style/SymbolLiteral
67
+ 'is_enabled': :'BOOLEAN',
68
+ 'action': :'String',
69
+ 'failure_threshold': :'Integer',
70
+ 'action_expiration_in_seconds': :'Integer',
71
+ 'failure_threshold_expiration_in_seconds': :'Integer',
72
+ 'max_address_count': :'Integer',
73
+ 'max_address_count_expiration_in_seconds': :'Integer',
74
+ 'challenge_settings': :'OCI::Waas::Models::BlockChallengeSettings'
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 [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
86
+ # @option attributes [String] :action The value to assign to the {#action} property
87
+ # @option attributes [Integer] :failure_threshold The value to assign to the {#failure_threshold} property
88
+ # @option attributes [Integer] :action_expiration_in_seconds The value to assign to the {#action_expiration_in_seconds} property
89
+ # @option attributes [Integer] :failure_threshold_expiration_in_seconds The value to assign to the {#failure_threshold_expiration_in_seconds} property
90
+ # @option attributes [Integer] :max_address_count The value to assign to the {#max_address_count} property
91
+ # @option attributes [Integer] :max_address_count_expiration_in_seconds The value to assign to the {#max_address_count_expiration_in_seconds} property
92
+ # @option attributes [OCI::Waas::Models::BlockChallengeSettings] :challenge_settings The value to assign to the {#challenge_settings} property
93
+ def initialize(attributes = {})
94
+ return unless attributes.is_a?(Hash)
95
+
96
+ # convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
98
+
99
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
100
+
101
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
102
+
103
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
104
+
105
+ self.action = attributes[:'action'] if attributes[:'action']
106
+
107
+ self.failure_threshold = attributes[:'failureThreshold'] if attributes[:'failureThreshold']
108
+
109
+ raise 'You cannot provide both :failureThreshold and :failure_threshold' if attributes.key?(:'failureThreshold') && attributes.key?(:'failure_threshold')
110
+
111
+ self.failure_threshold = attributes[:'failure_threshold'] if attributes[:'failure_threshold']
112
+
113
+ self.action_expiration_in_seconds = attributes[:'actionExpirationInSeconds'] if attributes[:'actionExpirationInSeconds']
114
+
115
+ raise 'You cannot provide both :actionExpirationInSeconds and :action_expiration_in_seconds' if attributes.key?(:'actionExpirationInSeconds') && attributes.key?(:'action_expiration_in_seconds')
116
+
117
+ self.action_expiration_in_seconds = attributes[:'action_expiration_in_seconds'] if attributes[:'action_expiration_in_seconds']
118
+
119
+ self.failure_threshold_expiration_in_seconds = attributes[:'failureThresholdExpirationInSeconds'] if attributes[:'failureThresholdExpirationInSeconds']
120
+
121
+ raise 'You cannot provide both :failureThresholdExpirationInSeconds and :failure_threshold_expiration_in_seconds' if attributes.key?(:'failureThresholdExpirationInSeconds') && attributes.key?(:'failure_threshold_expiration_in_seconds')
122
+
123
+ self.failure_threshold_expiration_in_seconds = attributes[:'failure_threshold_expiration_in_seconds'] if attributes[:'failure_threshold_expiration_in_seconds']
124
+
125
+ self.max_address_count = attributes[:'maxAddressCount'] if attributes[:'maxAddressCount']
126
+
127
+ raise 'You cannot provide both :maxAddressCount and :max_address_count' if attributes.key?(:'maxAddressCount') && attributes.key?(:'max_address_count')
128
+
129
+ self.max_address_count = attributes[:'max_address_count'] if attributes[:'max_address_count']
130
+
131
+ self.max_address_count_expiration_in_seconds = attributes[:'maxAddressCountExpirationInSeconds'] if attributes[:'maxAddressCountExpirationInSeconds']
132
+
133
+ raise 'You cannot provide both :maxAddressCountExpirationInSeconds and :max_address_count_expiration_in_seconds' if attributes.key?(:'maxAddressCountExpirationInSeconds') && attributes.key?(:'max_address_count_expiration_in_seconds')
134
+
135
+ self.max_address_count_expiration_in_seconds = attributes[:'max_address_count_expiration_in_seconds'] if attributes[:'max_address_count_expiration_in_seconds']
136
+
137
+ self.challenge_settings = attributes[:'challengeSettings'] if attributes[:'challengeSettings']
138
+
139
+ raise 'You cannot provide both :challengeSettings and :challenge_settings' if attributes.key?(:'challengeSettings') && attributes.key?(:'challenge_settings')
140
+
141
+ self.challenge_settings = attributes[:'challenge_settings'] if attributes[:'challenge_settings']
142
+ end
143
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
144
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
145
+
146
+ # Custom attribute writer method checking allowed values (enum).
147
+ # @param [Object] action Object to be assigned
148
+ def action=(action)
149
+ # rubocop:disable Style/ConditionalAssignment
150
+ if action && !ACTION_ENUM.include?(action)
151
+ # rubocop: disable Metrics/LineLength
152
+ OCI.logger.debug("Unknown value for 'action' [" + action + "]. Mapping to 'ACTION_UNKNOWN_ENUM_VALUE'") if OCI.logger
153
+ # rubocop: enable Metrics/LineLength
154
+ @action = ACTION_UNKNOWN_ENUM_VALUE
155
+ else
156
+ @action = action
157
+ end
158
+ # rubocop:enable Style/ConditionalAssignment
159
+ end
160
+
161
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
162
+
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] other the other object to be compared
166
+ def ==(other)
167
+ return true if equal?(other)
168
+
169
+ self.class == other.class &&
170
+ is_enabled == other.is_enabled &&
171
+ action == other.action &&
172
+ failure_threshold == other.failure_threshold &&
173
+ action_expiration_in_seconds == other.action_expiration_in_seconds &&
174
+ failure_threshold_expiration_in_seconds == other.failure_threshold_expiration_in_seconds &&
175
+ max_address_count == other.max_address_count &&
176
+ max_address_count_expiration_in_seconds == other.max_address_count_expiration_in_seconds &&
177
+ challenge_settings == other.challenge_settings
178
+ end
179
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
180
+
181
+ # @see the `==` method
182
+ # @param [Object] other the other object to be compared
183
+ def eql?(other)
184
+ self == other
185
+ end
186
+
187
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
188
+
189
+
190
+ # Calculates hash code according to all attributes.
191
+ # @return [Fixnum] Hash code
192
+ def hash
193
+ [is_enabled, action, failure_threshold, action_expiration_in_seconds, failure_threshold_expiration_in_seconds, max_address_count, max_address_count_expiration_in_seconds, challenge_settings].hash
194
+ end
195
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
196
+
197
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
198
+
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+
206
+ self.class.swagger_types.each_pair do |key, type|
207
+ if type =~ /^Array<(.*)>/i
208
+ # check to ensure the input is an array given that the the attribute
209
+ # is documented as an array but the input is not
210
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
211
+ public_method("#{key}=").call(
212
+ attributes[self.class.attribute_map[key]]
213
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
214
+ )
215
+ end
216
+ elsif !attributes[self.class.attribute_map[key]].nil?
217
+ public_method("#{key}=").call(
218
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
219
+ )
220
+ end
221
+ # or else data not found in attributes(hash), not an issue as the data can be optional
222
+ end
223
+
224
+ self
225
+ end
226
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = public_method(attr).call
240
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ private
248
+
249
+ # Outputs non-array value in the form of hash
250
+ # For object, use to_hash. Otherwise, just return the value
251
+ # @param [Object] value Any valid value
252
+ # @return [Hash] Returns the value in the form of hash
253
+ def _to_hash(value)
254
+ if value.is_a?(Array)
255
+ value.compact.map { |v| _to_hash(v) }
256
+ elsif value.is_a?(Hash)
257
+ {}.tap do |hash|
258
+ value.each { |k, v| hash[k] = _to_hash(v) }
259
+ end
260
+ elsif value.respond_to? :to_hash
261
+ value.to_hash
262
+ else
263
+ value
264
+ end
265
+ end
266
+ end
267
+ end
268
+ # rubocop:enable Lint/UnneededCopDisableDirective