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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 618bdb3d3d05f50343ba3ec7f8fc0088a4e76e74
4
- data.tar.gz: bf6a43fc1c10492b661167faf7a92f06cf5e0e97
3
+ metadata.gz: e4b6f055fd6a44f614362a59b5da331ffdaa45b8
4
+ data.tar.gz: 47a1b20e3a7646f7eb6851450a3ee8c417ab7ce3
5
5
  SHA512:
6
- metadata.gz: c2cde2ee5b5c23b1450e59a537328a8cc0aa522e19f36a78a1134724e4cad75b9a379f6f1c0f4b89be47a4c4a76334e4037fc01eeb79a705cc861690c8c7122c
7
- data.tar.gz: 1cf7d1c087d69c7abe12933ffe5d42c75a822da2bb68ad3b35df70b3160b297ae80ad9866080e36b6bae7a4e976a87837d4297e9a4db5edd340d5587cd1c9a8e
6
+ metadata.gz: da5eabdc021b20d0be6a294c183237ae30fa1269a861582a415b1968979d8fc0f6b49eae4988549048b6a8cb20cd17eafa232162a50ba7caac62e78fec3527be
7
+ data.tar.gz: ddb0459abf040a768c1637addb2c55868f5be818cfe0139bd2c6d3de38421acb62a0ef155a48edf91faef536258141035d85c764b659d114f5933931c8e4c87c
data/LICENSE.txt CHANGED
@@ -3,7 +3,7 @@ Copyright (c) 2016, 2017, Oracle and/or its affiliates.  All rights reserved.
3
3
  This software is dual-licensed to you under the Universal Permissive License (UPL) and Apache License 2.0.  See below for license terms.  You may choose either license, or both.
4
4
   ____________________________
5
5
  The Universal Permissive License (UPL), Version 1.0
6
- Copyright (c) 2016, Oracle and/or its affiliates.  All rights reserved.
6
+ Copyright (c) 2016, 2017, Oracle and/or its affiliates.  All rights reserved.
7
7
 
8
8
  Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both
9
9
 
@@ -19,7 +19,7 @@ The above copyright notice and either this complete permission notice or at a mi
19
19
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
 
21
21
  The Apache Software License, Version 2.0
22
- Copyright (c) 2016, Oracle and/or its affiliates.  All rights reserved.
22
+ Copyright (c) 2016, 2017, Oracle and/or its affiliates.  All rights reserved.
23
23
 
24
24
  Licensed under the Apache License, Version 2.0 (the "License"); You may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is also reproduced below. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
25
25
 
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Oracle Bare Metal Cloud Services Ruby SDK
2
- **Version 1.1.2**
2
+ **Version 1.2.0**
3
3
 
4
4
  This topic describes how to install, configure, and use the Oracle Bare Metal Cloud Services Ruby SDK.
5
5
 
@@ -77,7 +77,7 @@ You can also [download the SDK](https://docs.us-phoenix-1.oraclecloud.com/tools/
77
77
  Install the gem with the following command:
78
78
 
79
79
 
80
- `gem install oraclebmc-1.1.2.gem`
80
+ `gem install oraclebmc-1.2.0.gem`
81
81
 
82
82
 
83
83
  The SDK depends on `libcurl`, which may need to be installed or upgraded on some operating systems to be compatible with Oracle Bare Metal Cloud Services.
@@ -248,56 +248,7 @@ module OracleBMC
248
248
  end
249
249
  end
250
250
 
251
- convert_to_type data, return_type
252
- end
253
-
254
- # Convert reponse data to the given return type
255
- # (for example, data:"15", return_type:"Integer" => 15).
256
- #
257
- # @param [Object] data Data to be converted
258
- # @param [String] return_type Return type
259
- # @return [Mixed] Data in a particular type
260
- def convert_to_type(data, return_type)
261
- return nil if data.nil?
262
- case return_type
263
- when 'String'
264
- data.to_s
265
- when 'Integer'
266
- data.to_i
267
- when 'Float'
268
- data.to_f
269
- when 'BOOLEAN'
270
- data == true
271
- when 'DateTime'
272
- # parse date time (expecting ISO 8601 format)
273
- DateTime.parse data
274
- when 'Date'
275
- # parse date time (expecting ISO 8601 format)
276
- Date.parse data
277
- when 'Object'
278
- # generic object (usually a Hash), return directly
279
- data
280
- when /\AArray<(.+)>\z/
281
- # e.g. Array<Pet>
282
- sub_type = $1
283
- data.map {|item| convert_to_type(item, sub_type) }
284
- when /\AHash\<String, (.+)\>\z/
285
- # e.g. Hash<String, Integer>
286
- sub_type = $1
287
- {}.tap do |hash|
288
- data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
289
- end
290
- else
291
- if defined? OracleBMC.const_get(return_type).get_subtype
292
- # The return type may be an abstract type, in which case
293
- # we need to use the discriminator value to get the correct subtype.
294
- return_type = OracleBMC.const_get(return_type).get_subtype(data)
295
- end
296
-
297
- OracleBMC.const_get(return_type).new.tap do |model|
298
- model.build_from_hash data
299
- end
300
- end
251
+ OracleBMC::Internal::Util.convert_to_type return_type, data
301
252
  end
302
253
 
303
254
  def build_request_url(path, endpoint)
@@ -470,6 +470,39 @@ module OracleBMC
470
470
  :return_type => 'OracleBMC::Core::Models::VolumeAttachment')
