oraclebmc 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +2 -2
  3. data/README.md +2 -2
  4. data/lib/oraclebmc/api_client.rb +1 -50
  5. data/lib/oraclebmc/core/compute_client.rb +33 -0
  6. data/lib/oraclebmc/core/core.rb +2 -0
  7. data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +2 -43
  8. data/lib/oraclebmc/core/models/attach_volume_details.rb +2 -43
  9. data/lib/oraclebmc/core/models/capture_console_history_details.rb +2 -43
  10. data/lib/oraclebmc/core/models/console_history.rb +2 -43
  11. data/lib/oraclebmc/core/models/cpe.rb +2 -43
  12. data/lib/oraclebmc/core/models/create_cpe_details.rb +2 -43
  13. data/lib/oraclebmc/core/models/create_dhcp_details.rb +2 -43
  14. data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +2 -43
  15. data/lib/oraclebmc/core/models/create_drg_details.rb +2 -43
  16. data/lib/oraclebmc/core/models/create_image_details.rb +2 -43
  17. data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +2 -43
  18. data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +2 -43
  19. data/lib/oraclebmc/core/models/create_route_table_details.rb +2 -43
  20. data/lib/oraclebmc/core/models/create_security_list_details.rb +2 -43
  21. data/lib/oraclebmc/core/models/create_subnet_details.rb +28 -44
  22. data/lib/oraclebmc/core/models/create_vcn_details.rb +33 -47
  23. data/lib/oraclebmc/core/models/create_volume_backup_details.rb +2 -43
  24. data/lib/oraclebmc/core/models/create_volume_details.rb +2 -43
  25. data/lib/oraclebmc/core/models/dhcp_dns_option.rb +16 -49
  26. data/lib/oraclebmc/core/models/dhcp_option.rb +7 -43
  27. data/lib/oraclebmc/core/models/dhcp_options.rb +2 -43
  28. data/lib/oraclebmc/core/models/dhcp_search_domain_option.rb +143 -0
  29. data/lib/oraclebmc/core/models/drg.rb +2 -43
  30. data/lib/oraclebmc/core/models/drg_attachment.rb +2 -43
  31. data/lib/oraclebmc/core/models/egress_security_rule.rb +2 -43
  32. data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +2 -43
  33. data/lib/oraclebmc/core/models/icmp_options.rb +2 -43
  34. data/lib/oraclebmc/core/models/image.rb +2 -43
  35. data/lib/oraclebmc/core/models/ingress_security_rule.rb +2 -43
  36. data/lib/oraclebmc/core/models/instance.rb +7 -43
  37. data/lib/oraclebmc/core/models/instance_credentials.rb +132 -0
  38. data/lib/oraclebmc/core/models/internet_gateway.rb +2 -43
  39. data/lib/oraclebmc/core/models/ip_sec_connection.rb +2 -43
  40. data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +2 -43
  41. data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +2 -43
  42. data/lib/oraclebmc/core/models/launch_instance_details.rb +32 -44
  43. data/lib/oraclebmc/core/models/port_range.rb +2 -43
  44. data/lib/oraclebmc/core/models/route_rule.rb +2 -43
  45. data/lib/oraclebmc/core/models/route_table.rb +2 -43
  46. data/lib/oraclebmc/core/models/security_list.rb +2 -43
  47. data/lib/oraclebmc/core/models/shape.rb +2 -43
  48. data/lib/oraclebmc/core/models/subnet.rb +45 -44
  49. data/lib/oraclebmc/core/models/tcp_options.rb +2 -43
  50. data/lib/oraclebmc/core/models/tunnel_config.rb +2 -43
  51. data/lib/oraclebmc/core/models/tunnel_status.rb +2 -43
  52. data/lib/oraclebmc/core/models/udp_options.rb +2 -43
  53. data/lib/oraclebmc/core/models/update_cpe_details.rb +2 -43
  54. data/lib/oraclebmc/core/models/update_dhcp_details.rb +2 -43
  55. data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +2 -43
  56. data/lib/oraclebmc/core/models/update_drg_details.rb +2 -43
  57. data/lib/oraclebmc/core/models/update_image_details.rb +2 -43
  58. data/lib/oraclebmc/core/models/update_instance_details.rb +2 -43
  59. data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +2 -43
  60. data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +2 -43
  61. data/lib/oraclebmc/core/models/update_route_table_details.rb +2 -43
  62. data/lib/oraclebmc/core/models/update_security_list_details.rb +2 -43
  63. data/lib/oraclebmc/core/models/update_subnet_details.rb +2 -43
  64. data/lib/oraclebmc/core/models/update_vcn_details.rb +2 -43
  65. data/lib/oraclebmc/core/models/update_volume_backup_details.rb +2 -43
  66. data/lib/oraclebmc/core/models/update_volume_details.rb +2 -43
  67. data/lib/oraclebmc/core/models/vcn.rb +48 -47
  68. data/lib/oraclebmc/core/models/vnic.rb +30 -47
  69. data/lib/oraclebmc/core/models/vnic_attachment.rb +2 -43
  70. data/lib/oraclebmc/core/models/volume.rb +2 -43
  71. data/lib/oraclebmc/core/models/volume_attachment.rb +2 -43
  72. data/lib/oraclebmc/core/models/volume_backup.rb +2 -43
  73. data/lib/oraclebmc/core/virtual_network_client.rb +10 -4
  74. data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +2 -43
  75. data/lib/oraclebmc/identity/models/api_key.rb +2 -43
  76. data/lib/oraclebmc/identity/models/availability_domain.rb +2 -43
  77. data/lib/oraclebmc/identity/models/compartment.rb +2 -43
  78. data/lib/oraclebmc/identity/models/create_api_key_details.rb +2 -43
  79. data/lib/oraclebmc/identity/models/create_compartment_details.rb +2 -43
  80. data/lib/oraclebmc/identity/models/create_group_details.rb +2 -43
  81. data/lib/oraclebmc/identity/models/create_policy_details.rb +2 -43
  82. data/lib/oraclebmc/identity/models/create_swift_password_details.rb +2 -43
  83. data/lib/oraclebmc/identity/models/create_user_details.rb +2 -43
  84. data/lib/oraclebmc/identity/models/group.rb +2 -43
  85. data/lib/oraclebmc/identity/models/policy.rb +2 -43
  86. data/lib/oraclebmc/identity/models/swift_password.rb +2 -43
  87. data/lib/oraclebmc/identity/models/ui_password.rb +2 -43
  88. data/lib/oraclebmc/identity/models/update_compartment_details.rb +2 -43
  89. data/lib/oraclebmc/identity/models/update_group_details.rb +2 -43
  90. data/lib/oraclebmc/identity/models/update_policy_details.rb +2 -43
  91. data/lib/oraclebmc/identity/models/update_state_details.rb +2 -43
  92. data/lib/oraclebmc/identity/models/update_swift_password_details.rb +2 -43
  93. data/lib/oraclebmc/identity/models/update_user_details.rb +2 -43
  94. data/lib/oraclebmc/identity/models/user.rb +2 -43
  95. data/lib/oraclebmc/identity/models/user_group_membership.rb +2 -43
  96. data/lib/oraclebmc/internal/internal.rb +11 -0
  97. data/lib/oraclebmc/internal/util.rb +69 -0
  98. data/lib/oraclebmc/load_balancer/models/backend.rb +2 -43
  99. data/lib/oraclebmc/load_balancer/models/backend_details.rb +2 -43
  100. data/lib/oraclebmc/load_balancer/models/backend_set.rb +2 -43
  101. data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +2 -43
  102. data/lib/oraclebmc/load_balancer/models/certificate.rb +2 -43
  103. data/lib/oraclebmc/load_balancer/models/certificate_details.rb +2 -43
  104. data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +2 -43
  105. data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +2 -43
  106. data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +2 -43
  107. data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +2 -43
  108. data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +2 -43
  109. data/lib/oraclebmc/load_balancer/models/health_checker.rb +2 -43
  110. data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +2 -43
  111. data/lib/oraclebmc/load_balancer/models/ip_address.rb +2 -43
  112. data/lib/oraclebmc/load_balancer/models/listener.rb +2 -43
  113. data/lib/oraclebmc/load_balancer/models/listener_details.rb +2 -43
  114. data/lib/oraclebmc/load_balancer/models/load_balancer.rb +2 -43
  115. data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +2 -43
  116. data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +2 -43
  117. data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +2 -43
  118. data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +2 -43
  119. data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +2 -43
  120. data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +2 -43
  121. data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +2 -43
  122. data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +2 -43
  123. data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +2 -43
  124. data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +2 -43
  125. data/lib/oraclebmc/load_balancer/models/work_request.rb +2 -43
  126. data/lib/oraclebmc/load_balancer/models/work_request_error.rb +2 -43
  127. data/lib/oraclebmc/version.rb +1 -1
  128. data/lib/oraclebmc.rb +1 -0
  129. metadata +6 -2
