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
@@ -97,10 +97,10 @@ module OracleBMC
|
|
97
97
|
# check to ensure the input is an array given that the the attribute
|
98
98
|
# is documented as an array but the input is not
|
99
99
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
100
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
100
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
101
101
|
end
|
102
102
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
103
|
-
self.send("#{key}=",
|
103
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
104
104
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
105
105
|
end
|
106
106
|
|
@@ -145,47 +145,6 @@ module OracleBMC
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
-
# Deserializes the data based on type
|
149
|
-
# @param [String] type Data type
|
150
|
-
# @param [String] value Value to be deserialized
|
151
|
-
# @return [Object] Deserialized data
|
152
|
-
def _deserialize(type, value)
|
153
|
-
case type.to_sym
|
154
|
-
when :DateTime
|
155
|
-
DateTime.parse(value)
|
156
|
-
when :Date
|
157
|
-
Date.parse(value)
|
158
|
-
when :String
|
159
|
-
value.to_s
|
160
|
-
when :Integer
|
161
|
-
value.to_i
|
162
|
-
when :Float
|
163
|
-
value.to_f
|
164
|
-
when :BOOLEAN
|
165
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
166
|
-
true
|
167
|
-
else
|
168
|
-
false
|
169
|
-
end
|
170
|
-
when :Object
|
171
|
-
# generic object (usually a Hash), return directly
|
172
|
-
value
|
173
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
174
|
-
inner_type = Regexp.last_match[:inner_type]
|
175
|
-
value.map { |v| _deserialize(inner_type, v) }
|
176
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
177
|
-
k_type = Regexp.last_match[:k_type]
|
178
|
-
v_type = Regexp.last_match[:v_type]
|
179
|
-
{}.tap do |hash|
|
180
|
-
value.each do |k, v|
|
181
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
182
|
-
end
|
183
|
-
end
|
184
|
-
else # model
|
185
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
186
|
-
temp_model.build_from_hash(value)
|
187
|
-
end
|
188
|
-
end
|
189
148
|
|
190
149
|
|
191
150
|
# 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|
|
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}=",
|
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.
|
@@ -130,10 +130,10 @@ module OracleBMC
|
|
130
130
|
# check to ensure the input is an array given that the the attribute
|
131
131
|
# is documented as an array but the input is not
|
132
132
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
134
134
|
end
|
135
135
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
-
self.send("#{key}=",
|
136
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
137
137
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
138
138
|
end
|
139
139
|
|
@@ -178,47 +178,6 @@ module OracleBMC
|
|
178
178
|
end
|
179
179
|
end
|
180
180
|
|
181
|
-
# Deserializes the data based on type
|
182
|
-
# @param [String] type Data type
|
183
|
-
# @param [String] value Value to be deserialized
|
184
|
-
# @return [Object] Deserialized data
|
185
|
-
def _deserialize(type, value)
|
186
|
-
case type.to_sym
|
187
|
-
when :DateTime
|
188
|
-
DateTime.parse(value)
|
189
|
-
when :Date
|
190
|
-
Date.parse(value)
|
191
|
-
when :String
|
192
|
-
value.to_s
|
193
|
-
when :Integer
|
194
|
-
value.to_i
|
195
|
-
when :Float
|
196
|
-
value.to_f
|
197
|
-
when :BOOLEAN
|
198
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
199
|
-
true
|
200
|
-
else
|
201
|
-
false
|
202
|
-
end
|
203
|
-
when :Object
|
204
|
-
# generic object (usually a Hash), return directly
|
205
|
-
value
|
206
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
207
|
-
inner_type = Regexp.last_match[:inner_type]
|
208
|
-
value.map { |v| _deserialize(inner_type, v) }
|
209
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
210
|
-
k_type = Regexp.last_match[:k_type]
|
211
|
-
v_type = Regexp.last_match[:v_type]
|
212
|
-
{}.tap do |hash|
|
213
|
-
value.each do |k, v|
|
214
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
215
|
-
end
|
216
|
-
end
|
217
|
-
else # model
|
218
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
219
|
-
temp_model.build_from_hash(value)
|
220
|
-
end
|
221
|
-
end
|
222
181
|
|
223
182
|
|
224
183
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -94,10 +94,10 @@ module OracleBMC
|
|
94
94
|
# check to ensure the input is an array given that the the attribute
|
95
95
|
# is documented as an array but the input is not
|
96
96
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
97
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
97
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
98
98
|
end
|
99
99
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
100
|
-
self.send("#{key}=",
|
100
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
101
101
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
102
102
|
end
|
103
103
|
|
@@ -142,47 +142,6 @@ module OracleBMC
|
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
145
|
-
# Deserializes the data based on type
|
146
|
-
# @param [String] type Data type
|
147
|
-
# @param [String] value Value to be deserialized
|
148
|
-
# @return [Object] Deserialized data
|
149
|
-
def _deserialize(type, value)
|
150
|
-
case type.to_sym
|
151
|
-
when :DateTime
|
152
|
-
DateTime.parse(value)
|
153
|
-
when :Date
|
154
|
-
Date.parse(value)
|
155
|
-
when :String
|
156
|
-
value.to_s
|
157
|
-
when :Integer
|
158
|
-
value.to_i
|
159
|
-
when :Float
|
160
|
-
value.to_f
|
161
|
-
when :BOOLEAN
|
162
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
163
|
-
true
|
164
|
-
else
|
165
|
-
false
|
166
|
-
end
|
167
|
-
when :Object
|
168
|
-
# generic object (usually a Hash), return directly
|
169
|
-
value
|
170
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
-
inner_type = Regexp.last_match[:inner_type]
|
172
|
-
value.map { |v| _deserialize(inner_type, v) }
|
173
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
174
|
-
k_type = Regexp.last_match[:k_type]
|
175
|
-
v_type = Regexp.last_match[:v_type]
|
176
|
-
{}.tap do |hash|
|
177
|
-
value.each do |k, v|
|
178
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
-
end
|
180
|
-
end
|
181
|
-
else # model
|
182
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
183
|
-
temp_model.build_from_hash(value)
|
184
|
-
end
|
185
|
-
end
|
186
145
|
|
187
146
|
|
188
147
|
# 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|
|
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}=",
|
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.
|
@@ -100,10 +100,10 @@ module OracleBMC
|
|
100
100
|
# check to ensure the input is an array given that the the attribute
|
101
101
|
# is documented as an array but the input is not
|
102
102
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
103
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
104
104
|
end
|
105
105
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
|
-
self.send("#{key}=",
|
106
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
107
107
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
108
108
|
end
|
109
109
|
|
@@ -148,47 +148,6 @@ module OracleBMC
|
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
151
|
-
# Deserializes the data based on type
|
152
|
-
# @param [String] type Data type
|
153
|
-
# @param [String] value Value to be deserialized
|
154
|
-
# @return [Object] Deserialized data
|
155
|
-
def _deserialize(type, value)
|
156
|
-
case type.to_sym
|
157
|
-
when :DateTime
|
158
|
-
DateTime.parse(value)
|
159
|
-
when :Date
|
160
|
-
Date.parse(value)
|
161
|
-
when :String
|
162
|
-
value.to_s
|
163
|
-
when :Integer
|
164
|
-
value.to_i
|
165
|
-
when :Float
|
166
|
-
value.to_f
|
167
|
-
when :BOOLEAN
|
168
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
169
|
-
true
|
170
|
-
else
|
171
|
-
false
|
172
|
-
end
|
173
|
-
when :Object
|
174
|
-
# generic object (usually a Hash), return directly
|
175
|
-
value
|
176
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
177
|
-
inner_type = Regexp.last_match[:inner_type]
|
178
|
-
value.map { |v| _deserialize(inner_type, v) }
|
179
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
180
|
-
k_type = Regexp.last_match[:k_type]
|
181
|
-
v_type = Regexp.last_match[:v_type]
|
182
|
-
{}.tap do |hash|
|
183
|
-
value.each do |k, v|
|
184
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
185
|
-
end
|
186
|
-
end
|
187
|
-
else # model
|
188
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
189
|
-
temp_model.build_from_hash(value)
|
190
|
-
end
|
191
|
-
end
|
192
151
|
|
193
152
|
|
194
153
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -113,10 +113,10 @@ module OracleBMC
|
|
113
113
|
# check to ensure the input is an array given that the the attribute
|
114
114
|
# is documented as an array but the input is not
|
115
115
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
116
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
117
117
|
end
|
118
118
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
119
|
-
self.send("#{key}=",
|
119
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
120
120
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
121
121
|
end
|
122
122
|
|
@@ -161,47 +161,6 @@ module OracleBMC
|
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
164
|
-
# Deserializes the data based on type
|
165
|
-
# @param [String] type Data type
|
166
|
-
# @param [String] value Value to be deserialized
|
167
|
-
# @return [Object] Deserialized data
|
168
|
-
def _deserialize(type, value)
|
169
|
-
case type.to_sym
|
170
|
-
when :DateTime
|
171
|
-
DateTime.parse(value)
|
172
|
-
when :Date
|
173
|
-
Date.parse(value)
|
174
|
-
when :String
|
175
|
-
value.to_s
|
176
|
-
when :Integer
|
177
|
-
value.to_i
|
178
|
-
when :Float
|
179
|
-
value.to_f
|
180
|
-
when :BOOLEAN
|
181
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
182
|
-
true
|
183
|
-
else
|
184
|
-
false
|
185
|
-
end
|
186
|
-
when :Object
|
187
|
-
# generic object (usually a Hash), return directly
|
188
|
-
value
|
189
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
190
|
-
inner_type = Regexp.last_match[:inner_type]
|
191
|
-
value.map { |v| _deserialize(inner_type, v) }
|
192
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
193
|
-
k_type = Regexp.last_match[:k_type]
|
194
|
-
v_type = Regexp.last_match[:v_type]
|
195
|
-
{}.tap do |hash|
|
196
|
-
value.each do |k, v|
|
197
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
198
|
-
end
|
199
|
-
end
|
200
|
-
else # model
|
201
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
202
|
-
temp_model.build_from_hash(value)
|
203
|
-
end
|
204
|
-
end
|
205
164
|
|
206
165
|
|
207
166
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -143,10 +143,10 @@ module OracleBMC
|
|
143
143
|
# check to ensure the input is an array given that the the attribute
|
144
144
|
# is documented as an array but the input is not
|
145
145
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
147
147
|
end
|
148
148
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
-
self.send("#{key}=",
|
149
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
150
150
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
151
151
|
end
|
152
152
|
|
@@ -191,47 +191,6 @@ module OracleBMC
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
-
# Deserializes the data based on type
|
195
|
-
# @param [String] type Data type
|
196
|
-
# @param [String] value Value to be deserialized
|
197
|
-
# @return [Object] Deserialized data
|
198
|
-
def _deserialize(type, value)
|
199
|
-
case type.to_sym
|
200
|
-
when :DateTime
|
201
|
-
DateTime.parse(value)
|
202
|
-
when :Date
|
203
|
-
Date.parse(value)
|
204
|
-
when :String
|
205
|
-
value.to_s
|
206
|
-
when :Integer
|
207
|
-
value.to_i
|
208
|
-
when :Float
|
209
|
-
value.to_f
|
210
|
-
when :BOOLEAN
|
211
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
212
|
-
true
|
213
|
-
else
|
214
|
-
false
|
215
|
-
end
|
216
|
-
when :Object
|
217
|
-
# generic object (usually a Hash), return directly
|
218
|
-
value
|
219
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
220
|
-
inner_type = Regexp.last_match[:inner_type]
|
221
|
-
value.map { |v| _deserialize(inner_type, v) }
|
222
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
223
|
-
k_type = Regexp.last_match[:k_type]
|
224
|
-
v_type = Regexp.last_match[:v_type]
|
225
|
-
{}.tap do |hash|
|
226
|
-
value.each do |k, v|
|
227
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
228
|
-
end
|
229
|
-
end
|
230
|
-
else # model
|
231
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
232
|
-
temp_model.build_from_hash(value)
|
233
|
-
end
|
234
|
-
end
|
235
194
|
|
236
195
|
|
237
196
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -142,10 +142,10 @@ module OracleBMC
|
|
142
142
|
# check to ensure the input is an array given that the the attribute
|
143
143
|
# is documented as an array but the input is not
|
144
144
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
145
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
145
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
146
146
|
end
|
147
147
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
148
|
-
self.send("#{key}=",
|
148
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
149
149
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
150
150
|
end
|
151
151
|
|
@@ -190,47 +190,6 @@ module OracleBMC
|
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
|
-
# Deserializes the data based on type
|
194
|
-
# @param [String] type Data type
|
195
|
-
# @param [String] value Value to be deserialized
|
196
|
-
# @return [Object] Deserialized data
|
197
|
-
def _deserialize(type, value)
|
198
|
-
case type.to_sym
|
199
|
-
when :DateTime
|
200
|
-
DateTime.parse(value)
|
201
|
-
when :Date
|
202
|
-
Date.parse(value)
|
203
|
-
when :String
|
204
|
-
value.to_s
|
205
|
-
when :Integer
|
206
|
-
value.to_i
|
207
|
-
when :Float
|
208
|
-
value.to_f
|
209
|
-
when :BOOLEAN
|
210
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
211
|
-
true
|
212
|
-
else
|
213
|
-
false
|
214
|
-
end
|
215
|
-
when :Object
|
216
|
-
# generic object (usually a Hash), return directly
|
217
|
-
value
|
218
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
219
|
-
inner_type = Regexp.last_match[:inner_type]
|
220
|
-
value.map { |v| _deserialize(inner_type, v) }
|
221
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
222
|
-
k_type = Regexp.last_match[:k_type]
|
223
|
-
v_type = Regexp.last_match[:v_type]
|
224
|
-
{}.tap do |hash|
|
225
|
-
value.each do |k, v|
|
226
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
227
|
-
end
|
228
|
-
end
|
229
|
-
else # model
|
230
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
231
|
-
temp_model.build_from_hash(value)
|
232
|
-
end
|
233
|
-
end
|
234
193
|
|
235
194
|
|
236
195
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -57,10 +57,10 @@ module OracleBMC
|
|
57
57
|
# check to ensure the input is an array given that the the attribute
|
58
58
|
# is documented as an array but the input is not
|
59
59
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
60
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
60
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
61
61
|
end
|
62
62
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
63
|
-
self.send("#{key}=",
|
63
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
64
64
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
65
65
|
end
|
66
66
|
|
@@ -105,47 +105,6 @@ module OracleBMC
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
# Deserializes the data based on type
|
109
|
-
# @param [String] type Data type
|
110
|
-
# @param [String] value Value to be deserialized
|
111
|
-
# @return [Object] Deserialized data
|
112
|
-
def _deserialize(type, value)
|
113
|
-
case type.to_sym
|
114
|
-
when :DateTime
|
115
|
-
DateTime.parse(value)
|
116
|
-
when :Date
|
117
|
-
Date.parse(value)
|
118
|
-
when :String
|
119
|
-
value.to_s
|
120
|
-
when :Integer
|
121
|
-
value.to_i
|
122
|
-
when :Float
|
123
|
-
value.to_f
|
124
|
-
when :BOOLEAN
|
125
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
126
|
-
true
|
127
|
-
else
|
128
|
-
false
|
129
|
-
end
|
130
|
-
when :Object
|
131
|
-
# generic object (usually a Hash), return directly
|
132
|
-
value
|
133
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
-
inner_type = Regexp.last_match[:inner_type]
|
135
|
-
value.map { |v| _deserialize(inner_type, v) }
|
136
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
137
|
-
k_type = Regexp.last_match[:k_type]
|
138
|
-
v_type = Regexp.last_match[:v_type]
|
139
|
-
{}.tap do |hash|
|
140
|
-
value.each do |k, v|
|
141
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
-
end
|
143
|
-
end
|
144
|
-
else # model
|
145
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
146
|
-
temp_model.build_from_hash(value)
|
147
|
-
end
|
148
|
-
end
|
149
108
|
|
150
109
|
|
151
110
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -100,10 +100,10 @@ module OracleBMC
|
|
100
100
|
# check to ensure the input is an array given that the the attribute
|
101
101
|
# is documented as an array but the input is not
|
102
102
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v|
|
103
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
104
104
|
end
|
105
105
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
|
-
self.send("#{key}=",
|
106
|
+
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
107
107
|
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
108
108
|
end
|
109
109
|
|
@@ -148,47 +148,6 @@ module OracleBMC
|
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
151
|
-
# Deserializes the data based on type
|
152
|
-
# @param [String] type Data type
|
153
|
-
# @param [String] value Value to be deserialized
|
154
|
-
# @return [Object] Deserialized data
|
155
|
-
def _deserialize(type, value)
|
156
|
-
case type.to_sym
|
157
|
-
when :DateTime
|
158
|
-
DateTime.parse(value)
|
159
|
-
when :Date
|
160
|
-
Date.parse(value)
|
161
|
-
when :String
|
162
|
-
value.to_s
|
163
|
-
when :Integer
|
164
|
-
value.to_i
|
165
|
-
when :Float
|
166
|
-
value.to_f
|
167
|
-
when :BOOLEAN
|
168
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
169
|
-
true
|
170
|
-
else
|
171
|
-
false
|
172
|
-
end
|
173
|
-
when :Object
|
174
|
-
# generic object (usually a Hash), return directly
|
175
|
-
value
|
176
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
177
|
-
inner_type = Regexp.last_match[:inner_type]
|
178
|
-
value.map { |v| _deserialize(inner_type, v) }
|
179
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
180
|
-
k_type = Regexp.last_match[:k_type]
|
181
|
-
v_type = Regexp.last_match[:v_type]
|
182
|
-
{}.tap do |hash|
|
183
|
-
value.each do |k, v|
|
184
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
185
|
-
end
|
186
|
-
end
|
187
|
-
else # model
|
188
|
-
temp_model = OracleBMC.const_get(type.to_s).new
|
189
|
-
temp_model.build_from_hash(value)
|
190
|
-
end
|
191
|
-
end
|
192
151
|
|
193
152
|
|
194
153
|
# Attribute mapping from ruby-style variable name to JSON key.
|