471
471
  end
472
472
 
473
+ # Gets the generated credentials for the instance. Only works for Windows instances. The returned credentials
474
+ # are only valid for the initial login.
475
+ #
476
+ # @param [String] instance_id The OCID of the instance.
477
+ # @param [Hash] opts the optional parameters
478
+ # @return [Response] A Response object with data of type OracleBMC::Core::Models::InstanceCredentials
479
+ def get_windows_instance_initial_credentials(instance_id, opts = {})
480
+ logger.debug "Calling operation ComputeClient#get_windows_instance_initial_credentials." if logger
481
+
482
+ fail "Missing the required parameter 'instance_id' when calling get_windows_instance_initial_credentials." if instance_id.nil?
483
+
484
+ path = "/instances/{instanceId}/initialCredentials".sub('{instanceId}', instance_id.to_s)
485
+
486
+ # Query Params
487
+ query_params = {}
488
+
489
+ # Header Params
490
+ header_params = {}
491
+ header_params['accept'] = 'application/json'
492
+ header_params['content-type'] = 'application/json'
493
+
494
+ post_body = nil
495
+
496
+ return @api_client.call_api(
497
+ :GET,
498
+ path,
499
+ endpoint,
500
+ :header_params => header_params,
501
+ :query_params => query_params,
502
+ :body => post_body,
503
+ :return_type => 'OracleBMC::Core::Models::InstanceCredentials')
504
+ end
505
+
473
506
  # Performs one of the power actions (start, stop, softreset, or reset)
474
507
  # on the specified instance.
475
508
  #
@@ -29,6 +29,7 @@ require 'oraclebmc/core/models/create_volume_details'
29
29
  require 'oraclebmc/core/models/dhcp_dns_option'
30
30
  require 'oraclebmc/core/models/dhcp_option'
31
31
  require 'oraclebmc/core/models/dhcp_options'
32
+ require 'oraclebmc/core/models/dhcp_search_domain_option'
32
33
  require 'oraclebmc/core/models/drg'
33
34
  require 'oraclebmc/core/models/drg_attachment'
34
35
  require 'oraclebmc/core/models/egress_security_rule'
@@ -40,6 +41,7 @@ require 'oraclebmc/core/models/icmp_options'
40
41
  require 'oraclebmc/core/models/image'
41
42
  require 'oraclebmc/core/models/ingress_security_rule'
42
43
  require 'oraclebmc/core/models/instance'
44
+ require 'oraclebmc/core/models/instance_credentials'
43
45
  require 'oraclebmc/core/models/internet_gateway'
44
46
  require 'oraclebmc/core/models/launch_instance_details'
45
47
  require 'oraclebmc/core/models/port_range'
@@ -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.
@@ -93,10 +93,10 @@ module OracleBMC
93
93
  # check to ensure the input is an array given that the the attribute
94
94
  # is documented as an array but the input is not
95
95
  if attributes[self.class.attribute_map[key]].is_a?(Array)
96
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
96
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
97
97
  end
98
98
  elsif !attributes[self.class.attribute_map[key]].nil?
99
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
99
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
100
100
  end # or else data not found in attributes(hash), not an issue as the data can be optional
101
101
  end
102
102
 
@@ -141,47 +141,6 @@ module OracleBMC
141
141
  end
142
142
  end
143
143
 