@@ -147,10 +147,10 @@ module OracleBMC
147
147
  # check to ensure the input is an array given that the the attribute
148
148
  # is documented as an array but the input is not
149
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) } )
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
151
151
  end
152
152
  elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
154
154
  end # or else data not found in attributes(hash), not an issue as the data can be optional
155
155
  end
156
156
 
@@ -195,47 +195,6 @@ module OracleBMC
195
195
  end
196
196
  end
197
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
198
 
240
199
 
241
200
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -129,10 +129,10 @@ module OracleBMC
129
129
  # check to ensure the input is an array given that the the attribute
130
130
  # is documented as an array but the input is not
131
131
  if attributes[self.class.attribute_map[key]].is_a?(Array)
132
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
133
133
  end
134
134
  elsif !attributes[self.class.attribute_map[key]].nil?
135
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
136
136
  end # or else data not found in attributes(hash), not an issue as the data can be optional
137
137
  end
138
138
 
@@ -177,47 +177,6 @@ module OracleBMC
177
177
  end
178
178
  end
179
179
 
180
- # Deserializes the data based on type
181
- # @param [String] type Data type
182
- # @param [String] value Value to be deserialized
183
- # @return [Object] Deserialized data
184
- def _deserialize(type, value)
185
- case type.to_sym
186
- when :DateTime
187
- DateTime.parse(value)
188
- when :Date
189
- Date.parse(value)
190
- when :String
191
- value.to_s
192
- when :Integer
193
- value.to_i
194
- when :Float
195
- value.to_f
196
- when :BOOLEAN
197
- if value.to_s =~ /^(true|t|yes|y|1)$/i
198
- true
199
- else
200
- false
201
- end
202
- when :Object
203
- # generic object (usually a Hash), return directly
204
- value
205
- when /\AArray<(?<inner_type>.+)>\z/
206
- inner_type = Regexp.last_match[:inner_type]
207
- value.map { |v| _deserialize(inner_type, v) }
208
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
209
- k_type = Regexp.last_match[:k_type]
210
- v_type = Regexp.last_match[:v_type]
211
- {}.tap do |hash|
212
- value.each do |k, v|
213
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
214
- end
215
- end
216
- else # model
217
- temp_model = OracleBMC.const_get(type.to_s).new
218
- temp_model.build_from_hash(value)
219
- end
220
- end
221
180
 
