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,192 @@
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 routing information for a vantage point.
8
+ class Healthchecks::Models::Routing # rubocop:disable Metrics/LineLength
9
+ # The registry label for `asn`, usually the name of the organization that
10
+ # owns the ASN. May be omitted or null.
11
+ #
12
+ # @return [String]
13
+ attr_accessor :as_label
14
+
15
+ # The Autonomous System Number (ASN) identifying the organization
16
+ # responsible for routing packets to `prefix`.
17
+ #
18
+ # @return [Integer]
19
+ attr_accessor :asn
20
+
21
+ # An IP prefix (CIDR syntax) that is less specific than
22
+ # `address`, through which `address` is routed.
23
+ #
24
+ # @return [String]
25
+ attr_accessor :prefix
26
+
27
+ # An integer between 0 and 100 used to select between multiple
28
+ # origin ASNs when routing to `prefix`. Most prefixes have
29
+ # exactly one origin ASN, in which case `weight` will be 100.
30
+ #
31
+ # @return [Integer]
32
+ attr_accessor :weight
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ # rubocop:disable Style/SymbolLiteral
38
+ 'as_label': :'asLabel',
39
+ 'asn': :'asn',
40
+ 'prefix': :'prefix',
41
+ 'weight': :'weight'
42
+ # rubocop:enable Style/SymbolLiteral
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ # rubocop:disable Style/SymbolLiteral
50
+ 'as_label': :'String',
51
+ 'asn': :'Integer',
52
+ 'prefix': :'String',
53
+ 'weight': :'Integer'
54
+ # rubocop:enable Style/SymbolLiteral
55
+ }
56
+ end
57
+
58
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
59
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
60
+
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ # @option attributes [String] :as_label The value to assign to the {#as_label} property
65
+ # @option attributes [Integer] :asn The value to assign to the {#asn} property
66
+ # @option attributes [String] :prefix The value to assign to the {#prefix} property
67
+ # @option attributes [Integer] :weight The value to assign to the {#weight} property
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ self.as_label = attributes[:'asLabel'] if attributes[:'asLabel']
75
+
76
+ raise 'You cannot provide both :asLabel and :as_label' if attributes.key?(:'asLabel') && attributes.key?(:'as_label')
77
+
78
+ self.as_label = attributes[:'as_label'] if attributes[:'as_label']
79
+
80
+ self.asn = attributes[:'asn'] if attributes[:'asn']
81
+
82
+ self.prefix = attributes[:'prefix'] if attributes[:'prefix']
83
+
84
+ self.weight = attributes[:'weight'] if attributes[:'weight']
85
+ end
86
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
87
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
88
+
89
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
90
+
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] other the other object to be compared
94
+ def ==(other)
95
+ return true if equal?(other)
96
+
97
+ self.class == other.class &&
98
+ as_label == other.as_label &&
99
+ asn == other.asn &&
100
+ prefix == other.prefix &&
101
+ weight == other.weight
102
+ end
103
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
104
+
105
+ # @see the `==` method
106
+ # @param [Object] other the other object to be compared
107
+ def eql?(other)
108
+ self == other
109
+ end
110
+
111
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
112
+
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Fixnum] Hash code
116
+ def hash
117
+ [as_label, asn, prefix, weight].hash
118
+ end
119
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
120
+
121
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
122
+
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+
130
+ self.class.swagger_types.each_pair do |key, type|
131
+ if type =~ /^Array<(.*)>/i
132
+ # check to ensure the input is an array given that the the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ public_method("#{key}=").call(
136
+ attributes[self.class.attribute_map[key]]
137
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
138
+ )
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ public_method("#{key}=").call(
142
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
143
+ )
144
+ end
145
+ # or else data not found in attributes(hash), not an issue as the data can be optional
146
+ end
147
+
148
+ self
149
+ end
150
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = public_method(attr).call
164
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ private
172
+
173
+ # Outputs non-array value in the form of hash
174
+ # For object, use to_hash. Otherwise, just return the value
175
+ # @param [Object] value Any valid value
176
+ # @return [Hash] Returns the value in the form of hash
177
+ def _to_hash(value)
178
+ if value.is_a?(Array)
179
+ value.compact.map { |v| _to_hash(v) }
180
+ elsif value.is_a?(Hash)
181
+ {}.tap do |hash|
182
+ value.each { |k, v| hash[k] = _to_hash(v) }
183
+ end
184
+ elsif value.respond_to? :to_hash
185
+ value.to_hash
186
+ else
187
+ value
188
+ end
189
+ end
190
+ end
191
+ end
192
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,189 @@
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
+ # TCP connection results. All durations are in milliseconds.
8
+ class Healthchecks::Models::TcpConnection # rubocop:disable Metrics/LineLength
9
+ # The connection IP address.
10
+ # @return [String]
11
+ attr_accessor :address
12
+
13
+ # The port.
14
+ # @return [Integer]
15
+ attr_accessor :port
16
+
17
+ # Total connect duration, calculated using `connectEnd` minus `connectStart`.
18
+ # @return [Float]
19
+ attr_accessor :connect_duration
20
+
21
+ # The duration to secure the connection. This value will be zero for
22
+ # insecure connections. Calculated using `connectEnd` minus `secureConnectionStart`.
23
+ #
24
+ # @return [Float]
25
+ attr_accessor :secure_connect_duration
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ # rubocop:disable Style/SymbolLiteral
31
+ 'address': :'address',
32
+ 'port': :'port',
33
+ 'connect_duration': :'connectDuration',
34
+ 'secure_connect_duration': :'secureConnectDuration'
35
+ # rubocop:enable Style/SymbolLiteral
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ # rubocop:disable Style/SymbolLiteral
43
+ 'address': :'String',
44
+ 'port': :'Integer',
45
+ 'connect_duration': :'Float',
46
+ 'secure_connect_duration': :'Float'
47
+ # rubocop:enable Style/SymbolLiteral
48
+ }
49
+ end
50
+
51
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
52
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
53
+
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ # @option attributes [String] :address The value to assign to the {#address} property
58
+ # @option attributes [Integer] :port The value to assign to the {#port} property
59
+ # @option attributes [Float] :connect_duration The value to assign to the {#connect_duration} property
60
+ # @option attributes [Float] :secure_connect_duration The value to assign to the {#secure_connect_duration} property
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
+
67
+ self.address = attributes[:'address'] if attributes[:'address']
68
+
69
+ self.port = attributes[:'port'] if attributes[:'port']
70
+
71
+ self.connect_duration = attributes[:'connectDuration'] if attributes[:'connectDuration']
72
+
73
+ raise 'You cannot provide both :connectDuration and :connect_duration' if attributes.key?(:'connectDuration') && attributes.key?(:'connect_duration')
74
+
75
+ self.connect_duration = attributes[:'connect_duration'] if attributes[:'connect_duration']
76
+
77
+ self.secure_connect_duration = attributes[:'secureConnectDuration'] if attributes[:'secureConnectDuration']
78
+
79
+ raise 'You cannot provide both :secureConnectDuration and :secure_connect_duration' if attributes.key?(:'secureConnectDuration') && attributes.key?(:'secure_connect_duration')
80
+
81
+ self.secure_connect_duration = attributes[:'secure_connect_duration'] if attributes[:'secure_connect_duration']
82
+ end
83
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
84
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
85
+
86
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
87
+
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] other the other object to be compared
91
+ def ==(other)
92
+ return true if equal?(other)
93
+
94
+ self.class == other.class &&
95
+ address == other.address &&
96
+ port == other.port &&
97
+ connect_duration == other.connect_duration &&
98
+ secure_connect_duration == other.secure_connect_duration
99
+ end
100
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
101
+
102
+ # @see the `==` method
103
+ # @param [Object] other the other object to be compared
104
+ def eql?(other)
105
+ self == other
106
+ end
107
+
108
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
109
+
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Fixnum] Hash code
113
+ def hash
114
+ [address, port, connect_duration, secure_connect_duration].hash
115
+ end
116
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
117
+
118
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
119
+
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+
127
+ self.class.swagger_types.each_pair do |key, type|
128
+ if type =~ /^Array<(.*)>/i
129
+ # check to ensure the input is an array given that the the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ public_method("#{key}=").call(
133
+ attributes[self.class.attribute_map[key]]
134
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
135
+ )
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ public_method("#{key}=").call(
139
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
140
+ )
141
+ end
142
+ # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = public_method(attr).call
161
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ private
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map { |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+ end
188
+ end
189
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,339 @@
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 request body used to update an HTTP monitor.
8
+ class Healthchecks::Models::UpdateHttpMonitorDetails # rubocop:disable Metrics/LineLength
9
+ PROTOCOL_ENUM = [
10
+ PROTOCOL_HTTP = 'HTTP'.freeze,
11
+ PROTOCOL_HTTPS = 'HTTPS'.freeze
12
+ ].freeze
13
+
14
+ METHOD_ENUM = [
15
+ METHOD_GET = 'GET'.freeze,
16
+ METHOD_HEAD = 'HEAD'.freeze
17
+ ].freeze
18
+
19
+ # @return [Array<String>]
20
+ attr_accessor :targets
21
+
22
+ # @return [Array<String>]
23
+ attr_accessor :vantage_point_names
24
+
25
+ # The port on which to probe endpoints. If unspecified, probes will use the
26
+ # default port of their protocol.
27
+ #
28
+ # @return [Integer]
29
+ attr_accessor :port
30
+
31
+ # The probe timeout in seconds. Valid values: 10, 20, 30, and 60.
32
+ # The probe timeout must be less than or equal to `intervalInSeconds` for monitors.
33
+ #
34
+ # @return [Integer]
35
+ attr_accessor :timeout_in_seconds
36
+
37
+ # @return [String]
38
+ attr_reader :protocol
39
+
40
+ # @return [String]
41
+ attr_reader :method
42
+
43
+ # The optional URL path to probe, including query parameters.
44
+ # @return [String]
45
+ attr_accessor :path
46
+
47
+ # A dictionary of HTTP request headers.
48
+ #
49
+ # *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header.
50
+ #
51
+ # @return [Hash<String, String>]
52
+ attr_accessor :headers
53
+
54
+ # A user-friendly and mutable name suitable for display in a user interface.
55
+ # @return [String]
56
+ attr_accessor :display_name
57
+
58
+ # The monitor interval in seconds. Valid values: 10, 30, and 60.
59
+ #
60
+ # @return [Integer]
61
+ attr_accessor :interval_in_seconds
62
+
63
+ # Enables or disables the monitor. Set to 'true' to launch monitoring.
64
+ #
65
+ # @return [BOOLEAN]
66
+ attr_accessor :is_enabled
67
+
68
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
69
+ # predefined name, type, or namespace. For more information,
70
+ # see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
71
+ # Example: `{\"Department\": \"Finance\"}`
72
+ #
73
+ # @return [Hash<String, String>]
74
+ attr_accessor :freeform_tags
75
+
76
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
77
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
78
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
79
+ #
80
+ # @return [Hash<String, Hash<String, Object>>]
81
+ attr_accessor :defined_tags
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ # rubocop:disable Style/SymbolLiteral
87
+ 'targets': :'targets',
88
+ 'vantage_point_names': :'vantagePointNames',
89
+ 'port': :'port',
90
+ 'timeout_in_seconds': :'timeoutInSeconds',
91
+ 'protocol': :'protocol',
92
+ 'method': :'method',
93
+ 'path': :'path',
94
+ 'headers': :'headers',
95
+ 'display_name': :'displayName',
96
+ 'interval_in_seconds': :'intervalInSeconds',
97
+ 'is_enabled': :'isEnabled',
98
+ 'freeform_tags': :'freeformTags',
99
+ 'defined_tags': :'definedTags'
100
+ # rubocop:enable Style/SymbolLiteral
101
+ }
102
+ end
103
+
104
+ # Attribute type mapping.
105
+ def self.swagger_types
106
+ {
107
+ # rubocop:disable Style/SymbolLiteral
108
+ 'targets': :'Array<String>',
109
+ 'vantage_point_names': :'Array<String>',
110
+ 'port': :'Integer',
111
+ 'timeout_in_seconds': :'Integer',
112
+ 'protocol': :'String',
113
+ 'method': :'String',
114
+ 'path': :'String',
115
+ 'headers': :'Hash<String, String>',
116
+ 'display_name': :'String',
117
+ 'interval_in_seconds': :'Integer',
118
+ 'is_enabled': :'BOOLEAN',
119
+ 'freeform_tags': :'Hash<String, String>',
120
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
121
+ # rubocop:enable Style/SymbolLiteral
122
+ }
123
+ end
124
+
125
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
126
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
127
+
128
+
129
+ # Initializes the object
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @option attributes [Array<String>] :targets The value to assign to the {#targets} property
132
+ # @option attributes [Array<String>] :vantage_point_names The value to assign to the {#vantage_point_names} property
133
+ # @option attributes [Integer] :port The value to assign to the {#port} property
134
+ # @option attributes [Integer] :timeout_in_seconds The value to assign to the {#timeout_in_seconds} property
135
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
136
+ # @option attributes [String] :method The value to assign to the {#method} property
137
+ # @option attributes [String] :path The value to assign to the {#path} property
138
+ # @option attributes [Hash<String, String>] :headers The value to assign to the {#headers} property
139
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
140
+ # @option attributes [Integer] :interval_in_seconds The value to assign to the {#interval_in_seconds} property
141
+ # @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
142
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
143
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
144
+ def initialize(attributes = {})
145
+ return unless attributes.is_a?(Hash)
146
+
147
+ # convert string to symbol for hash key
148
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
149
+
150
+ self.targets = attributes[:'targets'] if attributes[:'targets']
151
+
152
+ self.vantage_point_names = attributes[:'vantagePointNames'] if attributes[:'vantagePointNames']
153
+
154
+ raise 'You cannot provide both :vantagePointNames and :vantage_point_names' if attributes.key?(:'vantagePointNames') && attributes.key?(:'vantage_point_names')
155
+
156
+ self.vantage_point_names = attributes[:'vantage_point_names'] if attributes[:'vantage_point_names']
157
+
158
+ self.port = attributes[:'port'] if attributes[:'port']
159
+
160
+ self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']
161
+
162
+ raise 'You cannot provide both :timeoutInSeconds and :timeout_in_seconds' if attributes.key?(:'timeoutInSeconds') && attributes.key?(:'timeout_in_seconds')
163
+
164
+ self.timeout_in_seconds = attributes[:'timeout_in_seconds'] if attributes[:'timeout_in_seconds']
165
+
166
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
167
+
168
+ self.method = attributes[:'method'] if attributes[:'method']
169
+
170
+ self.path = attributes[:'path'] if attributes[:'path']
171
+
172
+ self.headers = attributes[:'headers'] if attributes[:'headers']
173
+
174
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
175
+
176
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
177
+
178
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
179
+
180
+ self.interval_in_seconds = attributes[:'intervalInSeconds'] if attributes[:'intervalInSeconds']
181
+
182
+ raise 'You cannot provide both :intervalInSeconds and :interval_in_seconds' if attributes.key?(:'intervalInSeconds') && attributes.key?(:'interval_in_seconds')
183
+
184
+ self.interval_in_seconds = attributes[:'interval_in_seconds'] if attributes[:'interval_in_seconds']
185
+
186
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
187
+
188
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
189
+
190
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
191
+
192
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
193
+
194
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
195
+
196
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
197
+
198
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
199
+
200
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
201
+
202
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
203
+ end
204
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
205
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
206
+
207
+ # Custom attribute writer method checking allowed values (enum).
208
+ # @param [Object] protocol Object to be assigned
209
+ def protocol=(protocol)
210
+ # rubocop: disable Metrics/LineLength
211
+ raise "Invalid value for 'protocol': this must be one of the values in PROTOCOL_ENUM." if protocol && !PROTOCOL_ENUM.include?(protocol)
212
+
213
+ # rubocop: enable Metrics/LineLength
214
+ @protocol = protocol
215
+ end
216
+
217
+ # Custom attribute writer method checking allowed values (enum).
218
+ # @param [Object] method Object to be assigned
219
+ def method=(method)
220
+ # rubocop: disable Metrics/LineLength
221
+ raise "Invalid value for 'method': this must be one of the values in METHOD_ENUM." if method && !METHOD_ENUM.include?(method)
222
+
223
+ # rubocop: enable Metrics/LineLength
224
+ @method = method
225
+ end
226
+
227
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
228
+
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] other the other object to be compared
232
+ def ==(other)
233
+ return true if equal?(other)
234
+
235
+ self.class == other.class &&
236
+ targets == other.targets &&
237
+ vantage_point_names == other.vantage_point_names &&
238
+ port == other.port &&
239
+ timeout_in_seconds == other.timeout_in_seconds &&
240
+ protocol == other.protocol &&
241
+ method == other.method &&
242
+ path == other.path &&
243
+ headers == other.headers &&
244
+ display_name == other.display_name &&
245
+ interval_in_seconds == other.interval_in_seconds &&
246
+ is_enabled == other.is_enabled &&
247
+ freeform_tags == other.freeform_tags &&
248
+ defined_tags == other.defined_tags
249
+ end
250
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
251
+
252
+ # @see the `==` method
253
+ # @param [Object] other the other object to be compared
254
+ def eql?(other)
255
+ self == other
256
+ end
257
+
258
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
259
+
260
+
261
+ # Calculates hash code according to all attributes.
262
+ # @return [Fixnum] Hash code
263
+ def hash
264
+ [targets, vantage_point_names, port, timeout_in_seconds, protocol, method, path, headers, display_name, interval_in_seconds, is_enabled, freeform_tags, defined_tags].hash
265
+ end
266
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
267
+
268
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
269
+
270
+
271
+ # Builds the object from hash
272
+ # @param [Hash] attributes Model attributes in the form of hash
273
+ # @return [Object] Returns the model itself
274
+ def build_from_hash(attributes)
275
+ return nil unless attributes.is_a?(Hash)
276
+
277
+ self.class.swagger_types.each_pair do |key, type|
278
+ if type =~ /^Array<(.*)>/i
279
+ # check to ensure the input is an array given that the the attribute
280
+ # is documented as an array but the input is not
281
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
282
+ public_method("#{key}=").call(
283
+ attributes[self.class.attribute_map[key]]
284
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
285
+ )
286
+ end
287
+ elsif !attributes[self.class.attribute_map[key]].nil?
288
+ public_method("#{key}=").call(
289
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
290
+ )
291
+ end
292
+ # or else data not found in attributes(hash), not an issue as the data can be optional
293
+ end
294
+
295
+ self
296
+ end
297
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
298
+
299
+ # Returns the string representation of the object
300
+ # @return [String] String presentation of the object
301
+ def to_s
302
+ to_hash.to_s
303
+ end
304
+
305
+ # Returns the object in the form of hash
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_hash
308
+ hash = {}
309
+ self.class.attribute_map.each_pair do |attr, param|
310
+ value = public_method(attr).call
311
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
312
+
313
+ hash[param] = _to_hash(value)
314
+ end
315
+ hash
316
+ end
317
+
318
+ private
319
+
320
+ # Outputs non-array value in the form of hash
321
+ # For object, use to_hash. Otherwise, just return the value
322
+ # @param [Object] value Any valid value
323
+ # @return [Hash] Returns the value in the form of hash
324
+ def _to_hash(value)
325
+ if value.is_a?(Array)
326
+ value.compact.map { |v| _to_hash(v) }
327
+ elsif value.is_a?(Hash)
328
+ {}.tap do |hash|
329
+ value.each { |k, v| hash[k] = _to_hash(v) }
330
+ end
331
+ elsif value.respond_to? :to_hash
332
+ value.to_hash
333
+ else
334
+ value
335
+ end
336
+ end
337
+ end
338
+ end
339
+ # rubocop:enable Lint/UnneededCopDisableDirective