144
- # Deserializes the data based on type
145
- # @param [String] type Data type
146
- # @param [String] value Value to be deserialized
147
- # @return [Object] Deserialized data
148
- def _deserialize(type, value)
149
- case type.to_sym
150
- when :DateTime
151
- DateTime.parse(value)
152
- when :Date
153
- Date.parse(value)
154
- when :String
155
- value.to_s
156
- when :Integer
157
- value.to_i
158
- when :Float
159
- value.to_f
160
- when :BOOLEAN
161
- if value.to_s =~ /^(true|t|yes|y|1)$/i
162
- true
163
- else
164
- false
165
- end
166
- when :Object
167
- # generic object (usually a Hash), return directly
168
- value
169
- when /\AArray<(?<inner_type>.+)>\z/
170
- inner_type = Regexp.last_match[:inner_type]
171
- value.map { |v| _deserialize(inner_type, v) }
172
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
173
- k_type = Regexp.last_match[:k_type]
174
- v_type = Regexp.last_match[:v_type]
175
- {}.tap do |hash|
176
- value.each do |k, v|
177
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
- end
179
- end
180
- else # model
181
- temp_model = OracleBMC.const_get(type.to_s).new
182
- temp_model.build_from_hash(value)
183
- end
184
- end
185
144
 
186
145
 
187
146
  # 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.
@@ -132,10 +132,10 @@ module OracleBMC
132
132
  # check to ensure the input is an array given that the the attribute
133
133
  # is documented as an array but the input is not
134
134
  if attributes[self.class.attribute_map[key]].is_a?(Array)
135
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
136
136
  end
137
137
  elsif !attributes[self.class.attribute_map[key]].nil?
138
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
139
139
  end # or else data not found in attributes(hash), not an issue as the data can be optional
140
140
  end
141
141
 
@@ -180,47 +180,6 @@ module OracleBMC
180
180
  end
181
181
  end
182
182
 
183
- # Deserializes the data based on type
184
- # @param [String] type Data type
185
- # @param [String] value Value to be deserialized
186
- # @return [Object] Deserialized data
187
- def _deserialize(type, value)
188
- case type.to_sym
189
- when :DateTime
190
- DateTime.parse(value)
191
- when :Date
192
- Date.parse(value)
193
- when :String
194
- value.to_s
195
- when :Integer
196
- value.to_i
197
- when :Float
198
- value.to_f
199
- when :BOOLEAN
200
- if value.to_s =~ /^(true|t|yes|y|1)$/i
201
- true
202
- else
203
- false
204
- end
205
- when :Object
206
- # generic object (usually a Hash), return directly
207
- value
208
- when /\AArray<(?<inner_type>.+)>\z/
209
- inner_type = Regexp.last_match[:inner_type]
210
- value.map { |v| _deserialize(inner_type, v) }
211
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
212
- k_type = Regexp.last_match[:k_type]
213
- v_type = Regexp.last_match[:v_type]
214
- {}.tap do |hash|
215
- value.each do |k, v|
216
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
- end
218
- end
219
- else # model
220
- temp_model = OracleBMC.const_get(type.to_s).new
221
- temp_model.build_from_hash(value)
222
- end
223
- end
224
183
 
225
184
 
226
185
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -93,10 +93,10 @@ module OracleBMC
93
93
  # check to ensure the input is an array given that the the attribute
94
94
  # is documented as an array but the input is not
95
95
  if attributes[self.class.attribute_map[key]].is_a?(Array)
96
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
96
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
97
97
  end
98
98
  elsif !attributes[self.class.attribute_map[key]].nil?
99
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
99
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
100
100
  end # or else data not found in attributes(hash), not an issue as the data can be optional
101
101
  end
102
102
 
@@ -141,47 +141,6 @@ module OracleBMC
141
141
  end
142
142
  end
143
143
 
144
- # Deserializes the data based on type
145
- # @param [String] type Data type
146
- # @param [String] value Value to be deserialized
147
- # @return [Object] Deserialized data
148
- def _deserialize(type, value)
149
- case type.to_sym
150
- when :DateTime
151
- DateTime.parse(value)
152
- when :Date
153
- Date.parse(value)
154
- when :String
155
- value.to_s
156
- when :Integer
157
- value.to_i
158
- when :Float
159
- value.to_f
160
- when :BOOLEAN
161
- if value.to_s =~ /^(true|t|yes|y|1)$/i
162
- true
163
- else
164
- false
165
- end
166
- when :Object
167
- # generic object (usually a Hash), return directly
168
- value
169
- when /\AArray<(?<inner_type>.+)>\z/
170
- inner_type = Regexp.last_match[:inner_type]
171
- value.map { |v| _deserialize(inner_type, v) }
172
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
173
- k_type = Regexp.last_match[:k_type]
174
- v_type = Regexp.last_match[:v_type]
175
- {}.tap do |hash|
176
- value.each do |k, v|
177
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
- end
179
- end
180
- else # model
181
- temp_model = OracleBMC.const_get(type.to_s).new
182
- temp_model.build_from_hash(value)
183
- end
184
- end
185
144
 