222
181
 
223
182
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -161,10 +161,10 @@ module OracleBMC
161
161
  # check to ensure the input is an array given that the the attribute
162
162
  # is documented as an array but the input is not
163
163
  if attributes[self.class.attribute_map[key]].is_a?(Array)
164
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
165
165
  end
166
166
  elsif !attributes[self.class.attribute_map[key]].nil?
167
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
167
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
168
168
  end # or else data not found in attributes(hash), not an issue as the data can be optional
169
169
  end
170
170
 
@@ -209,47 +209,6 @@ module OracleBMC
209
209
  end
210
210
  end
211
211
 
212
- # Deserializes the data based on type
213
- # @param [String] type Data type
214
- # @param [String] value Value to be deserialized
215
- # @return [Object] Deserialized data
216
- def _deserialize(type, value)
217
- case type.to_sym
218
- when :DateTime
219
- DateTime.parse(value)
220
- when :Date
221
- Date.parse(value)
222
- when :String
223
- value.to_s
224
- when :Integer
225
- value.to_i
226
- when :Float
227
- value.to_f
228
- when :BOOLEAN
229
- if value.to_s =~ /^(true|t|yes|y|1)$/i
230
- true
231
- else
232
- false
233
- end
234
- when :Object
235
- # generic object (usually a Hash), return directly
236
- value
237
- when /\AArray<(?<inner_type>.+)>\z/
238
- inner_type = Regexp.last_match[:inner_type]
239
- value.map { |v| _deserialize(inner_type, v) }
240
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
241
- k_type = Regexp.last_match[:k_type]
242
- v_type = Regexp.last_match[:v_type]
243
- {}.tap do |hash|
244
- value.each do |k, v|
245
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
- end
247
- end
248
- else # model
249
- temp_model = OracleBMC.const_get(type.to_s).new
250
- temp_model.build_from_hash(value)
251
- end
252
- end
253
212
 
