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,237 @@
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
+ # Configuration for sorting and/or filtering the list of remaining candidate answers, subject to
9
+ # rule type and the values of type-specific parameters and/or data associated with answers.
10
+ #
11
+ # A rule may optionally include a sequence of cases, each with an optional `caseCondition`
12
+ # expression. If it does, the first case with a matching `caseCondition` or with no
13
+ # `caseCondition` at all is used to set rule parameter values and/or answer-associated data,
14
+ # and the rule will be ignored during processing of any request that does not match any case.
15
+ # Rules without a sequence of cases are processed unconditionally, and rules with an _empty_
16
+ # sequence of cases are **ignored** unconditionally.
17
+ #
18
+ # Data is associated with answers one-by-one in a similar fashion\u2014for each answer, the first
19
+ # answerData item with a matching `answerCondition` or with no `answerCondition` at all is used
20
+ # to associate data with the answer, and the absence of any such item associates with the answer
21
+ # a default value. Rule-level default answer data is always processed, but case-level answer
22
+ # data will override it on a per-answer basis.
23
+ #
24
+ # To prevent empty responses, any attempt to filter away all answers is suppressed at runtime.
25
+ #
26
+ # This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
27
+ class Dns::Models::SteeringPolicyRule # rubocop:disable Metrics/LineLength
28
+ RULE_TYPE_ENUM = [
29
+ RULE_TYPE_FILTER = 'FILTER'.freeze,
30
+ RULE_TYPE_HEALTH = 'HEALTH'.freeze,
31
+ RULE_TYPE_WEIGHTED = 'WEIGHTED'.freeze,
32
+ RULE_TYPE_PRIORITY = 'PRIORITY'.freeze,
33
+ RULE_TYPE_LIMIT = 'LIMIT'.freeze,
34
+ RULE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
35
+ ].freeze
36
+
37
+ # Your description of the rule's purpose and/or behavior.
38
+ # @return [String]
39
+ attr_accessor :description
40
+
41
+ # **[Required]** The type of a rule determines its sorting/filtering behavior.
42
+ # - FILTER rules filter the list of answers (e.g., to remove those with hosts that are down
43
+ # for maintenance). Answers remain if and only if their associated data is `true`.
44
+ # - HEALTH rules remove answers from the list if their `rdata` matches a target in the
45
+ # health check monitor referenced by the steering policy and the target is reported down.
46
+ # - WEIGHTED rules probabilistically move answers with greater associated integer data to
47
+ # the beginning of the list.
48
+ # - PRIORITY rules sort answers by associated integer data, moving those with the lowest
49
+ # values to the beginning of the list without changing the relative order of those with
50
+ # the same value.
51
+ # - LIMIT rules filter away answers that are too far down the list. Parameter \"count\"
52
+ # specifies how many answers to keep.
53
+ #
54
+ # @return [String]
55
+ attr_reader :rule_type
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ # rubocop:disable Style/SymbolLiteral
61
+ 'description': :'description',
62
+ 'rule_type': :'ruleType'
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
+ 'description': :'String',
72
+ 'rule_type': :'String'
73
+ # rubocop:enable Style/SymbolLiteral
74
+ }
75
+ end
76
+
77
+ # rubocop:disable Metrics/CyclomaticComplexity, Layout/EmptyLines
78
+
79
+
80
+ # Given the hash representation of a subtype of this class,
81
+ # use the info in the hash to return the class of the subtype.
82
+ def self.get_subtype(object_hash)
83
+ type = object_hash[:'ruleType'] # rubocop:disable Style/SymbolLiteral
84
+
85
+ return 'OCI::Dns::Models::SteeringPolicyFilterRule' if type == 'FILTER'
86
+ return 'OCI::Dns::Models::SteeringPolicyWeightedRule' if type == 'WEIGHTED'
87
+ return 'OCI::Dns::Models::SteeringPolicyLimitRule' if type == 'LIMIT'
88
+ return 'OCI::Dns::Models::SteeringPolicyHealthRule' if type == 'HEALTH'
89
+ return 'OCI::Dns::Models::SteeringPolicyPriorityRule' if type == 'PRIORITY'
90
+
91
+ # TODO: Log a warning when the subtype is not found.
92
+ 'OCI::Dns::Models::SteeringPolicyRule'
93
+ end
94
+ # rubocop:enable Metrics/CyclomaticComplexity, Layout/EmptyLines
95
+
96
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
97
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
98
+
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @option attributes [String] :description The value to assign to the {#description} property
103
+ # @option attributes [String] :rule_type The value to assign to the {#rule_type} property
104
+ def initialize(attributes = {})
105
+ return unless attributes.is_a?(Hash)
106
+
107
+ # convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
109
+
110
+ self.description = attributes[:'description'] if attributes[:'description']
111
+
112
+ self.rule_type = attributes[:'ruleType'] if attributes[:'ruleType']
113
+
114
+ raise 'You cannot provide both :ruleType and :rule_type' if attributes.key?(:'ruleType') && attributes.key?(:'rule_type')
115
+
116
+ self.rule_type = attributes[:'rule_type'] if attributes[:'rule_type']
117
+ end
118
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
119
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
120
+
121
+ # Custom attribute writer method checking allowed values (enum).
122
+ # @param [Object] rule_type Object to be assigned
123
+ def rule_type=(rule_type)
124
+ # rubocop:disable Style/ConditionalAssignment
125
+ if rule_type && !RULE_TYPE_ENUM.include?(rule_type)
126
+ # rubocop: disable Metrics/LineLength
127
+ OCI.logger.debug("Unknown value for 'rule_type' [" + rule_type + "]. Mapping to 'RULE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
128
+ # rubocop: enable Metrics/LineLength
129
+ @rule_type = RULE_TYPE_UNKNOWN_ENUM_VALUE
130
+ else
131
+ @rule_type = rule_type
132
+ end
133
+ # rubocop:enable Style/ConditionalAssignment
134
+ end
135
+
136
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
137
+
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] other the other object to be compared
141
+ def ==(other)
142
+ return true if equal?(other)
143
+
144
+ self.class == other.class &&
145
+ description == other.description &&
146
+ rule_type == other.rule_type
147
+ end
148
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
149
+
150
+ # @see the `==` method
151
+ # @param [Object] other the other object to be compared
152
+ def eql?(other)
153
+ self == other
154
+ end
155
+
156
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
157
+
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Fixnum] Hash code
161
+ def hash
162
+ [description, rule_type].hash
163
+ end
164
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
165
+
166
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
167
+
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+
175
+ self.class.swagger_types.each_pair do |key, type|
176
+ if type =~ /^Array<(.*)>/i
177
+ # check to ensure the input is an array given that the the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
180
+ public_method("#{key}=").call(
181
+ attributes[self.class.attribute_map[key]]
182
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
183
+ )
184
+ end
185
+ elsif !attributes[self.class.attribute_map[key]].nil?
186
+ public_method("#{key}=").call(
187
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
188
+ )
189
+ end
190
+ # or else data not found in attributes(hash), not an issue as the data can be optional
191
+ end
192
+
193
+ self
194
+ end
195
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = public_method(attr).call
209
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ private
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+ end
236
+ end
237
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,391 @@
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
+ # A DNS steering policy.
9
+ #
10
+ # *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
11
+ #
12
+ class Dns::Models::SteeringPolicySummary # rubocop:disable Metrics/LineLength
13
+ TEMPLATE_ENUM = [
14
+ TEMPLATE_FAILOVER = 'FAILOVER'.freeze,
15
+ TEMPLATE_LOAD_BALANCE = 'LOAD_BALANCE'.freeze,
16
+ TEMPLATE_ROUTE_BY_GEO = 'ROUTE_BY_GEO'.freeze,
17
+ TEMPLATE_ROUTE_BY_ASN = 'ROUTE_BY_ASN'.freeze,
18
+ TEMPLATE_ROUTE_BY_IP = 'ROUTE_BY_IP'.freeze,
19
+ TEMPLATE_CUSTOM = 'CUSTOM'.freeze,
20
+ TEMPLATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
21
+ ].freeze
22
+
23
+ LIFECYCLE_STATE_ENUM = [
24
+ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
25
+ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
26
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
27
+ LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
28
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
29
+ ].freeze
30
+
31
+ # The OCID of the compartment containing the steering policy.
32
+ # @return [String]
33
+ attr_accessor :compartment_id
34
+
35
+ # A user-friendly name for the steering policy.
36
+ # Does not have to be unique, and it's changeable.
37
+ # Avoid entering confidential information.
38
+ #
39
+ # @return [String]
40
+ attr_accessor :display_name
41
+
42
+ # The Time To Live for responses from the steering policy, in seconds.
43
+ # If not specified during creation, a value of 30 seconds will be used.
44
+ #
45
+ # @return [Integer]
46
+ attr_accessor :ttl
47
+
48
+ # The OCID of the health check monitor providing health data about the answers of the
49
+ # steering policy.
50
+ # A steering policy answer with `rdata` matching a monitored endpoint will use the health
51
+ # data of that endpoint.
52
+ # A steering policy answer with `rdata` not matching any monitored endpoint will be assumed
53
+ # healthy.
54
+ #
55
+ # @return [String]
56
+ attr_accessor :health_check_monitor_id
57
+
58
+ # The common pattern (or lack thereof) to which the steering policy adheres. This
59
+ # value restricts the possible configurations of rules, but thereby supports
60
+ # specifically tailored interfaces. Values other than \"CUSTOM\" require the rules to
61
+ # begin with an unconditional FILTER that keeps answers contingent upon
62
+ # `answer.isDisabled != true`, followed
63
+ # _if and only if the policy references a health check monitor_ by an unconditional
64
+ # HEALTH rule, and require the last rule to be an unconditional LIMIT.
65
+ # What must precede the LIMIT rule is determined by the template value:
66
+ # - FAILOVER requires exactly an unconditional PRIORITY rule that ranks answers by pool.
67
+ # Each answer pool must have a unique priority value assigned to it. Answer data must
68
+ # be defined in the `defaultAnswerData` property for the rule and the `cases` property
69
+ # must not be defined.
70
+ # - LOAD_BALANCE requires exactly an unconditional WEIGHTED rule that shuffles answers
71
+ # by name. Answer data must be defined in the `defaultAnswerData` property for the
72
+ # rule and the `cases` property must not be defined.
73
+ # - ROUTE_BY_GEO requires exactly one PRIORITY rule that ranks answers by pool using the
74
+ # geographical location of the client as a condition. Within that rule you may only
75
+ # use `query.client.geoKey` in the `caseCondition` expressions for defining the cases.
76
+ # For each case in the PRIORITY rule each answer pool must have a unique priority
77
+ # value assigned to it. Answer data can only be defined within cases and
78
+ # `defaultAnswerData` cannot be used in the PRIORITY rule.
79
+ # - ROUTE_BY_ASN requires exactly one PRIORITY rule that ranks answers by pool using the
80
+ # ASN of the client as a condition. Within that rule you may only use
81
+ # `query.client.asn` in the `caseCondition` expressions for defining the cases.
82
+ # For each case in the PRIORITY rule each answer pool must have a unique priority
83
+ # value assigned to it. Answer data can only be defined within cases and
84
+ # `defaultAnswerData` cannot be used in the PRIORITY rule.
85
+ # - ROUTE_BY_IP requires exactly one PRIORITY rule that ranks answers by pool using the
86
+ # IP subnet of the client as a condition. Within that rule you may only use
87
+ # `query.client.address` in the `caseCondition` expressions for defining the cases.
88
+ # For each case in the PRIORITY rule each answer pool must have a unique priority
89
+ # value assigned to it. Answer data can only be defined within cases and
90
+ # `defaultAnswerData` cannot be used in the PRIORITY rule.
91
+ # - CUSTOM allows an arbitrary configuration of rules.
92
+ #
93
+ # For an existing steering policy, the template value may be changed to any of the
94
+ # supported options but the resulting policy must conform to the requirements for the
95
+ # new template type or else a Bad Request error will be returned.
96
+ #
97
+ # @return [String]
98
+ attr_reader :template
99
+
100
+ # Simple key-value pair that is applied without any predefined name, type, or scope.
101
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
102
+ # Example: `{\"bar-key\": \"value\"}`
103
+ #
104
+ # @return [Hash<String, String>]
105
+ attr_accessor :freeform_tags
106
+
107
+ # Usage of predefined tag keys. These predefined keys are scoped to a namespace.
108
+ # Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`
109
+ #
110
+ # @return [Hash<String, Hash<String, Object>>]
111
+ attr_accessor :defined_tags
112
+
113
+ # The canonical absolute URL of the resource.
114
+ # @return [String]
115
+ attr_accessor :_self
116
+
117
+ # The OCID of the resource.
118
+ # @return [String]
119
+ attr_accessor :id
120
+
121
+ # The date and time the resource was created in \"YYYY-MM-ddThh:mmZ\" format
122
+ # with a Z offset, as defined by RFC 3339.
123
+ #
124
+ # **Example:** `2016-07-22T17:23:59:60Z`
125
+ #
126
+ # @return [DateTime]
127
+ attr_accessor :time_created
128
+
129
+ # The current state of the resource.
130
+ # @return [String]
131
+ attr_reader :lifecycle_state
132
+
133
+ # Attribute mapping from ruby-style variable name to JSON key.
134
+ def self.attribute_map
135
+ {
136
+ # rubocop:disable Style/SymbolLiteral
137
+ 'compartment_id': :'compartmentId',
138
+ 'display_name': :'displayName',
139
+ 'ttl': :'ttl',
140
+ 'health_check_monitor_id': :'healthCheckMonitorId',
141
+ 'template': :'template',
142
+ 'freeform_tags': :'freeformTags',
143
+ 'defined_tags': :'definedTags',
144
+ '_self': :'self',
145
+ 'id': :'id',
146
+ 'time_created': :'timeCreated',
147
+ 'lifecycle_state': :'lifecycleState'
148
+ # rubocop:enable Style/SymbolLiteral
149
+ }
150
+ end
151
+
152
+ # Attribute type mapping.
153
+ def self.swagger_types
154
+ {
155
+ # rubocop:disable Style/SymbolLiteral
156
+ 'compartment_id': :'String',
157
+ 'display_name': :'String',
158
+ 'ttl': :'Integer',
159
+ 'health_check_monitor_id': :'String',
160
+ 'template': :'String',
161
+ 'freeform_tags': :'Hash<String, String>',
162
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
163
+ '_self': :'String',
164
+ 'id': :'String',
165
+ 'time_created': :'DateTime',
166
+ 'lifecycle_state': :'String'
167
+ # rubocop:enable Style/SymbolLiteral
168
+ }
169
+ end
170
+
171
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
172
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
173
+
174
+
175
+ # Initializes the object
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
178
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
179
+ # @option attributes [Integer] :ttl The value to assign to the {#ttl} property
180
+ # @option attributes [String] :health_check_monitor_id The value to assign to the {#health_check_monitor_id} property
181
+ # @option attributes [String] :template The value to assign to the {#template} property
182
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
183
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
184
+ # @option attributes [String] :_self The value to assign to the {#_self} property
185
+ # @option attributes [String] :id The value to assign to the {#id} property
186
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
187
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
188
+ def initialize(attributes = {})
189
+ return unless attributes.is_a?(Hash)
190
+
191
+ # convert string to symbol for hash key
192
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
193
+
194
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
195
+
196
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
197
+
198
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
199
+
200
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
201
+
202
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
203
+
204
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
205
+
206
+ self.ttl = attributes[:'ttl'] if attributes[:'ttl']
207
+
208
+ self.health_check_monitor_id = attributes[:'healthCheckMonitorId'] if attributes[:'healthCheckMonitorId']
209
+
210
+ raise 'You cannot provide both :healthCheckMonitorId and :health_check_monitor_id' if attributes.key?(:'healthCheckMonitorId') && attributes.key?(:'health_check_monitor_id')
211
+
212
+ self.health_check_monitor_id = attributes[:'health_check_monitor_id'] if attributes[:'health_check_monitor_id']
213
+
214
+ self.template = attributes[:'template'] if attributes[:'template']
215
+
216
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
217
+
218
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
219
+
220
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
221
+
222
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
223
+
224
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
225
+
226
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
227
+
228
+ self._self = attributes[:'self'] if attributes[:'self']
229
+
230
+ raise 'You cannot provide both :self and :_self' if attributes.key?(:'self') && attributes.key?(:'_self')
231
+
232
+ self._self = attributes[:'_self'] if attributes[:'_self']
233
+
234
+ self.id = attributes[:'id'] if attributes[:'id']
235
+
236
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
237
+
238
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
239
+
240
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
241
+
242
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
243
+
244
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
245
+
246
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
247
+ end
248
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
249
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
250
+
251
+ # Custom attribute writer method checking allowed values (enum).
252
+ # @param [Object] template Object to be assigned
253
+ def template=(template)
254
+ # rubocop:disable Style/ConditionalAssignment
255
+ if template && !TEMPLATE_ENUM.include?(template)
256
+ # rubocop: disable Metrics/LineLength
257
+ OCI.logger.debug("Unknown value for 'template' [" + template + "]. Mapping to 'TEMPLATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
258
+ # rubocop: enable Metrics/LineLength
259
+ @template = TEMPLATE_UNKNOWN_ENUM_VALUE
260
+ else
261
+ @template = template
262
+ end
263
+ # rubocop:enable Style/ConditionalAssignment
264
+ end
265
+
266
+ # Custom attribute writer method checking allowed values (enum).
267
+ # @param [Object] lifecycle_state Object to be assigned
268
+ def lifecycle_state=(lifecycle_state)
269
+ # rubocop:disable Style/ConditionalAssignment
270
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
271
+ # rubocop: disable Metrics/LineLength
272
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
273
+ # rubocop: enable Metrics/LineLength
274
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
275
+ else
276
+ @lifecycle_state = lifecycle_state
277
+ end
278
+ # rubocop:enable Style/ConditionalAssignment
279
+ end
280
+
281
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
282
+
283
+
284
+ # Checks equality by comparing each attribute.
285
+ # @param [Object] other the other object to be compared
286
+ def ==(other)
287
+ return true if equal?(other)
288
+
289
+ self.class == other.class &&
290
+ compartment_id == other.compartment_id &&
291
+ display_name == other.display_name &&
292
+ ttl == other.ttl &&
293
+ health_check_monitor_id == other.health_check_monitor_id &&
294
+ template == other.template &&
295
+ freeform_tags == other.freeform_tags &&
296
+ defined_tags == other.defined_tags &&
297
+ _self == other._self &&
298
+ id == other.id &&
299
+ time_created == other.time_created &&
300
+ lifecycle_state == other.lifecycle_state
301
+ end
302
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
303
+
304
+ # @see the `==` method
305
+ # @param [Object] other the other object to be compared
306
+ def eql?(other)
307
+ self == other
308
+ end
309
+
310
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
311
+
312
+
313
+ # Calculates hash code according to all attributes.
314
+ # @return [Fixnum] Hash code
315
+ def hash
316
+ [compartment_id, display_name, ttl, health_check_monitor_id, template, freeform_tags, defined_tags, _self, id, time_created, lifecycle_state].hash
317
+ end
318
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
319
+
320
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
321
+
322
+
323
+ # Builds the object from hash
324
+ # @param [Hash] attributes Model attributes in the form of hash
325
+ # @return [Object] Returns the model itself
326
+ def build_from_hash(attributes)
327
+ return nil unless attributes.is_a?(Hash)
328
+
329
+ self.class.swagger_types.each_pair do |key, type|
330
+ if type =~ /^Array<(.*)>/i
331
+ # check to ensure the input is an array given that the the attribute
332
+ # is documented as an array but the input is not
333
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
334
+ public_method("#{key}=").call(
335
+ attributes[self.class.attribute_map[key]]
336
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
337
+ )
338
+ end
339
+ elsif !attributes[self.class.attribute_map[key]].nil?
340
+ public_method("#{key}=").call(
341
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
342
+ )
343
+ end
344
+ # or else data not found in attributes(hash), not an issue as the data can be optional
345
+ end
346
+
347
+ self
348
+ end
349
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
350
+
351
+ # Returns the string representation of the object
352
+ # @return [String] String presentation of the object
353
+ def to_s
354
+ to_hash.to_s
355
+ end
356
+
357
+ # Returns the object in the form of hash
358
+ # @return [Hash] Returns the object in the form of hash
359
+ def to_hash
360
+ hash = {}
361
+ self.class.attribute_map.each_pair do |attr, param|
362
+ value = public_method(attr).call
363
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
364
+
365
+ hash[param] = _to_hash(value)
366
+ end
367
+ hash
368
+ end
369
+
370
+ private
371
+
372
+ # Outputs non-array value in the form of hash
373
+ # For object, use to_hash. Otherwise, just return the value
374
+ # @param [Object] value Any valid value
375
+ # @return [Hash] Returns the value in the form of hash
376
+ def _to_hash(value)
377
+ if value.is_a?(Array)
378
+ value.compact.map { |v| _to_hash(v) }
379
+ elsif value.is_a?(Hash)
380
+ {}.tap do |hash|
381
+ value.each { |k, v| hash[k] = _to_hash(v) }
382
+ end
383
+ elsif value.respond_to? :to_hash
384
+ value.to_hash
385
+ else
386
+ value
387
+ end
388
+ end
389
+ end
390
+ end
391
+ # rubocop:enable Lint/UnneededCopDisableDirective