oraclebmc 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +2 -2
- data/README.md +2 -2
- data/lib/oraclebmc/api_client.rb +1 -50
- data/lib/oraclebmc/core/compute_client.rb +33 -0
- data/lib/oraclebmc/core/core.rb +2 -0
- data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +2 -43
- data/lib/oraclebmc/core/models/attach_volume_details.rb +2 -43
- data/lib/oraclebmc/core/models/capture_console_history_details.rb +2 -43
- data/lib/oraclebmc/core/models/console_history.rb +2 -43
- data/lib/oraclebmc/core/models/cpe.rb +2 -43
- data/lib/oraclebmc/core/models/create_cpe_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_dhcp_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_drg_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_image_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_route_table_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_security_list_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_subnet_details.rb +28 -44
- data/lib/oraclebmc/core/models/create_vcn_details.rb +33 -47
- data/lib/oraclebmc/core/models/create_volume_backup_details.rb +2 -43
- data/lib/oraclebmc/core/models/create_volume_details.rb +2 -43
- data/lib/oraclebmc/core/models/dhcp_dns_option.rb +16 -49
- data/lib/oraclebmc/core/models/dhcp_option.rb +7 -43
- data/lib/oraclebmc/core/models/dhcp_options.rb +2 -43
- data/lib/oraclebmc/core/models/dhcp_search_domain_option.rb +143 -0
- data/lib/oraclebmc/core/models/drg.rb +2 -43
- data/lib/oraclebmc/core/models/drg_attachment.rb +2 -43
- data/lib/oraclebmc/core/models/egress_security_rule.rb +2 -43
- data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +2 -43
- data/lib/oraclebmc/core/models/icmp_options.rb +2 -43
- data/lib/oraclebmc/core/models/image.rb +2 -43
- data/lib/oraclebmc/core/models/ingress_security_rule.rb +2 -43
- data/lib/oraclebmc/core/models/instance.rb +7 -43
- data/lib/oraclebmc/core/models/instance_credentials.rb +132 -0
- data/lib/oraclebmc/core/models/internet_gateway.rb +2 -43
- data/lib/oraclebmc/core/models/ip_sec_connection.rb +2 -43
- data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +2 -43
- data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +2 -43
- data/lib/oraclebmc/core/models/launch_instance_details.rb +32 -44
- data/lib/oraclebmc/core/models/port_range.rb +2 -43
- data/lib/oraclebmc/core/models/route_rule.rb +2 -43
- data/lib/oraclebmc/core/models/route_table.rb +2 -43
- data/lib/oraclebmc/core/models/security_list.rb +2 -43
- data/lib/oraclebmc/core/models/shape.rb +2 -43
- data/lib/oraclebmc/core/models/subnet.rb +45 -44
- data/lib/oraclebmc/core/models/tcp_options.rb +2 -43
- data/lib/oraclebmc/core/models/tunnel_config.rb +2 -43
- data/lib/oraclebmc/core/models/tunnel_status.rb +2 -43
- data/lib/oraclebmc/core/models/udp_options.rb +2 -43
- data/lib/oraclebmc/core/models/update_cpe_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_dhcp_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_drg_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_image_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_instance_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_route_table_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_security_list_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_subnet_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_vcn_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_volume_backup_details.rb +2 -43
- data/lib/oraclebmc/core/models/update_volume_details.rb +2 -43
- data/lib/oraclebmc/core/models/vcn.rb +48 -47
- data/lib/oraclebmc/core/models/vnic.rb +30 -47
- data/lib/oraclebmc/core/models/vnic_attachment.rb +2 -43
- data/lib/oraclebmc/core/models/volume.rb +2 -43
- data/lib/oraclebmc/core/models/volume_attachment.rb +2 -43
- data/lib/oraclebmc/core/models/volume_backup.rb +2 -43
- data/lib/oraclebmc/core/virtual_network_client.rb +10 -4
- data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +2 -43
- data/lib/oraclebmc/identity/models/api_key.rb +2 -43
- data/lib/oraclebmc/identity/models/availability_domain.rb +2 -43
- data/lib/oraclebmc/identity/models/compartment.rb +2 -43
- data/lib/oraclebmc/identity/models/create_api_key_details.rb +2 -43
- data/lib/oraclebmc/identity/models/create_compartment_details.rb +2 -43
- data/lib/oraclebmc/identity/models/create_group_details.rb +2 -43
- data/lib/oraclebmc/identity/models/create_policy_details.rb +2 -43
- data/lib/oraclebmc/identity/models/create_swift_password_details.rb +2 -43
- data/lib/oraclebmc/identity/models/create_user_details.rb +2 -43
- data/lib/oraclebmc/identity/models/group.rb +2 -43
- data/lib/oraclebmc/identity/models/policy.rb +2 -43
- data/lib/oraclebmc/identity/models/swift_password.rb +2 -43
- data/lib/oraclebmc/identity/models/ui_password.rb +2 -43
- data/lib/oraclebmc/identity/models/update_compartment_details.rb +2 -43
- data/lib/oraclebmc/identity/models/update_group_details.rb +2 -43
- data/lib/oraclebmc/identity/models/update_policy_details.rb +2 -43
- data/lib/oraclebmc/identity/models/update_state_details.rb +2 -43
- data/lib/oraclebmc/identity/models/update_swift_password_details.rb +2 -43
- data/lib/oraclebmc/identity/models/update_user_details.rb +2 -43
- data/lib/oraclebmc/identity/models/user.rb +2 -43
- data/lib/oraclebmc/identity/models/user_group_membership.rb +2 -43
- data/lib/oraclebmc/internal/internal.rb +11 -0
- data/lib/oraclebmc/internal/util.rb +69 -0
- data/lib/oraclebmc/load_balancer/models/backend.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/backend_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/backend_set.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/certificate.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/certificate_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/health_checker.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/ip_address.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/listener.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/listener_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/load_balancer.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/work_request.rb +2 -43
- data/lib/oraclebmc/load_balancer/models/work_request_error.rb +2 -43
- data/lib/oraclebmc/version.rb +1 -1
- data/lib/oraclebmc.rb +1 -0
- metadata +6 -2
@@ -88,10 +88,10 @@ module OracleBMC
|
|
88
88
|
# check to ensure the input is an array given that the the attribute
|
89
89
|
# is documented as an array but the input is not
|
90
90
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
91
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
92
92
|
end
|
93
93
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
94
|
-
self.send("#{key}=",
|
94
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
95
95
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
96
96
|
end
|
97
97
|
|
@@ -136,47 +136,6 @@ module OracleBMC
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
-
# Deserializes the data based on type
|
140
|
-
# @param [String] type Data type
|
141
|
-
# @param [String] value Value to be deserialized
|
142
|
-
# @return [Object] Deserialized data
|
143
|
-
def _deserialize(type, value)
|
144
|
-
case type.to_sym
|
145
|
-
when :DateTime
|
146
|
-
DateTime.parse(value)
|
147
|
-
when :Date
|
148
|
-
Date.parse(value)
|
149
|
-
when :String
|
150
|
-
value.to_s
|
151
|
-
when :Integer
|
152
|
-
value.to_i
|
153
|
-
when :Float
|
154
|
-
value.to_f
|
155
|
-
when :BOOLEAN
|
156
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
157
|
-
true
|
158
|
-
else
|
159
|
-
false
|
160
|
-
end
|
161
|
-
when :Object
|
162
|
-
# generic object (usually a Hash), return directly
|
163
|
-
value
|
164
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
165
|
-
inner_type = Regexp.last_match[:inner_type]
|
166
|
-
value.map { |v| _deserialize(inner_type, v) }
|
167
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
168
|
-
k_type = Regexp.last_match[:k_type]
|
169
|
-
v_type = Regexp.last_match[:v_type]
|
170
|
-
{}.tap do |hash|
|
171
|
-
value.each do |k, v|
|
172
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
173
|
-
end
|
174
|
-
end
|
175
|
-
else # model
|
176
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
177
|
-
temp_model.build_from_hash(value)
|
178
|
-
end
|
179
|
-
end
|
180
139
|
|
181
140
|
|
182
141
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -168,10 +168,10 @@ module OracleBMC
|
|
168
168
|
# check to ensure the input is an array given that the the attribute
|
169
169
|
# is documented as an array but the input is not
|
170
170
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
171
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
171
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
172
172
|
end
|
173
173
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
174
|
-
self.send("#{key}=",
|
174
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
175
175
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
176
176
|
end
|
177
177
|
|
@@ -216,47 +216,6 @@ module OracleBMC
|
|
216
216
|
end
|
217
217
|
end
|
218
218
|
|
219
|
-
# Deserializes the data based on type
|
220
|
-
# @param [String] type Data type
|
221
|
-
# @param [String] value Value to be deserialized
|
222
|
-
# @return [Object] Deserialized data
|
223
|
-
def _deserialize(type, value)
|
224
|
-
case type.to_sym
|
225
|
-
when :DateTime
|
226
|
-
DateTime.parse(value)
|
227
|
-
when :Date
|
228
|
-
Date.parse(value)
|
229
|
-
when :String
|
230
|
-
value.to_s
|
231
|
-
when :Integer
|
232
|
-
value.to_i
|
233
|
-
when :Float
|
234
|
-
value.to_f
|
235
|
-
when :BOOLEAN
|
236
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
237
|
-
true
|
238
|
-
else
|
239
|
-
false
|
240
|
-
end
|
241
|
-
when :Object
|
242
|
-
# generic object (usually a Hash), return directly
|
243
|
-
value
|
244
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
245
|
-
inner_type = Regexp.last_match[:inner_type]
|
246
|
-
value.map { |v| _deserialize(inner_type, v) }
|
247
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
248
|
-
k_type = Regexp.last_match[:k_type]
|
249
|
-
v_type = Regexp.last_match[:v_type]
|
250
|
-
{}.tap do |hash|
|
251
|
-
value.each do |k, v|
|
252
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
253
|
-
end
|
254
|
-
end
|
255
|
-
else # model
|
256
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
257
|
-
temp_model.build_from_hash(value)
|
258
|
-
end
|
259
|
-
end
|
260
219
|
|
261
220
|
|
262
221
|
# 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|
|
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}=",
|
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.
|
@@ -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|
|
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}=",
|
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.
|
@@ -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|
|
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}=",
|
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.
|
@@ -83,10 +83,10 @@ module OracleBMC
|
|
83
83
|
# check to ensure the input is an array given that the the attribute
|
84
84
|
# is documented as an array but the input is not
|
85
85
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
86
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
86
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
87
87
|
end
|
88
88
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
89
|
-
self.send("#{key}=",
|
89
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
90
90
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
91
91
|
end
|
92
92
|
|
@@ -131,47 +131,6 @@ module OracleBMC
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
-
# Deserializes the data based on type
|
135
|
-
# @param [String] type Data type
|
136
|
-
# @param [String] value Value to be deserialized
|
137
|
-
# @return [Object] Deserialized data
|
138
|
-
def _deserialize(type, value)
|
139
|
-
case type.to_sym
|
140
|
-
when :DateTime
|
141
|
-
DateTime.parse(value)
|
142
|
-
when :Date
|
143
|
-
Date.parse(value)
|
144
|
-
when :String
|
145
|
-
value.to_s
|
146
|
-
when :Integer
|
147
|
-
value.to_i
|
148
|
-
when :Float
|
149
|
-
value.to_f
|
150
|
-
when :BOOLEAN
|
151
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
152
|
-
true
|
153
|
-
else
|
154
|
-
false
|
155
|
-
end
|
156
|
-
when :Object
|
157
|
-
# generic object (usually a Hash), return directly
|
158
|
-
value
|
159
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
-
inner_type = Regexp.last_match[:inner_type]
|
161
|
-
value.map { |v| _deserialize(inner_type, v) }
|
162
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
163
|
-
k_type = Regexp.last_match[:k_type]
|
164
|
-
v_type = Regexp.last_match[:v_type]
|
165
|
-
{}.tap do |hash|
|
166
|
-
value.each do |k, v|
|
167
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
-
end
|
169
|
-
end
|
170
|
-
else # model
|
171
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
172
|
-
temp_model.build_from_hash(value)
|
173
|
-
end
|
174
|
-
end
|
175
134
|
|
176
135
|
|
177
136
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -83,10 +83,10 @@ module OracleBMC
|
|
83
83
|
# check to ensure the input is an array given that the the attribute
|
84
84
|
# is documented as an array but the input is not
|
85
85
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
86
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
86
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
87
87
|
end
|
88
88
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
89
|
-
self.send("#{key}=",
|
89
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
90
90
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
91
91
|
end
|
92
92
|
|
@@ -131,47 +131,6 @@ module OracleBMC
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
-
# Deserializes the data based on type
|
135
|
-
# @param [String] type Data type
|
136
|
-
# @param [String] value Value to be deserialized
|
137
|
-
# @return [Object] Deserialized data
|
138
|
-
def _deserialize(type, value)
|
139
|
-
case type.to_sym
|
140
|
-
when :DateTime
|
141
|
-
DateTime.parse(value)
|
142
|
-
when :Date
|
143
|
-
Date.parse(value)
|
144
|
-
when :String
|
145
|
-
value.to_s
|
146
|
-
when :Integer
|
147
|
-
value.to_i
|
148
|
-
when :Float
|
149
|
-
value.to_f
|
150
|
-
when :BOOLEAN
|
151
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
152
|
-
true
|
153
|
-
else
|
154
|
-
false
|
155
|
-
end
|
156
|
-
when :Object
|
157
|
-
# generic object (usually a Hash), return directly
|
158
|
-
value
|
159
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
-
inner_type = Regexp.last_match[:inner_type]
|
161
|
-
value.map { |v| _deserialize(inner_type, v) }
|
162
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
163
|
-
k_type = Regexp.last_match[:k_type]
|
164
|
-
v_type = Regexp.last_match[:v_type]
|
165
|
-
{}.tap do |hash|
|
166
|
-
value.each do |k, v|
|
167
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
-
end
|
169
|
-
end
|
170
|
-
else # model
|
171
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
172
|
-
temp_model.build_from_hash(value)
|
173
|
-
end
|
174
|
-
end
|
175
134
|
|
176
135
|
|
177
136
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -106,10 +106,10 @@ module OracleBMC
|
|
106
106
|
# check to ensure the input is an array given that the the attribute
|
107
107
|
# is documented as an array but the input is not
|
108
108
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
109
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
109
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
110
110
|
end
|
111
111
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
112
|
-
self.send("#{key}=",
|
112
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
113
113
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
114
114
|
end
|
115
115
|
|
@@ -154,47 +154,6 @@ module OracleBMC
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
-
# Deserializes the data based on type
|
158
|
-
# @param [String] type Data type
|
159
|
-
# @param [String] value Value to be deserialized
|
160
|
-
# @return [Object] Deserialized data
|
161
|
-
def _deserialize(type, value)
|
162
|
-
case type.to_sym
|
163
|
-
when :DateTime
|
164
|
-
DateTime.parse(value)
|
165
|
-
when :Date
|
166
|
-
Date.parse(value)
|
167
|
-
when :String
|
168
|
-
value.to_s
|
169
|
-
when :Integer
|
170
|
-
value.to_i
|
171
|
-
when :Float
|
172
|
-
value.to_f
|
173
|
-
when :BOOLEAN
|
174
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
175
|
-
true
|
176
|
-
else
|
177
|
-
false
|
178
|
-
end
|
179
|
-
when :Object
|
180
|
-
# generic object (usually a Hash), return directly
|
181
|
-
value
|
182
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
183
|
-
inner_type = Regexp.last_match[:inner_type]
|
184
|
-
value.map { |v| _deserialize(inner_type, v) }
|
185
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
186
|
-
k_type = Regexp.last_match[:k_type]
|
187
|
-
v_type = Regexp.last_match[:v_type]
|
188
|
-
{}.tap do |hash|
|
189
|
-
value.each do |k, v|
|
190
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
191
|
-
end
|
192
|
-
end
|
193
|
-
else # model
|
194
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
195
|
-
temp_model.build_from_hash(value)
|
196
|
-
end
|
197
|
-
end
|
198
157
|
|
199
158
|
|
200
159
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -83,10 +83,10 @@ module OracleBMC
|
|
83
83
|
# check to ensure the input is an array given that the the attribute
|
84
84
|
# is documented as an array but the input is not
|
85
85
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
86
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
86
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
87
87
|
end
|
88
88
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
89
|
-
self.send("#{key}=",
|
89
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
90
90
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
91
91
|
end
|
92
92
|
|
@@ -131,47 +131,6 @@ module OracleBMC
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
-
# Deserializes the data based on type
|
135
|
-
# @param [String] type Data type
|
136
|
-
# @param [String] value Value to be deserialized
|
137
|
-
# @return [Object] Deserialized data
|
138
|
-
def _deserialize(type, value)
|
139
|
-
case type.to_sym
|
140
|
-
when :DateTime
|
141
|
-
DateTime.parse(value)
|
142
|
-
when :Date
|
143
|
-
Date.parse(value)
|
144
|
-
when :String
|
145
|
-
value.to_s
|
146
|
-
when :Integer
|
147
|
-
value.to_i
|
148
|
-
when :Float
|
149
|
-
value.to_f
|
150
|
-
when :BOOLEAN
|
151
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
152
|
-
true
|
153
|
-
else
|
154
|
-
false
|
155
|
-
end
|
156
|
-
when :Object
|
157
|
-
# generic object (usually a Hash), return directly
|
158
|
-
value
|
159
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
-
inner_type = Regexp.last_match[:inner_type]
|
161
|
-
value.map { |v| _deserialize(inner_type, v) }
|
162
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
163
|
-
k_type = Regexp.last_match[:k_type]
|
164
|
-
v_type = Regexp.last_match[:v_type]
|
165
|
-
{}.tap do |hash|
|
166
|
-
value.each do |k, v|
|
167
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
-
end
|
169
|
-
end
|
170
|
-
else # model
|
171
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
172
|
-
temp_model.build_from_hash(value)
|
173
|
-
end
|
174
|
-
end
|
175
134
|
|
176
135
|
|
177
136
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -141,10 +141,10 @@ module OracleBMC
|
|
141
141
|
# check to ensure the input is an array given that the the attribute
|
142
142
|
# is documented as an array but the input is not
|
143
143
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
145
145
|
end
|
146
146
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
-
self.send("#{key}=",
|
147
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
148
148
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
149
149
|
end
|
150
150
|
|
@@ -189,47 +189,6 @@ module OracleBMC
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
|
-
# Deserializes the data based on type
|
193
|
-
# @param [String] type Data type
|
194
|
-
# @param [String] value Value to be deserialized
|
195
|
-
# @return [Object] Deserialized data
|
196
|
-
def _deserialize(type, value)
|
197
|
-
case type.to_sym
|
198
|
-
when :DateTime
|
199
|
-
DateTime.parse(value)
|
200
|
-
when :Date
|
201
|
-
Date.parse(value)
|
202
|
-
when :String
|
203
|
-
value.to_s
|
204
|
-
when :Integer
|
205
|
-
value.to_i
|
206
|
-
when :Float
|
207
|
-
value.to_f
|
208
|
-
when :BOOLEAN
|
209
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
210
|
-
true
|
211
|
-
else
|
212
|
-
false
|
213
|
-
end
|
214
|
-
when :Object
|
215
|
-
# generic object (usually a Hash), return directly
|
216
|
-
value
|
217
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
218
|
-
inner_type = Regexp.last_match[:inner_type]
|
219
|
-
value.map { |v| _deserialize(inner_type, v) }
|
220
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
221
|
-
k_type = Regexp.last_match[:k_type]
|
222
|
-
v_type = Regexp.last_match[:v_type]
|
223
|
-
{}.tap do |hash|
|
224
|
-
value.each do |k, v|
|
225
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
226
|
-
end
|
227
|
-
end
|
228
|
-
else # model
|
229
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
230
|
-
temp_model.build_from_hash(value)
|
231
|
-
end
|
232
|
-
end
|
233
192
|
|
234
193
|
|
235
194
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -88,10 +88,10 @@ module OracleBMC
|
|
88
88
|
# check to ensure the input is an array given that the the attribute
|
89
89
|
# is documented as an array but the input is not
|
90
90
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
91
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
92
92
|
end
|
93
93
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
94
|
-
self.send("#{key}=",
|
94
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
95
95
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
96
96
|
end
|
97
97
|
|
@@ -136,47 +136,6 @@ module OracleBMC
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
-
# Deserializes the data based on type
|
140
|
-
# @param [String] type Data type
|
141
|
-
# @param [String] value Value to be deserialized
|
142
|
-
# @return [Object] Deserialized data
|
143
|
-
def _deserialize(type, value)
|
144
|
-
case type.to_sym
|
145
|
-
when :DateTime
|
146
|
-
DateTime.parse(value)
|
147
|
-
when :Date
|
148
|
-
Date.parse(value)
|
149
|
-
when :String
|
150
|
-
value.to_s
|
151
|
-
when :Integer
|
152
|
-
value.to_i
|
153
|
-
when :Float
|
154
|
-
value.to_f
|
155
|
-
when :BOOLEAN
|
156
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
157
|
-
true
|
158
|
-
else
|
159
|
-
false
|
160
|
-
end
|
161
|
-
when :Object
|
162
|
-
# generic object (usually a Hash), return directly
|
163
|
-
value
|
164
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
165
|
-
inner_type = Regexp.last_match[:inner_type]
|
166
|
-
value.map { |v| _deserialize(inner_type, v) }
|
167
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
168
|
-
k_type = Regexp.last_match[:k_type]
|
169
|
-
v_type = Regexp.last_match[:v_type]
|
170
|
-
{}.tap do |hash|
|
171
|
-
value.each do |k, v|
|
172
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
173
|
-
end
|
174
|
-
end
|
175
|
-
else # model
|
176
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
177
|
-
temp_model.build_from_hash(value)
|
178
|
-
end
|
179
|
-
end
|
180
139
|
|
181
140
|
|
182
141
|
# Attribute mapping from ruby-style variable name to JSON key.
|