254
213
 
255
214
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -149,10 +149,10 @@ module OracleBMC
149
149
  # check to ensure the input is an array given that the the attribute
150
150
  # is documented as an array but the input is not
151
151
  if attributes[self.class.attribute_map[key]].is_a?(Array)
152
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
153
153
  end
154
154
  elsif !attributes[self.class.attribute_map[key]].nil?
155
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
156
156
  end # or else data not found in attributes(hash), not an issue as the data can be optional
157
157
  end
158
158
 
@@ -197,47 +197,6 @@ module OracleBMC
197
197
  end
198
198
  end
199
199
 
200
- # Deserializes the data based on type
201
- # @param [String] type Data type
202
- # @param [String] value Value to be deserialized
203
- # @return [Object] Deserialized data
204
- def _deserialize(type, value)
205
- case type.to_sym
206
- when :DateTime
207
- DateTime.parse(value)
208
- when :Date
209
- Date.parse(value)
210
- when :String
211
- value.to_s
212
- when :Integer
213
- value.to_i
214
- when :Float
215
- value.to_f
216
- when :BOOLEAN
217
- if value.to_s =~ /^(true|t|yes|y|1)$/i
218
- true
219
- else
220
- false
221
- end
222
- when :Object
223
- # generic object (usually a Hash), return directly
224
- value
225
- when /\AArray<(?<inner_type>.+)>\z/
226
- inner_type = Regexp.last_match[:inner_type]
227
- value.map { |v| _deserialize(inner_type, v) }
228
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
229
- k_type = Regexp.last_match[:k_type]
230
- v_type = Regexp.last_match[:v_type]
231
- {}.tap do |hash|
232
- value.each do |k, v|
233
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
- end
235
- end
236
- else # model
237
- temp_model = OracleBMC.const_get(type.to_s).new
238
- temp_model.build_from_hash(value)
239
- end
240
- end
241
200
 
242
201
 
243
202
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -109,10 +109,8 @@ module OracleBMC
109
109
  :return_type => 'OracleBMC::Core::Models::Cpe')
110
110
  end
111
111
 
112
- # Creates a new set of DHCP options for the specified VCN. The only option available to use is
113
- # {DhcpDnsOption}, which lets you specify how DNS (host name resolution) is
114
- # handled in the subnets in your VCN. For more information, see
115
- # [Managing DHCP Options](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingDHCP.htm).
112
+ # Creates a new set of DHCP options for the specified VCN. For more information, see
113
+ # {DhcpOptions}.
116
114
  #
117
115
  # For the purposes of access control, you must provide the OCID of the compartment where you want the set of
118
116
  # DHCP options to reside. Notice that the set of options doesn't have to be in the same compartment as the VCN,
@@ -514,6 +512,10 @@ module OracleBMC
514
512
  # You may optionally specify a *display name* for the subnet, otherwise a default is provided.
515
513
  # It does not have to be unique, and you can change it.
516
514
  #
515
+ # You can also add a DNS label for the subnet, which is required if you want the Internet and
516
+ # VCN Resolver to resolve hostnames for instances in the subnet. For more information, see
517
+ # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
518
+ #
517
519
  # @param [CreateSubnetDetails] create_subnet_details Details for creating a subnet.
