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,274 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::Vnic
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
11
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED']
12
+
13
+ # The VNIC's Availability Domain.
14
+ #
15
+ # Example: `Uocm:PHX-AD-1`
16
+ #
17
+ # @return [String]
18
+ attr_accessor :availability_domain
19
+
20
+ # The OCID of the compartment containing the VNIC.
21
+ # @return [String]
22
+ attr_accessor :compartment_id
23
+
24
+ # A user-friendly name. Does not have to be unique.
25
+ # @return [String]
26
+ attr_accessor :display_name
27
+
28
+ # The VNIC's Oracle ID (OCID).
29
+ # @return [String]
30
+ attr_accessor :id
31
+
32
+ # The current state of the VNIC.
33
+ # @return [String]
34
+ attr_accessor :lifecycle_state
35
+
36
+ # The private IP addresses of the VNIC, which is within the VNIC subnet
37
+ # and is accessible within the VCN.
38
+ #
39
+ # @return [String]
40
+ attr_accessor :private_ip
41
+
42
+ # The public IP address of the VNIC, which Oracle performs NAT for at the gateway.
43
+ #
44
+ # @return [String]
45
+ attr_accessor :public_ip
46
+
47
+ # The OCID of the subnet the VNIC is in.
48
+ # @return [String]
49
+ attr_accessor :subnet_id
50
+
51
+ # The date and time the VNIC was created, in the format defined by RFC3339.
52
+ #
53
+ # Example: `2016-08-25T21:10:29.600Z`
54
+ #
55
+ # @return [DateTime]
56
+ attr_accessor :time_created
57
+
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
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
+
68
+ if attributes[:'availabilityDomain']
69
+ self.availability_domain = attributes[:'availabilityDomain']
70
+ end
71
+
72
+ if attributes[:'compartmentId']
73
+ self.compartment_id = attributes[:'compartmentId']
74
+ end
75
+
76
+ if attributes[:'displayName']
77
+ self.display_name = attributes[:'displayName']
78
+ end
79
+
80
+ if attributes[:'id']
81
+ self.id = attributes[:'id']
82
+ end
83
+
84
+ if attributes[:'lifecycleState']
85
+ self.lifecycle_state = attributes[:'lifecycleState']
86
+ end
87
+
88
+ if attributes[:'privateIp']
89
+ self.private_ip = attributes[:'privateIp']
90
+ end
91
+
92
+ if attributes[:'publicIp']
93
+ self.public_ip = attributes[:'publicIp']
94
+ end
95
+
96
+ if attributes[:'subnetId']
97
+ self.subnet_id = attributes[:'subnetId']
98
+ end
99
+
100
+ if attributes[:'timeCreated']
101
+ self.time_created = attributes[:'timeCreated']
102
+ end
103
+
104
+ end
105
+
106
+ # Custom attribute writer method checking allowed values (enum).
107
+ # @param [Object] lifecycle_state Object to be assigned
108
+ def lifecycle_state=(lifecycle_state)
109
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
110
+ fail "Invalid value for 'lifecycle_state': this must be one of the values in LIFECYCLE_STATE_ENUM."
111
+ end
112
+ @lifecycle_state = lifecycle_state
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] other_object to be compared
117
+ def ==(other_object)
118
+ return true if self.equal?(other_object)
119
+ self.class == other_object.class &&
120
+ availability_domain == other_object.availability_domain &&
121
+ compartment_id == other_object.compartment_id &&
122
+ display_name == other_object.display_name &&
123
+ id == other_object.id &&
124
+ lifecycle_state == other_object.lifecycle_state &&
125
+ private_ip == other_object.private_ip &&
126
+ public_ip == other_object.public_ip &&
127
+ subnet_id == other_object.subnet_id &&
128
+ time_created == other_object.time_created
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] other_object to be compared
133
+ def eql?(other_object)
134
+ self == other_object
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Fixnum] Hash code
139
+ def hash
140
+ [availability_domain, compartment_id, display_name, id, lifecycle_state, private_ip, public_ip, subnet_id, time_created].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ self.class.swagger_types.each_pair do |key, type|
149
+ if type =~ /^Array<(.*)>/i
150
+ # check to ensure the input is an array given that the the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
153
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
154
+ end
155
+ elsif !attributes[self.class.attribute_map[key]].nil?
156
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
158
+ end
159
+
160
+ self
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ next if value.nil?
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ private
182
+
183
+ # Outputs non-array value in the form of hash
184
+ # For object, use to_hash. Otherwise, just return the value
185
+ # @param [Object] value Any valid value
186
+ # @return [Hash] Returns the value in the form of hash
187
+ def _to_hash(value)
188
+ if value.is_a?(Array)
189
+ value.compact.map{ |v| _to_hash(v) }
190
+ elsif value.is_a?(Hash)
191
+ {}.tap do |hash|
192
+ value.each { |k, v| hash[k] = _to_hash(v) }
193
+ end
194
+ elsif value.respond_to? :to_hash
195
+ value.to_hash
196
+ else
197
+ value
198
+ end
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param [String] type Data type
203
+ # @param [String] value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def _deserialize(type, value)
206
+ case type.to_sym
207
+ when :DateTime
208
+ DateTime.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :BOOLEAN
218
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ temp_model = OracleBMC.const_get(type.to_s).new
239
+ temp_model.build_from_hash(value)
240
+ end
241
+ end
242
+
243
+
244
+ # Attribute mapping from ruby-style variable name to JSON key.
245
+ def self.attribute_map
246
+ {
247
+ :'availability_domain' => :'availabilityDomain',
248
+ :'compartment_id' => :'compartmentId',
249
+ :'display_name' => :'displayName',
250
+ :'id' => :'id',
251
+ :'lifecycle_state' => :'lifecycleState',
252
+ :'private_ip' => :'privateIp',
253
+ :'public_ip' => :'publicIp',
254
+ :'subnet_id' => :'subnetId',
255
+ :'time_created' => :'timeCreated'
256
+ }
257
+ end
258
+
259
+ # Attribute type mapping.
260
+ def self.swagger_types
261
+ {
262
+ :'availability_domain' => :'String',
263
+ :'compartment_id' => :'String',
264
+ :'display_name' => :'String',
265
+ :'id' => :'String',
266
+ :'lifecycle_state' => :'String',
267
+ :'private_ip' => :'String',
268
+ :'public_ip' => :'String',
269
+ :'subnet_id' => :'String',
270
+ :'time_created' => :'DateTime'
271
+ }
272
+ end
273
+ end
274
+ end
@@ -0,0 +1,271 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::VnicAttachment
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_ATTACHING = 'ATTACHING',
9
+ LIFECYCLE_STATE_ATTACHED = 'ATTACHED',
10
+ LIFECYCLE_STATE_DETACHING = 'DETACHING',
11
+ LIFECYCLE_STATE_DETACHED = 'DETACHED']
12
+
13
+ # The Availability Domain of an instance.
14
+ #
15
+ # Example: `Uocm:PHX-AD-1`
16
+ #
17
+ # @return [String]
18
+ attr_accessor :availability_domain
19
+
20
+ # The OCID of the compartment.
21
+ # @return [String]
22
+ attr_accessor :compartment_id
23
+
24
+ # A user-friendly name. Does not have to be unique.
25
+ # @return [String]
26
+ attr_accessor :display_name
27
+
28
+ # The OCID of the VNIC attachment.
29
+ # @return [String]
30
+ attr_accessor :id
31
+
32
+ # The OCID of the instance.
33
+ # @return [String]
34
+ attr_accessor :instance_id
35
+
36
+ # The current state of the VNIC attachment.
37
+ # @return [String]
38
+ attr_accessor :lifecycle_state
39
+
40
+ # The OCID of the subnet of the VNIC.
41
+ # @return [String]
42
+ attr_accessor :subnet_id
43
+
44
+ # The date and time the VNIC attachment was created, in the format defined by RFC3339.
45
+ #
46
+ # Example: `2016-08-25T21:10:29.600Z`
47
+ #
48
+ # @return [DateTime]
49
+ attr_accessor :time_created
50
+
51
+ # The OCID of the VNIC.
52
+ # @return [String]
53
+ attr_accessor :vnic_id
54
+
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+
65
+ if attributes[:'availabilityDomain']
66
+ self.availability_domain = attributes[:'availabilityDomain']
67
+ end
68
+
69
+ if attributes[:'compartmentId']
70
+ self.compartment_id = attributes[:'compartmentId']
71
+ end
72
+
73
+ if attributes[:'displayName']
74
+ self.display_name = attributes[:'displayName']
75
+ end
76
+
77
+ if attributes[:'id']
78
+ self.id = attributes[:'id']
79
+ end
80
+
81
+ if attributes[:'instanceId']
82
+ self.instance_id = attributes[:'instanceId']
83
+ end
84
+
85
+ if attributes[:'lifecycleState']
86
+ self.lifecycle_state = attributes[:'lifecycleState']
87
+ end
88
+
89
+ if attributes[:'subnetId']
90
+ self.subnet_id = attributes[:'subnetId']
91
+ end
92
+
93
+ if attributes[:'timeCreated']
94
+ self.time_created = attributes[:'timeCreated']
95
+ end
96
+
97
+ if attributes[:'vnicId']
98
+ self.vnic_id = attributes[:'vnicId']
99
+ end
100
+
101
+ end
102
+
103
+ # Custom attribute writer method checking allowed values (enum).
104
+ # @param [Object] lifecycle_state Object to be assigned
105
+ def lifecycle_state=(lifecycle_state)
106
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
107
+ fail "Invalid value for 'lifecycle_state': this must be one of the values in LIFECYCLE_STATE_ENUM."
108
+ end
109
+ @lifecycle_state = lifecycle_state
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] other_object to be compared
114
+ def ==(other_object)
115
+ return true if self.equal?(other_object)
116
+ self.class == other_object.class &&
117
+ availability_domain == other_object.availability_domain &&
118
+ compartment_id == other_object.compartment_id &&
119
+ display_name == other_object.display_name &&
120
+ id == other_object.id &&
121
+ instance_id == other_object.instance_id &&
122
+ lifecycle_state == other_object.lifecycle_state &&
123
+ subnet_id == other_object.subnet_id &&
124
+ time_created == other_object.time_created &&
125
+ vnic_id == other_object.vnic_id
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] other_object to be compared
130
+ def eql?(other_object)
131
+ self == other_object
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
136
+ def hash
137
+ [availability_domain, compartment_id, display_name, id, instance_id, lifecycle_state, subnet_id, time_created, vnic_id].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.swagger_types.each_pair do |key, type|
146
+ if type =~ /^Array<(.*)>/i
147
+ # check to ensure the input is an array given that the the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Returns the string representation of the object
161
+ # @return [String] String presentation of the object
162
+ def to_s
163
+ to_hash.to_s
164
+ end
165
+
166
+ # Returns the object in the form of hash
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_hash
169
+ hash = {}
170
+ self.class.attribute_map.each_pair do |attr, param|
171
+ value = self.send(attr)
172
+ next if value.nil?
173
+ hash[param] = _to_hash(value)
174
+ end
175
+ hash
176
+ end
177
+
178
+ private
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map{ |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param [String] type Data type
200
+ # @param [String] value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :BOOLEAN
215
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ temp_model = OracleBMC.const_get(type.to_s).new
236
+ temp_model.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+
241
+ # Attribute mapping from ruby-style variable name to JSON key.
242
+ def self.attribute_map
243
+ {
244
+ :'availability_domain' => :'availabilityDomain',
245
+ :'compartment_id' => :'compartmentId',
246
+ :'display_name' => :'displayName',
247
+ :'id' => :'id',
248
+ :'instance_id' => :'instanceId',
249
+ :'lifecycle_state' => :'lifecycleState',
250
+ :'subnet_id' => :'subnetId',
251
+ :'time_created' => :'timeCreated',
252
+ :'vnic_id' => :'vnicId'
253
+ }
254
+ end
255
+
256
+ # Attribute type mapping.
257
+ def self.swagger_types
258
+ {
259
+ :'availability_domain' => :'String',
260
+ :'compartment_id' => :'String',
261
+ :'display_name' => :'String',
262
+ :'id' => :'String',
263
+ :'instance_id' => :'String',
264
+ :'lifecycle_state' => :'String',
265
+ :'subnet_id' => :'String',
266
+ :'time_created' => :'DateTime',
267
+ :'vnic_id' => :'String'
268
+ }
269
+ end
270
+ end
271
+ end