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,279 @@
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
+ # WafMeterDatum model.
8
+ class Waas::Models::WafMeterDatum # rubocop:disable Metrics/LineLength
9
+ # The date and time the traffic was observed, rounded down to the start of a range, and expressed in RFC 3339 timestamp format.
10
+ # @return [DateTime]
11
+ attr_accessor :time_observed
12
+
13
+ # The number of seconds this data covers.
14
+ # @return [Integer]
15
+ attr_accessor :time_range_in_seconds
16
+
17
+ # The tenancy OCID of the data.
18
+ # @return [String]
19
+ attr_accessor :tenancy_id
20
+
21
+ # The compartment OCID of the data.
22
+ # @return [String]
23
+ attr_accessor :compartment_id
24
+
25
+ # The policy OCID of the data.
26
+ # @return [String]
27
+ attr_accessor :waas_policy_id
28
+
29
+ # True if origin (endpoint) is an OCI resource. False if external.
30
+ # @return [BOOLEAN]
31
+ attr_accessor :is_oci_origin
32
+
33
+ # True if bot manager is enabled.
34
+ # @return [BOOLEAN]
35
+ attr_accessor :is_bot_enabled
36
+
37
+ # The number of incoming requests.
38
+ # @return [Integer]
39
+ attr_accessor :request_count
40
+
41
+ # Traffic in bytes.
42
+ # @return [Integer]
43
+ attr_accessor :traffic_in_bytes
44
+
45
+ # The tag slug for the specified `waasPolicyId`.
46
+ # @return [String]
47
+ attr_accessor :tag_slug
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ # rubocop:disable Style/SymbolLiteral
53
+ 'time_observed': :'timeObserved',
54
+ 'time_range_in_seconds': :'timeRangeInSeconds',
55
+ 'tenancy_id': :'tenancyId',
56
+ 'compartment_id': :'compartmentId',
57
+ 'waas_policy_id': :'waasPolicyId',
58
+ 'is_oci_origin': :'isOciOrigin',
59
+ 'is_bot_enabled': :'isBotEnabled',
60
+ 'request_count': :'requestCount',
61
+ 'traffic_in_bytes': :'trafficInBytes',
62
+ 'tag_slug': :'tagSlug'
63
+ # rubocop:enable Style/SymbolLiteral
64
+ }
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.swagger_types
69
+ {
70
+ # rubocop:disable Style/SymbolLiteral
71
+ 'time_observed': :'DateTime',
72
+ 'time_range_in_seconds': :'Integer',
73
+ 'tenancy_id': :'String',
74
+ 'compartment_id': :'String',
75
+ 'waas_policy_id': :'String',
76
+ 'is_oci_origin': :'BOOLEAN',
77
+ 'is_bot_enabled': :'BOOLEAN',
78
+ 'request_count': :'Integer',
79
+ 'traffic_in_bytes': :'Integer',
80
+ 'tag_slug': :'String'
81
+ # rubocop:enable Style/SymbolLiteral
82
+ }
83
+ end
84
+
85
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
86
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
87
+
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @option attributes [DateTime] :time_observed The value to assign to the {#time_observed} property
92
+ # @option attributes [Integer] :time_range_in_seconds The value to assign to the {#time_range_in_seconds} property
93
+ # @option attributes [String] :tenancy_id The value to assign to the {#tenancy_id} property
94
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
95
+ # @option attributes [String] :waas_policy_id The value to assign to the {#waas_policy_id} property
96
+ # @option attributes [BOOLEAN] :is_oci_origin The value to assign to the {#is_oci_origin} property
97
+ # @option attributes [BOOLEAN] :is_bot_enabled The value to assign to the {#is_bot_enabled} property
98
+ # @option attributes [Integer] :request_count The value to assign to the {#request_count} property
99
+ # @option attributes [Integer] :traffic_in_bytes The value to assign to the {#traffic_in_bytes} property
100
+ # @option attributes [String] :tag_slug The value to assign to the {#tag_slug} property
101
+ def initialize(attributes = {})
102
+ return unless attributes.is_a?(Hash)
103
+
104
+ # convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
106
+
107
+ self.time_observed = attributes[:'timeObserved'] if attributes[:'timeObserved']
108
+
109
+ raise 'You cannot provide both :timeObserved and :time_observed' if attributes.key?(:'timeObserved') && attributes.key?(:'time_observed')
110
+
111
+ self.time_observed = attributes[:'time_observed'] if attributes[:'time_observed']
112
+
113
+ self.time_range_in_seconds = attributes[:'timeRangeInSeconds'] if attributes[:'timeRangeInSeconds']
114
+
115
+ raise 'You cannot provide both :timeRangeInSeconds and :time_range_in_seconds' if attributes.key?(:'timeRangeInSeconds') && attributes.key?(:'time_range_in_seconds')
116
+
117
+ self.time_range_in_seconds = attributes[:'time_range_in_seconds'] if attributes[:'time_range_in_seconds']
118
+
119
+ self.tenancy_id = attributes[:'tenancyId'] if attributes[:'tenancyId']
120
+
121
+ raise 'You cannot provide both :tenancyId and :tenancy_id' if attributes.key?(:'tenancyId') && attributes.key?(:'tenancy_id')
122
+
123
+ self.tenancy_id = attributes[:'tenancy_id'] if attributes[:'tenancy_id']
124
+
125
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
126
+
127
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
128
+
129
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
130
+
131
+ self.waas_policy_id = attributes[:'waasPolicyId'] if attributes[:'waasPolicyId']
132
+
133
+ raise 'You cannot provide both :waasPolicyId and :waas_policy_id' if attributes.key?(:'waasPolicyId') && attributes.key?(:'waas_policy_id')
134
+
135
+ self.waas_policy_id = attributes[:'waas_policy_id'] if attributes[:'waas_policy_id']
136
+
137
+ self.is_oci_origin = attributes[:'isOciOrigin'] unless attributes[:'isOciOrigin'].nil?
138
+
139
+ raise 'You cannot provide both :isOciOrigin and :is_oci_origin' if attributes.key?(:'isOciOrigin') && attributes.key?(:'is_oci_origin')
140
+
141
+ self.is_oci_origin = attributes[:'is_oci_origin'] unless attributes[:'is_oci_origin'].nil?
142
+
143
+ self.is_bot_enabled = attributes[:'isBotEnabled'] unless attributes[:'isBotEnabled'].nil?
144
+
145
+ raise 'You cannot provide both :isBotEnabled and :is_bot_enabled' if attributes.key?(:'isBotEnabled') && attributes.key?(:'is_bot_enabled')
146
+
147
+ self.is_bot_enabled = attributes[:'is_bot_enabled'] unless attributes[:'is_bot_enabled'].nil?
148
+
149
+ self.request_count = attributes[:'requestCount'] if attributes[:'requestCount']
150
+
151
+ raise 'You cannot provide both :requestCount and :request_count' if attributes.key?(:'requestCount') && attributes.key?(:'request_count')
152
+
153
+ self.request_count = attributes[:'request_count'] if attributes[:'request_count']
154
+
155
+ self.traffic_in_bytes = attributes[:'trafficInBytes'] if attributes[:'trafficInBytes']
156
+
157
+ raise 'You cannot provide both :trafficInBytes and :traffic_in_bytes' if attributes.key?(:'trafficInBytes') && attributes.key?(:'traffic_in_bytes')
158
+
159
+ self.traffic_in_bytes = attributes[:'traffic_in_bytes'] if attributes[:'traffic_in_bytes']
160
+
161
+ self.tag_slug = attributes[:'tagSlug'] if attributes[:'tagSlug']
162
+
163
+ raise 'You cannot provide both :tagSlug and :tag_slug' if attributes.key?(:'tagSlug') && attributes.key?(:'tag_slug')
164
+
165
+ self.tag_slug = attributes[:'tag_slug'] if attributes[:'tag_slug']
166
+ end
167
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
168
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
169
+
170
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
171
+
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] other the other object to be compared
175
+ def ==(other)
176
+ return true if equal?(other)
177
+
178
+ self.class == other.class &&
179
+ time_observed == other.time_observed &&
180
+ time_range_in_seconds == other.time_range_in_seconds &&
181
+ tenancy_id == other.tenancy_id &&
182
+ compartment_id == other.compartment_id &&
183
+ waas_policy_id == other.waas_policy_id &&
184
+ is_oci_origin == other.is_oci_origin &&
185
+ is_bot_enabled == other.is_bot_enabled &&
186
+ request_count == other.request_count &&
187
+ traffic_in_bytes == other.traffic_in_bytes &&
188
+ tag_slug == other.tag_slug
189
+ end
190
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
191
+
192
+ # @see the `==` method
193
+ # @param [Object] other the other object to be compared
194
+ def eql?(other)
195
+ self == other
196
+ end
197
+
198
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
199
+
200
+
201
+ # Calculates hash code according to all attributes.
202
+ # @return [Fixnum] Hash code
203
+ def hash
204
+ [time_observed, time_range_in_seconds, tenancy_id, compartment_id, waas_policy_id, is_oci_origin, is_bot_enabled, request_count, traffic_in_bytes, tag_slug].hash
205
+ end
206
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
207
+
208
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
209
+
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def build_from_hash(attributes)
215
+ return nil unless attributes.is_a?(Hash)
216
+
217
+ self.class.swagger_types.each_pair do |key, type|
218
+ if type =~ /^Array<(.*)>/i
219
+ # check to ensure the input is an array given that the the attribute
220
+ # is documented as an array but the input is not
221
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
222
+ public_method("#{key}=").call(
223
+ attributes[self.class.attribute_map[key]]
224
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
225
+ )
226
+ end
227
+ elsif !attributes[self.class.attribute_map[key]].nil?
228
+ public_method("#{key}=").call(
229
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
230
+ )
231
+ end
232
+ # or else data not found in attributes(hash), not an issue as the data can be optional
233
+ end
234
+
235
+ self
236
+ end
237
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = public_method(attr).call
251
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
252
+
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ private
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+ end
278
+ end
279
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,177 @@
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
+ # A time series of request counts handled by the Web Application Firewall, including blocked requests.
8
+ class Waas::Models::WafRequest # rubocop:disable Metrics/LineLength
9
+ # The date and time the traffic was observed, rounded down to the start of a range, and expressed in RFC 3339 timestamp format.
10
+ # @return [DateTime]
11
+ attr_accessor :time_observed
12
+
13
+ # The number of seconds this data covers.
14
+ # @return [Integer]
15
+ attr_accessor :time_range_in_seconds
16
+
17
+ # The total number of requests received in this time period.
18
+ # @return [Integer]
19
+ attr_accessor :count
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ # rubocop:disable Style/SymbolLiteral
25
+ 'time_observed': :'timeObserved',
26
+ 'time_range_in_seconds': :'timeRangeInSeconds',
27
+ 'count': :'count'
28
+ # rubocop:enable Style/SymbolLiteral
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ # rubocop:disable Style/SymbolLiteral
36
+ 'time_observed': :'DateTime',
37
+ 'time_range_in_seconds': :'Integer',
38
+ 'count': :'Integer'
39
+ # rubocop:enable Style/SymbolLiteral
40
+ }
41
+ end
42
+
43
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
44
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
45
+
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ # @option attributes [DateTime] :time_observed The value to assign to the {#time_observed} property
50
+ # @option attributes [Integer] :time_range_in_seconds The value to assign to the {#time_range_in_seconds} property
51
+ # @option attributes [Integer] :count The value to assign to the {#count} property
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ self.time_observed = attributes[:'timeObserved'] if attributes[:'timeObserved']
59
+
60
+ raise 'You cannot provide both :timeObserved and :time_observed' if attributes.key?(:'timeObserved') && attributes.key?(:'time_observed')
61
+
62
+ self.time_observed = attributes[:'time_observed'] if attributes[:'time_observed']
63
+
64
+ self.time_range_in_seconds = attributes[:'timeRangeInSeconds'] if attributes[:'timeRangeInSeconds']
65
+
66
+ raise 'You cannot provide both :timeRangeInSeconds and :time_range_in_seconds' if attributes.key?(:'timeRangeInSeconds') && attributes.key?(:'time_range_in_seconds')
67
+
68
+ self.time_range_in_seconds = attributes[:'time_range_in_seconds'] if attributes[:'time_range_in_seconds']
69
+
70
+ self.count = attributes[:'count'] if attributes[:'count']
71
+ end
72
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
73
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
74
+
75
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
76
+
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] other the other object to be compared
80
+ def ==(other)
81
+ return true if equal?(other)
82
+
83
+ self.class == other.class &&
84
+ time_observed == other.time_observed &&
85
+ time_range_in_seconds == other.time_range_in_seconds &&
86
+ count == other.count
87
+ end
88
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
89
+
90
+ # @see the `==` method
91
+ # @param [Object] other the other object to be compared
92
+ def eql?(other)
93
+ self == other
94
+ end
95
+
96
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
97
+
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [time_observed, time_range_in_seconds, count].hash
103
+ end
104
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
105
+
106
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
107
+
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if type =~ /^Array<(.*)>/i
117
+ # check to ensure the input is an array given that the the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ public_method("#{key}=").call(
121
+ attributes[self.class.attribute_map[key]]
122
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
123
+ )
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ public_method("#{key}=").call(
127
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
128
+ )
129
+ end
130
+ # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
136
+
137
+ # Returns the string representation of the object
138
+ # @return [String] String presentation of the object
139
+ def to_s
140
+ to_hash.to_s
141
+ end
142
+
143
+ # Returns the object in the form of hash
144
+ # @return [Hash] Returns the object in the form of hash
145
+ def to_hash
146
+ hash = {}
147
+ self.class.attribute_map.each_pair do |attr, param|
148
+ value = public_method(attr).call
149
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
150
+
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ private
157
+
158
+ # Outputs non-array value in the form of hash
159
+ # For object, use to_hash. Otherwise, just return the value
160
+ # @param [Object] value Any valid value
161
+ # @return [Hash] Returns the value in the form of hash
162
+ def _to_hash(value)
163
+ if value.is_a?(Array)
164
+ value.compact.map { |v| _to_hash(v) }
165
+ elsif value.is_a?(Hash)
166
+ {}.tap do |hash|
167
+ value.each { |k, v| hash[k] = _to_hash(v) }
168
+ end
169
+ elsif value.respond_to? :to_hash
170
+ value.to_hash
171
+ else
172
+ value
173
+ end
174
+ end
175
+ end
176
+ end
177
+ # rubocop:enable Lint/UnneededCopDisableDirective