oraclebmc 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +82 -0
  3. data/README.md +220 -0
  4. data/lib/oraclebmc/api_client.rb +349 -0
  5. data/lib/oraclebmc/config.rb +80 -0
  6. data/lib/oraclebmc/config_file_loader.rb +85 -0
  7. data/lib/oraclebmc/core/blockstorage_client.rb +459 -0
  8. data/lib/oraclebmc/core/compute_client.rb +1053 -0
  9. data/lib/oraclebmc/core/core.rb +82 -0
  10. data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +179 -0
  11. data/lib/oraclebmc/core/models/attach_volume_details.rb +206 -0
  12. data/lib/oraclebmc/core/models/capture_console_history_details.rb +162 -0
  13. data/lib/oraclebmc/core/models/console_history.rb +252 -0
  14. data/lib/oraclebmc/core/models/cpe.rb +209 -0
  15. data/lib/oraclebmc/core/models/create_cpe_details.rb +187 -0
  16. data/lib/oraclebmc/core/models/create_dhcp_details.rb +195 -0
  17. data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +184 -0
  18. data/lib/oraclebmc/core/models/create_drg_details.rb +173 -0
  19. data/lib/oraclebmc/core/models/create_image_details.rb +188 -0
  20. data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +195 -0
  21. data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +210 -0
  22. data/lib/oraclebmc/core/models/create_route_table_details.rb +195 -0
  23. data/lib/oraclebmc/core/models/create_security_list_details.rb +206 -0
  24. data/lib/oraclebmc/core/models/create_subnet_details.rb +253 -0
  25. data/lib/oraclebmc/core/models/create_vcn_details.rb +187 -0
  26. data/lib/oraclebmc/core/models/create_volume_backup_details.rb +173 -0
  27. data/lib/oraclebmc/core/models/create_volume_details.rb +211 -0
  28. data/lib/oraclebmc/core/models/dhcp_dns_option.rb +203 -0
  29. data/lib/oraclebmc/core/models/dhcp_option.rb +171 -0
  30. data/lib/oraclebmc/core/models/dhcp_options.rb +246 -0
  31. data/lib/oraclebmc/core/models/drg.rb +224 -0
  32. data/lib/oraclebmc/core/models/drg_attachment.rb +246 -0
  33. data/lib/oraclebmc/core/models/egress_security_rule.rb +240 -0
  34. data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +254 -0
  35. data/lib/oraclebmc/core/models/icmp_options.rb +173 -0
  36. data/lib/oraclebmc/core/models/image.rb +282 -0
  37. data/lib/oraclebmc/core/models/ingress_security_rule.rb +240 -0
  38. data/lib/oraclebmc/core/models/instance.rb +326 -0
  39. data/lib/oraclebmc/core/models/internet_gateway.rb +248 -0
  40. data/lib/oraclebmc/core/models/ip_sec_connection.rb +261 -0
  41. data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +195 -0
  42. data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +198 -0
  43. data/lib/oraclebmc/core/models/launch_instance_details.rb +327 -0
  44. data/lib/oraclebmc/core/models/port_range.rb +175 -0
  45. data/lib/oraclebmc/core/models/route_rule.rb +177 -0
  46. data/lib/oraclebmc/core/models/route_table.rb +246 -0
  47. data/lib/oraclebmc/core/models/security_list.rb +257 -0
  48. data/lib/oraclebmc/core/models/shape.rb +164 -0
  49. data/lib/oraclebmc/core/models/subnet.rb +325 -0
  50. data/lib/oraclebmc/core/models/tcp_options.rb +177 -0
  51. data/lib/oraclebmc/core/models/tunnel_config.rb +193 -0
  52. data/lib/oraclebmc/core/models/tunnel_status.rb +218 -0
  53. data/lib/oraclebmc/core/models/udp_options.rb +177 -0
  54. data/lib/oraclebmc/core/models/update_cpe_details.rb +162 -0
  55. data/lib/oraclebmc/core/models/update_dhcp_details.rb +172 -0
  56. data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +162 -0
  57. data/lib/oraclebmc/core/models/update_drg_details.rb +162 -0
  58. data/lib/oraclebmc/core/models/update_image_details.rb +165 -0
  59. data/lib/oraclebmc/core/models/update_instance_details.rb +165 -0
  60. data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +173 -0
  61. data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +162 -0
  62. data/lib/oraclebmc/core/models/update_route_table_details.rb +173 -0
  63. data/lib/oraclebmc/core/models/update_security_list_details.rb +184 -0
  64. data/lib/oraclebmc/core/models/update_subnet_details.rb +162 -0
  65. data/lib/oraclebmc/core/models/update_vcn_details.rb +162 -0
  66. data/lib/oraclebmc/core/models/update_volume_backup_details.rb +162 -0
  67. data/lib/oraclebmc/core/models/update_volume_details.rb +163 -0
  68. data/lib/oraclebmc/core/models/vcn.rb +272 -0
  69. data/lib/oraclebmc/core/models/vnic.rb +274 -0
  70. data/lib/oraclebmc/core/models/vnic_attachment.rb +271 -0
  71. data/lib/oraclebmc/core/models/volume.rb +249 -0
  72. data/lib/oraclebmc/core/models/volume_attachment.rb +284 -0
  73. data/lib/oraclebmc/core/models/volume_backup.rb +273 -0
  74. data/lib/oraclebmc/core/util.rb +1 -0
  75. data/lib/oraclebmc/core/virtual_network_client.rb +2263 -0
  76. data/lib/oraclebmc/errors.rb +62 -0
  77. data/lib/oraclebmc/global_context.rb +21 -0
  78. data/lib/oraclebmc/identity/identity.rb +38 -0
  79. data/lib/oraclebmc/identity/identity_client.rb +1462 -0
  80. data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +173 -0
  81. data/lib/oraclebmc/identity/models/api_key.rb +251 -0
  82. data/lib/oraclebmc/identity/models/availability_domain.rb +173 -0
  83. data/lib/oraclebmc/identity/models/compartment.rb +251 -0
  84. data/lib/oraclebmc/identity/models/create_api_key_details.rb +162 -0
  85. data/lib/oraclebmc/identity/models/create_compartment_details.rb +187 -0
  86. data/lib/oraclebmc/identity/models/create_group_details.rb +186 -0
  87. data/lib/oraclebmc/identity/models/create_policy_details.rb +215 -0
  88. data/lib/oraclebmc/identity/models/create_swift_password_details.rb +163 -0
  89. data/lib/oraclebmc/identity/models/create_user_details.rb +186 -0
  90. data/lib/oraclebmc/identity/models/group.rb +251 -0
  91. data/lib/oraclebmc/identity/models/policy.rb +277 -0
  92. data/lib/oraclebmc/identity/models/swift_password.rb +266 -0
  93. data/lib/oraclebmc/identity/models/ui_password.rb +227 -0
  94. data/lib/oraclebmc/identity/models/update_compartment_details.rb +162 -0
  95. data/lib/oraclebmc/identity/models/update_group_details.rb +162 -0
  96. data/lib/oraclebmc/identity/models/update_policy_details.rb +190 -0
  97. data/lib/oraclebmc/identity/models/update_state_details.rb +163 -0
  98. data/lib/oraclebmc/identity/models/update_swift_password_details.rb +162 -0
  99. data/lib/oraclebmc/identity/models/update_user_details.rb +162 -0
  100. data/lib/oraclebmc/identity/models/user.rb +257 -0
  101. data/lib/oraclebmc/identity/models/user_group_membership.rb +249 -0
  102. data/lib/oraclebmc/identity/util.rb +1 -0
  103. data/lib/oraclebmc/load_balancer/load_balancer.rb +45 -0
  104. data/lib/oraclebmc/load_balancer/load_balancer_client.rb +1218 -0
  105. data/lib/oraclebmc/load_balancer/models/backend.rb +262 -0
  106. data/lib/oraclebmc/load_balancer/models/backend_details.rb +248 -0
  107. data/lib/oraclebmc/load_balancer/models/backend_set.rb +211 -0
  108. data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +197 -0
  109. data/lib/oraclebmc/load_balancer/models/certificate.rb +209 -0
  110. data/lib/oraclebmc/load_balancer/models/certificate_details.rb +245 -0
  111. data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +248 -0
  112. data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +210 -0
  113. data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +245 -0
  114. data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +216 -0
  115. data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +233 -0
  116. data/lib/oraclebmc/load_balancer/models/health_checker.rb +265 -0
  117. data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +264 -0
  118. data/lib/oraclebmc/load_balancer/models/ip_address.rb +165 -0
  119. data/lib/oraclebmc/load_balancer/models/listener.rb +216 -0
  120. data/lib/oraclebmc/load_balancer/models/listener_details.rb +202 -0
  121. data/lib/oraclebmc/load_balancer/models/load_balancer.rb +296 -0
  122. data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +162 -0
  123. data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +162 -0
  124. data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +162 -0
  125. data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +195 -0
  126. data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +195 -0
  127. data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +220 -0
  128. data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +197 -0
  129. data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +263 -0
  130. data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +202 -0
  131. data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +165 -0
  132. data/lib/oraclebmc/load_balancer/models/work_request.rb +269 -0
  133. data/lib/oraclebmc/load_balancer/models/work_request_error.rb +185 -0
  134. data/lib/oraclebmc/load_balancer/util.rb +55 -0
  135. data/lib/oraclebmc/regions.rb +41 -0
  136. data/lib/oraclebmc/response.rb +86 -0
  137. data/lib/oraclebmc/signer.rb +119 -0
  138. data/lib/oraclebmc/version.rb +5 -0
  139. data/lib/oraclebmc/waiter.rb +111 -0
  140. data/lib/oraclebmc.rb +20 -0
  141. metadata +265 -0