186
145
 
187
146
  # 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.
@@ -81,10 +81,10 @@ module OracleBMC
81
81
  # check to ensure the input is an array given that the the attribute
82
82
  # is documented as an array but the input is not
83
83
  if attributes[self.class.attribute_map[key]].is_a?(Array)
84
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
84
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
85
85
  end
86
86
  elsif !attributes[self.class.attribute_map[key]].nil?
87
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
87
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
88
88
  end # or else data not found in attributes(hash), not an issue as the data can be optional
89
89
  end
90
90
 
@@ -129,47 +129,6 @@ module OracleBMC
129
129
  end
130
130
  end
131
131
 
132
- # Deserializes the data based on type
133
- # @param [String] type Data type
134
- # @param [String] value Value to be deserialized
135
- # @return [Object] Deserialized data
136
- def _deserialize(type, value)
137
- case type.to_sym
138
- when :DateTime
139
- DateTime.parse(value)
140
- when :Date
141
- Date.parse(value)
142
- when :String
143
- value.to_s
144
- when :Integer
145
- value.to_i
146
- when :Float
147
- value.to_f
148
- when :BOOLEAN
149
- if value.to_s =~ /^(true|t|yes|y|1)$/i
150
- true
151
- else
152
- false
153
- end
154
- when :Object
155
- # generic object (usually a Hash), return directly
156
- value
157
- when /\AArray<(?<inner_type>.+)>\z/
158
- inner_type = Regexp.last_match[:inner_type]
159
- value.map { |v| _deserialize(inner_type, v) }
160
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
161
- k_type = Regexp.last_match[:k_type]
162
- v_type = Regexp.last_match[:v_type]
163
- {}.tap do |hash|
164
- value.each do |k, v|
165
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
- end
167
- end
168
- else # model
169
- temp_model = OracleBMC.const_get(type.to_s).new
170
- temp_model.build_from_hash(value)
171
- end
172
- end
173
132
 
174
133
 
175
134
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -72,10 +72,10 @@ module OracleBMC
72
72
  # check to ensure the input is an array given that the the attribute
73
73
  # is documented as an array but the input is not
74
74
  if attributes[self.class.attribute_map[key]].is_a?(Array)
75
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
75
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
76
76
  end
77
77
  elsif !attributes[self.class.attribute_map[key]].nil?
78
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
78
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
79
79
  end # or else data not found in attributes(hash), not an issue as the data can be optional
80
80
  end
81
81
 
@@ -120,47 +120,6 @@ module OracleBMC
120
120
  end
121
121
  end
122
122
 
123
- # Deserializes the data based on type
124
- # @param [String] type Data type
125
- # @param [String] value Value to be deserialized
126
- # @return [Object] Deserialized data
127
- def _deserialize(type, value)
128
- case type.to_sym
129
- when :DateTime
130
- DateTime.parse(value)
131
- when :Date
132
- Date.parse(value)
133
- when :String
134
- value.to_s
135
- when :Integer
136
- value.to_i
137
- when :Float
138
- value.to_f
139
- when :BOOLEAN
140
- if value.to_s =~ /^(true|t|yes|y|1)$/i
141
- true
142
- else
143
- false
144
- end
145
- when :Object
146
- # generic object (usually a Hash), return directly
147
- value
148
- when /\AArray<(?<inner_type>.+)>\z/
149
- inner_type = Regexp.last_match[:inner_type]
150
- value.map { |v| _deserialize(inner_type, v) }
151
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
152
- k_type = Regexp.last_match[:k_type]
153
- v_type = Regexp.last_match[:v_type]
154
- {}.tap do |hash|
155
- value.each do |k, v|
156
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
- end
158
- end
159
- else # model
160
- temp_model = OracleBMC.const_get(type.to_s).new
161
- temp_model.build_from_hash(value)
162
- end
163
- end
164
123
 
165
124
 
166
125
  # Attribute mapping from ruby-style variable name to JSON key.