518
520
  # @param [Hash] opts the optional parameters
519
521
  # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
@@ -569,6 +571,10 @@ module OracleBMC
569
571
  # You may optionally specify a *display name* for the VCN, otherwise a default is provided. It does not have to
570
572
  # be unique, and you can change it.
571
573
  #
574
+ # You can also add a DNS label for the VCN, which is required if you want the instances to use the
575
+ # Interent and VCN Resolver option for DNS in the VCN. For more information, see
576
+ # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
577
+ #
572
578
  # The VCN automatically comes with a default route table, default security list, and default set of DHCP options.
573
579
  # The OCID for each is returned in the response. You can't delete these default objects, but you can change their
574
580
  # contents (i.e., route rules, etc.)
@@ -63,10 +63,10 @@ module OracleBMC
63
63
  # check to ensure the input is an array given that the the attribute
64
64
  # is documented as an array but the input is not
65
65
  if attributes[self.class.attribute_map[key]].is_a?(Array)
66
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
66
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
67
67
  end
68
68
  elsif !attributes[self.class.attribute_map[key]].nil?
69
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
69
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
70
70
  end # or else data not found in attributes(hash), not an issue as the data can be optional
71
71
  end
72
72
 
@@ -111,47 +111,6 @@ module OracleBMC
111
111
  end
112
112
  end
113
113
 
114
- # Deserializes the data based on type
115
- # @param [String] type Data type
116
- # @param [String] value Value to be deserialized
117
- # @return [Object] Deserialized data
118
- def _deserialize(type, value)
119
- case type.to_sym
120
- when :DateTime
121
- DateTime.parse(value)
122
- when :Date
123
- Date.parse(value)
124
- when :String
125
- value.to_s
126
- when :Integer
127
- value.to_i
128
- when :Float
129
- value.to_f
130
- when :BOOLEAN
131
- if value.to_s =~ /^(true|t|yes|y|1)$/i
132
- true
133
- else
134
- false
135
- end
136
- when :Object
137
- # generic object (usually a Hash), return directly
138
- value
139
- when /\AArray<(?<inner_type>.+)>\z/
140
- inner_type = Regexp.last_match[:inner_type]
141
- value.map { |v| _deserialize(inner_type, v) }
142
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
143
- k_type = Regexp.last_match[:k_type]
144
- v_type = Regexp.last_match[:v_type]
145
- {}.tap do |hash|
146
- value.each do |k, v|
147
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
148
- end
149
- end
150
- else # model
151
- temp_model = OracleBMC.const_get(type.to_s).new
152
- temp_model.build_from_hash(value)
153
- end
154
- end
155
114
 
156
115
 
157
116
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -131,10 +131,10 @@ module OracleBMC
131
131
  # check to ensure the input is an array given that the the attribute
132
132
  # is documented as an array but the input is not
133
133
  if attributes[self.class.attribute_map[key]].is_a?(Array)
134
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
135
135
  end
136
136
  elsif !attributes[self.class.attribute_map[key]].nil?
137
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
138
138
  end # or else data not found in attributes(hash), not an issue as the data can be optional
139
139
  end
140
140
 
@@ -179,47 +179,6 @@ module OracleBMC
179
179
  end
180
180
  end
181
181
 
182
- # Deserializes the data based on type
183
- # @param [String] type Data type
184
- # @param [String] value Value to be deserialized
185
- # @return [Object] Deserialized data
186
- def _deserialize(type, value)
187
- case type.to_sym
188
- when :DateTime
189
- DateTime.parse(value)
190
- when :Date
191
- Date.parse(value)
192
- when :String
193
- value.to_s
194
- when :Integer
195
- value.to_i
196
- when :Float
197
- value.to_f
198
- when :BOOLEAN
199
- if value.to_s =~ /^(true|t|yes|y|1)$/i
200
- true
201
- else
202
- false
203
- end
204
- when :Object
205
- # generic object (usually a Hash), return directly
206
- value
207
- when /\AArray<(?<inner_type>.+)>\z/
208
- inner_type = Regexp.last_match[:inner_type]
209
- value.map { |v| _deserialize(inner_type, v) }
210
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
211
- k_type = Regexp.last_match[:k_type]
212
- v_type = Regexp.last_match[:v_type]
213
- {}.tap do |hash|
214
- value.each do |k, v|
215
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
216
- end
217
- end
218
- else # model
219
- temp_model = OracleBMC.const_get(type.to_s).new
220
- temp_model.build_from_hash(value)
221
- end
222
- end
223
182
 
