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,156 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # The body for updating a steering policy attachment.
8
+ class Dns::Models::UpdateSteeringPolicyAttachmentDetails # rubocop:disable Metrics/LineLength
9
+ # A user-friendly name for the steering policy attachment.
10
+ # Does not have to be unique, and it's changeable.
11
+ # Avoid entering confidential information.
12
+ #
13
+ # @return [String]
14
+ attr_accessor :display_name
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ # rubocop:disable Style/SymbolLiteral
20
+ 'display_name': :'displayName'
21
+ # rubocop:enable Style/SymbolLiteral
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.swagger_types
27
+ {
28
+ # rubocop:disable Style/SymbolLiteral
29
+ 'display_name': :'String'
30
+ # rubocop:enable Style/SymbolLiteral
31
+ }
32
+ end
33
+
34
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
35
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
36
+
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
48
+
49
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
50
+
51
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
52
+ end
53
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
54
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
55
+
56
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
57
+
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] other the other object to be compared
61
+ def ==(other)
62
+ return true if equal?(other)
63
+
64
+ self.class == other.class &&
65
+ display_name == other.display_name
66
+ end
67
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
68
+
69
+ # @see the `==` method
70
+ # @param [Object] other the other object to be compared
71
+ def eql?(other)
72
+ self == other
73
+ end
74
+
75
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
76
+
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [display_name].hash
82
+ end
83
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
84
+
85
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
86
+
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+
94
+ self.class.swagger_types.each_pair do |key, type|
95
+ if type =~ /^Array<(.*)>/i
96
+ # check to ensure the input is an array given that the the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
99
+ public_method("#{key}=").call(
100
+ attributes[self.class.attribute_map[key]]
101
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
102
+ )
103
+ end
104
+ elsif !attributes[self.class.attribute_map[key]].nil?
105
+ public_method("#{key}=").call(
106
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
107
+ )
108
+ end
109
+ # or else data not found in attributes(hash), not an issue as the data can be optional
110
+ end
111
+
112
+ self
113
+ end
114
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
115
+
116
+ # Returns the string representation of the object
117
+ # @return [String] String presentation of the object
118
+ def to_s
119
+ to_hash.to_s
120
+ end
121
+
122
+ # Returns the object in the form of hash
123
+ # @return [Hash] Returns the object in the form of hash
124
+ def to_hash
125
+ hash = {}
126
+ self.class.attribute_map.each_pair do |attr, param|
127
+ value = public_method(attr).call
128
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
129
+
130
+ hash[param] = _to_hash(value)
131
+ end
132
+ hash
133
+ end
134
+
135
+ private
136
+
137
+ # Outputs non-array value in the form of hash
138
+ # For object, use to_hash. Otherwise, just return the value
139
+ # @param [Object] value Any valid value
140
+ # @return [Hash] Returns the value in the form of hash
141
+ def _to_hash(value)
142
+ if value.is_a?(Array)
143
+ value.compact.map { |v| _to_hash(v) }
144
+ elsif value.is_a?(Hash)
145
+ {}.tap do |hash|
146
+ value.each { |k, v| hash[k] = _to_hash(v) }
147
+ end
148
+ elsif value.respond_to? :to_hash
149
+ value.to_hash
150
+ else
151
+ value
152
+ end
153
+ end
154
+ end
155
+ end
156
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,319 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # The body for updating a steering policy. New rules and answers provided in the request will
8
+ # replace the existing rules and answers in the 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::UpdateSteeringPolicyDetails # 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
+ ].freeze
21
+
22
+ # A user-friendly name for the steering policy.
23
+ # Does not have to be unique, and it's changeable.
24
+ # Avoid entering confidential information.
25
+ #
26
+ # @return [String]
27
+ attr_accessor :display_name
28
+
29
+ # The Time To Live for responses from the steering policy, in seconds.
30
+ # If not specified during creation, a value of 30 seconds will be used.
31
+ #
32
+ # @return [Integer]
33
+ attr_accessor :ttl
34
+
35
+ # The OCID of the health check monitor providing health data about the answers of the
36
+ # steering policy.
37
+ # A steering policy answer with `rdata` matching a monitored endpoint will use the health
38
+ # data of that endpoint.
39
+ # A steering policy answer with `rdata` not matching any monitored endpoint will be assumed
40
+ # healthy.
41
+ #
42
+ # @return [String]
43
+ attr_accessor :health_check_monitor_id
44
+
45
+ # The common pattern (or lack thereof) to which the steering policy adheres. This
46
+ # value restricts the possible configurations of rules, but thereby supports
47
+ # specifically tailored interfaces. Values other than \"CUSTOM\" require the rules to
48
+ # begin with an unconditional FILTER that keeps answers contingent upon
49
+ # `answer.isDisabled != true`, followed
50
+ # _if and only if the policy references a health check monitor_ by an unconditional
51
+ # HEALTH rule, and require the last rule to be an unconditional LIMIT.
52
+ # What must precede the LIMIT rule is determined by the template value:
53
+ # - FAILOVER requires exactly an unconditional PRIORITY rule that ranks answers by pool.
54
+ # Each answer pool must have a unique priority value assigned to it. Answer data must
55
+ # be defined in the `defaultAnswerData` property for the rule and the `cases` property
56
+ # must not be defined.
57
+ # - LOAD_BALANCE requires exactly an unconditional WEIGHTED rule that shuffles answers
58
+ # by name. Answer data must be defined in the `defaultAnswerData` property for the
59
+ # rule and the `cases` property must not be defined.
60
+ # - ROUTE_BY_GEO requires exactly one PRIORITY rule that ranks answers by pool using the
61
+ # geographical location of the client as a condition. Within that rule you may only
62
+ # use `query.client.geoKey` in the `caseCondition` expressions for defining the cases.
63
+ # For each case in the PRIORITY rule each answer pool must have a unique priority
64
+ # value assigned to it. Answer data can only be defined within cases and
65
+ # `defaultAnswerData` cannot be used in the PRIORITY rule.
66
+ # - ROUTE_BY_ASN requires exactly one PRIORITY rule that ranks answers by pool using the
67
+ # ASN of the client as a condition. Within that rule you may only use
68
+ # `query.client.asn` in the `caseCondition` expressions for defining the cases.
69
+ # For each case in the PRIORITY rule each answer pool must have a unique priority
70
+ # value assigned to it. Answer data can only be defined within cases and
71
+ # `defaultAnswerData` cannot be used in the PRIORITY rule.
72
+ # - ROUTE_BY_IP requires exactly one PRIORITY rule that ranks answers by pool using the
73
+ # IP subnet of the client as a condition. Within that rule you may only use
74
+ # `query.client.address` in the `caseCondition` expressions for defining the cases.
75
+ # For each case in the PRIORITY rule each answer pool must have a unique priority
76
+ # value assigned to it. Answer data can only be defined within cases and
77
+ # `defaultAnswerData` cannot be used in the PRIORITY rule.
78
+ # - CUSTOM allows an arbitrary configuration of rules.
79
+ #
80
+ # For an existing steering policy, the template value may be changed to any of the
81
+ # supported options but the resulting policy must conform to the requirements for the
82
+ # new template type or else a Bad Request error will be returned.
83
+ #
84
+ # @return [String]
85
+ attr_reader :template
86
+
87
+ # Simple key-value pair that is applied without any predefined name, type, or scope.
88
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
89
+ # Example: `{\"bar-key\": \"value\"}`
90
+ #
91
+ # @return [Hash<String, String>]
92
+ attr_accessor :freeform_tags
93
+
94
+ # Usage of predefined tag keys. These predefined keys are scoped to a namespace.
95
+ # Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`
96
+ #
97
+ # @return [Hash<String, Hash<String, Object>>]
98
+ attr_accessor :defined_tags
99
+
100
+ # The set of all answers that can potentially issue from the steering policy.
101
+ #
102
+ # @return [Array<OCI::Dns::Models::SteeringPolicyAnswer>]
103
+ attr_accessor :answers
104
+
105
+ # The pipeline of rules that will be processed in sequence to reduce the pool of answers
106
+ # to a response for any given request.
107
+ #
108
+ # The first rule receives a shuffled list of all answers, and every other rule receives
109
+ # the list of answers emitted by the one preceding it. The last rule populates the
110
+ # response.
111
+ #
112
+ # @return [Array<OCI::Dns::Models::SteeringPolicyRule>]
113
+ attr_accessor :rules
114
+
115
+ # Attribute mapping from ruby-style variable name to JSON key.
116
+ def self.attribute_map
117
+ {
118
+ # rubocop:disable Style/SymbolLiteral
119
+ 'display_name': :'displayName',
120
+ 'ttl': :'ttl',
121
+ 'health_check_monitor_id': :'healthCheckMonitorId',
122
+ 'template': :'template',
123
+ 'freeform_tags': :'freeformTags',
124
+ 'defined_tags': :'definedTags',
125
+ 'answers': :'answers',
126
+ 'rules': :'rules'
127
+ # rubocop:enable Style/SymbolLiteral
128
+ }
129
+ end
130
+
131
+ # Attribute type mapping.
132
+ def self.swagger_types
133
+ {
134
+ # rubocop:disable Style/SymbolLiteral
135
+ 'display_name': :'String',
136
+ 'ttl': :'Integer',
137
+ 'health_check_monitor_id': :'String',
138
+ 'template': :'String',
139
+ 'freeform_tags': :'Hash<String, String>',
140
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
141
+ 'answers': :'Array<OCI::Dns::Models::SteeringPolicyAnswer>',
142
+ 'rules': :'Array<OCI::Dns::Models::SteeringPolicyRule>'
143
+ # rubocop:enable Style/SymbolLiteral
144
+ }
145
+ end
146
+
147
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
148
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
149
+
150
+
151
+ # Initializes the object
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
154
+ # @option attributes [Integer] :ttl The value to assign to the {#ttl} property
155
+ # @option attributes [String] :health_check_monitor_id The value to assign to the {#health_check_monitor_id} property
156
+ # @option attributes [String] :template The value to assign to the {#template} property
157
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
158
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
159
+ # @option attributes [Array<OCI::Dns::Models::SteeringPolicyAnswer>] :answers The value to assign to the {#answers} property
160
+ # @option attributes [Array<OCI::Dns::Models::SteeringPolicyRule>] :rules The value to assign to the {#rules} property
161
+ def initialize(attributes = {})
162
+ return unless attributes.is_a?(Hash)
163
+
164
+ # convert string to symbol for hash key
165
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
166
+
167
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
168
+
169
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
170
+
171
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
172
+
173
+ self.ttl = attributes[:'ttl'] if attributes[:'ttl']
174
+
175
+ self.health_check_monitor_id = attributes[:'healthCheckMonitorId'] if attributes[:'healthCheckMonitorId']
176
+
177
+ raise 'You cannot provide both :healthCheckMonitorId and :health_check_monitor_id' if attributes.key?(:'healthCheckMonitorId') && attributes.key?(:'health_check_monitor_id')
178
+
179
+ self.health_check_monitor_id = attributes[:'health_check_monitor_id'] if attributes[:'health_check_monitor_id']
180
+
181
+ self.template = attributes[:'template'] if attributes[:'template']
182
+
183
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
184
+
185
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
186
+
187
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
188
+
189
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
190
+
191
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
192
+
193
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
194
+
195
+ self.answers = attributes[:'answers'] if attributes[:'answers']
196
+
197
+ self.rules = attributes[:'rules'] if attributes[:'rules']
198
+ end
199
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
200
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
201
+
202
+ # Custom attribute writer method checking allowed values (enum).
203
+ # @param [Object] template Object to be assigned
204
+ def template=(template)
205
+ # rubocop: disable Metrics/LineLength
206
+ raise "Invalid value for 'template': this must be one of the values in TEMPLATE_ENUM." if template && !TEMPLATE_ENUM.include?(template)
207
+
208
+ # rubocop: enable Metrics/LineLength
209
+ @template = template
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
+ display_name == other.display_name &&
222
+ ttl == other.ttl &&
223
+ health_check_monitor_id == other.health_check_monitor_id &&
224
+ template == other.template &&
225
+ freeform_tags == other.freeform_tags &&
226
+ defined_tags == other.defined_tags &&
227
+ answers == other.answers &&
228
+ rules == other.rules
229
+ end
230
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
231
+
232
+ # @see the `==` method
233
+ # @param [Object] other the other object to be compared
234
+ def eql?(other)
235
+ self == other
236
+ end
237
+
238
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
239
+
240
+
241
+ # Calculates hash code according to all attributes.
242
+ # @return [Fixnum] Hash code
243
+ def hash
244
+ [display_name, ttl, health_check_monitor_id, template, freeform_tags, defined_tags, answers, rules].hash
245
+ end
246
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
247
+
248
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
249
+
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def build_from_hash(attributes)
255
+ return nil unless attributes.is_a?(Hash)
256
+
257
+ self.class.swagger_types.each_pair do |key, type|
258
+ if type =~ /^Array<(.*)>/i
259
+ # check to ensure the input is an array given that the the attribute
260
+ # is documented as an array but the input is not
261
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
262
+ public_method("#{key}=").call(
263
+ attributes[self.class.attribute_map[key]]
264
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
265
+ )
266
+ end
267
+ elsif !attributes[self.class.attribute_map[key]].nil?
268
+ public_method("#{key}=").call(
269
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
270
+ )
271
+ end
272
+ # or else data not found in attributes(hash), not an issue as the data can be optional
273
+ end
274
+
275
+ self
276
+ end
277
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
278
+
279
+ # Returns the string representation of the object
280
+ # @return [String] String presentation of the object
281
+ def to_s
282
+ to_hash.to_s
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = public_method(attr).call
291
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
292
+
293
+ hash[param] = _to_hash(value)
294
+ end
295
+ hash
296
+ end
297
+
298
+ private
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+ end
318
+ end
319
+ # rubocop:enable Lint/UnneededCopDisableDirective