@@ -0,0 +1,265 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class LoadBalancer::Models::HealthChecker
7
+ # The protocol the health check must use; either HTTP or TCP.
8
+ #
9
+ # Example: `HTTP`
10
+ #
11
+ # @return [String]
12
+ attr_accessor :protocol
13
+
14
+ # The path against which to run the health check.
15
+ #
16
+ # Example: `/healthcheck`
17
+ #
18
+ # @return [String]
19
+ attr_accessor :url_path
20
+
21
+ # The backend server port against which to run the health check. If the port is not specified, the load balancer uses the
22
+ # port information from the `Backend` object.
23
+ #
24
+ # Example: `8080`
25
+ #
26
+ # @return [Integer]
27
+ attr_accessor :port
28
+
29
+ # The status code a healthy backend server should return. If you configure the health check policy to use the HTTP protocol,
30
+ # you can use common HTTP status codes such as \"200\".
31
+ #
32
+ # Example: `200`
33
+ #
34
+ # @return [Integer]
35
+ attr_accessor :return_code
36
+
37
+ # The number of retries to attempt before a backend server is considered \"unhealthy\". Defaults to 3.
38
+ #
39
+ # Example: `3`
40
+ #
41
+ # @return [Integer]
42
+ attr_accessor :retries
43
+
44
+ # The maximum timeout before a retry, in milliseconds. Defaults to 3000 (3 seconds).
45
+ #
46
+ # Example: `6000`
47
+ #
48
+ # @return [Integer]
49
+ attr_accessor :timeout_in_millis
50
+
51
+ # The interval between health checks, in milliseconds. The default is 10000 (10 seconds).
52
+ #
53
+ # Example: `30000`
54
+ #
55
+ # @return [Integer]
56
+ attr_accessor :interval_in_millis
57
+
58
+ # A regular expression for parsing the response body from the backend server.
59
+ #
60
+ # Example: `^(500|40[1348])$`
61
+ #
62
+ # @return [String]
63
+ attr_accessor :response_body_regex
64
+
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
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
+
75
+ if attributes[:'protocol']
76
+ self.protocol = attributes[:'protocol']
77
+ end
78
+
79
+ if attributes[:'urlPath']
80
+ self.url_path = attributes[:'urlPath']
81
+ end
82
+
83
+ if attributes[:'port']
84
+ self.port = attributes[:'port']
85
+ end
86
+
87
+ if attributes[:'returnCode']
88
+ self.return_code = attributes[:'returnCode']
89
+ end
90
+
91
+ if attributes[:'retries']
92
+ self.retries = attributes[:'retries']
93
+ end
94
+
95
+ if attributes[:'timeoutInMillis']
96
+ self.timeout_in_millis = attributes[:'timeoutInMillis']
97
+ end
98
+
99
+ if attributes[:'intervalInMillis']
100
+ self.interval_in_millis = attributes[:'intervalInMillis']
101
+ end
102
+
103
+ if attributes[:'responseBodyRegex']
104
+ self.response_body_regex = attributes[:'responseBodyRegex']
105
+ end
106
+
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] other_object to be compared
111
+ def ==(other_object)
112
+ return true if self.equal?(other_object)
113
+ self.class == other_object.class &&
114
+ protocol == other_object.protocol &&
115
+ url_path == other_object.url_path &&
116
+ port == other_object.port &&
117
+ return_code == other_object.return_code &&
118
+ retries == other_object.retries &&
119
+ timeout_in_millis == other_object.timeout_in_millis &&
120
+ interval_in_millis == other_object.interval_in_millis &&
121
+ response_body_regex == other_object.response_body_regex
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] other_object to be compared
126
+ def eql?(other_object)
127
+ self == other_object
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Fixnum] Hash code
132
+ def hash
133
+ [protocol, url_path, port, return_code, retries, timeout_in_millis, interval_in_millis, response_body_regex].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.swagger_types.each_pair do |key, type|
142
+ if type =~ /^Array<(.*)>/i
143
+ # check to ensure the input is an array given that the the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Returns the string representation of the object
157
+ # @return [String] String presentation of the object
158
+ def to_s
159
+ to_hash.to_s
160
+ end
161
+
162
+ # Returns the object in the form of hash
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_hash
165
+ hash = {}
166
+ self.class.attribute_map.each_pair do |attr, param|
167
+ value = self.send(attr)
168
+ next if value.nil?
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ private
175
+
176
+ # Outputs non-array value in the form of hash
177
+ # For object, use to_hash. Otherwise, just return the value
178
+ # @param [Object] value Any valid value
179
+ # @return [Hash] Returns the value in the form of hash
180
+ def _to_hash(value)
181
+ if value.is_a?(Array)
182
+ value.compact.map{ |v| _to_hash(v) }
183
+ elsif value.is_a?(Hash)
184
+ {}.tap do |hash|
185
+ value.each { |k, v| hash[k] = _to_hash(v) }
186
+ end
187
+ elsif value.respond_to? :to_hash
188
+ value.to_hash
189
+ else
190
+ value
191
+ end
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param [String] type Data type
196
+ # @param [String] value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ DateTime.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :BOOLEAN
211
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ temp_model = OracleBMC.const_get(type.to_s).new
232
+ temp_model.build_from_hash(value)
233
+ end
234
+ end
235
+
236
+
237
+ # Attribute mapping from ruby-style variable name to JSON key.
238
+ def self.attribute_map
239
+ {
240
+ :'protocol' => :'protocol',
241
+ :'url_path' => :'urlPath',
242
+ :'port' => :'port',
243
+ :'return_code' => :'returnCode',
244
+ :'retries' => :'retries',
245
+ :'timeout_in_millis' => :'timeoutInMillis',
246
+ :'interval_in_millis' => :'intervalInMillis',
247
+ :'response_body_regex' => :'responseBodyRegex'
248
+ }
249
+ end
250
+
251
+ # Attribute type mapping.
252
+ def self.swagger_types
253
+ {
254
+ :'protocol' => :'String',
255
+ :'url_path' => :'String',
256
+ :'port' => :'Integer',
257
+ :'return_code' => :'Integer',
258
+ :'retries' => :'Integer',
259
+ :'timeout_in_millis' => :'Integer',
260
+ :'interval_in_millis' => :'Integer',
261
+ :'response_body_regex' => :'String'
262
+ }
263
+ end
264
+ end
265
+ end
@@ -0,0 +1,264 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class LoadBalancer::Models::HealthCheckerDetails
7
+ # The protocol the health check must use; either HTTP or TCP.
8
+ #
9
+ # Example: `HTTP`
10
+ #
11
+ # @return [String]
12
+ attr_accessor :protocol
13
+
14
+ # The path against which to run the health check.
15
+ #
16
+ # Example: `/healthcheck`
17
+ #
18
+ # @return [String]
19
+ attr_accessor :url_path
20
+
21
+ # The backend server port against which to run the health check. If the port is not specified, the load balancer uses the
22
+ # port information from the `Backend` object.
23
+ #
24
+ # Example: `8080`
25
+ #
26
+ # @return [Integer]
27
+ attr_accessor :port
28
+
29
+ # The status code a healthy backend server should return.
30
+ #
31
+ # Example: `200`
32
+ #
33
+ # @return [Integer]
34
+ attr_accessor :return_code
35
+
36
+ # The number of retries to attempt before a backend server is considered \"unhealthy\".
37
+ #
38
+ # Example: `3`
39
+ #
40
+ # @return [Integer]
41
+ attr_accessor :retries
42
+
43
+ # The maximum timeout in milliseconds before a retry.
44
+ #
45
+ # Example: `6000`
46
+ #
47
+ # @return [Integer]
48
+ attr_accessor :timeout_in_millis
49
+
50
+ # The interval between health checks, in milliseconds.
51
+ #
52
+ # Example: `30000`
53
+ #
54
+ # @return [Integer]
55
+ attr_accessor :interval_in_millis
56
+
57
+ # A regular expression for parsing the response body from the backend server.
58
+ #
59
+ # Example: `^(500|40[1348])$`
60
+ #
61
+ # @return [String]
62
+ attr_accessor :response_body_regex
63
+
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
72
+
73
+
74
+ if attributes[:'protocol']
75
+ self.protocol = attributes[:'protocol']
76
+ end
77
+
78
+ if attributes[:'urlPath']
79
+ self.url_path = attributes[:'urlPath']
80
+ end
81
+
82
+ if attributes[:'port']
83
+ self.port = attributes[:'port']
84
+ end
85
+
86
+ if attributes[:'returnCode']
87
+ self.return_code = attributes[:'returnCode']
88
+ end
89
+
90
+ if attributes[:'retries']
91
+ self.retries = attributes[:'retries']
92
+ end
93
+
94
+ if attributes[:'timeoutInMillis']
95
+ self.timeout_in_millis = attributes[:'timeoutInMillis']
96
+ end
97
+
98
+ if attributes[:'intervalInMillis']
99
+ self.interval_in_millis = attributes[:'intervalInMillis']
100
+ end
101
+
102
+ if attributes[:'responseBodyRegex']
103
+ self.response_body_regex = attributes[:'responseBodyRegex']
104
+ end
105
+
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] other_object to be compared
110
+ def ==(other_object)
111
+ return true if self.equal?(other_object)
112
+ self.class == other_object.class &&
113
+ protocol == other_object.protocol &&
114
+ url_path == other_object.url_path &&
115
+ port == other_object.port &&
116
+ return_code == other_object.return_code &&
117
+ retries == other_object.retries &&
118
+ timeout_in_millis == other_object.timeout_in_millis &&
119
+ interval_in_millis == other_object.interval_in_millis &&
120
+ response_body_regex == other_object.response_body_regex
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] other_object to be compared
125
+ def eql?(other_object)
126
+ self == other_object
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Fixnum] Hash code
131
+ def hash
132
+ [protocol, url_path, port, return_code, retries, timeout_in_millis, interval_in_millis, response_body_regex].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ self.class.swagger_types.each_pair do |key, type|
141
+ if type =~ /^Array<(.*)>/i
142
+ # check to ensure the input is an array given that the the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
157
+ def to_s
158
+ to_hash.to_s
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ next if value.nil?
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ private
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map{ |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+
193
+ # Deserializes the data based on type
194
+ # @param [String] type Data type
195
+ # @param [String] value Value to be deserialized
196
+ # @return [Object] Deserialized data
197
+ def _deserialize(type, value)
198
+ case type.to_sym
199
+ when :DateTime
200
+ DateTime.parse(value)
201
+ when :Date
202
+ Date.parse(value)
203
+ when :String
204
+ value.to_s
205
+ when :Integer
206
+ value.to_i
207
+ when :Float
208
+ value.to_f
209
+ when :BOOLEAN
210
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
211
+ true
212
+ else
213
+ false
214
+ end
215
+ when :Object
216
+ # generic object (usually a Hash), return directly
217
+ value
218
+ when /\AArray<(?<inner_type>.+)>\z/
219
+ inner_type = Regexp.last_match[:inner_type]
220
+ value.map { |v| _deserialize(inner_type, v) }
221
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
222
+ k_type = Regexp.last_match[:k_type]
223
+ v_type = Regexp.last_match[:v_type]
224
+ {}.tap do |hash|
225
+ value.each do |k, v|
226
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
227
+ end
228
+ end
229
+ else # model
230
+ temp_model = OracleBMC.const_get(type.to_s).new
231
+ temp_model.build_from_hash(value)
232
+ end
233
+ end
234
+
235
+
236
+ # Attribute mapping from ruby-style variable name to JSON key.
237
+ def self.attribute_map
238
+ {
239
+ :'protocol' => :'protocol',
240
+ :'url_path' => :'urlPath',
241
+ :'port' => :'port',
242
+ :'return_code' => :'returnCode',
243
+ :'retries' => :'retries',
244
+ :'timeout_in_millis' => :'timeoutInMillis',
245
+ :'interval_in_millis' => :'intervalInMillis',
246
+ :'response_body_regex' => :'responseBodyRegex'
247
+ }
248
+ end
249
+
250
+ # Attribute type mapping.
251
+ def self.swagger_types
252
+ {
253
+ :'protocol' => :'String',
254
+ :'url_path' => :'String',
255
+ :'port' => :'Integer',
256
+ :'return_code' => :'Integer',
257
+ :'retries' => :'Integer',
258
+ :'timeout_in_millis' => :'Integer',
259
+ :'interval_in_millis' => :'Integer',
260
+ :'response_body_regex' => :'String'
261
+ }
262
+ end
263
+ end
264
+ end
@@ -0,0 +1,165 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class LoadBalancer::Models::IpAddress
7
+ # An IP address.
8
+ #
9
+ # Example: `128.148.10.20`
10
+ #
11
+ # @return [String]
12
+ attr_accessor :ip_address
13
+
14
+
15
+ # Initializes the object
16
+ # @param [Hash] attributes Model attributes in the form of hash
17
+ def initialize(attributes = {})
18
+ return unless attributes.is_a?(Hash)
19
+
20
+ # convert string to symbol for hash key
21
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
22
+
23
+
24
+ if attributes[:'ipAddress']
25
+ self.ip_address = attributes[:'ipAddress']
26
+ end
27
+
28
+ end
29
+
30
+ # Checks equality by comparing each attribute.
31
+ # @param [Object] other_object to be compared
32
+ def ==(other_object)
33
+ return true if self.equal?(other_object)
34
+ self.class == other_object.class &&
35
+ ip_address == other_object.ip_address
36
+ end
37
+
38
+ # @see the `==` method
39
+ # @param [Object] other_object to be compared
40
+ def eql?(other_object)
41
+ self == other_object
42
+ end
43
+
44
+ # Calculates hash code according to all attributes.
45
+ # @return [Fixnum] Hash code
46
+ def hash
47
+ [ip_address].hash
48
+ end
49
+
50
+ # Builds the object from hash
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ # @return [Object] Returns the model itself
53
+ def build_from_hash(attributes)
54
+ return nil unless attributes.is_a?(Hash)
55
+ self.class.swagger_types.each_pair do |key, type|
56
+ if type =~ /^Array<(.*)>/i
57
+ # check to ensure the input is an array given that the the attribute
58
+ # is documented as an array but the input is not
59
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
60
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
61
+ end
62
+ elsif !attributes[self.class.attribute_map[key]].nil?
63
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
64
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
65
+ end
66
+
67
+ self
68
+ end
69
+
70
+ # Returns the string representation of the object
71
+ # @return [String] String presentation of the object
72
+ def to_s
73
+ to_hash.to_s
74
+ end
75
+
76
+ # Returns the object in the form of hash
77
+ # @return [Hash] Returns the object in the form of hash
78
+ def to_hash
79
+ hash = {}
80
+ self.class.attribute_map.each_pair do |attr, param|
81
+ value = self.send(attr)
82
+ next if value.nil?
83
+ hash[param] = _to_hash(value)
84
+ end
85
+ hash
86
+ end
87
+
88
+ private
89
+
90
+ # Outputs non-array value in the form of hash
91
+ # For object, use to_hash. Otherwise, just return the value
92
+ # @param [Object] value Any valid value
93
+ # @return [Hash] Returns the value in the form of hash
94
+ def _to_hash(value)
95
+ if value.is_a?(Array)
96
+ value.compact.map{ |v| _to_hash(v) }
97
+ elsif value.is_a?(Hash)
98
+ {}.tap do |hash|
99
+ value.each { |k, v| hash[k] = _to_hash(v) }
100
+ end
101
+ elsif value.respond_to? :to_hash
102
+ value.to_hash
103
+ else
104
+ value
105
+ end
106
+ end
107
+
108
+ # Deserializes the data based on type
109
+ # @param [String] type Data type
110
+ # @param [String] value Value to be deserialized
111
+ # @return [Object] Deserialized data
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :BOOLEAN
125
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ temp_model = OracleBMC.const_get(type.to_s).new
146
+ temp_model.build_from_hash(value)
147
+ end
148
+ end
149
+
150
+
151
+ # Attribute mapping from ruby-style variable name to JSON key.
152
+ def self.attribute_map
153
+ {
154
+ :'ip_address' => :'ipAddress'
155
+ }
156
+ end
157
+
158
+ # Attribute type mapping.
159
+ def self.swagger_types
160
+ {
161
+ :'ip_address' => :'String'
162
+ }
163
+ end
164
+ end
165
+ end