224
183
 
225
184
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -63,10 +63,10 @@ module OracleBMC
63
63
  # check to ensure the input is an array given that the the attribute
64
64
  # is documented as an array but the input is not
65
65
  if attributes[self.class.attribute_map[key]].is_a?(Array)
66
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
66
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
67
67
  end
68
68
  elsif !attributes[self.class.attribute_map[key]].nil?
69
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
69
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
70
70
  end # or else data not found in attributes(hash), not an issue as the data can be optional
71
71
  end
72
72
 
@@ -111,47 +111,6 @@ module OracleBMC
111
111
  end
112
112
  end
113
113
 
114
- # Deserializes the data based on type
115
- # @param [String] type Data type
116
- # @param [String] value Value to be deserialized
117
- # @return [Object] Deserialized data
118
- def _deserialize(type, value)
119
- case type.to_sym
120
- when :DateTime
121
- DateTime.parse(value)
122
- when :Date
123
- Date.parse(value)
124
- when :String
125
- value.to_s
126
- when :Integer
127
- value.to_i
128
- when :Float
129
- value.to_f
130
- when :BOOLEAN
131
- if value.to_s =~ /^(true|t|yes|y|1)$/i
132
- true
133
- else
134
- false
135
- end
136
- when :Object
137
- # generic object (usually a Hash), return directly
138
- value
139
- when /\AArray<(?<inner_type>.+)>\z/
140
- inner_type = Regexp.last_match[:inner_type]
141
- value.map { |v| _deserialize(inner_type, v) }
142
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
143
- k_type = Regexp.last_match[:k_type]
144
- v_type = Regexp.last_match[:v_type]
145
- {}.tap do |hash|
146
- value.each do |k, v|
147
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
148
- end
149
- end
150
- else # model
151
- temp_model = OracleBMC.const_get(type.to_s).new
152
- temp_model.build_from_hash(value)
153
- end
154
- end
155
114
 
156
115
 
157
116
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -131,10 +131,10 @@ module OracleBMC
131
131
  # check to ensure the input is an array given that the the attribute
132
132
  # is documented as an array but the input is not
133
133
  if attributes[self.class.attribute_map[key]].is_a?(Array)
134
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
135
135
  end
136
136
  elsif !attributes[self.class.attribute_map[key]].nil?
137
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
138
138
  end # or else data not found in attributes(hash), not an issue as the data can be optional
139
139
  end
140
140
 
@@ -179,47 +179,6 @@ module OracleBMC
179
179
  end
180
180
  end
181
181
 
182
- # Deserializes the data based on type
183
- # @param [String] type Data type
184
- # @param [String] value Value to be deserialized
185
- # @return [Object] Deserialized data
186
- def _deserialize(type, value)
187
- case type.to_sym
188
- when :DateTime
189
- DateTime.parse(value)
190
- when :Date
191
- Date.parse(value)
192
- when :String
193
- value.to_s
194
- when :Integer
195
- value.to_i
196
- when :Float
197
- value.to_f
198
- when :BOOLEAN
199
- if value.to_s =~ /^(true|t|yes|y|1)$/i
200
- true
201
- else
202
- false
203
- end
204
- when :Object
205
- # generic object (usually a Hash), return directly
206
- value
207
- when /\AArray<(?<inner_type>.+)>\z/
208
- inner_type = Regexp.last_match[:inner_type]
209
- value.map { |v| _deserialize(inner_type, v) }
210
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
211
- k_type = Regexp.last_match[:k_type]
212
- v_type = Regexp.last_match[:v_type]
213
- {}.tap do |hash|
214
- value.each do |k, v|
215
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
216
- end
217
- end
218
- else # model
219
- temp_model = OracleBMC.const_get(type.to_s).new
220
- temp_model.build_from_hash(value)
221
- end
222
- end
223
182
 
