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,223 @@
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 traffic data for the Web Application Firewall configured for a policy.
8
+ class Waas::Models::WafTrafficDatum # rubocop:disable Metrics/LineLength
9
+ # The date and time the traffic was observed, rounded down to the start of the 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
+ # Traffic in bytes.
30
+ # @return [Integer]
31
+ attr_accessor :traffic_in_bytes
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ # rubocop:disable Style/SymbolLiteral
37
+ 'time_observed': :'timeObserved',
38
+ 'time_range_in_seconds': :'timeRangeInSeconds',
39
+ 'tenancy_id': :'tenancyId',
40
+ 'compartment_id': :'compartmentId',
41
+ 'waas_policy_id': :'waasPolicyId',
42
+ 'traffic_in_bytes': :'trafficInBytes'
43
+ # rubocop:enable Style/SymbolLiteral
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ # rubocop:disable Style/SymbolLiteral
51
+ 'time_observed': :'DateTime',
52
+ 'time_range_in_seconds': :'Integer',
53
+ 'tenancy_id': :'String',
54
+ 'compartment_id': :'String',
55
+ 'waas_policy_id': :'String',
56
+ 'traffic_in_bytes': :'Integer'
57
+ # rubocop:enable Style/SymbolLiteral
58
+ }
59
+ end
60
+
61
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
62
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
63
+
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ # @option attributes [DateTime] :time_observed The value to assign to the {#time_observed} property
68
+ # @option attributes [Integer] :time_range_in_seconds The value to assign to the {#time_range_in_seconds} property
69
+ # @option attributes [String] :tenancy_id The value to assign to the {#tenancy_id} property
70
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
71
+ # @option attributes [String] :waas_policy_id The value to assign to the {#waas_policy_id} property
72
+ # @option attributes [Integer] :traffic_in_bytes The value to assign to the {#traffic_in_bytes} property
73
+ def initialize(attributes = {})
74
+ return unless attributes.is_a?(Hash)
75
+
76
+ # convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
78
+
79
+ self.time_observed = attributes[:'timeObserved'] if attributes[:'timeObserved']
80
+
81
+ raise 'You cannot provide both :timeObserved and :time_observed' if attributes.key?(:'timeObserved') && attributes.key?(:'time_observed')
82
+
83
+ self.time_observed = attributes[:'time_observed'] if attributes[:'time_observed']
84
+
85
+ self.time_range_in_seconds = attributes[:'timeRangeInSeconds'] if attributes[:'timeRangeInSeconds']
86
+
87
+ raise 'You cannot provide both :timeRangeInSeconds and :time_range_in_seconds' if attributes.key?(:'timeRangeInSeconds') && attributes.key?(:'time_range_in_seconds')
88
+
89
+ self.time_range_in_seconds = attributes[:'time_range_in_seconds'] if attributes[:'time_range_in_seconds']
90
+
91
+ self.tenancy_id = attributes[:'tenancyId'] if attributes[:'tenancyId']
92
+
93
+ raise 'You cannot provide both :tenancyId and :tenancy_id' if attributes.key?(:'tenancyId') && attributes.key?(:'tenancy_id')
94
+
95
+ self.tenancy_id = attributes[:'tenancy_id'] if attributes[:'tenancy_id']
96
+
97
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
98
+
99
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
100
+
101
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
102
+
103
+ self.waas_policy_id = attributes[:'waasPolicyId'] if attributes[:'waasPolicyId']
104
+
105
+ raise 'You cannot provide both :waasPolicyId and :waas_policy_id' if attributes.key?(:'waasPolicyId') && attributes.key?(:'waas_policy_id')
106
+
107
+ self.waas_policy_id = attributes[:'waas_policy_id'] if attributes[:'waas_policy_id']
108
+
109
+ self.traffic_in_bytes = attributes[:'trafficInBytes'] if attributes[:'trafficInBytes']
110
+
111
+ raise 'You cannot provide both :trafficInBytes and :traffic_in_bytes' if attributes.key?(:'trafficInBytes') && attributes.key?(:'traffic_in_bytes')
112
+
113
+ self.traffic_in_bytes = attributes[:'traffic_in_bytes'] if attributes[:'traffic_in_bytes']
114
+ end
115
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
116
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
117
+
118
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
119
+
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] other the other object to be compared
123
+ def ==(other)
124
+ return true if equal?(other)
125
+
126
+ self.class == other.class &&
127
+ time_observed == other.time_observed &&
128
+ time_range_in_seconds == other.time_range_in_seconds &&
129
+ tenancy_id == other.tenancy_id &&
130
+ compartment_id == other.compartment_id &&
131
+ waas_policy_id == other.waas_policy_id &&
132
+ traffic_in_bytes == other.traffic_in_bytes
133
+ end
134
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
135
+
136
+ # @see the `==` method
137
+ # @param [Object] other the other object to be compared
138
+ def eql?(other)
139
+ self == other
140
+ end
141
+
142
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
143
+
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Fixnum] Hash code
147
+ def hash
148
+ [time_observed, time_range_in_seconds, tenancy_id, compartment_id, waas_policy_id, traffic_in_bytes].hash
149
+ end
150
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
151
+
152
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
153
+
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+
161
+ self.class.swagger_types.each_pair do |key, type|
162
+ if type =~ /^Array<(.*)>/i
163
+ # check to ensure the input is an array given that the the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ public_method("#{key}=").call(
167
+ attributes[self.class.attribute_map[key]]
168
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
169
+ )
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ public_method("#{key}=").call(
173
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
174
+ )
175
+ end
176
+ # or else data not found in attributes(hash), not an issue as the data can be optional
177
+ end
178
+
179
+ self
180
+ end
181
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = public_method(attr).call
195
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ private
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+ end
222
+ end
223
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,159 @@
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
+ # An array of IP addresses that bypass the Web Application Firewall. Supports both single IP addresses or subnet masks (CIDR notation).
8
+ class Waas::Models::Whitelist # rubocop:disable Metrics/LineLength
9
+ # **[Required]** The unique name of the whitelist.
10
+ # @return [String]
11
+ attr_accessor :name
12
+
13
+ # **[Required]** A set of IP addresses or CIDR notations to include in the whitelist.
14
+ # @return [Array<String>]
15
+ attr_accessor :addresses
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ # rubocop:disable Style/SymbolLiteral
21
+ 'name': :'name',
22
+ 'addresses': :'addresses'
23
+ # rubocop:enable Style/SymbolLiteral
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ # rubocop:disable Style/SymbolLiteral
31
+ 'name': :'String',
32
+ 'addresses': :'Array<String>'
33
+ # rubocop:enable Style/SymbolLiteral
34
+ }
35
+ end
36
+
37
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
38
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
39
+
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ # @option attributes [String] :name The value to assign to the {#name} property
44
+ # @option attributes [Array<String>] :addresses The value to assign to the {#addresses} property
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ self.name = attributes[:'name'] if attributes[:'name']
52
+
53
+ self.addresses = attributes[:'addresses'] if attributes[:'addresses']
54
+ end
55
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
56
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
57
+
58
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
59
+
60
+
61
+ # Checks equality by comparing each attribute.
62
+ # @param [Object] other the other object to be compared
63
+ def ==(other)
64
+ return true if equal?(other)
65
+
66
+ self.class == other.class &&
67
+ name == other.name &&
68
+ addresses == other.addresses
69
+ end
70
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
71
+
72
+ # @see the `==` method
73
+ # @param [Object] other the other object to be compared
74
+ def eql?(other)
75
+ self == other
76
+ end
77
+
78
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
79
+
80
+
81
+ # Calculates hash code according to all attributes.
82
+ # @return [Fixnum] Hash code
83
+ def hash
84
+ [name, addresses].hash
85
+ end
86
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
87
+
88
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
89
+
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+
97
+ self.class.swagger_types.each_pair do |key, type|
98
+ if type =~ /^Array<(.*)>/i
99
+ # check to ensure the input is an array given that the the attribute
100
+ # is documented as an array but the input is not
101
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
102
+ public_method("#{key}=").call(
103
+ attributes[self.class.attribute_map[key]]
104
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
105
+ )
106
+ end
107
+ elsif !attributes[self.class.attribute_map[key]].nil?
108
+ public_method("#{key}=").call(
109
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
110
+ )
111
+ end
112
+ # or else data not found in attributes(hash), not an issue as the data can be optional
113
+ end
114
+
115
+ self
116
+ end
117
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
118
+
119
+ # Returns the string representation of the object
120
+ # @return [String] String presentation of the object
121
+ def to_s
122
+ to_hash.to_s
123
+ end
124
+
125
+ # Returns the object in the form of hash
126
+ # @return [Hash] Returns the object in the form of hash
127
+ def to_hash
128
+ hash = {}
129
+ self.class.attribute_map.each_pair do |attr, param|
130
+ value = public_method(attr).call
131
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
132
+
133
+ hash[param] = _to_hash(value)
134
+ end
135
+ hash
136
+ end
137
+
138
+ private
139
+
140
+ # Outputs non-array value in the form of hash
141
+ # For object, use to_hash. Otherwise, just return the value
142
+ # @param [Object] value Any valid value
143
+ # @return [Hash] Returns the value in the form of hash
144
+ def _to_hash(value)
145
+ if value.is_a?(Array)
146
+ value.compact.map { |v| _to_hash(v) }
147
+ elsif value.is_a?(Hash)
148
+ {}.tap do |hash|
149
+ value.each { |k, v| hash[k] = _to_hash(v) }
150
+ end
151
+ elsif value.respond_to? :to_hash
152
+ value.to_hash
153
+ else
154
+ value
155
+ end
156
+ end
157
+ end
158
+ end
159
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,322 @@
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
+ # Many of the API requests you use to create and configure WAAS policies do not take effect immediately. In these cases, the request spawns an asynchronous work flow to fulfill the request. `WorkRequest` objects provide visibility for in-progress work flows. For more information about work requests, see [Viewing the State of a Work Request](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/viewingworkrequest.htm).
9
+ class Waas::Models::WorkRequest # rubocop:disable Metrics/LineLength
10
+ OPERATION_TYPE_ENUM = [
11
+ OPERATION_TYPE_CREATE_WAAS_POLICY = 'CREATE_WAAS_POLICY'.freeze,
12
+ OPERATION_TYPE_UPDATE_WAAS_POLICY = 'UPDATE_WAAS_POLICY'.freeze,
13
+ OPERATION_TYPE_DELETE_WAAS_POLICY = 'DELETE_WAAS_POLICY'.freeze,
14
+ OPERATION_TYPE_PURGE_WAAS_POLICY = 'PURGE_WAAS_POLICY'.freeze,
15
+ OPERATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
16
+ ].freeze
17
+
18
+ STATUS_ENUM = [
19
+ STATUS_ACCEPTED = 'ACCEPTED'.freeze,
20
+ STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
21
+ STATUS_FAILED = 'FAILED'.freeze,
22
+ STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
23
+ STATUS_CANCELING = 'CANCELING'.freeze,
24
+ STATUS_CANCELED = 'CANCELED'.freeze,
25
+ STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
26
+ ].freeze
27
+
28
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request.
29
+ # @return [String]
30
+ attr_accessor :id
31
+
32
+ # **[Required]** A description of the operation requested by the work request.
33
+ # @return [String]
34
+ attr_reader :operation_type
35
+
36
+ # **[Required]** The current status of the work request.
37
+ # @return [String]
38
+ attr_reader :status
39
+
40
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request.
41
+ # @return [String]
42
+ attr_accessor :compartment_id
43
+
44
+ # The resources being used to complete the work request operation.
45
+ # @return [Array<OCI::Waas::Models::WorkRequestResource>]
46
+ attr_accessor :resources
47
+
48
+ # The percentage of work completed by the work request.
49
+ # @return [Integer]
50
+ attr_accessor :percent_complete
51
+
52
+ # The list of log entries from the work request workflow.
53
+ # @return [Array<OCI::Waas::Models::WorkRequestLogEntry>]
54
+ attr_accessor :logs
55
+
56
+ # The list of errors that occurred while fulfilling the work request.
57
+ # @return [Array<OCI::Waas::Models::WorkRequestError>]
58
+ attr_accessor :errors
59
+
60
+ # **[Required]** The date and time the work request was created, in the format defined by RFC3339.
61
+ # @return [DateTime]
62
+ attr_accessor :time_accepted
63
+
64
+ # **[Required]** The date and time the work request moved from the `ACCEPTED` state to the `IN_PROGRESS` state, expressed in RFC 3339 timestamp format.
65
+ # @return [DateTime]
66
+ attr_accessor :time_started
67
+
68
+ # **[Required]** The date and time the work request was fulfilled or terminated, expressed in RFC 3339 timestamp format.
69
+ # @return [DateTime]
70
+ attr_accessor :time_finished
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ # rubocop:disable Style/SymbolLiteral
76
+ 'id': :'id',
77
+ 'operation_type': :'operationType',
78
+ 'status': :'status',
79
+ 'compartment_id': :'compartmentId',
80
+ 'resources': :'resources',
81
+ 'percent_complete': :'percentComplete',
82
+ 'logs': :'logs',
83
+ 'errors': :'errors',
84
+ 'time_accepted': :'timeAccepted',
85
+ 'time_started': :'timeStarted',
86
+ 'time_finished': :'timeFinished'
87
+ # rubocop:enable Style/SymbolLiteral
88
+ }
89
+ end
90
+
91
+ # Attribute type mapping.
92
+ def self.swagger_types
93
+ {
94
+ # rubocop:disable Style/SymbolLiteral
95
+ 'id': :'String',
96
+ 'operation_type': :'String',
97
+ 'status': :'String',
98
+ 'compartment_id': :'String',
99
+ 'resources': :'Array<OCI::Waas::Models::WorkRequestResource>',
100
+ 'percent_complete': :'Integer',
101
+ 'logs': :'Array<OCI::Waas::Models::WorkRequestLogEntry>',
102
+ 'errors': :'Array<OCI::Waas::Models::WorkRequestError>',
103
+ 'time_accepted': :'DateTime',
104
+ 'time_started': :'DateTime',
105
+ 'time_finished': :'DateTime'
106
+ # rubocop:enable Style/SymbolLiteral
107
+ }
108
+ end
109
+
110
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
111
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
112
+
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @option attributes [String] :id The value to assign to the {#id} property
117
+ # @option attributes [String] :operation_type The value to assign to the {#operation_type} property
118
+ # @option attributes [String] :status The value to assign to the {#status} property
119
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
120
+ # @option attributes [Array<OCI::Waas::Models::WorkRequestResource>] :resources The value to assign to the {#resources} property
121
+ # @option attributes [Integer] :percent_complete The value to assign to the {#percent_complete} property
122
+ # @option attributes [Array<OCI::Waas::Models::WorkRequestLogEntry>] :logs The value to assign to the {#logs} property
123
+ # @option attributes [Array<OCI::Waas::Models::WorkRequestError>] :errors The value to assign to the {#errors} property
124
+ # @option attributes [DateTime] :time_accepted The value to assign to the {#time_accepted} property
125
+ # @option attributes [DateTime] :time_started The value to assign to the {#time_started} property
126
+ # @option attributes [DateTime] :time_finished The value to assign to the {#time_finished} property
127
+ def initialize(attributes = {})
128
+ return unless attributes.is_a?(Hash)
129
+
130
+ # convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
132
+
133
+ self.id = attributes[:'id'] if attributes[:'id']
134
+
135
+ self.operation_type = attributes[:'operationType'] if attributes[:'operationType']
136
+
137
+ raise 'You cannot provide both :operationType and :operation_type' if attributes.key?(:'operationType') && attributes.key?(:'operation_type')
138
+
139
+ self.operation_type = attributes[:'operation_type'] if attributes[:'operation_type']
140
+
141
+ self.status = attributes[:'status'] if attributes[:'status']
142
+
143
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
144
+
145
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
146
+
147
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
148
+
149
+ self.resources = attributes[:'resources'] if attributes[:'resources']
150
+
151
+ self.percent_complete = attributes[:'percentComplete'] if attributes[:'percentComplete']
152
+
153
+ raise 'You cannot provide both :percentComplete and :percent_complete' if attributes.key?(:'percentComplete') && attributes.key?(:'percent_complete')
154
+
155
+ self.percent_complete = attributes[:'percent_complete'] if attributes[:'percent_complete']
156
+
157
+ self.logs = attributes[:'logs'] if attributes[:'logs']
158
+
159
+ self.errors = attributes[:'errors'] if attributes[:'errors']
160
+
161
+ self.time_accepted = attributes[:'timeAccepted'] if attributes[:'timeAccepted']
162
+
163
+ raise 'You cannot provide both :timeAccepted and :time_accepted' if attributes.key?(:'timeAccepted') && attributes.key?(:'time_accepted')
164
+
165
+ self.time_accepted = attributes[:'time_accepted'] if attributes[:'time_accepted']
166
+
167
+ self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']
168
+
169
+ raise 'You cannot provide both :timeStarted and :time_started' if attributes.key?(:'timeStarted') && attributes.key?(:'time_started')
170
+
171
+ self.time_started = attributes[:'time_started'] if attributes[:'time_started']
172
+
173
+ self.time_finished = attributes[:'timeFinished'] if attributes[:'timeFinished']
174
+
175
+ raise 'You cannot provide both :timeFinished and :time_finished' if attributes.key?(:'timeFinished') && attributes.key?(:'time_finished')
176
+
177
+ self.time_finished = attributes[:'time_finished'] if attributes[:'time_finished']
178
+ end
179
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
180
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
181
+
182
+ # Custom attribute writer method checking allowed values (enum).
183
+ # @param [Object] operation_type Object to be assigned
184
+ def operation_type=(operation_type)
185
+ # rubocop:disable Style/ConditionalAssignment
186
+ if operation_type && !OPERATION_TYPE_ENUM.include?(operation_type)
187
+ # rubocop: disable Metrics/LineLength
188
+ OCI.logger.debug("Unknown value for 'operation_type' [" + operation_type + "]. Mapping to 'OPERATION_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
189
+ # rubocop: enable Metrics/LineLength
190
+ @operation_type = OPERATION_TYPE_UNKNOWN_ENUM_VALUE
191
+ else
192
+ @operation_type = operation_type
193
+ end
194
+ # rubocop:enable Style/ConditionalAssignment
195
+ end
196
+
197
+ # Custom attribute writer method checking allowed values (enum).
198
+ # @param [Object] status Object to be assigned
199
+ def status=(status)
200
+ # rubocop:disable Style/ConditionalAssignment
201
+ if status && !STATUS_ENUM.include?(status)
202
+ # rubocop: disable Metrics/LineLength
203
+ OCI.logger.debug("Unknown value for 'status' [" + status + "]. Mapping to 'STATUS_UNKNOWN_ENUM_VALUE'") if OCI.logger
204
+ # rubocop: enable Metrics/LineLength
205
+ @status = STATUS_UNKNOWN_ENUM_VALUE
206
+ else
207
+ @status = status
208
+ end
209
+ # rubocop:enable Style/ConditionalAssignment
210
+ end
211
+
212
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
213
+
214
+
215
+ # Checks equality by comparing each attribute.
216
+ # @param [Object] other the other object to be compared
217
+ def ==(other)
218
+ return true if equal?(other)
219
+
220
+ self.class == other.class &&
221
+ id == other.id &&
222
+ operation_type == other.operation_type &&
223
+ status == other.status &&
224
+ compartment_id == other.compartment_id &&
225
+ resources == other.resources &&
226
+ percent_complete == other.percent_complete &&
227
+ logs == other.logs &&
228
+ errors == other.errors &&
229
+ time_accepted == other.time_accepted &&
230
+ time_started == other.time_started &&
231
+ time_finished == other.time_finished
232
+ end
233
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
234
+
235
+ # @see the `==` method
236
+ # @param [Object] other the other object to be compared
237
+ def eql?(other)
238
+ self == other
239
+ end
240
+
241
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
242
+
243
+
244
+ # Calculates hash code according to all attributes.
245
+ # @return [Fixnum] Hash code
246
+ def hash
247
+ [id, operation_type, status, compartment_id, resources, percent_complete, logs, errors, time_accepted, time_started, time_finished].hash
248
+ end
249
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
250
+
251
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
252
+
253
+
254
+ # Builds the object from hash
255
+ # @param [Hash] attributes Model attributes in the form of hash
256
+ # @return [Object] Returns the model itself
257
+ def build_from_hash(attributes)
258
+ return nil unless attributes.is_a?(Hash)
259
+
260
+ self.class.swagger_types.each_pair do |key, type|
261
+ if type =~ /^Array<(.*)>/i
262
+ # check to ensure the input is an array given that the the attribute
263
+ # is documented as an array but the input is not
264
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
265
+ public_method("#{key}=").call(
266
+ attributes[self.class.attribute_map[key]]
267
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
268
+ )
269
+ end
270
+ elsif !attributes[self.class.attribute_map[key]].nil?
271
+ public_method("#{key}=").call(
272
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
273
+ )
274
+ end
275
+ # or else data not found in attributes(hash), not an issue as the data can be optional
276
+ end
277
+
278
+ self
279
+ end
280
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
281
+
282
+ # Returns the string representation of the object
283
+ # @return [String] String presentation of the object
284
+ def to_s
285
+ to_hash.to_s
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = public_method(attr).call
294
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
295
+
296
+ hash[param] = _to_hash(value)
297
+ end
298
+ hash
299
+ end
300
+
301
+ private
302
+
303
+ # Outputs non-array value in the form of hash
304
+ # For object, use to_hash. Otherwise, just return the value
305
+ # @param [Object] value Any valid value
306
+ # @return [Hash] Returns the value in the form of hash
307
+ def _to_hash(value)
308
+ if value.is_a?(Array)
309
+ value.compact.map { |v| _to_hash(v) }
310
+ elsif value.is_a?(Hash)
311
+ {}.tap do |hash|
312
+ value.each { |k, v| hash[k] = _to_hash(v) }
313
+ end
314
+ elsif value.respond_to? :to_hash
315
+ value.to_hash
316
+ else
317
+ value
318
+ end
319
+ end
320
+ end
321
+ end
322
+ # rubocop:enable Lint/UnneededCopDisableDirective