224
183
 
225
184
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -54,10 +54,10 @@ module OracleBMC
54
54
  # check to ensure the input is an array given that the the attribute
55
55
  # is documented as an array but the input is not
56
56
  if attributes[self.class.attribute_map[key]].is_a?(Array)
57
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
57
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
58
58
  end
59
59
  elsif !attributes[self.class.attribute_map[key]].nil?
60
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
60
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
61
61
  end # or else data not found in attributes(hash), not an issue as the data can be optional
62
62
  end
63
63
 
@@ -102,47 +102,6 @@ module OracleBMC
102
102
  end
103
103
  end
104
104
 
105
- # Deserializes the data based on type
106
- # @param [String] type Data type
107
- # @param [String] value Value to be deserialized
108
- # @return [Object] Deserialized data
109
- def _deserialize(type, value)
110
- case type.to_sym
111
- when :DateTime
112
- DateTime.parse(value)
113
- when :Date
114
- Date.parse(value)
115
- when :String
116
- value.to_s
117
- when :Integer
118
- value.to_i
119
- when :Float
120
- value.to_f
121
- when :BOOLEAN
122
- if value.to_s =~ /^(true|t|yes|y|1)$/i
123
- true
124
- else
125
- false
126
- end
127
- when :Object
128
- # generic object (usually a Hash), return directly
129
- value
130
- when /\AArray<(?<inner_type>.+)>\z/
131
- inner_type = Regexp.last_match[:inner_type]
132
- value.map { |v| _deserialize(inner_type, v) }
133
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
134
- k_type = Regexp.last_match[:k_type]
135
- v_type = Regexp.last_match[:v_type]
136
- {}.tap do |hash|
137
- value.each do |k, v|
138
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
139
- end
140
- end
141
- else # model
142
- temp_model = OracleBMC.const_get(type.to_s).new
143
- temp_model.build_from_hash(value)
144
- end
145
- end
146
105
 
147
106
 
148
107
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -75,10 +75,10 @@ module OracleBMC
75
75
  # check to ensure the input is an array given that the the attribute
76
76
  # is documented as an array but the input is not
77
77
  if attributes[self.class.attribute_map[key]].is_a?(Array)
78
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
78
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
79
79
  end
80
80
  elsif !attributes[self.class.attribute_map[key]].nil?
81
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
81
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
82
82
  end # or else data not found in attributes(hash), not an issue as the data can be optional
83
83
  end
84
84
 
@@ -123,47 +123,6 @@ module OracleBMC
123
123
  end
124
124
  end
125
125
 
126
- # Deserializes the data based on type
127
- # @param [String] type Data type
128
- # @param [String] value Value to be deserialized
129
- # @return [Object] Deserialized data
130
- def _deserialize(type, value)
131
- case type.to_sym
132
- when :DateTime
133
- DateTime.parse(value)
134
- when :Date
135
- Date.parse(value)
136
- when :String
137
- value.to_s
138
- when :Integer
139
- value.to_i
140
- when :Float
141
- value.to_f
142
- when :BOOLEAN
143
- if value.to_s =~ /^(true|t|yes|y|1)$/i
144
- true
145
- else
146
- false
147
- end
148
- when :Object
149
- # generic object (usually a Hash), return directly
150
- value
151
- when /\AArray<(?<inner_type>.+)>\z/
152
- inner_type = Regexp.last_match[:inner_type]
153
- value.map { |v| _deserialize(inner_type, v) }
154
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
155
- k_type = Regexp.last_match[:k_type]
156
- v_type = Regexp.last_match[:v_type]
157
- {}.tap do |hash|
158
- value.each do |k, v|
159
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
- end
161
- end
162
- else # model
163
- temp_model = OracleBMC.const_get(type.to_s).new
164
- temp_model.build_from_hash(value)
165
- end
166
- end
167
126
 
168
127
 
169
128
  # Attribute mapping from ruby-style variable name to JSON key.